Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ReactionProduct Class Reference

#include <G4ReactionProduct.hh>

Public Member Functions

 G4ReactionProduct ()
 
 G4ReactionProduct (const G4ParticleDefinition *aParticleDefinition)
 
 ~G4ReactionProduct ()
 
 G4ReactionProduct (const G4ReactionProduct &right)
 
void * operator new (size_t)
 
void operator delete (void *aReactionProduct)
 
G4ReactionProductoperator= (const G4ReactionProduct &right)
 
G4ReactionProductoperator= (const G4DynamicParticle &right)
 
G4ReactionProductoperator= (const G4HadProjectile &right)
 
G4bool operator== (const G4ReactionProduct &right) const
 
G4bool operator!= (const G4ReactionProduct &right) const
 
const G4ParticleDefinitionGetDefinition () const
 
void SetDefinition (const G4ParticleDefinition *aParticleDefinition)
 
void SetDefinitionAndUpdateE (const G4ParticleDefinition *aParticleDefinition)
 
void SetMomentum (const G4double x, const G4double y, const G4double z)
 
void SetMomentum (const G4double x, const G4double y)
 
void SetMomentum (const G4double z)
 
void SetMomentum (const G4ThreeVector &mom)
 
G4ThreeVector GetMomentum () const
 
G4double GetTotalMomentum () const
 
G4double GetTotalEnergy () const
 
void SetKineticEnergy (const G4double en)
 
G4double GetKineticEnergy () const
 
void SetTotalEnergy (const G4double en)
 
void SetMass (const G4double mas)
 
G4double GetMass () const
 
void SetTOF (const G4double t)
 
G4double GetTOF () const
 
void SetSide (const G4int sid)
 
G4int GetSide () const
 
void SetCreatorModelID (const G4int mod)
 
G4int GetCreatorModelID () const
 
const G4ParticleDefinitionGetParentResonanceDef () const
 
void SetParentResonanceDef (const G4ParticleDefinition *parentDef)
 
G4int GetParentResonanceID () const
 
void SetParentResonanceID (const G4int parentID)
 
void SetNewlyAdded (const G4bool f)
 
G4bool GetNewlyAdded () const
 
void SetMayBeKilled (const G4bool f)
 
G4bool GetMayBeKilled () const
 
void SetZero ()
 
void Lorentz (const G4ReactionProduct &p1, const G4ReactionProduct &p2)
 
G4double Angle (const G4ReactionProduct &p) const
 
void SetPositionInNucleus (G4double x, G4double y, G4double z)
 
void SetPositionInNucleus (G4ThreeVector &aPosition)
 
G4ThreeVector GetPositionInNucleus () const
 
G4double GetXPositionInNucleus () const
 
G4double GetYPositionInNucleus () const
 
G4double GetZPositionInNucleus () const
 
void SetFormationTime (G4double aTime)
 
G4double GetFormationTime () const
 
void HasInitialStateParton (G4bool aFlag)
 
G4bool HasInitialStateParton () const
 

Friends

G4ReactionProduct operator+ (const G4ReactionProduct &p1, const G4ReactionProduct &p2)
 
G4ReactionProduct operator- (const G4ReactionProduct &p1, const G4ReactionProduct &p2)
 
G4ReactionProduct operator* (const G4double aDouble, const G4ReactionProduct &p2)
 

Detailed Description

Definition at line 53 of file G4ReactionProduct.hh.

Constructor & Destructor Documentation

◆ G4ReactionProduct() [1/3]

G4ReactionProduct::G4ReactionProduct ( )

Definition at line 39 of file G4ReactionProduct.cc.

39 :
40 theParticleDefinition(NULL),
41 formationTime(0.0),
42 hasInitialStateParton(false),
43 mass(0.0),
44 totalEnergy(0.0),
45 kineticEnergy(0.0),
46 timeOfFlight(0.0),
47 side(0),
48 theCreatorModel(-1),
49 theParentResonanceDef(nullptr),
50 theParentResonanceID(0),
51 NewlyAdded(false),
52 MayBeKilled(true)
53 {
54 SetMomentum( 0.0, 0.0, 0.0 );
55 SetPositionInNucleus( 0.0, 0.0, 0.0 );
56 }
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetPositionInNucleus(G4double x, G4double y, G4double z)

