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.),
77 theParentResonancePDGCode(0),
78 theParentResonanceID(0),
91 thePropagationEnergy(&theEnergy),
92 theFrozenEnergy(theEnergy),
93 theMomentum(momentum),
94 thePropagationMomentum(&theMomentum),
95 theFrozenMomentum(theMomentum),
97 nCollisions(0), nDecays(0),
98 thePotentialEnergy(0.),
100 uncorrelatedMomentum(theMomentum.mag()),
103 theParentResonancePDGCode(0),
104 theParentResonanceID(0),
106 emissionTime(0.0), outOfWell(false)
120 : thePropagationEnergy(&theEnergy),
121 theMomentum(momentum),
122 thePropagationMomentum(&theMomentum),
123 theFrozenMomentum(theMomentum),
125 nCollisions(0), nDecays(0),
126 thePotentialEnergy(0.),
128 uncorrelatedMomentum(theMomentum.mag()),
131 theParentResonancePDGCode(0),
132 theParentResonanceID(0),
134 emissionTime(0.0), outOfWell(false)
141 INCL_ERROR(
"Cannot create resonance without specifying its momentum four-vector." <<
'\n');
167 for(const_iterator i=begin(), e=end(); i!=e; ++i) {
168 (*i)->rotatePositionAndMomentum(angle, axis);
173 for(const_iterator i=begin(), e=end(); i!=e; ++i) {
174 (*i)->rotatePosition(angle, axis);
179 for(const_iterator i=begin(), e=end(); i!=e; ++i) {
180 (*i)->rotateMomentum(angle, axis);
185 for(const_iterator i=begin(), e=end(); i!=e; ++i) {
191 if(
G4int((*this).size())==0)
return 1.;
192 std::vector<G4int> MergedVector;
193 for(
ParticleIter i = (*this).begin(), e = (*this).end(); i!=e; ++i){
200 std::vector<G4int> MergedVector;
201 if(
G4int((*this).size())==0)
return MergedVector;
202 for(
ParticleIter i = (*this).begin(), e = (*this).end(); i!=e; ++i){
218 if(VectorBias.empty())
return 1.;
222 for(
G4int i=0; i<
G4int(VectorBias.size()); i++){
230 std::vector<G4int> MergedVectorBias;
235 if(VectorBias1.size()==0 && VectorBias2.size()==0)
return MergedVectorBias;
236 else if(VectorBias1.size()==0)
return VectorBias2;
237 else if(VectorBias2.size()==0)
return VectorBias1;
239 while(i <
G4int(VectorBias1.size()) || j <
G4int(VectorBias2.size())){
240 if(VectorBias1[i]==VectorBias2[j]){
241 MergedVectorBias.push_back(VectorBias1[i]);
244 if(i ==
G4int(VectorBias1.size())){
245 for(;j<
G4int(VectorBias2.size());j++) MergedVectorBias.push_back(VectorBias2[j]);
247 else if(j ==
G4int(VectorBias2.size())){
248 for(;i<
G4int(VectorBias1.size());i++) MergedVectorBias.push_back(VectorBias1[i]);
250 }
else if(VectorBias1[i]<VectorBias2[j]){
251 MergedVectorBias.push_back(VectorBias1[i]);
253 if(i ==
G4int(VectorBias1.size())){
254 for(;j<
G4int(VectorBias2.size());j++) MergedVectorBias.push_back(VectorBias2[j]);
258 MergedVectorBias.push_back(VectorBias2[j]);
260 if(j ==
G4int(VectorBias2.size())){
261 for(;i<
G4int(VectorBias1.size());i++) MergedVectorBias.push_back(VectorBias1[i]);
265 return MergedVectorBias;
269 std::vector<G4int> MergedVectorBias;
273 if(p1.size()==0 && VectorBias.size()==0)
return MergedVectorBias;
274 else if(p1.size()==0)
return VectorBias;
275 else if(VectorBias.size()==0)
return p1;
277 while(i <
G4int(p1.size()) || j <
G4int(VectorBias.size())){
278 if(p1[i]==VectorBias[j]){
279 MergedVectorBias.push_back(p1[i]);
282 if(i ==
G4int(p1.size())){
283 for(;j<
G4int(VectorBias.size());j++) MergedVectorBias.push_back(VectorBias[j]);
285 else if(j ==
G4int(VectorBias.size())){
286 for(;i<
G4int(p1.size());i++) MergedVectorBias.push_back(p1[i]);
288 }
else if(p1[i]<VectorBias[j]){
289 MergedVectorBias.push_back(p1[i]);
291 if(i ==
G4int(p1.size())){
292 for(;j<
G4int(VectorBias.size());j++) MergedVectorBias.push_back(VectorBias[j]);
296 MergedVectorBias.push_back(VectorBias[j]);
298 if(j ==
G4int(VectorBias.size())){
299 for(;i<
G4int(p1.size());i++) MergedVectorBias.push_back(p1[i]);
303 return MergedVectorBias;
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