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 | // $Id: G4InuclParticle.hh,v 1.22 2010/09/16 05:21:00 mkelsey Exp $ |
---|
27 | // Geant4 tag: $Name: hadr-casc-V09-03-85 $ |
---|
28 | // |
---|
29 | // 20100112 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly |
---|
30 | // 20100409 M. Kelsey -- Drop unused string argument from ctors. |
---|
31 | // 20100519 M. Kelsey -- Add public access to G4DynamicParticle content |
---|
32 | // 20100715 M. Kelsey -- Add setKineticEnergy() function |
---|
33 | // 20100915 M. Kelsey -- Add constructor to copy G4DynamicParticle input |
---|
34 | |
---|
35 | #ifndef G4INUCL_PARTICLE_HH |
---|
36 | #define G4INUCL_PARTICLE_HH |
---|
37 | |
---|
38 | #include "G4DynamicParticle.hh" |
---|
39 | #include "G4LorentzVector.hh" |
---|
40 | #include "globals.hh" |
---|
41 | |
---|
42 | |
---|
43 | class G4InuclParticle { |
---|
44 | public: |
---|
45 | G4InuclParticle() : modelId(0) {} |
---|
46 | |
---|
47 | explicit G4InuclParticle(const G4DynamicParticle& dynPart) |
---|
48 | : pDP(dynPart), modelId(0) {} |
---|
49 | |
---|
50 | explicit G4InuclParticle(const G4LorentzVector& mom) : modelId(0) { |
---|
51 | pDP.Set4Momentum(mom*GeV/MeV); // From Bertini to G4 units |
---|
52 | } |
---|
53 | |
---|
54 | virtual ~G4InuclParticle() {} |
---|
55 | |
---|
56 | // Copy and assignment constructors for use with std::vector<> |
---|
57 | G4InuclParticle(const G4InuclParticle& right) |
---|
58 | : pDP(right.pDP), modelId(right.modelId) {} |
---|
59 | |
---|
60 | G4InuclParticle& operator=(const G4InuclParticle& right); |
---|
61 | |
---|
62 | // This is no longer required, as setMomentum() handles mass adjustment |
---|
63 | void setEnergy() { ; } |
---|
64 | |
---|
65 | // These are call-throughs to G4DynamicParticle |
---|
66 | void setMomentum(const G4LorentzVector& mom); |
---|
67 | |
---|
68 | void setKineticEnergy(G4double ekin) { pDP.SetKineticEnergy(ekin*GeV/MeV); } |
---|
69 | |
---|
70 | void setMass(G4double mass) { pDP.SetMass(mass*GeV/MeV); } |
---|
71 | |
---|
72 | G4double getMass() const { |
---|
73 | return pDP.GetMass()*MeV/GeV; // From G4 to Bertini units |
---|
74 | } |
---|
75 | |
---|
76 | G4double getCharge() const { |
---|
77 | return pDP.GetCharge(); |
---|
78 | } |
---|
79 | |
---|
80 | G4double getKineticEnergy() const { |
---|
81 | return pDP.GetKineticEnergy()*MeV/GeV; // From G4 to Bertini units |
---|
82 | } |
---|
83 | |
---|
84 | G4double getEnergy() const { |
---|
85 | return pDP.GetTotalEnergy()*MeV/GeV; // From G4 to Bertini units |
---|
86 | } |
---|
87 | |
---|
88 | G4double getMomModule() const { |
---|
89 | return pDP.GetTotalMomentum()*MeV/GeV; // From G4 to Bertini units |
---|
90 | } |
---|
91 | |
---|
92 | G4LorentzVector getMomentum() const { |
---|
93 | return pDP.Get4Momentum()*MeV/GeV; // From G4 to Bertini units |
---|
94 | } |
---|
95 | |
---|
96 | virtual void printParticle() const; |
---|
97 | |
---|
98 | void setModel(G4int model) { modelId = model; } |
---|
99 | |
---|
100 | G4int getModel() const { return modelId; } |
---|
101 | |
---|
102 | G4ParticleDefinition* getDefinition() const { |
---|
103 | return pDP.GetDefinition(); |
---|
104 | } |
---|
105 | |
---|
106 | const G4DynamicParticle& getDynamicParticle() const { |
---|
107 | return pDP; |
---|
108 | } |
---|
109 | |
---|
110 | protected: |
---|
111 | // Special constructors for subclasses to set particle type correctly |
---|
112 | explicit G4InuclParticle(G4ParticleDefinition* pd) : modelId(0) { |
---|
113 | setDefinition(pd); |
---|
114 | } |
---|
115 | |
---|
116 | // FIXME: Bertini code doesn't pass valid 4-vectors, so force mass value |
---|
117 | // from supplied PartDefn, with required unit conversions |
---|
118 | G4InuclParticle(G4ParticleDefinition* pd, const G4LorentzVector& mom); |
---|
119 | |
---|
120 | // NOTE: Momentum forced along Z direction |
---|
121 | G4InuclParticle(G4ParticleDefinition* pd, G4double ekin) |
---|
122 | : pDP(pd,G4ThreeVector(0.,0.,1.),ekin*GeV/MeV), modelId(0) {} |
---|
123 | |
---|
124 | void setDefinition(G4ParticleDefinition* pd) { pDP.SetDefinition(pd); } |
---|
125 | |
---|
126 | private: |
---|
127 | G4DynamicParticle pDP; // Carries all the kinematics and info |
---|
128 | |
---|
129 | G4int modelId; |
---|
130 | // used to indicate model that created instance of G4InuclParticle |
---|
131 | // 0 default |
---|
132 | // 1 bullet |
---|
133 | // 2 target |
---|
134 | // 3 G4ElementaryParticleCollider |
---|
135 | // 4 G4IntraNucleiCascader |
---|
136 | // 5 G4NonEquilibriumEvaporator |
---|
137 | // 6 G4EquilibriumEvaporator |
---|
138 | // 7 G4Fissioner |
---|
139 | // 8 G4BigBanger |
---|
140 | }; |
---|
141 | |
---|
142 | #endif // G4INUCL_PARTICLE_HH |
---|