◆ G4ReactionProduct() [2/3]

G4ReactionProduct::G4ReactionProduct ( const G4ParticleDefinition * aParticleDefinition)

Definition at line 58 of file G4ReactionProduct.cc.

60 {
61 SetMomentum( 0.0, 0.0, 0.0 );
62 SetPositionInNucleus( 0.0, 0.0, 0.0 );
63 formationTime = 0.0;
64 hasInitialStateParton = false;
65 theParticleDefinition = aParticleDefinition;
66 mass = aParticleDefinition->GetPDGMass();
67 totalEnergy = mass;
68 kineticEnergy = 0.0;
69 (aParticleDefinition->GetPDGEncoding()<0) ? timeOfFlight=-1.0 : timeOfFlight=1.0;
70 side = 0;
71 theCreatorModel = -1;
72 theParentResonanceDef = nullptr;
73 theParentResonanceID = 0;
74 NewlyAdded = false;
75 MayBeKilled = true;
76 }

◆ ~G4ReactionProduct()

G4ReactionProduct::~G4ReactionProduct ( )
inline

Definition at line 77 of file G4ReactionProduct.hh.

77{}

◆ G4ReactionProduct() [3/3]

G4ReactionProduct::G4ReactionProduct ( const G4ReactionProduct & right)

Definition at line 78 of file G4ReactionProduct.cc.

80 {
81 theParticleDefinition = right.theParticleDefinition;
82 positionInNucleus = right.positionInNucleus;
83 formationTime = right.formationTime;
84 hasInitialStateParton = right.hasInitialStateParton;
85 momentum = right.momentum;
86 mass = right.mass;
87 totalEnergy = right.totalEnergy;
88 kineticEnergy = right.kineticEnergy;
89 timeOfFlight = right.timeOfFlight;
90 side = right.side;
91 theCreatorModel = right.theCreatorModel;
92 theParentResonanceDef = right.theParentResonanceDef;
93 theParentResonanceID = right.theParentResonanceID;
94 NewlyAdded = right.NewlyAdded;
95 MayBeKilled = right.MayBeKilled;
96 }

Member Function Documentation

◆ Angle()

G4double G4ReactionProduct::Angle ( const G4ReactionProduct & p) const

Definition at line 242 of file G4ReactionProduct.cc.

244 {
245 G4ThreeVector tM = momentum;
246 G4ThreeVector pM = p.momentum;
247 G4double tx = tM.x(); G4double ty = tM.y(); G4double tz = tM.z();
248 G4double px = pM.x(); G4double py = pM.y(); G4double pz = pM.z();
249 G4double a = std::sqrt( ( px*px + py*py + pz*pz ) * ( tx*tx + ty*ty + tz*tz ) );
250 if( a == 0.0 ) {
251 return 0.0;
252 } else {
253 a = ( tx*px + ty*py + tz*pz ) / a;
254 if( std::abs(a) > 1.0 ) { a<0.0 ? a=-1.0 : a=1.0; }
255 return std::acos( a );
256 }
257 }
double G4double
Definition G4Types.hh:83
double z() const
double x() const
double y() const

◆ GetCreatorModelID()

G4int G4ReactionProduct::GetCreatorModelID ( ) const
inline

Definition at line 168 of file G4ReactionProduct.hh.

169 { return theCreatorModel; }

◆ GetDefinition()

◆ GetFormationTime()

G4double G4ReactionProduct::GetFormationTime ( ) const
inline

Definition at line 219 of file G4ReactionProduct.hh.

219{ return formationTime; }

◆ GetKineticEnergy()

◆ GetMass()

◆ GetMayBeKilled()

G4bool G4ReactionProduct::GetMayBeKilled ( ) const
inline

Definition at line 191 of file G4ReactionProduct.hh.

192 { return MayBeKilled; }

◆ GetMomentum()

◆ GetNewlyAdded()

G4bool G4ReactionProduct::GetNewlyAdded ( ) const
inline

Definition at line 185 of file G4ReactionProduct.hh.

186 { return NewlyAdded; }

◆ GetParentResonanceDef()

