Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions | Variables
G4ReactionProduct.cc File Reference
#include "G4ReactionProduct.hh"

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 235 of file G4ReactionProduct.cc.

References G4ReactionProduct::HasInitialStateParton(), G4ReactionProduct::SetFormationTime(), G4ReactionProduct::SetMass(), G4ReactionProduct::SetMomentum(), G4ReactionProduct::SetPositionInNucleus(), G4ReactionProduct::SetTotalEnergy(), test::x, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), z, and CLHEP::Hep3Vector::z().

237  {
238  G4double totEnergy = p1.totalEnergy + p2.totalEnergy;
239  G4double x = p1.momentum.x() + p2.momentum.x();
240  G4double y = p1.momentum.y() + p2.momentum.y();
241  G4double z = p1.momentum.z() + p2.momentum.z();
242  G4double newMass = totEnergy*totEnergy - ( x*x + y*y + z*z );
243  if( newMass < 0.0 )
244  newMass = -1. * std::sqrt( -newMass );
245  else
246  newMass = std::sqrt( newMass );
247  G4ReactionProduct result;
248  result.SetMass( newMass );
249  result.SetMomentum( x, y, z );
250  result.SetTotalEnergy( totEnergy );
251  result.SetPositionInNucleus( 0.0, 0.0, 0.0 );
252  result.SetFormationTime(0.0);
253  result.HasInitialStateParton(false);
254  return result;
255  }
void SetPositionInNucleus(G4double x, G4double y, G4double z)
void HasInitialStateParton(G4bool aFlag)
double x() const
G4double z
Definition: TRTMaterials.hh:39
void SetMomentum(const G4double x, const G4double y, const G4double z)
double z() const
void SetMass(const G4double mas)
void SetTotalEnergy(const G4double en)
double y() const
void SetFormationTime(G4double aTime)
double G4double
Definition: G4Types.hh:76
G4ReactionProduct operator- ( const G4ReactionProduct p1,
const G4ReactionProduct p2 
)

Definition at line 257 of file G4ReactionProduct.cc.

References G4ReactionProduct::HasInitialStateParton(), G4ReactionProduct::SetFormationTime(), G4ReactionProduct::SetMass(), G4ReactionProduct::SetMomentum(), G4ReactionProduct::SetPositionInNucleus(), G4ReactionProduct::SetTotalEnergy(), test::x, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), z, and CLHEP::Hep3Vector::z().

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

Variable Documentation