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.),
88 thePropagationEnergy(&theEnergy),
89 theFrozenEnergy(theEnergy),
90 theMomentum(momentum),
91 thePropagationMomentum(&theMomentum),
92 theFrozenMomentum(theMomentum),
93 thePosition(position),
94 nCollisions(0), nDecays(0),
95 thePotentialEnergy(0.),
97 uncorrelatedMomentum(theMomentum.mag()),
100 emissionTime(0.0), outOfWell(false)
114 : thePropagationEnergy(&theEnergy),
115 theMomentum(momentum),
116 thePropagationMomentum(&theMomentum),
117 theFrozenMomentum(theMomentum),
118 thePosition(position),
119 nCollisions(0), nDecays(0),
120 thePotentialEnergy(0.),
122 uncorrelatedMomentum(theMomentum.mag()),
125 emissionTime(0.0), outOfWell(false)
132 INCL_ERROR(
"Cannot create resonance without specifying its momentum four-vector." <<
'\n');
158 for(const_iterator i=begin(),
e=end(); i!=
e; ++i) {
159 (*i)->rotatePositionAndMomentum(angle, axis);
164 for(const_iterator i=begin(),
e=end(); i!=
e; ++i) {
165 (*i)->rotatePosition(angle, axis);
170 for(const_iterator i=begin(),
e=end(); i!=
e; ++i) {
171 (*i)->rotateMomentum(angle, axis);
176 for(const_iterator i=begin(),
e=end(); i!=
e; ++i) {
182 if(
G4int((*this).size())==0)
return 1.;
183 std::vector<G4int> MergedVector;
184 for(
ParticleIter i = (*this).begin(),
e = (*this).end(); i!=
e; ++i){
191 std::vector<G4int> MergedVector;
192 if(
G4int((*this).size())==0)
return MergedVector;
193 for(
ParticleIter i = (*this).begin(),
e = (*this).end(); i!=
e; ++i){
209 if(VectorBias.empty())
return 1.;
213 for(
G4int i=0; i<
G4int(VectorBias.size()); i++){
221 std::vector<G4int> MergedVectorBias;
226 if(VectorBias1.size()==0 && VectorBias2.size()==0)
return MergedVectorBias;
227 else if(VectorBias1.size()==0)
return VectorBias2;
228 else if(VectorBias2.size()==0)
return VectorBias1;
230 while(i <
G4int(VectorBias1.size()) || j <
G4int(VectorBias2.size())){
231 if(VectorBias1[i]==VectorBias2[j]){
232 MergedVectorBias.push_back(VectorBias1[i]);
235 if(i ==
G4int(VectorBias1.size())){
236 for(;j<
G4int(VectorBias2.size());j++) MergedVectorBias.push_back(VectorBias2[j]);
238 if(j ==
G4int(VectorBias2.size())){
239 for(;i<
G4int(VectorBias1.size());i++) MergedVectorBias.push_back(VectorBias1[i]);
241 }
else if(VectorBias1[i]<VectorBias2[j]){
242 MergedVectorBias.push_back(VectorBias1[i]);
244 if(i ==
G4int(VectorBias1.size())){
245 for(;j<
G4int(VectorBias2.size());j++) MergedVectorBias.push_back(VectorBias2[j]);
249 MergedVectorBias.push_back(VectorBias2[j]);
251 if(j ==
G4int(VectorBias2.size())){
252 for(;i<
G4int(VectorBias1.size());i++) MergedVectorBias.push_back(VectorBias1[i]);
256 return MergedVectorBias;
260 std::vector<G4int> MergedVectorBias;
264 if(p1.size()==0 && VectorBias.size()==0)
return MergedVectorBias;
265 else if(p1.size()==0)
return VectorBias;
266 else if(VectorBias.size()==0)
return p1;
268 while(i <
G4int(p1.size()) || j <
G4int(VectorBias.size())){
269 if(p1[i]==VectorBias[j]){
270 MergedVectorBias.push_back(p1[i]);
273 if(i ==
G4int(p1.size())){
274 for(;j<
G4int(VectorBias.size());j++) MergedVectorBias.push_back(VectorBias[j]);
276 if(j ==
G4int(VectorBias.size())){
277 for(;i<
G4int(p1.size());i++) MergedVectorBias.push_back(p1[i]);
279 }
else if(p1[i]<VectorBias[j]){
280 MergedVectorBias.push_back(p1[i]);
282 if(i ==
G4int(p1.size())){
283 for(;j<
G4int(VectorBias.size());j++) MergedVectorBias.push_back(VectorBias[j]);
287 MergedVectorBias.push_back(VectorBias[j]);
289 if(j ==
G4int(VectorBias.size())){
290 for(;i<
G4int(p1.size());i++) MergedVectorBias.push_back(p1[i]);
294 return MergedVectorBias;
std::vector< G4int > getBiasCollisionVector() const
Get the vector list of biased vertices on the particle path.
ParticleList::const_iterator ParticleIter
void rotatePositionAndMomentum(const G4double angle, const ThreeVector &axis) const
const ThreeVector & adjustMomentumFromEnergy()
Rescale the momentum to match the total energy.
static std::vector< G4double > INCLBiasVector
Time ordered vector of all bias applied.
static void FillINCLBiasVector(G4double newBias)
void setMass(G4double mass)
G4INCL::ThreeVector theMomentum
ParticipantType theParticipantType
G4bool isResonance() const
Is it a resonance?
static G4double getBiasFromVector(std::vector< G4int > VectorBias)
void boost(const ThreeVector &b) const
static G4double getTotalBias()
General bias vector function.
void rotatePosition(const G4double angle, const ThreeVector &axis) const
G4double getInvariantMass() const
Get the the particle invariant mass.
static std::vector< G4int > MergeVectorBias(Particle const *const p1, Particle const *const p2)
std::string print() const
void setType(ParticleType t)
static void setINCLBiasVector(std::vector< G4double > NewVector)
G4double adjustEnergyFromMomentum()
Recompute the energy to match the momentum.
static G4ThreadLocal long nextID
static G4ThreadLocal G4int nextBiasedCollisionID
G4double getParticleListBias() const
std::vector< G4int > getParticleListBiasVector() const
void rotateMomentum(const G4double angle, const ThreeVector &axis) const