const G4ParticleDefinition * G4ReactionProduct::GetParentResonanceDef ( ) const
inline

Definition at line 171 of file G4ReactionProduct.hh.

172 { return theParentResonanceDef; }

◆ GetParentResonanceID()

G4int G4ReactionProduct::GetParentResonanceID ( ) const
inline

Definition at line 177 of file G4ReactionProduct.hh.

177{ return theParentResonanceID; }

◆ GetPositionInNucleus()

G4ThreeVector G4ReactionProduct::GetPositionInNucleus ( ) const
inline

Definition at line 212 of file G4ReactionProduct.hh.

212{ return positionInNucleus; }

◆ GetSide()

G4int G4ReactionProduct::GetSide ( ) const
inline

Definition at line 162 of file G4ReactionProduct.hh.

163 { return side; }

◆ GetTOF()

G4double G4ReactionProduct::GetTOF ( ) const
inline

Definition at line 156 of file G4ReactionProduct.hh.

157 { return timeOfFlight; }

Referenced by G4LowEIonFragmentation::ApplyYourself(), and G4MuMinusCapturePrecompound::ApplyYourself().

◆ GetTotalEnergy()

◆ GetTotalMomentum()

G4double G4ReactionProduct::GetTotalMomentum ( ) const
inline

◆ GetXPositionInNucleus()

G4double G4ReactionProduct::GetXPositionInNucleus ( ) const
inline

Definition at line 213 of file G4ReactionProduct.hh.

213{ return positionInNucleus.x(); }

◆ GetYPositionInNucleus()

G4double G4ReactionProduct::GetYPositionInNucleus ( ) const
inline

Definition at line 214 of file G4ReactionProduct.hh.

214{ return positionInNucleus.y(); }

◆ GetZPositionInNucleus()

G4double G4ReactionProduct::GetZPositionInNucleus ( ) const
inline

Definition at line 215 of file G4ReactionProduct.hh.

215{ return positionInNucleus.z(); }

◆ HasInitialStateParton() [1/2]

G4bool G4ReactionProduct::HasInitialStateParton ( ) const
inline

Definition at line 223 of file G4ReactionProduct.hh.

223{ return hasInitialStateParton; }

◆ HasInitialStateParton() [2/2]

void G4ReactionProduct::HasInitialStateParton ( G4bool aFlag)
inline

Definition at line 221 of file G4ReactionProduct.hh.

221{ hasInitialStateParton = aFlag; }

◆ Lorentz()

void G4ReactionProduct::Lorentz ( const G4ReactionProduct & p1,
const G4ReactionProduct & p2 )

Definition at line 223 of file G4ReactionProduct.cc.

225 {
226 G4ThreeVector p1M = p1.momentum;
227 G4ThreeVector p2M = p2.momentum;
228 G4double p1x = p1M.x(); G4double p1y = p1M.y(); G4double p1z = p1M.z();
229 G4double p2x = p2M.x(); G4double p2y = p2M.y(); G4double p2z = p2M.z();
230 G4double a = ( (p1x*p2x+p1y*p2y+p1z*p2z)/(p2.totalEnergy+p2.mass) -
231 p1.totalEnergy ) / p2.mass;
232 G4double x = p1x+a*p2x;
233 G4double y = p1y+a*p2y;
234 G4double z = p1z+a*p2z;
235 G4double p = std::sqrt(x*x+y*y+z*z);
236 SetMass( p1.mass );
237 SetTotalEnergy( std::sqrt( (p1.mass+p)*(p1.mass+p) - 2.*p1.mass*p ) );
238 //SetTotalEnergy( std::sqrt( p1.mass*p1.mass + x*x + y*y + z*z ) );
239 SetMomentum( x, y, z );
240 }
void SetTotalEnergy(const G4double en)
void SetMass(const G4double mas)

