source: trunk/source/processes/hadronic/models/cascade/cascade/include/G4LorentzConvertor.hh @ 962

Last change on this file since 962 was 962, checked in by garnier, 15 years ago

update processes

File size: 3.8 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26#ifndef G4LORENTZ_CONVERTOR_HH
27#define G4LORENTZ_CONVERTOR_HH
28
29#ifndef GLOB
30#include "globals.hh"
31#endif
32
33#include <vector>
34#include "G4CascadeMomentum.hh"
35
36class G4LorentzConvertor {
37
38public:
39
40  G4LorentzConvertor();
41
42  G4LorentzConvertor(const G4CascadeMomentum& bmom, 
43                     G4double bmass, 
44                     const G4CascadeMomentum& tmom, 
45                     G4double tmass) {
46
47    setBullet(bmom, bmass);
48    setTarget(tmom, tmass);
49    degenerated = false; 
50  }; 
51
52  void setBullet(const G4CascadeMomentum& bmom, 
53                 G4double bmass) {
54
55    bullet_mom = bmom;
56    bullet_mass = bmass;
57    //  G4cout << " bullet: e " << bmom[0] << " mass " << bmass << G4endl;
58  };
59
60  void setTarget(const G4CascadeMomentum& tmom, 
61                 G4double tmass) {
62
63    target_mom = tmom;
64    target_mass = tmass;
65    //  G4cout << " target: e " << tmom[0] << " mass " << tmass << G4endl;
66  };
67
68  void toTheCenterOfMass();
69 
70  void toTheTargetRestFrame(); 
71
72  G4CascadeMomentum backToTheLab(const G4CascadeMomentum& mom) const; 
73
74  G4double getKinEnergyInTheTRS() const {
75
76    G4double pv = bullet_mom[1] * target_mom[1] + 
77      bullet_mom[2] * target_mom[2] + 
78      bullet_mom[3] * target_mom[3]; 
79    G4double ekin_trf = (target_mom[0] * 
80                         bullet_mom[0] - pv) / target_mass - bullet_mass;
81    return ekin_trf; 
82  };
83
84  G4double getTotalSCMEnergy() const { 
85
86    return ecm_tot; 
87  };
88
89  G4double getSCMMomentum() const { 
90
91    return pscm; 
92  };
93
94  G4double getTRSMomentum() const { 
95
96    return plab; 
97  };
98 
99  G4CascadeMomentum rotate(const G4CascadeMomentum& mom) const; 
100
101  G4CascadeMomentum rotate(const G4CascadeMomentum& mom1,
102                            const G4CascadeMomentum& mom) const; 
103
104  G4bool reflectionNeeded() const; 
105
106  G4bool trivial() const { 
107    return degenerated; 
108  }; 
109
110private: 
111G4int verboseLevel;
112  G4CascadeMomentum bullet_mom;
113  G4double bullet_mass;
114
115  G4CascadeMomentum target_mom;
116  G4double target_mass;
117
118  std::vector<G4double> velocity;
119
120  G4CascadeMomentum scm_momentum;
121
122  G4double ecm_tot;
123
124  G4double pscm;
125
126  G4double plab;
127
128  G4double gamma;
129
130  G4double v2;
131
132  G4double ga;
133
134  G4double gb;
135
136  G4double gbpp;
137
138  G4double gapp;
139
140  G4bool degenerated;
141};       
142
143#endif // G4LORENTZ_CONVERTOR_HH
Note: See TracBrowser for help on using the repository browser.