Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCL::Particle Class Reference

#include <G4INCLParticle.hh>

+ Inheritance diagram for G4INCL::Particle:

Public Member Functions

 Particle ()
 
 Particle (ParticleType t, G4double energy, ThreeVector momentum, ThreeVector position)
 
 Particle (ParticleType t, ThreeVector momentum, ThreeVector position)
 
virtual ~Particle ()
 
 Particle (const Particle &rhs)
 Copy constructor.
 
Particleoperator= (const Particle &rhs)
 Assignment operator.
 
G4INCL::ParticleType getType () const
 
virtual G4INCL::ParticleSpecies getSpecies () const
 Get the particle species.
 
void setType (ParticleType t)
 
G4bool isNucleon () const
 
ParticipantType getParticipantType () const
 
void setParticipantType (ParticipantType const p)
 
G4bool isParticipant () const
 
G4bool isTargetSpectator () const
 
G4bool isProjectileSpectator () const
 
virtual void makeParticipant ()
 
virtual void makeTargetSpectator ()
 
virtual void makeProjectileSpectator ()
 
G4bool isPion () const
 Is this a pion?
 
G4bool isResonance () const
 Is it a resonance?
 
G4bool isDelta () const
 Is it a Delta?
 
G4int getA () const
 Returns the baryon number.
 
G4int getZ () const
 Returns the charge number.
 
G4double getBeta () const
 
ThreeVector boostVector () const
 
void boost (const ThreeVector &aBoostVector)
 
void lorentzContract (const ThreeVector &aBoostVector, const ThreeVector &refPos)
 Lorentz-contract the particle position around some center.
 
G4double getMass () const
 Get the cached particle mass.
 
G4double getINCLMass () const
 Get the INCL particle mass.
 
virtual G4double getTableMass () const
 Get the tabulated particle mass.
 
G4double getRealMass () const
 Get the real particle mass.
 
void setRealMass ()
 Set the mass of the Particle to its real mass.
 
void setTableMass ()
 Set the mass of the Particle to its table mass.
 
void setINCLMass ()
 Set the mass of the Particle to its table mass.
 
G4double getEmissionQValueCorrection (const G4int AParent, const G4int ZParent) const
 Computes correction on the emission Q-value.
 
G4double getTransferQValueCorrection (const G4int AFrom, const G4int ZFrom, const G4int ATo, const G4int ZTo) const
 Computes correction on the transfer Q-value.
 
G4double getInvariantMass () const
 Get the the particle invariant mass.
 
G4double getKineticEnergy () const
 Get the particle kinetic energy.
 
G4double getPotentialEnergy () const
 Get the particle potential energy.
 
void setPotentialEnergy (G4double v)
 Set the particle potential energy.
 
G4double getEnergy () const
 
void setMass (G4double mass)
 
void setEnergy (G4double energy)
 
const G4INCL::ThreeVectorgetMomentum () const
 
virtual G4INCL::ThreeVector getAngularMomentum () const
 
virtual void setMomentum (const G4INCL::ThreeVector &momentum)
 
const G4INCL::ThreeVectorgetPosition () const
 
virtual void setPosition (const G4INCL::ThreeVector &position)
 
G4double getHelicity ()
 
void setHelicity (G4double h)
 
void propagate (G4double step)
 
G4int getNumberOfCollisions () const
 Return the number of collisions undergone by the particle.
 
void setNumberOfCollisions (G4int n)
 Set the number of collisions undergone by the particle.
 
void incrementNumberOfCollisions ()
 Increment the number of collisions undergone by the particle.
 
G4int getNumberOfDecays () const
 Return the number of decays undergone by the particle.
 
void setNumberOfDecays (G4int n)
 Set the number of decays undergone by the particle.
 
void incrementNumberOfDecays ()
 Increment the number of decays undergone by the particle.
 
void setOutOfWell ()
 Mark the particle as out of its potential well.
 
G4bool isOutOfWell () const
 Check if the particle is out of its potential well.
 
void setEmissionTime (G4double t)
 
G4double getEmissionTime ()
 
ThreeVector getTransversePosition () const
 Transverse component of the position w.r.t. the momentum.
 
ThreeVector getLongitudinalPosition () const
 Longitudinal component of the position w.r.t. the momentum.
 
const ThreeVectoradjustMomentumFromEnergy ()
 Rescale the momentum to match the total energy.
 
G4double adjustEnergyFromMomentum ()
 Recompute the energy to match the momentum.
 
G4bool isInList (ParticleList const &l) const
 Check if the particle belongs to a given list.
 
G4bool isCluster () const
 
void setFrozenMomentum (const ThreeVector &momentum)
 Set the frozen particle momentum.
 
void setFrozenEnergy (const G4double energy)
 Set the frozen particle momentum.
 
ThreeVector getFrozenMomentum () const
 Get the frozen particle momentum.
 
G4double getFrozenEnergy () const
 Get the frozen particle momentum.
 
ThreeVector getPropagationVelocity () const
 Get the propagation velocity of the particle.
 
void freezePropagation ()
 Freeze particle propagation.
 
void thawPropagation ()
 Unfreeze particle propagation.
 