Referenced by G4FissionLibrary::ApplyYourself(), G4LENDElastic::ApplyYourself(), G4LENDModel::ApplyYourself(), G4NeutronHPCaptureFS::ApplyYourself(), G4ParticleHPElasticFS::ApplyYourself(), G4ParticleHPFissionBaseFS::ApplyYourself(), G4ParticleHPFissionFS::ApplyYourself(), G4ParticleHPFSFissionFS::ApplyYourself(), G4ParticleHPInelasticBaseFS::BaseApply(), G4ParticleHPInelasticCompFS::CompositeApply(), G4NRESP71M03::DKINMA(), G4NeutronHPCaptureData::GetCrossSection(), G4ParticleHPElasticData::GetCrossSection(), G4ParticleHPFissionData::GetCrossSection(), G4ParticleHPInelasticData::GetCrossSection(), G4ParticleHPFSFissionFS::GetPhotons(), G4ParticleHPThermalBoost::GetThermalEnergy(), G4ParticleHPEnAngCorrelation::Sample(), and G4ParticleHPAngular::SampleAndUpdate().

◆ operator delete()

void G4ReactionProduct::operator delete ( void * aReactionProduct)
inline

Definition at line 91 of file G4ReactionProduct.hh.

91 {
92 aRPAllocator()->FreeSingle((G4ReactionProduct*)aReactionProduct);
93 }
G4DLLIMPORT G4Allocator< G4ReactionProduct > *& aRPAllocator()

◆ operator new()

void * G4ReactionProduct::operator new ( size_t )
inline

Definition at line 82 of file G4ReactionProduct.hh.

82 {
84 return (void *)aRPAllocator()->MallocSingle();
85 }
Type * MallocSingle()

◆ operator!=()

G4bool G4ReactionProduct::operator!= ( const G4ReactionProduct & right) const
inline

Definition at line 104 of file G4ReactionProduct.hh.

105 { return ( this != (G4ReactionProduct*) &right ); }

◆ operator=() [1/3]

G4ReactionProduct & G4ReactionProduct::operator= ( const G4DynamicParticle & right)

Definition at line 121 of file G4ReactionProduct.cc.

123 {
124 theParticleDefinition = right.GetDefinition();
125 SetPositionInNucleus( 0.0, 0.0, 0.0 );
126 formationTime = 0.0;
127 hasInitialStateParton = false;
128 momentum = right.GetMomentum();
129 mass = right.GetDefinition()->GetPDGMass();
130 totalEnergy = right.GetTotalEnergy();
131 kineticEnergy = right.GetKineticEnergy();
132 (right.GetDefinition()->GetPDGEncoding()<0) ? timeOfFlight=-1.0 : timeOfFlight=1.0;
133 side = 0;
134 theCreatorModel = -1;
135 theParentResonanceDef = nullptr;
136 theParentResonanceID = 0;
137 NewlyAdded = false;
138 MayBeKilled = true;
139 return *this;
140 }
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const

◆ operator=() [2/3]

G4ReactionProduct & G4ReactionProduct::operator= ( const G4HadProjectile & right)

Definition at line 142 of file G4ReactionProduct.cc.

144 {
145 theParticleDefinition = right.GetDefinition();
146 SetPositionInNucleus( 0.0, 0.0, 0.0 );
147 formationTime = 0.0;
148 hasInitialStateParton = false;
149 momentum = right.Get4Momentum().vect();
150 mass = right.GetDefinition()->GetPDGMass();
151 totalEnergy = right.Get4Momentum().e();
152 kineticEnergy = right.GetKineticEnergy();
153 (right.GetDefinition()->GetPDGEncoding()<0) ? timeOfFlight=-1.0 : timeOfFlight=1.0;
154 side = 0;
155 theCreatorModel = -1;
156 theParentResonanceDef = nullptr;
157 theParentResonanceID = 0;
158 NewlyAdded = false;
159 MayBeKilled = true;
160 return *this;
161 }
Hep3Vector vect() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const

◆ operator=() [3/3]

G4ReactionProduct & G4ReactionProduct::operator= ( const G4ReactionProduct & right)

Definition at line 98 of file G4ReactionProduct.cc.

