37 theParticleDefinition(NULL),
39 hasInitialStateParton(false),
58 hasInitialStateParton =
false;
59 theParticleDefinition = aParticleDefinition;
63 (aParticleDefinition->
GetPDGEncoding()<0) ? timeOfFlight=-1.0 : timeOfFlight=1.0;
72 theParticleDefinition = right.theParticleDefinition;
73 positionInNucleus = right.positionInNucleus;
74 formationTime = right.formationTime;
75 hasInitialStateParton = right.hasInitialStateParton;
76 momentum = right.momentum;
78 totalEnergy = right.totalEnergy;
79 kineticEnergy = right.kineticEnergy;
80 timeOfFlight = right.timeOfFlight;
82 NewlyAdded = right.NewlyAdded;
83 MayBeKilled = right.MayBeKilled;
89 if(
this != &right ) {
90 theParticleDefinition = right.theParticleDefinition;
91 positionInNucleus = right.positionInNucleus;
92 formationTime = right.formationTime;
93 hasInitialStateParton = right.hasInitialStateParton;
94 momentum = right.momentum;
96 totalEnergy = right.totalEnergy;
97 kineticEnergy = right.kineticEnergy;
98 timeOfFlight = right.timeOfFlight;
100 NewlyAdded = right.NewlyAdded;
101 MayBeKilled = right.MayBeKilled;
112 hasInitialStateParton =
false;
130 hasInitialStateParton =
false;
151 SetMomentum( aMomentum * (std::sqrt(aKineticEnergy*aKineticEnergy +
152 2*aKineticEnergy*
GetMass())/pp) );
158 theParticleDefinition = aParticleDefinition;
163 timeOfFlight=-1.0 : timeOfFlight=1.0;
197 hasInitialStateParton =
false;
207 G4double a = ( (p1x*p2x+p1y*p2y+p1z*p2z)/(p2.totalEnergy+p2.mass) -
208 p1.totalEnergy ) / p2.mass;
212 G4double p = std::sqrt(x*x+y*y+z*z);
214 SetTotalEnergy( std::sqrt( (p1.mass+p)*(p1.mass+p) - 2.*p1.mass*p ) );
226 G4double a = std::sqrt( ( px*px + py*py + pz*pz ) * ( tx*tx + ty*ty + tz*tz ) );
230 a = ( tx*px + ty*py + tz*pz ) / a;
231 if( std::fabs(a) > 1.0 ) { a<0.0 ? a=-1.0 : a=1.0; }
232 return std::acos( a );
239 G4double totEnergy = p1.totalEnergy + p2.totalEnergy;
240 G4double x = p1.momentum.
x() + p2.momentum.
x();
241 G4double y = p1.momentum.
y() + p2.momentum.
y();
242 G4double z = p1.momentum.
z() + p2.momentum.
z();
243 G4double newMass = totEnergy*totEnergy - ( x*x + y*y + z*z );
245 newMass = -1. * std::sqrt( -newMass );
247 newMass = std::sqrt( newMass );
261 G4double totEnergy = p1.totalEnergy - p2.totalEnergy;
262 G4double x = p1.momentum.
x() - p2.momentum.
x();
263 G4double y = p1.momentum.
y() - p2.momentum.
y();
264 G4double z = p1.momentum.
z() - p2.momentum.
z();
265 G4double newMass = totEnergy*totEnergy - ( x*x + y*y + z*z );
267 newMass = -1. * std::sqrt( -newMass );
269 newMass = std::sqrt( newMass );
G4ReactionProduct operator+(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
G4ReactionProduct operator-(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
G4Allocator< G4ReactionProduct > aRPAllocator
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4double GetPDGMass() const
G4int GetPDGEncoding() const
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetTotalEnergy(const G4double en)
G4double GetKineticEnergy() const
void HasInitialStateParton(G4bool aFlag)
G4ThreeVector GetMomentum() const
G4ReactionProduct & operator=(const G4ReactionProduct &right)
void SetPositionInNucleus(G4double x, G4double y, G4double z)
void SetDefinitionAndUpdateE(G4ParticleDefinition *aParticleDefinition)
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void SetKineticEnergy(const G4double en)
void SetDefinition(G4ParticleDefinition *aParticleDefinition)
G4double Angle(const G4ReactionProduct &p) const
void SetFormationTime(G4double aTime)
void SetMass(const G4double mas)