virtual void rotate (const G4double angle, const ThreeVector &axis)
 Rotate the particle position and momentum.
 
std::string print () const
 
std::string dump () const
 
long getID () const
 
ParticleList constgetParticles () const
 

Protected Member Functions

void swap (Particle &rhs)
 Helper method for the assignment operator.
 

Protected Attributes

G4int theZ
 
G4int theA
 
ParticipantType theParticipantType
 
G4INCL::ParticleType theType
 
G4double theEnergy
 
G4doublethePropagationEnergy
 
G4double theFrozenEnergy
 
G4INCL::ThreeVector theMomentum
 
G4INCL::ThreeVectorthePropagationMomentum
 
G4INCL::ThreeVector theFrozenMomentum
 
G4INCL::ThreeVector thePosition
 
G4int nCollisions
 
G4int nDecays
 
G4double thePotentialEnergy
 
long ID
 

Detailed Description

Definition at line 66 of file G4INCLParticle.hh.

Constructor & Destructor Documentation

◆ Particle() [1/4]

G4INCL::Particle::Particle ( )

Definition at line 53 of file G4INCLParticle.cc.

54 : theZ(0), theA(0),
57 theEnergy(0.0),
60 theMomentum(ThreeVector(0.,0.,0.)),
63 thePosition(ThreeVector(0.,0.,0.)),
64 nCollisions(0),
65 nDecays(0),
67 theHelicity(0.0),
68 emissionTime(0.0),
69 outOfWell(false),
70 theMass(0.)
71 {
72 ID = nextID;
73 nextID++;
74 }
G4INCL::ThreeVector * thePropagationMomentum
G4INCL::ThreeVector theMomentum
G4double thePotentialEnergy
ParticipantType theParticipantType
G4INCL::ParticleType theType
G4double theFrozenEnergy
G4double * thePropagationEnergy
G4INCL::ThreeVector thePosition
G4INCL::ThreeVector theFrozenMomentum

Referenced by G4INCL::Cluster::Cluster().

◆ Particle() [2/4]

G4INCL::Particle::Particle ( ParticleType  t,
G4double  energy,
ThreeVector  momentum,
ThreeVector  position 
)

Definition at line 76 of file G4INCLParticle.cc.

78 : theEnergy(energy),
81 theMomentum(momentum),
85 nCollisions(0), nDecays(0),
86 thePotentialEnergy(0.), theHelicity(0.0),
87 emissionTime(0.0), outOfWell(false)
88 {
90 ID = nextID;
91 nextID++;
92 if(theEnergy <= 0.0) {
93 WARN("Particle with energy " << theEnergy << " created." << std::endl);
94 }
95 setType(t);
97 }
#define WARN(x)
void setMass(G4double mass)
G4double getInvariantMass() const
Get the the particle invariant mass.
void setType(ParticleType t)

◆ Particle() [3/4]

G4INCL::Particle::Particle ( ParticleType  t,
ThreeVector  momentum,
ThreeVector  position 
)

Definition at line 99 of file G4INCLParticle.cc.

102 theMomentum(momentum),
106 nCollisions(0), nDecays(0),
107 thePotentialEnergy(0.), theHelicity(0.0),
108 emissionTime(0.0), outOfWell(false)
109 {
111 ID = nextID;
112 nextID++;
113 setType(t);
114 if( isResonance() ) {
115 ERROR("Cannot create resonance without specifying its momentum four-vector." << std::endl);
116 }
117 G4double energy = std::sqrt(theMomentum.mag2() + theMass*theMass);
118 theEnergy = energy;
120 }
#define ERROR(x)
double G4double
Definition: G4Types.hh:64
G4bool isResonance() const
Is it a resonance?
G4double mag2() const

◆ ~Particle()

virtual G4INCL::Particle::~Particle ( )
inlinevirtual

Definition at line 71 of file G4INCLParticle.hh.

71{}

◆ Particle() [4/4]

G4INCL::Particle::Particle ( const Particle rhs)
inline

Copy constructor.

Does not copy the particle ID.

Definition at line 77 of file G4INCLParticle.hh.

77 :
78 theZ(rhs.theZ),
79 theA(rhs.theA),
80 theParticipantType(rhs.theParticipantType),
81 theType(rhs.theType),
82 theEnergy(rhs.theEnergy),
83 theFrozenEnergy(rhs.theFrozenEnergy),
84 theMomentum(rhs.theMomentum),
85 theFrozenMomentum(rhs.theFrozenMomentum),
86 thePosition(rhs.thePosition),
87 nCollisions(rhs.nCollisions),
88 nDecays(rhs.nDecays),
89 thePotentialEnergy(rhs.thePotentialEnergy),
90 theHelicity(rhs.theHelicity),
91 emissionTime(rhs.emissionTime),
92 outOfWell(rhs.outOfWell),
93 theMass(rhs.theMass)
94 {
95 if(rhs.thePropagationEnergy == &(rhs.theFrozenEnergy))
97 else
99 if(rhs.thePropagationMomentum == &(rhs.theFrozenMomentum))
101 else
103 // ID intentionally not copied
104 ID = nextID++;
105 }

Member Function Documentation

◆ adjustEnergyFromMomentum()