100 {
101 if( this != &right ) {
102 theParticleDefinition = right.theParticleDefinition;
103 positionInNucleus = right.positionInNucleus;
104 formationTime = right.formationTime;
105 hasInitialStateParton = right.hasInitialStateParton;
106 momentum = right.momentum;
107 mass = right.mass;
108 totalEnergy = right.totalEnergy;
109 kineticEnergy = right.kineticEnergy;
110 timeOfFlight = right.timeOfFlight;
111 side = right.side;
112 theCreatorModel = right.theCreatorModel;
113 theParentResonanceDef = right.theParentResonanceDef;
114 theParentResonanceID = right.theParentResonanceID;
115 NewlyAdded = right.NewlyAdded;
116 MayBeKilled = right.MayBeKilled;
117 }
118 return *this;
119 }

◆ operator==()

G4bool G4ReactionProduct::operator== ( const G4ReactionProduct & right) const
inline

Definition at line 101 of file G4ReactionProduct.hh.

102 { return ( this == (G4ReactionProduct*) &right ); }

◆ SetCreatorModelID()

◆ SetDefinition()

void G4ReactionProduct::SetDefinition ( const G4ParticleDefinition * aParticleDefinition)

◆ SetDefinitionAndUpdateE()

void G4ReactionProduct::SetDefinitionAndUpdateE ( const G4ParticleDefinition * aParticleDefinition)

Definition at line 163 of file G4ReactionProduct.cc.

165 { G4double aKineticEnergy = GetKineticEnergy();
167 G4ThreeVector aMomentum = GetMomentum();
168 SetDefinition( aParticleDefinition );
169 SetKineticEnergy( aKineticEnergy );
170 if( pp > DBL_MIN )
171 SetMomentum( aMomentum * (std::sqrt(aKineticEnergy*aKineticEnergy +
172 2*aKineticEnergy*GetMass())/pp) );
173 }
double mag() const
G4double GetKineticEnergy() const
G4ThreeVector GetMomentum() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetKineticEnergy(const G4double en)
G4double GetMass() const
#define DBL_MIN
Definition templates.hh:54

Referenced by G4NeutronHPCaptureFS::ApplyYourself().

◆ SetFormationTime()

void G4ReactionProduct::SetFormationTime ( G4double aTime)
inline

Definition at line 217 of file G4ReactionProduct.hh.

217{ formationTime = aTime; }

Referenced by G4ExcitationHandler::BreakItUp().

◆ SetKineticEnergy()

◆ SetMass()

◆ SetMayBeKilled()

void G4ReactionProduct::SetMayBeKilled ( const G4bool f)
inline

Definition at line 188 of file G4ReactionProduct.hh.

189 { MayBeKilled = f; }

◆ SetMomentum() [1/4]

void G4ReactionProduct::SetMomentum ( const G4double x,
const G4double y )

Definition at line 194 of file G4ReactionProduct.cc.

196 {
197 momentum.setX( x );
198 momentum.setY( y );
199 }
void setY(double)
void setX(double)

◆ SetMomentum() [2/4]

◆ SetMomentum() [3/4]

void G4ReactionProduct::SetMomentum ( const G4double z)

Definition at line 201 of file G4ReactionProduct.cc.

202 {
203 momentum.setZ( z );
204 }

◆ SetMomentum() [4/4]

void G4ReactionProduct::SetMomentum ( const G4ThreeVector & mom)
inline

Definition at line 120 of file G4ReactionProduct.hh.

121 { momentum = mom; }

◆ SetNewlyAdded()

void G4ReactionProduct::SetNewlyAdded ( const G4bool f)
inline

Definition at line 182 of file G4ReactionProduct.hh.

183 { NewlyAdded = f; }

◆ SetParentResonanceDef()

void G4ReactionProduct::SetParentResonanceDef ( const G4ParticleDefinition * parentDef)
inline

◆ SetParentResonanceID()

void G4ReactionProduct::SetParentResonanceID ( const G4int parentID)
inline

◆ SetPositionInNucleus() [1/2]

void G4ReactionProduct::SetPositionInNucleus ( G4double x,
G4double y,
G4double z )
inline

Definition at line 200 of file G4ReactionProduct.hh.

201 {
202 positionInNucleus.setX(x);
203 positionInNucleus.setY(y);
204 positionInNucleus.setZ(z);
205 }

Referenced by G4ReactionProduct(), G4ReactionProduct(), operator=(), operator=(), and SetZero().

◆ SetPositionInNucleus() [2/2]

