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.),
89 thePropagationEnergy(&theEnergy),
90 theFrozenEnergy(theEnergy),
91 theMomentum(momentum),
92 thePropagationMomentum(&theMomentum),
93 theFrozenMomentum(theMomentum),
95 nCollisions(0), nDecays(0),
96 thePotentialEnergy(0.),
98 uncorrelatedMomentum(theMomentum.mag()),
102 emissionTime(0.0), outOfWell(false)
116 : thePropagationEnergy(&theEnergy),
117 theMomentum(momentum),
118 thePropagationMomentum(&theMomentum),
119 theFrozenMomentum(theMomentum),
121 nCollisions(0), nDecays(0),
122 thePotentialEnergy(0.),
124 uncorrelatedMomentum(theMomentum.mag()),
128 emissionTime(0.0), outOfWell(false)
135 INCL_ERROR(
"Cannot create resonance without specifying its momentum four-vector." <<
'\n');
161 for(const_iterator i=begin(), e=end(); i!=e; ++i) {
162 (*i)->rotatePositionAndMomentum(
angle, axis);
167 for(const_iterator i=begin(), e=end(); i!=e; ++i) {
168 (*i)->rotatePosition(
angle, axis);
173 for(const_iterator i=begin(), e=end(); i!=e; ++i) {
174 (*i)->rotateMomentum(
angle, axis);
179 for(const_iterator i=begin(), e=end(); i!=e; ++i) {
185 if(
G4int((*this).size())==0)
return 1.;
186 std::vector<G4int> MergedVector;
187 for(
ParticleIter i = (*this).begin(), e = (*this).end(); i!=e; ++i){
194 std::vector<G4int> MergedVector;
195 if(
G4int((*this).size())==0)
return MergedVector;
196 for(
ParticleIter i = (*this).begin(), e = (*this).end(); i!=e; ++i){
212 if(VectorBias.empty())
return 1.;
216 for(
G4int i=0; i<
G4int(VectorBias.size()); i++){
224 std::vector<G4int> MergedVectorBias;
229 if(VectorBias1.size()==0 && VectorBias2.size()==0)
return MergedVectorBias;
230 else if(VectorBias1.size()==0)
return VectorBias2;
231 else if(VectorBias2.size()==0)
return VectorBias1;
233 while(i <
G4int(VectorBias1.size()) || j <
G4int(VectorBias2.size())){
234 if(VectorBias1[i]==VectorBias2[j]){
235 MergedVectorBias.push_back(VectorBias1[i]);
238 if(i ==
G4int(VectorBias1.size())){
239 for(;j<
G4int(VectorBias2.size());j++) MergedVectorBias.push_back(VectorBias2[j]);
241 else if(j ==
G4int(VectorBias2.size())){
242 for(;i<
G4int(VectorBias1.size());i++) MergedVectorBias.push_back(VectorBias1[i]);
244 }
else if(VectorBias1[i]<VectorBias2[j]){
245 MergedVectorBias.push_back(VectorBias1[i]);
247 if(i ==
G4int(VectorBias1.size())){
248 for(;j<
G4int(VectorBias2.size());j++) MergedVectorBias.push_back(VectorBias2[j]);
252 MergedVectorBias.push_back(VectorBias2[j]);
254 if(j ==
G4int(VectorBias2.size())){
255 for(;i<
G4int(VectorBias1.size());i++) MergedVectorBias.push_back(VectorBias1[i]);
259 return MergedVectorBias;
263 std::vector<G4int> MergedVectorBias;
267 if(p1.size()==0 && VectorBias.size()==0)
return MergedVectorBias;
268 else if(p1.size()==0)
return VectorBias;
269 else if(VectorBias.size()==0)
return p1;
271 while(i <
G4int(p1.size()) || j <
G4int(VectorBias.size())){
272 if(p1[i]==VectorBias[j]){
273 MergedVectorBias.push_back(p1[i]);
276 if(i ==
G4int(p1.size())){
277 for(;j<
G4int(VectorBias.size());j++) MergedVectorBias.push_back(VectorBias[j]);
279 else if(j ==
G4int(VectorBias.size())){
280 for(;i<
G4int(p1.size());i++) MergedVectorBias.push_back(p1[i]);
282 }
else if(p1[i]<VectorBias[j]){
283 MergedVectorBias.push_back(p1[i]);
285 if(i ==
G4int(p1.size())){
286 for(;j<
G4int(VectorBias.size());j++) MergedVectorBias.push_back(VectorBias[j]);
290 MergedVectorBias.push_back(VectorBias[j]);
292 if(j ==
G4int(VectorBias.size())){
293 for(;i<
G4int(p1.size());i++) MergedVectorBias.push_back(p1[i]);
297 return MergedVectorBias;
static const G4double angle[DIMMOTT]
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.
static G4ThreadLocal long nextID
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)
G4double energy(const ThreeVector &p, const G4double m)
ParticleList::const_iterator ParticleIter