55 delete theAngularDistribution;
68 if (OutputDefinitions.size() != 2)
69 throw G4HadronicException(__FILE__, __LINE__,
"G4VScatteringCollision: Too many output particles!");
71 if (OutputDefinitions[0]->IsShortLived() && OutputDefinitions[1]->IsShortLived())
73 if(getenv(
"G4KCDEBUG"))
G4cerr <<
"two shortlived for Type = "<<
typeid(*this).name()<<
G4endl;
77 G4double outm1 = OutputDefinitions[0]->GetPDGMass();
78 G4double outm2 = OutputDefinitions[1]->GetPDGMass();
80 if (OutputDefinitions[0]->IsShortLived())
82 outm1 = SampleResonanceMass(outm1,
83 OutputDefinitions[0]->GetPDGWidth(),
88 if (OutputDefinitions[1]->IsShortLived())
90 outm2 = SampleResonanceMass(outm2, OutputDefinitions[1]->GetPDGWidth(),
108 G4ThreeVector pFinal1(std::sin(std::acos(cosTheta))*std::cos(phi), std::sin(std::acos(cosTheta))*std::sin(phi), cosTheta);
111 G4double pCM = std::sqrt( (S-(outm1+outm2)*(outm1+outm2)) * (S-(outm1-outm2)*(outm1-outm2)) /(4.*S));
112 pFinal1 = pFinal1 * pCM;
115 G4double eFinal1 = std::sqrt(pFinal1.
mag2() + outm1*outm1);
116 G4double eFinal2 = std::sqrt(pFinal2.
mag2() + outm2*outm2);
120 p4Final1 = toCMS*p4Final1;
121 p4Final2 = toCMS*p4Final2;
126 p4Final1 *= toLabFrame;
127 p4Final2 *= toLabFrame;
131 G4double chargeBalance = OutputDefinitions[0]->GetPDGCharge()+OutputDefinitions[1]->GetPDGCharge();
134 if(std::abs(chargeBalance) >.1)
137 G4cout << OutputDefinitions[0]->GetPDGCharge()<<
" "<<OutputDefinitions[0]->GetParticleName()
138 << OutputDefinitions[1]->GetPDGCharge()<<
" "<<OutputDefinitions[1]->GetParticleName()
149 finalTracks->push_back(final1);
150 finalTracks->push_back(final2);
157double G4VScatteringCollision::SampleResonanceMass(
const double poleMass,
159 const double aMinMass,
160 const double maxMass)
const
167 if (minMass > maxMass)
G4cerr <<
"##################### SampleResonanceMass: particle out of mass range" <<
G4endl;
169 if(minMass > maxMass) minMass = 0;
171 if (gamma < 1E-10*GeV)
172 return std::max(minMass,std::min(maxMass, poleMass));
174 double fmin = BrWigInt0(minMass, gamma, poleMass);
175 double fmax = BrWigInt0(maxMass, gamma, poleMass);
177 return BrWigInv(f, gamma, poleMass);
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
HepLorentzRotation inverse() const
Hep3Vector boostVector() const
const G4ThreeVector & GetPosition() const
G4ParticleDefinition * GetDefinition() const
const G4LorentzVector & Get4Momentum() const
G4double GetActualMass() const
static G4Neutron * NeutronDefinition()
G4double GetPDGMass() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
static G4PionPlus * PionPlus()
virtual G4double Phi() const
virtual G4double CosTheta(G4double s, G4double m1, G4double m2) const =0
virtual const G4VAngularDistribution * GetAngularDistribution() const
virtual ~G4VScatteringCollision()
virtual G4KineticTrackVector * FinalState(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
virtual const std::vector< const G4ParticleDefinition * > & GetOutgoingParticles() const =0