Changeset 1315 for trunk/source/processes/hadronic/models/cascade/cascade/include/G4LorentzConvertor.hh
- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/cascade/cascade/include/G4LorentzConvertor.hh
r962 r1315 23 23 // * acceptance of all terms of the Geant4 Software license. * 24 24 // ******************************************************************** 25 // $Id: G4LorentzConvertor.hh,v 1.15 2010/05/21 17:56:34 mkelsey Exp $ 26 // Geant4 tag: $Name: geant4-09-04-beta-cand-01 $ 25 27 // 28 // 20100108 Michael Kelsey -- Use G4LorentzVector internally 29 // 20100120 M. Kelsey -- BUG FIX: scm_momentum should be G4ThreeVector 30 // 20100126 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly 31 // 20100519 M. Kelsey -- Add interfaces to pass G4InuclParticles directly 32 26 33 #ifndef G4LORENTZ_CONVERTOR_HH 27 34 #define G4LORENTZ_CONVERTOR_HH 28 35 29 #ifndef GLOB30 36 #include "globals.hh" 31 #endif 37 #include "G4LorentzVector.hh" 38 #include "G4ThreeVector.hh" 32 39 33 #include <vector> 34 #include "G4CascadeMomentum.hh" 40 class G4InuclParticle; 35 41 36 42 class G4LorentzConvertor { … … 40 46 G4LorentzConvertor(); 41 47 42 G4LorentzConvertor(const G4CascadeMomentum& bmom, 43 G4double bmass, 44 const G4CascadeMomentum& tmom, 45 G4double tmass) { 46 48 G4LorentzConvertor(const G4LorentzVector& bmom, G4double bmass, 49 const G4LorentzVector& tmom, G4double tmass) { 47 50 setBullet(bmom, bmass); 48 51 setTarget(tmom, tmass); 49 degenerated = false; 50 }; 52 } 51 53 52 void setBullet(const G4CascadeMomentum& bmom, 53 G4double bmass) { 54 G4LorentzConvertor(const G4InuclParticle* bullet, 55 const G4InuclParticle* target) { 56 setBullet(bullet); 57 setTarget(target); 58 } 54 59 55 bullet_mom = bmom; 56 bullet_mass = bmass; 57 // G4cout << " bullet: e " << bmom[0] << " mass " << bmass << G4endl; 60 void setVerbose(G4int vb=0) { verboseLevel = vb; } 61 62 void setBullet(const G4InuclParticle* bullet); 63 void setTarget(const G4InuclParticle* target); 64 65 void setBullet(const G4InuclParticle& bullet) { setBullet(&bullet); } 66 void setTarget(const G4InuclParticle& target) { setTarget(&target); } 67 68 // Use correct four-vectors as input 69 void setBullet(const G4LorentzVector& bmom) { bullet_mom = bmom; } 70 void setTarget(const G4LorentzVector& bmom) { target_mom = bmom; } 71 72 // NOTE: These functions "repair" input 4-vectors using specified mass 73 void setBullet(const G4LorentzVector& bmom, G4double bmass) { 74 bullet_mom.setVectM(bmom.vect(), bmass); 75 76 // G4cout << " bullet: e " << bullet_mom.e() << " mass " 77 // << bullet_mom.m() << G4endl; 58 78 }; 59 79 60 void setTarget(const G4 CascadeMomentum& tmom,61 G4double tmass) { 80 void setTarget(const G4LorentzVector& tmom, G4double tmass) { 81 target_mom.setVectM(tmom.vect(), tmass); 62 82 63 target_mom = tmom; 64 target_mass = tmass; 65 // G4cout << " target: e " << tmom[0] << " mass " << tmass << G4endl; 83 // G4cout << " target: e " << target_mom.e() << " mass " 84 // << target_mom.m() << G4endl; 66 85 }; 67 86 68 87 void toTheCenterOfMass(); 69 70 88 void toTheTargetRestFrame(); 71 89 72 G4 CascadeMomentum backToTheLab(const G4CascadeMomentum& mom) const;90 G4LorentzVector backToTheLab(const G4LorentzVector& mom) const; 73 91 74 G4double getKinEnergyInTheTRS() const { 92 // Four-vectors of bullet and target in last chosen reference frame 93 const G4LorentzVector& getBullet() const { return bullet_mom; } 94 const G4LorentzVector& getTarget() const { return target_mom; } 95 96 G4double getKinEnergyInTheTRS() const; 97 G4double getTotalSCMEnergy() const { return ecm_tot; } 98 G4double getSCMMomentum() const { return scm_momentum.rho(); } 99 G4double getTRSMomentum() const; 75 100 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 }; 101 G4LorentzVector rotate(const G4LorentzVector& mom) const; 83 102 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 G4LorentzVector rotate(const G4LorentzVector& mom1, 104 const G4LorentzVector& mom) const; 103 105 104 106 G4bool reflectionNeeded() const; 105 107 106 G4bool trivial() const { 107 return degenerated; 108 }; 108 G4bool trivial() const { return degenerated; } 109 109 110 110 private: 111 G4int verboseLevel; 112 G4CascadeMomentum bullet_mom; 113 G4double bullet_mass; 111 static const G4double small; 114 112 115 G4CascadeMomentum target_mom; 116 G4double target_mass; 113 G4int verboseLevel; 114 G4LorentzVector bullet_mom; 115 G4LorentzVector target_mom; 117 116 118 std::vector<G4double> velocity;117 G4LorentzVector scm_momentum; // CM momentum relative to target/bullet 119 118 120 G4CascadeMomentum scm_momentum; 121 119 // Buffer variables for doing ::rotate() calculations 120 G4ThreeVector velocity; 121 G4double gamma; 122 G4double v2; 122 123 G4double ecm_tot; 123 124 G4double pscm;125 126 G4double plab;127 128 G4double gamma;129 130 G4double v2;131 132 124 G4double ga; 133 134 125 G4double gb; 135 136 126 G4double gbpp; 137 138 127 G4double gapp; 139 140 128 G4bool degenerated; 141 129 };
Note: See TracChangeset
for help on using the changeset viewer.