Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4ReactionProduct.cc File Reference
Include dependency graph for G4ReactionProduct.cc:

Go to the source code of this file.

Functions

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

Variables

G4ThreadLocal G4Allocator
< G4ReactionProduct > * 
aRPAllocator = 0
 

Function Documentation

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

Definition at line 242 of file G4ReactionProduct.cc.

244  {
245  G4double totEnergy = p1.totalEnergy + p2.totalEnergy;
246  G4double x = p1.momentum.x() + p2.momentum.x();
247  G4double y = p1.momentum.y() + p2.momentum.y();
248  G4double z = p1.momentum.z() + p2.momentum.z();
249  G4double newMass = totEnergy*totEnergy - ( x*x + y*y + z*z );
250  if( newMass < 0.0 )
251  newMass = -1. * std::sqrt( -newMass );
252  else
253  newMass = std::sqrt( newMass );
255  result.SetMass( newMass );
256  result.SetMomentum( x, y, z );
257  result.SetTotalEnergy( totEnergy );
258  result.SetPositionInNucleus( 0.0, 0.0, 0.0 );
259  result.SetFormationTime(0.0);
260  result.HasInitialStateParton(false);
261  return result;
262  }
G4double G4ParticleHPJENDLHEData::G4double result
void SetPositionInNucleus(G4double x, G4double y, G4double z)
void HasInitialStateParton(G4bool aFlag)
double x() const
void SetMomentum(const G4double x, const G4double y, const G4double z)
tuple x
Definition: test.py:50
double z() const
void SetMass(const G4double mas)
void SetTotalEnergy(const G4double en)
double y() const
tuple z
Definition: test.py:28
void SetFormationTime(G4double aTime)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

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

Definition at line 264 of file G4ReactionProduct.cc.

266  {
267  G4double totEnergy = p1.totalEnergy - p2.totalEnergy;
268  G4double x = p1.momentum.x() - p2.momentum.x();
269  G4double y = p1.momentum.y() - p2.momentum.y();
270  G4double z = p1.momentum.z() - p2.momentum.z();
271  G4double newMass = totEnergy*totEnergy - ( x*x + y*y + z*z );
272  if( newMass < 0.0 )
273  newMass = -1. * std::sqrt( -newMass );
274  else
275  newMass = std::sqrt( newMass );
277  result.SetMass( newMass );
278  result.SetMomentum( x, y, z );
279  result.SetTotalEnergy( totEnergy );
280  result.SetPositionInNucleus( 0.0, 0.0, 0.0 );
281  result.SetFormationTime(0.0);
282  result.HasInitialStateParton(false);
283  return result;
284  }
G4double G4ParticleHPJENDLHEData::G4double result
void SetPositionInNucleus(G4double x, G4double y, G4double z)
void HasInitialStateParton(G4bool aFlag)
double x() const
void SetMomentum(const G4double x, const G4double y, const G4double z)
tuple x
Definition: test.py:50
double z() const
void SetMass(const G4double mas)
void SetTotalEnergy(const G4double en)
double y() const
tuple z
Definition: test.py:28
void SetFormationTime(G4double aTime)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Variable Documentation

Definition at line 33 of file G4ReactionProduct.cc.