G4double G4INCL::Particle::adjustEnergyFromMomentum ( )

Recompute the energy to match the momentum.

Definition at line 135 of file G4INCLParticle.cc.

135 {
136 theEnergy = std::sqrt(theMomentum.mag2() + theMass*theMass);
137 return theEnergy;
138 }

Referenced by G4INCL::Nucleus::computeRecoilKinematics(), G4INCL::Nucleus::decayOutgoingDeltas(), G4INCL::DeltaDecayChannel::getFinalState(), and G4INCL::RecombinationChannel::getFinalState().

◆ adjustMomentumFromEnergy()

const ThreeVector & G4INCL::Particle::adjustMomentumFromEnergy ( )

Rescale the momentum to match the total energy.

Definition at line 122 of file G4INCLParticle.cc.

122 {
123 const G4double p2 = theMomentum.mag2();
124 G4double newp2 = theEnergy*theEnergy - theMass*theMass;
125 if( newp2<0.0 ) {
126 ERROR("Particle has E^2 < m^2." << std::endl << print());
127 newp2 = 0.0;
128 theEnergy = theMass;
129 }
130
131 theMomentum *= std::sqrt(newp2/p2);
132 return theMomentum;
133 }
std::string print() const

Referenced by G4INCL::Cluster::Cluster(), G4INCL::CrossSections::interactionDistanceNN(), G4INCL::CrossSections::interactionDistancePiN(), G4INCL::StandardPropagationModel::shootParticle(), and G4INCL::KinematicsUtils::transformToLocalEnergyFrame().

◆ boost()

void G4INCL::Particle::boost ( const ThreeVector aBoostVector)
inline

Boost the particle using a boost vector.

Example (go to the particle rest frame): particle->boost(particle->boostVector());

Definition at line 295 of file G4INCLParticle.hh.

295 {
296 const G4double beta2 = aBoostVector.mag2();
297 const G4double gamma = 1.0 / std::sqrt(1.0 - beta2);
298 const G4double bp = theMomentum.dot(aBoostVector);
299 const G4double alpha = (gamma*gamma)/(1.0 + gamma);
300
301 theMomentum = theMomentum + aBoostVector * (alpha * bp - gamma * theEnergy);
302 theEnergy = gamma * (theEnergy - bp);
303 }
G4double dot(const ThreeVector &v) const

Referenced by G4INCL::Cluster::boost(), G4INCL::Nucleus::decayOutgoingDeltas(), and G4INCL::InteractionAvatar::preInteraction().

◆ boostVector()

ThreeVector G4INCL::Particle::boostVector ( ) const
inline

Returns a three vector we can give to the boost() -method.

In order to go to the particle rest frame you need to multiply the boost vector by -1.0.

Definition at line 285 of file G4INCLParticle.hh.

285 {
286 return theMomentum / theEnergy;
287 }

Referenced by G4INCL::StandardPropagationModel::shootComposite(), and G4INCL::StandardPropagationModel::shootParticle().

◆ dump()

std::string G4INCL::Particle::dump ( ) const
inline

Definition at line 703 of file G4INCLParticle.hh.

703 {
704 std::stringstream ss;
705 ss << "(particle " << ID << " ";
707 ss << std::endl
708 << thePosition.dump()
709 << std::endl
710 << theMomentum.dump()
711 << std::endl
712 << theEnergy << ")" << std::endl;
713 return ss.str();
714 };
static std::string getName(const ParticleType t)
Get the native INCL name of the particle.
std::string dump() const

Referenced by G4INCL::BinaryCollisionAvatar::dump(), G4INCL::DecayAvatar::dump(), G4INCL::ParticleEntryAvatar::dump(), and G4INCL::SurfaceAvatar::dump().

◆ freezePropagation()

void G4INCL::Particle::freezePropagation ( )
inline

Freeze particle propagation.

Make the particle use theFrozenMomentum and theFrozenEnergy for propagation. The normal state can be restored by calling the thawPropagation() method.

Definition at line 661 of file G4INCLParticle.hh.

◆ getA()

◆ getAngularMomentum()

virtual G4INCL::ThreeVector G4INCL::Particle::getAngularMomentum ( ) const
inlinevirtual

Get the angular momentum w.r.t. the origin

Reimplemented in G4INCL::Cluster.

Definition at line 548 of file G4INCLParticle.hh.

549 {
551 };
ThreeVector vector(const ThreeVector &v) const

Referenced by G4INCL::Cluster::getAngularMomentum(), and G4INCL::StandardPropagationModel::shootParticle().

◆ getBeta()

G4double G4INCL::Particle::getBeta ( ) const
inline

Definition at line 274 of file G4INCLParticle.hh.

274 {
275 const G4double P = theMomentum.mag();
276 return P/theEnergy;
277 }
G4double mag() const

◆ getEmissionQValueCorrection()

G4double G4INCL::Particle::getEmissionQValueCorrection ( const G4int  AParent,
const G4int  ZParent 
) const
inline

Computes correction on the emission Q-value.

Computes the correction that must be applied to INCL particles in order to obtain the correct Q-value for particle emission from a given nucleus. For absorption, the correction is obviously equal to minus the value returned by this function.

