45 std::vector<G4KineticTrack *> & someCandidates,
49 if(someCandidates.size() >1)
51 std::vector<G4KineticTrack *>::iterator j=someCandidates.begin();
52 for(; j != someCandidates.end(); ++j)
60 aTarget.push_back(*j);
75 G4KineticTrack * aProjectile, std::vector<G4KineticTrack *> & someCandidates)
77 std::vector<G4KineticTrack *>::iterator j=someCandidates.begin();
84 for(; j != someCandidates.end(); ++j)
86 if(*j == aTarget)
continue;
87 G4int cCharge =
G4lrint((*j)->GetDefinition()->GetPDGCharge());
88 if (chargeSum+cCharge > 2)
continue;
89 if (chargeSum+cCharge < 0)
continue;
92 if((firstBase+secodeBase).mag()<min)
94 min=(firstBase+secodeBase).mag();
98 if(partner) result.push_back(partner);
105 std::vector<G4KineticTrack *> & targets)
114 G4double energyBalance = incoming.t();
116 + targets[0]->GetDefinition()->GetPDGCharge()
117 + targets[1]->GetDefinition()->GetPDGCharge());
120 + targets[0]->GetDefinition()->GetBaryonNumber()
121 + targets[1]->GetDefinition()->GetBaryonNumber();
126 theT1 = toSPS * theT1;
127 theT2 = toSPS * theT2;
128 thePro = toSPS * thePro;
134 toZ.rotateZ(-1*Ptmp.phi());
135 toZ.rotateY(-1*Ptmp.theta());
138 thePro = toZ * thePro;
147 temp=
d1;d1=
d2;d2=temp;
152 if(d1->GetPDGCharge()>.5)
170 if(d1->GetPDGCharge()<.5)
188 G4double M_sq = (thePro+theT1+theT2).mag2();
192 G4double p = std::sqrt((m_sq*m_sq - 4.*m1_sq * m2_sq)/(4.*M_sq));
195 G4ThreeVector pFinal(p*std::sin(std::acos(costh))*std::cos(phi), p*std::sin(std::acos(costh))*std::sin(phi), p*costh);
199 G4double eFinal1 = std::sqrt(m1_sq+pFinal.mag2());
201 G4double eFinal2 = std::sqrt(m2_sq+pFinal.mag2());
205 final1 = toLab * final1;
206 final2 = toLab * final2;
209 final1 = fromSPS * final1;
210 final2 = fromSPS * final2;
218 result->push_back(f1);
219 result->push_back(f2);
221 for(
size_t hpw=0; hpw<result->size(); hpw++)
223 energyBalance-=result->operator[](hpw)->Get4Momentum().t();
224 chargeBalance-=
G4lrint(result->operator[](hpw)->GetDefinition()->GetPDGCharge());
225 baryonBalance-=result->operator[](hpw)->GetDefinition()->GetBaryonNumber();
227 if(getenv(
"AbsorptionEnergyBalanceCheck"))
228 std::cout <<
"DEBUGGING energy balance B: "
257 if ( mom1.mag2() < -1.*
eV )
259 G4cout <<
"G4MesonAbsorption::GetTimeToInteraction(): negative m2:" << mom1.mag2() <<
G4endl;
262 G4double collisionTime = - (position * velocity) / (velocity * velocity);
264 if (collisionTime > 0)
268 mom1 = toCMSFrame * mom1;
269 mom2 = toCMSFrame * mom2;
274 (toCMSFrame * coordinate2).vect());
277 G4double distance = pos * pos - (pos*mom) * (pos*mom) / (mom*mom);
281 if(
pi*distance>maxCrossSection)
return time;
286 pi*distance>maxChargedCrossSection)
return time;
290 sqrtS>1.91*
GeV &&
pi*distance>maxChargedCrossSection)
return time;
293 if ( totalCrossSection > 0 )
295 if (distance <= totalCrossSection /
pi)
297 time = collisionTime;
321 {0,4,50,5.5,75,8,95,10,120,11.5,140,12,160,11.5,180,10,190,8,210,6,235,4,260,3,300,2};
327 while(t>it[count])count+=2;
332 aCross = y1+(y2-y1)/(x2-x1)*(t-x1);
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepLorentzRotation G4LorentzRotation
const G4ThreeVector & GetPosition() const
static G4Proton * ProtonDefinition()
G4double AbsorptionCrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2)
G4double GetActualMass() const
G4GLOB_DLL std::ostream G4cout
static G4PionMinus * PionMinusDefinition()
static G4PionPlus * PionPlusDefinition()
void FindAndFillCluster(G4KineticTrackVector &result, G4KineticTrack *aProjectile, std::vector< G4KineticTrack * > &someCandidates)
static G4Neutron * Neutron()
G4double GetPDGMass() const
std::vector< G4CollisionInitialState * > theCollisions
const G4LorentzVector & GetTrackingMomentum() const
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
static const double millibarn
virtual G4KineticTrackVector * GetFinalState(G4KineticTrack *aProjectile, std::vector< G4KineticTrack * > &theTargets)
G4double GetTimeToAbsorption(const G4KineticTrack &trk1, const G4KineticTrack &trk2)
const G4LorentzVector & Get4Momentum() const
G4double GetPDGCharge() const
virtual const std::vector< G4CollisionInitialState * > & GetCollisions(G4KineticTrack *aProjectile, std::vector< G4KineticTrack * > &someCandidates, G4double aCurrentTime)
const G4ParticleDefinition * GetDefinition() const
static G4Neutron * NeutronDefinition()
static const G4double pos
G4int GetBaryonNumber() const
CLHEP::HepLorentzVector G4LorentzVector