34#define INCLXX_IN_GEANT4_MODE 1
50#ifdef INCLXX_IN_GEANT4_MODE
60 : theZ(0), theA(0), theS(0),
64 thePropagationEnergy(&theEnergy),
65 theFrozenEnergy(theEnergy),
67 thePropagationMomentum(&theMomentum),
68 theFrozenMomentum(theMomentum),
72 thePotentialEnergy(0.0),
74 uncorrelatedMomentum(0.),
78 theParentResonancePDGCode(0),
79 theParentResonanceID(0),
93 thePropagationEnergy(&theEnergy),
94 theFrozenEnergy(theEnergy),
95 theMomentum(momentum),
96 thePropagationMomentum(&theMomentum),
97 theFrozenMomentum(theMomentum),
99 nCollisions(0), nDecays(0),
100 thePotentialEnergy(0.),
102 uncorrelatedMomentum(theMomentum.mag()),
106 theParentResonancePDGCode(0),
107 theParentResonanceID(0),
110 emissionTime(0.0), outOfWell(false)
124 : thePropagationEnergy(&theEnergy),
125 theMomentum(momentum),
126 thePropagationMomentum(&theMomentum),
127 theFrozenMomentum(theMomentum),
129 nCollisions(0), nDecays(0),
130 thePotentialEnergy(0.),
132 uncorrelatedMomentum(theMomentum.mag()),
136 theParentResonancePDGCode(0),
137 theParentResonanceID(0),
140 emissionTime(0.0), outOfWell(false)
147 INCL_ERROR(
"Cannot create resonance without specifying its momentum four-vector." <<
'\n');
173 for(const_iterator i=begin(), e=end(); i!=e; ++i) {
174 (*i)->rotatePositionAndMomentum(angle, axis);
179 for(const_iterator i=begin(), e=end(); i!=e; ++i) {
180 (*i)->rotatePosition(angle, axis);
185 for(const_iterator i=begin(), e=end(); i!=e; ++i) {
186 (*i)->rotateMomentum(angle, axis);
191 for(const_iterator i=begin(), e=end(); i!=e; ++i) {
197 if(
G4int((*this).size())==0)
return 1.;
198 std::vector<G4int> MergedVector;
199 for(
ParticleIter i = (*this).begin(), e = (*this).end(); i!=e; ++i){
206 std::vector<G4int> MergedVector;
207 if(
G4int((*this).size())==0)
return MergedVector;
208 for(
ParticleIter i = (*this).begin(), e = (*this).end(); i!=e; ++i){
224 if(VectorBias.empty())
return 1.;
228 for(
G4int i=0; i<
G4int(VectorBias.size()); i++){
236 std::vector<G4int> MergedVectorBias;
241 if(VectorBias1.size()==0 && VectorBias2.size()==0)
return MergedVectorBias;
242 else if(VectorBias1.size()==0)
return VectorBias2;
243 else if(VectorBias2.size()==0)
return VectorBias1;
245 while(i <
G4int(VectorBias1.size()) || j <
G4int(VectorBias2.size())){
246 if(VectorBias1[i]==VectorBias2[j]){
247 MergedVectorBias.push_back(VectorBias1[i]);
250 if(i ==
G4int(VectorBias1.size())){
251 for(;j<
G4int(VectorBias2.size());j++) MergedVectorBias.push_back(VectorBias2[j]);
253 else if(j ==
G4int(VectorBias2.size())){
254 for(;i<
G4int(VectorBias1.size());i++) MergedVectorBias.push_back(VectorBias1[i]);
256 }
else if(VectorBias1[i]<VectorBias2[j]){
257 MergedVectorBias.push_back(VectorBias1[i]);
259 if(i ==
G4int(VectorBias1.size())){
260 for(;j<
G4int(VectorBias2.size());j++) MergedVectorBias.push_back(VectorBias2[j]);
264 MergedVectorBias.push_back(VectorBias2[j]);
266 if(j ==
G4int(VectorBias2.size())){
267 for(;i<
G4int(VectorBias1.size());i++) MergedVectorBias.push_back(VectorBias1[i]);
271 return MergedVectorBias;
275 std::vector<G4int> MergedVectorBias;
279 if(p1.size()==0 && VectorBias.size()==0)
return MergedVectorBias;
280 else if(p1.size()==0)
return VectorBias;
281 else if(VectorBias.size()==0)
return p1;
283 while(i <
G4int(p1.size()) || j <
G4int(VectorBias.size())){
284 if(p1[i]==VectorBias[j]){
285 MergedVectorBias.push_back(p1[i]);
288 if(i ==
G4int(p1.size())){
289 for(;j<
G4int(VectorBias.size());j++) MergedVectorBias.push_back(VectorBias[j]);
291 else if(j ==
G4int(VectorBias.size())){
292 for(;i<
G4int(p1.size());i++) MergedVectorBias.push_back(p1[i]);
294 }
else if(p1[i]<VectorBias[j]){
295 MergedVectorBias.push_back(p1[i]);
297 if(i ==
G4int(p1.size())){
298 for(;j<
G4int(VectorBias.size());j++) MergedVectorBias.push_back(VectorBias[j]);
302 MergedVectorBias.push_back(VectorBias[j]);
304 if(j ==
G4int(VectorBias.size())){
305 for(;i<
G4int(p1.size());i++) MergedVectorBias.push_back(p1[i]);
309 return MergedVectorBias;
#define INCLXX_IN_GEANT4_MODE
G4double getParticleListBias() const
std::vector< G4int > getParticleListBiasVector() const
void rotateMomentum(const G4double angle, const ThreeVector &axis) const
void boost(const ThreeVector &b) const
void rotatePosition(const G4double angle, const ThreeVector &axis) const
void rotatePositionAndMomentum(const G4double angle, const ThreeVector &axis) const
G4INCL::ThreeVector theMomentum
static std::vector< G4double > INCLBiasVector
Time ordered vector of all bias applied.
void setMass(G4double mass)
ParticipantType theParticipantType
static void FillINCLBiasVector(G4double newBias)
static std::vector< G4int > MergeVectorBias(Particle const *const p1, Particle const *const p2)
std::vector< G4int > getBiasCollisionVector() const
Get the vector list of biased vertices on the particle path.
G4double adjustEnergyFromMomentum()
Recompute the energy to match the momentum.
static void setINCLBiasVector(std::vector< G4double > NewVector)
static G4double getTotalBias()
General bias vector function.
const ThreeVector & adjustMomentumFromEnergy()
Rescale the momentum to match the total energy.
G4double getInvariantMass() const
Get the the particle invariant mass.
G4bool isResonance() const
Is it a resonance?
void setType(ParticleType t)
std::string print() const
static G4ThreadLocal G4int nextBiasedCollisionID
static G4double getBiasFromVector(std::vector< G4int > VectorBias)
ParticleList::const_iterator ParticleIter