85{
89
92
93 if (ekin <= lowEnergyLimit) {
95 }
97
98 G4int projPDG = part->GetPDGEncoding();
99
100
101 if (1 == Z && (211 == projPDG || 321 == projPDG)) {
A = 2; }
102
104 G4cout <<
"G4ChargeExchange for " << part->GetParticleName()
105 << " PDGcode= " << projPDG << " on nucleus Z= " << Z
106 <<
" A= " <<
A <<
" N= " <<
A - Z
108 }
109
112
113
114 const G4ParticleDefinition* theSecondary =
115 fXSection->SampleSecondaryType(part, aTrack.
GetMaterial(),
118
121
122
123 G4bool isShortLived = (pdg == 223 || pdg == 225);
124
125
126 if (projPDG == -211) { --Z; }
127 else if (projPDG == 211) { ++Z; }
128 else if (projPDG == -321) { --Z; }
129 else if (projPDG == 321) { ++Z; }
130 else if (projPDG == 130) {
132 else { ++Z; }
133 } else {
134
136 }
137
138
139 const G4ParticleDefinition* theRecoil = nullptr;
144 else if (Z == 2 &&
A == 3) { theRecoil =
G4He3::He3(); }
146
147
148
149
157
160 << " mass(MeV)=" << mass2 << " pdg=" << pdg
161 << " Final Z=" << Z << " isShortLived=" << isShortLived
162 << " " << lv
164 }
165
166 if (nullptr != theRecoil) {
168 ok = (m0 > mass2 + mass3);
169
170
171 } else {
173 const G4double eFermi = 10*CLHEP::MeV;
174 for (
G4int i=0; i<10; ++i) {
176 if (m0 > mass2 + mass3) {
177 ok = true;
178 break;
179 }
180 }
181 }
182 if (isShortLived) {
183 const G4double elim = 300*CLHEP::MeV;
184 ok = false;
185 for (
G4int i=0; i<10; ++i) {
186 if (SampleMass(mass2, theSecondary->
GetPDGWidth(), elim)) {
187 if (m0 > mass2 + mass3) {
188 ok = true;
189 break;
190 }
191 }
192 }
193 }
194
195
197
198 G4double e2 = (m0*m0 + mass2*mass2 - mass3*mass3)/(2*m0);
199 G4double momentumCMS = std::sqrt(e2*e2 - mass2*mass2);
200 G4double tmax = 4*momentumCMS*momentumCMS;
201
202
204 if (fXSection->isPion()) {
206 }
207 else {
209 }
210
213
214
215
216
217 if (std::abs(cost) > 1.0) { cost = 1.0; }
218
219 G4double sint = std::sqrt((1.0 - cost)*(1.0 + cost));
220
222 G4cout <<
" t= " << t <<
" tmax(GeV^2)= " << tmax/(GeV*GeV)
223 <<
" cos(t)=" << cost <<
" sin(t)=" << sint <<
G4endl;
224 }
226 momentumCMS*sint*std::sin(phi),
227 momentumCMS*cost, e2);
228
229
231 lv2.boost(bst);
232 lv -= lv2;
233 if (lv.
e() < mass3) {
235 }
236
237
241
242 if (!isShortLived) {
243 auto aSec = new G4DynamicParticle(theSecondary, lv2);
245 } else {
247 auto products = channel->
DecayIt(mass2);
249 G4int N = products->entries();
250 for (
G4int i=0; i<
N; ++i) {
251 auto p = (*products)[i];
252 auto lvp = p->Get4Momentum();
253 lvp.boost(bst1);
254 auto pnew = new G4DynamicParticle(*p);
255 pnew->Set4Momentum(lvp);
257 }
258 delete products;
259 }
260
261
262 if (nullptr != theRecoil) {
263 auto aRec = new G4DynamicParticle(theRecoil, lv);
265 } else {
266
267 G4Fragment frag(
A, Z, lv);
268 auto products = fHandler->BreakItUp(frag);
269 for (auto & prod : *products) {
270 auto dp = new G4DynamicParticle(prod->GetDefinition(), prod->GetMomentum());
272 delete prod;
273 }
274 delete products;
275 }
277}
CLHEP::HepLorentzVector G4LorentzVector
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
Hep3Vector boostVector() const
G4double SampleT(const G4ParticleDefinition *theSec, const G4int A, const G4double tmax) const
G4VDecayChannel * SelectADecayChannel(G4double parentMass=-1.)
static G4Deuteron * Deuteron()
const G4Material * GetMaterial() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4double GetTotalEnergy() const
G4HadFinalState theParticleChange
static G4Neutron * Neutron()
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4double GetPDGMass() const
G4int GetPDGEncoding() const
G4double GetPDGWidth() const
G4double GetPDGCharge() const
G4DecayTable * GetDecayTable() const
const G4String & GetParticleName() const
static G4Proton * Proton()
static G4Triton * Triton()
virtual G4DecayProducts * DecayIt(G4double parentMass=-1.0)=0