92{
96
99
100 if(ekin <= lowestEnergyLimit || A < 3) {
104 }
105
107
109 G4cout <<
"G4ChargeExchange::DoIt: Incident particle plab="
110 << plab/GeV << " GeV/c "
111 << " ekin(MeV) = " << ekin/MeV << " "
113
114
116
121 << " PDGcode= " << projPDG << " on nucleus Z= " << Z
122 << " A= " << A << " N= " << N
124
126
130
133 lv1.boost(-bst);
134 lv0.boost(-bst);
135
136
137 G4bool theHyperon =
false;
140
141 if(theParticle == theProton) {
142 theSecondary = theNeutron;
143 Z++;
144 } else if(theParticle == theNeutron) {
145 theSecondary = theProton;
146 Z--;
147 } else if(theParticle == thePiPlus) {
148 theSecondary = thePiZero;
149 Z++;
150 } else if(theParticle == thePiMinus) {
151 theSecondary = thePiZero;
152 Z--;
153 } else if(theParticle == theKPlus) {
155 else theSecondary = theK0L;
156 Z++;
157 } else if(theParticle == theKMinus) {
159 else theSecondary = theK0L;
160 Z--;
161 } else if(theParticle == theK0S || theParticle == theK0L) {
163 theSecondary = theKPlus;
164 Z--;
165 } else {
166 theSecondary = theKMinus;
167 Z++;
168 }
169 } else if(theParticle == theANeutron) {
170 theSecondary = theAProton;
171 Z++;
172 } else if(theParticle == theAProton) {
173 theSecondary = theANeutron;
174 Z--;
175 } else if(theParticle == theL) {
178 if(x < 0.2) {
179 theSecondary = theS0;
180 } else if (x < 0.4) {
181 theSecondary = theSPlus;
182 Z--;
183 } else if (x < 0.6) {
184 theSecondary = theProton;
185 theRecoil = theL;
186 theHyperon = true;
187 A--;
188 } else if (x < 0.8) {
189 theSecondary = theProton;
190 theRecoil = theS0;
191 theHyperon = true;
192 A--;
193 } else {
194 theSecondary = theNeutron;
195 theRecoil = theSPlus;
196 theHyperon = true;
197 A--;
198 }
199 } else {
200 if(x < 0.2) {
201 theSecondary = theS0;
202 } else if (x < 0.4) {
203 theSecondary = theSMinus;
204 Z++;
205 } else if (x < 0.6) {
206 theSecondary = theNeutron;
207 theRecoil = theL;
208 A--;
209 theHyperon = true;
210 } else if (x < 0.8) {
211 theSecondary = theNeutron;
212 theRecoil = theS0;
213 theHyperon = true;
214 A--;
215 } else {
216 theSecondary = theProton;
217 theRecoil = theSMinus;
218 theHyperon = true;
219 A--;
220 }
221 }
222 }
223
224 if (Z == 1 && A == 2) theDef = theD;
225 else if (Z == 1 && A == 3) theDef = theT;
226 else if (Z == 2 && A == 3) theDef = theHe3;
227 else if (Z == 2 && A == 4) theDef = theA;
228 else {
229 theDef =
231 }
233
236 if(theRecoil) { m21 += theRecoil->
GetPDGMass(); }
237 else { theRecoil = theDef; }
238
240
241
242 if(etot < m11 + m21) {
246 }
247
249 G4double e1 = 0.5*etot*(1.0 - (m21*m21 - m11*m11)/(etot*etot));
250
251 G4double ptot = std::sqrt(e1*e1 - m11*m11);
252
255
257
259 G4cout <<
"## G4ChargeExchange t= " << t <<
" tmax= " << tmax
260 <<
" ptot= " << ptot <<
G4endl;
261
262
265 if(std::abs(cost) > 1.0) cost = 1.0;
266 G4double sint = std::sqrt((1.0-cost)*(1.0+cost));
267
268
269
270
271 G4ThreeVector v1(sint*std::cos(phi),sint*std::sin(phi),cost);
272 v1 *= ptot;
275
278
283
285
286
287
288 if(theHyperon) {
293 } else if(erec > lowEnergyRecoilLimit) {
296 } else {
297 if(erec < 0.0) erec = 0.0;
299 }
301}
G4DLLIMPORT std::ostream G4cout
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
G4double SampleT(G4double p, G4double A)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetKineticEnergy(G4double aEnergy)
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
void SetLocalEnergyDeposit(G4double aE)
G4double GetTotalMomentum() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4HadFinalState theParticleChange
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int J=0)
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4double GetPDGMass() const
G4int GetPDGEncoding() const
const G4String & GetParticleName() const
static G4ParticleTable * GetParticleTable()
G4IonTable * GetIonTable()