Parameters
AParentthe mass number of the emitting nucleus
ZParentthe charge number of the emitting nucleus
Returns
the correction

Definition at line 433 of file G4INCLParticle.hh.

433 {
434 const G4int ADaughter = AParent - theA;
435 const G4int ZDaughter = ZParent - theZ;
436
437 // Note the minus sign here
438 G4double theQValue;
439 if(isCluster())
440 theQValue = -ParticleTable::getTableQValue(theA, theZ, ADaughter, ZDaughter);
441 else {
442 const G4double massTableParent = ParticleTable::getTableMass(AParent,ZParent);
443 const G4double massTableDaughter = ParticleTable::getTableMass(ADaughter,ZDaughter);
444 const G4double massTableParticle = getTableMass();
445 theQValue = massTableParent - massTableDaughter - massTableParticle;
446 }
447
448 const G4double massINCLParent = ParticleTable::getINCLMass(AParent,ZParent);
449 const G4double massINCLDaughter = ParticleTable::getINCLMass(ADaughter,ZDaughter);
450 const G4double massINCLParticle = getINCLMass();
451
452 // The rhs corresponds to the INCL Q-value
453 return theQValue - (massINCLParent-massINCLDaughter-massINCLParticle);
454 }
int G4int
Definition: G4Types.hh:66
static G4double getINCLMass(const G4int A, const G4int Z)
Get INCL nuclear mass (in MeV/c^2)
static NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
static G4double getTableQValue(const G4int A1, const G4int Z1, const G4int A2, const G4int Z2)
Get Q-value (in MeV/c^2)
G4bool isCluster() const
G4double getINCLMass() const
Get the INCL particle mass.
virtual G4double getTableMass() const
Get the tabulated particle mass.

Referenced by G4INCL::ParticleEntryChannel::getFinalState(), and G4INCL::SurfaceAvatar::getTransmissionProbability().

◆ getEmissionTime()

G4double G4INCL::Particle::getEmissionTime ( )
inline

Definition at line 613 of file G4INCLParticle.hh.

613{ return emissionTime; };

◆ getEnergy()

◆ getFrozenEnergy()

G4double G4INCL::Particle::getFrozenEnergy ( ) const
inline

Get the frozen particle momentum.

Definition at line 650 of file G4INCLParticle.hh.

650{ return theFrozenEnergy; }

◆ getFrozenMomentum()

ThreeVector G4INCL::Particle::getFrozenMomentum ( ) const
inline

Get the frozen particle momentum.

Definition at line 647 of file G4INCLParticle.hh.

647{ return theFrozenMomentum; }

◆ getHelicity()

G4double G4INCL::Particle::getHelicity ( )
inline

Definition at line 574 of file G4INCLParticle.hh.

574{ return theHelicity; };

Referenced by G4INCL::InteractionAvatar::preInteractionBlocking().

◆ getID()

◆ getINCLMass()

G4double G4INCL::Particle::getINCLMass ( ) const
inline

Get the INCL particle mass.

Definition at line 327 of file G4INCLParticle.hh.

327 {
328 switch(theType) {
329 case Proton:
330 case Neutron:
331 case PiPlus:
332 case PiMinus:
333 case PiZero:
335 break;
336
337 case DeltaPlusPlus:
338 case DeltaPlus:
339 case DeltaZero:
340 case DeltaMinus:
341 return theMass;
342 break;
343
344 case Composite:
346 break;
347
348 default:
349 ERROR("Particle::getINCLMass: Unknown particle type." << std::endl);
350 return 0.0;
351 break;
352 }
353 }

Referenced by getEmissionQValueCorrection(), G4INCL::ParticleEntryChannel::getFinalState(), and setINCLMass().

◆ getInvariantMass()

G4double G4INCL::Particle::getInvariantMass ( ) const
inline

Get the the particle invariant mass.

Uses the relativistic invariant

\[ m = \sqrt{E^2 - {\vec p}^2}\]

Definition at line 496 of file G4INCLParticle.hh.

496 {
497 const G4double mass = std::pow(theEnergy, 2) - theMomentum.dot(theMomentum);
498 if(mass < 0.0) {
499 ERROR("E*E - p*p is negative." << std::endl);
500 return 0.0;
501 } else {
502 return std::sqrt(mass);
503 }
504 };

Referenced by G4INCL::Nucleus::finalizeProjectileRemnant(), and Particle().

◆ getKineticEnergy()

◆ getLongitudinalPosition()

ThreeVector G4INCL::Particle::getLongitudinalPosition ( ) const
inline

Longitudinal component of the position w.r.t. the momentum.

Definition at line 621 of file G4INCLParticle.hh.

Referenced by getTransversePosition().

◆ getMass()

◆ getMomentum()

◆ getNumberOfCollisions()

G4int G4INCL::Particle::getNumberOfCollisions ( ) const
inline

Return the number of collisions undergone by the particle.

Definition at line 582 of file G4INCLParticle.hh.

582{ return nCollisions; }

Referenced by G4INCL::Cluster::addParticle().

◆ getNumberOfDecays()

G4int G4INCL::Particle::getNumberOfDecays ( ) const
inline

Return the number of decays undergone by the particle.

Definition at line 591 of file G4INCLParticle.hh.

591{ return nDecays; }

◆ getParticipantType()

ParticipantType G4INCL::Particle::getParticipantType ( ) const
inline

Definition at line 224 of file G4INCLParticle.hh.

224 {
225 return theParticipantType;
226 }

Referenced by G4INCL::StandardPropagationModel::generateBinaryCollisionAvatar().

◆ getParticles()

ParticleList const * G4INCL::Particle::getParticles ( ) const
inline

Return a NULL pointer

Definition at line 721 of file G4INCLParticle.hh.

721 {
722 WARN("Particle::getParticles() method was called on a Particle object" << std::endl);
723 return 0;
724 }

◆ getPosition()

◆ getPotentialEnergy()

◆ getPropagationVelocity()

ThreeVector G4INCL::Particle::getPropagationVelocity ( ) const
inline

Get the propagation velocity of the particle.

Definition at line 653 of file G4INCLParticle.hh.

653{ return (*thePropagationMomentum)/(*thePropagationEnergy); }

Referenced by G4INCL::CoulombNone::bringToSurface(), G4INCL::StandardPropagationModel::getReflectionTime(), and G4INCL::StandardPropagationModel::getTime().

◆ getRealMass()

G4double G4INCL::Particle::getRealMass ( ) const
inline

Get the real particle mass.

Definition at line 385 of file G4INCLParticle.hh.

385 {
386 switch(theType) {
387 case Proton:
388 case Neutron:
389 case PiPlus:
390 case PiMinus:
391 case PiZero:
393 break;
394
395 case DeltaPlusPlus:
396 case DeltaPlus:
397 case DeltaZero:
398 case DeltaMinus:
399 return theMass;
400 break;
401
402 case Composite:
404 break;
405
406 default:
407 ERROR("Particle::getRealMass: Unknown particle type." << std::endl);
408 return 0.0;
409 break;
410 }
411 }
static G4double getRealMass(const G4INCL::ParticleType t)
Get particle mass (in MeV/c^2)

Referenced by G4INCL::Cluster::getTableMass(), and setRealMass().

◆ getSpecies()

virtual G4INCL::ParticleSpecies G4INCL::Particle::getSpecies ( ) const
inlinevirtual

Get the particle species.

Reimplemented in G4INCL::Cluster.

Definition at line 160 of file G4INCLParticle.hh.

160 {
161 return ParticleSpecies(theType);
162 };

Referenced by G4INCL::CoulombDistortion::maxImpactParameter(), and G4INCL::StandardPropagationModel::shootParticle().

◆ getTableMass()

virtual G4double G4INCL::Particle::getTableMass ( ) const
inlinevirtual

Get the tabulated particle mass.

Reimplemented in G4INCL::Cluster.

Definition at line 356 of file G4INCLParticle.hh.

356 {
357 switch(theType) {
358 case Proton:
359 case Neutron:
360 case PiPlus:
361 case PiMinus:
362 case PiZero:
364 break;
365
366 case DeltaPlusPlus:
367 case DeltaPlus:
368 case DeltaZero:
369 case DeltaMinus:
370 return theMass;
371 break;
372
373 case Composite:
375 break;
376
377 default:
378 ERROR("Particle::getTableMass: Unknown particle type." << std::endl);
379 return 0.0;
380 break;
381 }
382 }
static ParticleMassFn getTableParticleMass
Static pointer to the mass function for particles.

Referenced by G4INCL::Nucleus::decayOutgoingDeltas(), getEmissionQValueCorrection(), G4INCL::ParticleEntryChannel::getFinalState(), G4INCL::TransmissionChannel::getFinalState(), getTransferQValueCorrection(), and setTableMass().

◆ getTransferQValueCorrection()

G4double G4INCL::Particle::getTransferQValueCorrection ( const G4int  AFrom,
const G4int  ZFrom,
const G4int  ATo,
const G4int  ZTo 
) const
inline

Computes correction on the transfer Q-value.

Computes the correction that must be applied to INCL particles in order to obtain the correct Q-value for particle transfer from a given nucleus to another.

Assumes that the receving nucleus is INCL's target nucleus, with the INCL separation energy.

Parameters
AFromthe mass number of the donating nucleus
ZFromthe charge number of the donating nucleus
ATothe mass number of the receiving nucleus
ZTothe charge number of the receiving nucleus
Returns
the correction

Definition at line 471 of file G4INCLParticle.hh.

471 {
472 const G4int AFromDaughter = AFrom - theA;
473 const G4int ZFromDaughter = ZFrom - theZ;
474 const G4int AToDaughter = ATo + theA;
475 const G4int ZToDaughter = ZTo + theZ;
476 const G4double theQValue = ParticleTable::getTableQValue(AToDaughter,ZToDaughter,AFromDaughter,ZFromDaughter,AFrom,ZFrom);
477
478 const G4double massINCLTo = ParticleTable::getINCLMass(ATo,ZTo);
479 const G4double massINCLToDaughter = ParticleTable::getINCLMass(AToDaughter,ZToDaughter);
480 /* Note that here we have to use the table mass in the INCL Q-value. We
481 * cannot use theMass, because at this stage the particle is probably
482 * still off-shell; and we cannot use getINCLMass(), because it leads to
483 * violations of global energy conservation.
484 */
485 const G4double massINCLParticle = getTableMass();
486
487 // The rhs corresponds to the INCL Q-value for particle absorption
488 return theQValue - (massINCLToDaughter-massINCLTo-massINCLParticle);
489 }

◆ getTransversePosition()

ThreeVector G4INCL::Particle::getTransversePosition ( ) const
inline

Transverse component of the position w.r.t. the momentum.

Definition at line 616 of file G4INCLParticle.hh.

616 {
618 }
ThreeVector getLongitudinalPosition() const
Longitudinal component of the position w.r.t. the momentum.

Referenced by G4INCL::StandardPropagationModel::shootComposite(), and G4INCL::StandardPropagationModel::shootParticle().

◆ getType()

◆ getZ()

◆ incrementNumberOfCollisions()

void G4INCL::Particle::incrementNumberOfCollisions ( )
inline

Increment the number of collisions undergone by the particle.

Definition at line 588 of file G4INCLParticle.hh.

588{ nCollisions++; }

◆ incrementNumberOfDecays()

void G4INCL::Particle::incrementNumberOfDecays ( )
inline

Increment the number of decays undergone by the particle.

Definition at line 597 of file G4INCLParticle.hh.

597{ nDecays++; }

◆ isCluster()

G4bool G4INCL::Particle::isCluster ( ) const
inline

Definition at line 636 of file G4INCLParticle.hh.

636 {
637 return (theType == Composite);
638 }

Referenced by getEmissionQValueCorrection(), and G4INCL::SurfaceAvatar::postInteraction().

◆ isDelta()

◆ isInList()

G4bool G4INCL::Particle::isInList ( ParticleList const l) const
inline

Check if the particle belongs to a given list.

Definition at line 632 of file G4INCLParticle.hh.

632 {
633 return (std::find(l.begin(), l.end(), this)!=l.end());
634 }

◆ isNucleon()

◆ isOutOfWell()

G4bool G4INCL::Particle::isOutOfWell ( ) const
inline

Check if the particle is out of its potential well.

Definition at line 610 of file G4INCLParticle.hh.

610{ return outOfWell; }

Referenced by G4INCL::NuclearPotential::INuclearPotential::computePionPotentialEnergy().

◆ isParticipant()

G4bool G4INCL::Particle::isParticipant ( ) const
inline

◆ isPion()

◆ isProjectileSpectator()

G4bool G4INCL::Particle::isProjectileSpectator ( ) const
inline

Definition at line 240 of file G4INCLParticle.hh.

240 {
242 }

Referenced by G4INCL::SurfaceAvatar::getChannel().

◆ isResonance()

G4bool G4INCL::Particle::isResonance ( ) const
inline

Is it a resonance?

Definition at line 260 of file G4INCLParticle.hh.

260{ return isDelta(); }
G4bool isDelta() const
Is it a Delta?

Referenced by G4INCL::StandardPropagationModel::generateBinaryCollisionAvatar(), G4INCL::SurfaceAvatar::getChannel(), Particle(), and setType().

◆ isTargetSpectator()

G4bool G4INCL::Particle::isTargetSpectator ( ) const
inline

◆ lorentzContract()

void G4INCL::Particle::lorentzContract ( const ThreeVector aBoostVector,
const ThreeVector refPos 
)
inline

Lorentz-contract the particle position around some center.

Apply Lorentz contraction to the position component along the direction of the boost vector.

Parameters
aBoostVectorthe boost vector (velocity) [c]
refPosthe reference position

Definition at line 313 of file G4INCLParticle.hh.

313 {
314 const G4double beta2 = aBoostVector.mag2();
315 const G4double gamma = 1.0 / std::sqrt(1.0 - beta2);
316 const ThreeVector theRelativePosition = thePosition - refPos;
317 const ThreeVector transversePosition = theRelativePosition - aBoostVector * (theRelativePosition.dot(aBoostVector) / aBoostVector.mag2());
318 const ThreeVector longitudinalPosition = theRelativePosition - transversePosition;
319
320 thePosition = refPos + transversePosition + longitudinalPosition / gamma;
321 }

◆ makeParticipant()

virtual void G4INCL::Particle::makeParticipant ( )
inlinevirtual

Reimplemented in G4INCL::Cluster.

Definition at line 244 of file G4INCLParticle.hh.

244 {
246 }

Referenced by G4INCL::Store::loadParticles(), and G4INCL::Cluster::makeParticipant().

◆ makeProjectileSpectator()

virtual void G4INCL::Particle::makeProjectileSpectator ( )
inlinevirtual

◆ makeTargetSpectator()

virtual void G4INCL::Particle::makeTargetSpectator ( )
inlinevirtual

Reimplemented in G4INCL::Cluster.

Definition at line 248 of file G4INCLParticle.hh.

248 {
250 }

Referenced by G4INCL::Cluster::makeTargetSpectator().

◆ operator=()

Particle & G4INCL::Particle::operator= ( const Particle rhs)
inline

Assignment operator.

Does not copy the particle ID.

Definition at line 145 of file G4INCLParticle.hh.

145 {
146 Particle temporaryParticle(rhs);
147 swap(temporaryParticle);
148 return *this;
149 }
void swap(Particle &rhs)
Helper method for the assignment operator.

Referenced by G4INCL::Cluster::operator=().

◆ print()

std::string G4INCL::Particle::print ( ) const
inline

Definition at line 688 of file G4INCLParticle.hh.

688 {
689 std::stringstream ss;
690 ss << "Particle (ID = " << ID << ") type = ";
692 ss << std::endl
693 << " energy = " << theEnergy << std::endl
694 << " momentum = "
695 << theMomentum.print()
696 << std::endl
697 << " position = "
698 << thePosition.print()
699 << std::endl;
700 return ss.str();
701 };
std::string print() const

Referenced by adjustMomentumFromEnergy(), G4INCL::BinaryCollisionAvatar::getChannel(), G4INCL::ParticleEntryChannel::getFinalState(), G4INCL::KinematicsUtils::getLocalEnergy(), G4INCL::StandardPropagationModel::getReflectionTime(), and G4INCL::ProjectileRemnant::removeParticle().

◆ propagate()

void G4INCL::Particle::propagate ( G4double  step)
inline

Definition at line 577 of file G4INCLParticle.hh.

577 {
578 thePosition += ((*thePropagationMomentum)*(step/(*thePropagationEnergy)));
579 };

Referenced by G4INCL::StandardPropagationModel::generateBinaryCollisionAvatar().

◆ rotate()

virtual void G4INCL::Particle::rotate ( const G4double  angle,
const ThreeVector axis 
)
inlinevirtual

Rotate the particle position and momentum.

Parameters
anglethe rotation angle
axisa unit vector representing the rotation axis

Reimplemented in G4INCL::Cluster.

Definition at line 682 of file G4INCLParticle.hh.

682 {
683 thePosition.rotate(angle, axis);
684 theMomentum.rotate(angle, axis);
685 theFrozenMomentum.rotate(angle, axis);
686 }
void rotate(const G4double angle, const ThreeVector &axis)
Rotate the vector by a given angle around a given axis.

Referenced by G4INCL::Cluster::rotate().

◆ setEmissionTime()

void G4INCL::Particle::setEmissionTime ( G4double  t)
inline

Definition at line 612 of file G4INCLParticle.hh.

612{ emissionTime = t; }

Referenced by G4INCL::Nucleus::decayOutgoingDeltas(), and G4INCL::Nucleus::finalizeProjectileRemnant().

◆ setEnergy()

◆ setFrozenEnergy()

void G4INCL::Particle::setFrozenEnergy ( const G4double  energy)
inline

Set the frozen particle momentum.

Definition at line 644 of file G4INCLParticle.hh.

644{ theFrozenEnergy = energy; }

◆ setFrozenMomentum()

void G4INCL::Particle::setFrozenMomentum ( const ThreeVector momentum)
inline

Set the frozen particle momentum.

Definition at line 641 of file G4INCLParticle.hh.

641{ theFrozenMomentum = momentum; }

◆ setHelicity()

void G4INCL::Particle::setHelicity ( G4double  h)
inline

◆ setINCLMass()

void G4INCL::Particle::setINCLMass ( )
inline

Set the mass of the Particle to its table mass.

Definition at line 420 of file G4INCLParticle.hh.

420{ setMass(getINCLMass()); }

Referenced by G4INCL::Cluster::Cluster(), setType(), and G4INCL::StandardPropagationModel::shootParticle().

◆ setMass()

◆ setMomentum()

◆ setNumberOfCollisions()

void G4INCL::Particle::setNumberOfCollisions ( G4int  n)
inline

Set the number of collisions undergone by the particle.

Definition at line 585 of file G4INCLParticle.hh.

◆ setNumberOfDecays()

void G4INCL::Particle::setNumberOfDecays ( G4int  n)
inline

Set the number of decays undergone by the particle.

Definition at line 594 of file G4INCLParticle.hh.

594{ nDecays = n; }

◆ setOutOfWell()

void G4INCL::Particle::setOutOfWell ( )
inline

Mark the particle as out of its potential well.

This flag is used to control pions created outside their potential well in delta decay. The pion potential checks it and returns zero if it is true (necessary in order to correctly enforce energy conservation). The Nucleus::applyFinalState() method uses it to determine whether new avatars should be generated for the particle.

Definition at line 607 of file G4INCLParticle.hh.

607{ outOfWell = true; }

◆ setParticipantType()

void G4INCL::Particle::setParticipantType ( ParticipantType const  p)
inline

Definition at line 228 of file G4INCLParticle.hh.

228 {
230 }

◆ setPosition()

◆ setPotentialEnergy()

void G4INCL::Particle::setPotentialEnergy ( G4double  v)
inline

Set the particle potential energy.

Definition at line 513 of file G4INCLParticle.hh.

513{ thePotentialEnergy = v; }

Referenced by G4INCL::Store::loadParticles(), G4INCL::InteractionAvatar::restoreParticles(), and G4INCL::Nucleus::updatePotentialEnergy().

◆ setRealMass()

void G4INCL::Particle::setRealMass ( )
inline

Set the mass of the Particle to its real mass.

Definition at line 414 of file G4INCLParticle.hh.

414{ setMass(getRealMass()); }
G4double getRealMass() const
Get the real particle mass.

◆ setTableMass()

void G4INCL::Particle::setTableMass ( )
inline

◆ setType()

void G4INCL::Particle::setType ( ParticleType  t)
inline

Definition at line 164 of file G4INCLParticle.hh.

164 {
165 theType = t;
166 switch(theType)
167 {
168 case DeltaPlusPlus:
169 theA = 1;
170 theZ = 2;
171 break;
172 case Proton:
173 case DeltaPlus:
174 theA = 1;
175 theZ = 1;
176 break;
177 case Neutron:
178 case DeltaZero:
179 theA = 1;
180 theZ = 0;
181 break;
182 case DeltaMinus:
183 theA = 1;
184 theZ = -1;
185 break;
186 case PiPlus:
187 theA = 0;
188 theZ = 1;
189 break;
190 case PiZero:
191 theA = 0;
192 theZ = 0;
193 break;
194 case PiMinus:
195 theA = 0;
196 theZ = -1;
197 break;
198 case Composite:
199 // ERROR("Trying to set particle type to Composite! Construct a Cluster object instead" << std::endl);
200 theA = 0;
201 theZ = 0;
202 break;
203 case UnknownParticle:
204 theA = 0;
205 theZ = 0;
206 ERROR("Trying to set particle type to Unknown!" << std::endl);
207 break;
208 }
209
210 if( !isResonance() && t!=Composite )
211 setINCLMass();
212 }
void setINCLMass()
Set the mass of the Particle to its table mass.

Referenced by G4INCL::Cluster::Cluster(), G4INCL::ClusterDecay::decay(), G4INCL::DeltaDecayChannel::getFinalState(), G4INCL::DeltaProductionChannel::getFinalState(), G4INCL::ElasticChannel::getFinalState(), G4INCL::PionNucleonChannel::getFinalState(), G4INCL::RecombinationChannel::getFinalState(), Particle(), and G4INCL::InteractionAvatar::restoreParticles().

◆ swap()

void G4INCL::Particle::swap ( Particle rhs)
inlineprotected

Helper method for the assignment operator.

Definition at line 109 of file G4INCLParticle.hh.

109 {
110 std::swap(theZ, rhs.theZ);
111 std::swap(theA, rhs.theA);
112 std::swap(theParticipantType, rhs.theParticipantType);
113 std::swap(theType, rhs.theType);
114 if(rhs.thePropagationEnergy == &(rhs.theFrozenEnergy))
116 else
118 std::swap(theEnergy, rhs.theEnergy);
119 std::swap(theFrozenEnergy, rhs.theFrozenEnergy);
120 if(rhs.thePropagationMomentum == &(rhs.theFrozenMomentum))
122 else
124 std::swap(theMomentum, rhs.theMomentum);
125 std::swap(theFrozenMomentum, rhs.theFrozenMomentum);
126 std::swap(thePosition, rhs.thePosition);
127 std::swap(nCollisions, rhs.nCollisions);
128 std::swap(nDecays, rhs.nDecays);
129 std::swap(thePotentialEnergy, rhs.thePotentialEnergy);
130 // ID intentionally not swapped
131
132 std::swap(theHelicity, rhs.theHelicity);
133 std::swap(emissionTime, rhs.emissionTime);
134 std::swap(outOfWell, rhs.outOfWell);
135
136 std::swap(theMass, rhs.theMass);
137 }

Referenced by operator=(), and G4INCL::Cluster::swap().

◆ thawPropagation()

void G4INCL::Particle::thawPropagation ( )
inline

Unfreeze particle propagation.

Make the particle use theMomentum and theEnergy for propagation. Call this method to restore the normal propagation if the freezePropagation() method has been called.

Definition at line 672 of file G4INCLParticle.hh.

Referenced by G4INCL::ReflectionChannel::getFinalState().

Member Data Documentation

◆ ID

long G4INCL::Particle::ID
protected

Definition at line 740 of file G4INCLParticle.hh.

Referenced by dump(), getID(), Particle(), G4INCL::Cluster::print(), and print().

◆ nCollisions

◆ nDecays

G4int G4INCL::Particle::nDecays
protected

◆ theA

◆ theEnergy

◆ theFrozenEnergy

G4double G4INCL::Particle::theFrozenEnergy
protected

◆ theFrozenMomentum

G4INCL::ThreeVector G4INCL::Particle::theFrozenMomentum
protected

◆ theMomentum

◆ theParticipantType

◆ thePosition

◆ thePotentialEnergy

G4double G4INCL::Particle::thePotentialEnergy
protected

◆ thePropagationEnergy

G4double* G4INCL::Particle::thePropagationEnergy
protected

Definition at line 731 of file G4INCLParticle.hh.

Referenced by freezePropagation(), Particle(), swap(), and thawPropagation().

◆ thePropagationMomentum

G4INCL::ThreeVector* G4INCL::Particle::thePropagationMomentum
protected

◆ theType

◆ theZ


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