void G4ReactionProduct::SetPositionInNucleus ( G4ThreeVector & aPosition)
inline

Definition at line 207 of file G4ReactionProduct.hh.

208 {
209 positionInNucleus = aPosition;
210 }

◆ SetSide()

void G4ReactionProduct::SetSide ( const G4int sid)
inline

Definition at line 159 of file G4ReactionProduct.hh.

160 { side = sid; }

◆ SetTOF()

void G4ReactionProduct::SetTOF ( const G4double t)
inline

Definition at line 153 of file G4ReactionProduct.hh.

154 { timeOfFlight = t; }

◆ SetTotalEnergy()

◆ SetZero()

void G4ReactionProduct::SetZero ( )

Definition at line 206 of file G4ReactionProduct.cc.

207 {
208 SetMomentum( 0.0, 0.0, 0.0 );
209 totalEnergy = 0.0;
210 kineticEnergy = 0.0;
211 mass = 0.0;
212 timeOfFlight = 0.0;
213 side = 0;
214 theCreatorModel = -1;
215 theParentResonanceDef = nullptr;
216 theParentResonanceID = 0;
217 NewlyAdded = false;
218 SetPositionInNucleus( 0.0, 0.0, 0.0 );
219 formationTime = 0.0;
220 hasInitialStateParton = false;
221 }

Friends And Related Symbol Documentation

◆ operator*

G4ReactionProduct operator* ( const G4double aDouble,
const G4ReactionProduct & p2 )
friend

Definition at line 61 of file G4ReactionProduct.hh.

63 {
64 G4ReactionProduct result;
65 result.SetMomentum(aDouble*p2.GetMomentum());
66 result.SetMass(p2.GetMass());
67 result.SetTotalEnergy(std::sqrt(result.GetMass()*result.GetMass()+
68 result.GetMomentum()*result.GetMomentum()));
69 return result;
70 }

◆ operator+

G4ReactionProduct operator+ ( const G4ReactionProduct & p1,
const G4ReactionProduct & p2 )
friend

Definition at line 259 of file G4ReactionProduct.cc.

261 {
262 G4double totEnergy = p1.totalEnergy + p2.totalEnergy;
263 G4double x = p1.momentum.x() + p2.momentum.x();
264 G4double y = p1.momentum.y() + p2.momentum.y();
265 G4double z = p1.momentum.z() + p2.momentum.z();
266 G4double newMass = totEnergy*totEnergy - ( x*x + y*y + z*z );
267 if( newMass < 0.0 )
268 newMass = -1. * std::sqrt( -newMass );
269 else
270 newMass = std::sqrt( newMass );
271 G4ReactionProduct result;
272 result.SetMass( newMass );
273 result.SetMomentum( x, y, z );
274 result.SetTotalEnergy( totEnergy );
275 result.SetPositionInNucleus( 0.0, 0.0, 0.0 );
276 result.SetFormationTime(0.0);
277 result.HasInitialStateParton(false);
278 return result;
279 }
void HasInitialStateParton(G4bool aFlag)
void SetFormationTime(G4double aTime)

◆ operator-

G4ReactionProduct operator- ( const G4ReactionProduct & p1,
const G4ReactionProduct & p2 )
friend

Definition at line 281 of file G4ReactionProduct.cc.

283 {
284 G4double totEnergy = p1.totalEnergy - p2.totalEnergy;
285 G4double x = p1.momentum.x() - p2.momentum.x();
286 G4double y = p1.momentum.y() - p2.momentum.y();
287 G4double z = p1.momentum.z() - p2.momentum.z();
288 G4double newMass = totEnergy*totEnergy - ( x*x + y*y + z*z );
289 if( newMass < 0.0 )
290 newMass = -1. * std::sqrt( -newMass );
291 else
292 newMass = std::sqrt( newMass );
293 G4ReactionProduct result;
294 result.SetMass( newMass );
295 result.SetMomentum( x, y, z );
296 result.SetTotalEnergy( totEnergy );
297 result.SetPositionInNucleus( 0.0, 0.0, 0.0 );
298 result.SetFormationTime(0.0);
299 result.HasInitialStateParton(false);
300 return result;
301 }

The documentation for this class was generated from the following files: