Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4RPGInelastic Class Reference

#include <G4RPGInelastic.hh>

+ Inheritance diagram for G4RPGInelastic:

Public Member Functions

 G4RPGInelastic (const G4String &modelName="RPGInelastic")
 
virtual ~G4RPGInelastic ()
 
- Public Member Functions inherited from G4HadronicInteraction
 G4HadronicInteraction (const G4String &modelName="HadronicModel")
 
virtual ~G4HadronicInteraction ()
 
virtual G4HadFinalStateApplyYourself (const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)=0
 
virtual G4double SampleInvariantT (const G4ParticleDefinition *p, G4double plab, G4int Z, G4int A)
 
virtual G4bool IsApplicable (const G4HadProjectile &, G4Nucleus &)
 
G4double GetMinEnergy () const
 
G4double GetMinEnergy (const G4Material *aMaterial, const G4Element *anElement) const
 
void SetMinEnergy (G4double anEnergy)
 
void SetMinEnergy (G4double anEnergy, const G4Element *anElement)
 
void SetMinEnergy (G4double anEnergy, const G4Material *aMaterial)
 
G4double GetMaxEnergy () const
 
G4double GetMaxEnergy (const G4Material *aMaterial, const G4Element *anElement) const
 
void SetMaxEnergy (const G4double anEnergy)
 
void SetMaxEnergy (G4double anEnergy, const G4Element *anElement)
 
void SetMaxEnergy (G4double anEnergy, const G4Material *aMaterial)
 
const G4HadronicInteractionGetMyPointer () const
 
G4int GetVerboseLevel () const
 
void SetVerboseLevel (G4int value)
 
const G4StringGetModelName () const
 
void DeActivateFor (const G4Material *aMaterial)
 
void ActivateFor (const G4Material *aMaterial)
 
void DeActivateFor (const G4Element *anElement)
 
void ActivateFor (const G4Element *anElement)
 
G4bool IsBlocked (const G4Material *aMaterial) const
 
G4bool IsBlocked (const G4Element *anElement) const
 
void SetRecoilEnergyThreshold (G4double val)
 
G4double GetRecoilEnergyThreshold () const
 
G4bool operator== (const G4HadronicInteraction &right) const
 
G4bool operator!= (const G4HadronicInteraction &right) const
 
virtual const std::pair< G4double, G4doubleGetFatalEnergyCheckLevels () const
 
virtual std::pair< G4double, G4doubleGetEnergyMomentumCheckLevels () const
 
void SetEnergyMomentumCheckLevels (G4double relativeLevel, G4double absoluteLevel)
 
virtual void ModelDescription (std::ostream &outFile) const
 

Protected Types

enum  {
  pi0 , pip , pim , kp ,
  km , k0 , k0b , pro ,
  neu , lam , sp , s0 ,
  sm , xi0 , xim , om ,
  ap , an
}
 

Protected Member Functions

G4double Pmltpc (G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c)
 
G4int Factorial (G4int n)
 
G4bool MarkLeadingStrangeParticle (const G4ReactionProduct &currentParticle, const G4ReactionProduct &targetParticle, G4ReactionProduct &leadParticle)
 
void SetUpPions (const G4int np, const G4int nm, const G4int nz, G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen)
 
void GetNormalizationConstant (const G4double availableEnergy, G4double &n, G4double &anpn)
 
void CalculateMomenta (G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen, const G4HadProjectile *originalIncident, const G4DynamicParticle *originalTarget, G4ReactionProduct &modifiedOriginal, G4Nucleus &targetNucleus, G4ReactionProduct &currentParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged, G4bool &targetHasChanged, G4bool quasiElastic)
 
void SetUpChange (G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen, G4ReactionProduct &currentParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged)
 
std::pair< G4int, G4doubleinterpolateEnergy (G4double ke) const
 
G4int sampleFlat (std::vector< G4double > sigma) const
 
void CheckQnums (G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen, G4ReactionProduct &currentParticle, G4ReactionProduct &targetParticle, G4double Q, G4double B, G4double S)
 
- Protected Member Functions inherited from G4HadronicInteraction
void SetModelName (const G4String &nam)
 
G4bool IsBlocked () const
 
void Block ()
 

Protected Attributes

G4RPGFragmentation fragmentation
 
G4RPGTwoCluster twoCluster
 
G4RPGPionSuppression pionSuppression
 
G4RPGStrangeProduction strangeProduction
 
G4RPGTwoBody twoBody
 
G4ParticleDefinitionparticleDef [18]
 
- Protected Attributes inherited from G4HadronicInteraction
G4HadFinalState theParticleChange
 
G4int verboseLevel
 
G4double theMinEnergy
 
G4double theMaxEnergy
 
G4bool isBlocked
 

Detailed Description

Definition at line 53 of file G4RPGInelastic.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected

Constructor & Destructor Documentation

◆ G4RPGInelastic()

G4RPGInelastic::G4RPGInelastic ( const G4String modelName = "RPGInelastic")

Definition at line 38 of file G4RPGInelastic.cc.

39 : G4HadronicInteraction(modelName)
40{
41 cache = 0.0;
60
61 G4cout << " **************************************************** " << G4endl;
62 G4cout << " * The RPG model is currently under development and * " << G4endl;
63 G4cout << " * should not be used. * " << G4endl;
64 G4cout << " **************************************************** " << G4endl;
65}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
static G4AntiKaonZero * AntiKaonZero()
static G4AntiNeutron * AntiNeutron()
static G4AntiProton * AntiProton()
Definition: G4AntiProton.cc:93
static G4KaonMinus * KaonMinus()
Definition: G4KaonMinus.cc:113
static G4KaonPlus * KaonPlus()
Definition: G4KaonPlus.cc:113
static G4KaonZero * KaonZero()
Definition: G4KaonZero.cc:104
static G4Lambda * Lambda()
Definition: G4Lambda.cc:108
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
static G4OmegaMinus * OmegaMinus()
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:98
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:98
static G4PionZero * PionZero()
Definition: G4PionZero.cc:104
static G4Proton * Proton()
Definition: G4Proton.cc:93
G4ParticleDefinition * particleDef[18]
static G4SigmaMinus * SigmaMinus()
static G4SigmaPlus * SigmaPlus()
Definition: G4SigmaPlus.cc:108
static G4SigmaZero * SigmaZero()
Definition: G4SigmaZero.cc:99
static G4XiMinus * XiMinus()
Definition: G4XiMinus.cc:106
static G4XiZero * XiZero()
Definition: G4XiZero.cc:106

◆ ~G4RPGInelastic()

virtual G4RPGInelastic::~G4RPGInelastic ( )
inlinevirtual

Definition at line 59 of file G4RPGInelastic.hh.

60 { }

Member Function Documentation

◆ CalculateMomenta()

void G4RPGInelastic::CalculateMomenta ( G4FastVector< G4ReactionProduct, 256 > &  vec,
G4int vecLen,
const G4HadProjectile originalIncident,
const G4DynamicParticle originalTarget,
G4ReactionProduct modifiedOriginal,
G4Nucleus targetNucleus,
G4ReactionProduct currentParticle,
G4ReactionProduct targetParticle,
G4bool incidentHasChanged,
G4bool targetHasChanged,
G4bool  quasiElastic 
)
protected

Definition at line 202 of file G4RPGInelastic.cc.

213{
214 cache = 0;
215 what = originalIncident->Get4Momentum().vect();
216
217 G4ReactionProduct leadingStrangeParticle;
218
219 // strangeProduction.ReactionStage(originalIncident, modifiedOriginal,
220 // incidentHasChanged, originalTarget,
221 // targetParticle, targetHasChanged,
222 // targetNucleus, currentParticle,
223 // vec, vecLen,
224 // false, leadingStrangeParticle);
225
226 if( quasiElastic )
227 {
228 twoBody.ReactionStage(originalIncident, modifiedOriginal,
229 incidentHasChanged, originalTarget,
230 targetParticle, targetHasChanged,
231 targetNucleus, currentParticle,
232 vec, vecLen,
233 false, leadingStrangeParticle);
234 return;
235 }
236
237 G4bool leadFlag = MarkLeadingStrangeParticle(currentParticle,
238 targetParticle,
239 leadingStrangeParticle );
240 //
241 // Note: the number of secondaries can be reduced in GenerateXandPt
242 // and TwoCluster
243 //
244 G4bool finishedGenXPt = false;
245 G4bool annihilation = false;
246 if( originalIncident->GetDefinition()->GetPDGEncoding() < 0 &&
247 currentParticle.GetMass() == 0.0 && targetParticle.GetMass() == 0.0 )
248 {
249 // original was an anti-particle and annihilation has taken place
250 annihilation = true;
251 G4double ekcor = 1.0;
252 G4double ek = originalIncident->GetKineticEnergy();
253 G4double ekOrg = ek;
254
255 const G4double tarmas = originalTarget->GetDefinition()->GetPDGMass();
256 if( ek > 1.0*GeV )ekcor = 1./(ek/GeV);
257 const G4double atomicWeight = targetNucleus.GetA_asInt();
258 ek = 2*tarmas + ek*(1.+ekcor/atomicWeight);
259 G4double tkin = targetNucleus.Cinema(ek);
260 ek += tkin;
261 ekOrg += tkin;
262 // modifiedOriginal.SetKineticEnergy( ekOrg );
263 //
264 // evaporation -- re-calculate black track energies
265 // this was Done already just before the cascade
266 //
267 tkin = targetNucleus.AnnihilationEvaporationEffects(ek, ekOrg);
268 ekOrg -= tkin;
269 ekOrg = std::max( 0.0001*GeV, ekOrg );
270 modifiedOriginal.SetKineticEnergy( ekOrg );
271 G4double amas = originalIncident->GetDefinition()->GetPDGMass();
272 G4double et = ekOrg + amas;
273 G4double p = std::sqrt( std::abs(et*et-amas*amas) );
274 G4double pp = modifiedOriginal.GetMomentum().mag();
275 if( pp > 0.0 )
276 {
277 G4ThreeVector momentum = modifiedOriginal.GetMomentum();
278 modifiedOriginal.SetMomentum( momentum * (p/pp) );
279 }
280 if( ekOrg <= 0.0001 )
281 {
282 modifiedOriginal.SetKineticEnergy( 0.0 );
283 modifiedOriginal.SetMomentum( 0.0, 0.0, 0.0 );
284 }
285 }
286
287 // twsup gives percentage of time two-cluster model is called
288
289 const G4double twsup[] = { 1.0, 0.7, 0.5, 0.3, 0.2, 0.1 };
290 G4double rand1 = G4UniformRand();
291 G4double rand2 = G4UniformRand();
292
293 // Cache current, target, and secondaries
294 G4ReactionProduct saveCurrent = currentParticle;
295 G4ReactionProduct saveTarget = targetParticle;
296 std::vector<G4ReactionProduct> savevec;
297 for (G4int i = 0; i < vecLen; i++) savevec.push_back(*vec[i]);
298
299 // Call fragmentation code if
300 // 1) there is annihilation, or
301 // 2) there are more than 5 secondaries, or
302 // 3) incident KE is > 1 GeV AND
303 // ( incident is a kaon AND rand < 0.5 OR twsup )
304 //
305
306 if( annihilation || vecLen > 5 ||
307 ( modifiedOriginal.GetKineticEnergy()/GeV >= 1.0 &&
308
309 (((originalIncident->GetDefinition() == G4KaonPlus::KaonPlus() ||
310 originalIncident->GetDefinition() == G4KaonMinus::KaonMinus() ||
311 originalIncident->GetDefinition() == G4KaonZeroLong::KaonZeroLong() ||
312 originalIncident->GetDefinition() == G4KaonZeroShort::KaonZeroShort()) &&
313 rand1 < 0.5)
314 || rand2 > twsup[vecLen]) ) )
315
316 finishedGenXPt =
317 fragmentation.ReactionStage(originalIncident, modifiedOriginal,
318 incidentHasChanged, originalTarget,
319 targetParticle, targetHasChanged,
320 targetNucleus, currentParticle,
321 vec, vecLen,
322 leadFlag, leadingStrangeParticle);
323
324 if (finishedGenXPt) return;
325
326 G4bool finishedTwoClu = false;
327
328 if (modifiedOriginal.GetTotalMomentum() < 1.0) {
329 for (G4int i = 0; i < vecLen; i++) delete vec[i];
330 vecLen = 0;
331
332 } else {
333 // Occaisionally, GenerateXandPt will fail in the annihilation channel.
334 // Restore current, target and secondaries to pre-GenerateXandPt state
335 // before trying annihilation in TwoCluster
336
337 if (!finishedGenXPt && annihilation) {
338 currentParticle = saveCurrent;
339 targetParticle = saveTarget;
340 for (G4int i = 0; i < vecLen; i++) delete vec[i];
341 vecLen = 0;
342 vec.Initialize( 0 );
343 for (G4int i = 0; i < G4int(savevec.size()); i++) {
345 *p = savevec[i];
346 vec.SetElement( vecLen++, p );
347 }
348 }
349
350 // Big violations of energy conservation in this method - don't use
351 //
352 // pionSuppression.ReactionStage(originalIncident, modifiedOriginal,
353 // incidentHasChanged, originalTarget,
354 // targetParticle, targetHasChanged,
355 // targetNucleus, currentParticle,
356 // vec, vecLen,
357 // false, leadingStrangeParticle);
358
359 try
360 {
361 finishedTwoClu =
362 twoCluster.ReactionStage(originalIncident, modifiedOriginal,
363 incidentHasChanged, originalTarget,
364 targetParticle, targetHasChanged,
365 targetNucleus, currentParticle,
366 vec, vecLen,
367 leadFlag, leadingStrangeParticle);
368 }
370 {
371 aC.Report(G4cout);
372 throw G4HadReentrentException(__FILE__, __LINE__, "Failing to calculate momenta");
373 }
374 }
375
376 if (finishedTwoClu) return;
377
378 twoBody.ReactionStage(originalIncident, modifiedOriginal,
379 incidentHasChanged, originalTarget,
380 targetParticle, targetHasChanged,
381 targetNucleus, currentParticle,
382 vec, vecLen,
383 false, leadingStrangeParticle);
384}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
#define G4UniformRand()
Definition: Randomize.hh:53
double mag() const
Hep3Vector vect() const
G4ParticleDefinition * GetDefinition() const
void SetElement(G4int anIndex, Type *anElement)
Definition: G4FastVector.hh:76
void Initialize(G4int items)
Definition: G4FastVector.hh:63
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
void Report(std::ostream &aS)
static G4KaonZeroLong * KaonZeroLong()
static G4KaonZeroShort * KaonZeroShort()
G4int GetA_asInt() const
Definition: G4Nucleus.hh:109
G4double AnnihilationEvaporationEffects(G4double kineticEnergy, G4double ekOrg)
Definition: G4Nucleus.cc:323
G4double Cinema(G4double kineticEnergy)
Definition: G4Nucleus.cc:368
G4bool ReactionStage(const G4HadProjectile *, G4ReactionProduct &, G4bool &, const G4DynamicParticle *, G4ReactionProduct &, G4bool &, const G4Nucleus &, G4ReactionProduct &, G4FastVector< G4ReactionProduct, 256 > &, G4int &, G4bool, G4ReactionProduct &)
G4RPGTwoBody twoBody
G4RPGFragmentation fragmentation
G4RPGTwoCluster twoCluster
G4bool MarkLeadingStrangeParticle(const G4ReactionProduct &currentParticle, const G4ReactionProduct &targetParticle, G4ReactionProduct &leadParticle)
G4bool ReactionStage(const G4HadProjectile *, G4ReactionProduct &, G4bool &, const G4DynamicParticle *, G4ReactionProduct &, G4bool &, const G4Nucleus &, G4ReactionProduct &, G4FastVector< G4ReactionProduct, 256 > &, G4int &, G4bool, G4ReactionProduct &)
Definition: G4RPGTwoBody.cc:44
G4bool ReactionStage(const G4HadProjectile *, G4ReactionProduct &, G4bool &, const G4DynamicParticle *, G4ReactionProduct &, G4bool &, const G4Nucleus &, G4ReactionProduct &, G4FastVector< G4ReactionProduct, 256 > &, G4int &, G4bool, G4ReactionProduct &)
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4double GetTotalMomentum() const
G4double GetKineticEnergy() const
G4ThreeVector GetMomentum() const
void SetKineticEnergy(const G4double en)
G4double GetMass() const

Referenced by G4RPGAntiKZeroInelastic::ApplyYourself(), G4RPGAntiLambdaInelastic::ApplyYourself(), G4RPGAntiNeutronInelastic::ApplyYourself(), G4RPGAntiOmegaMinusInelastic::ApplyYourself(), G4RPGAntiProtonInelastic::ApplyYourself(), G4RPGAntiSigmaMinusInelastic::ApplyYourself(), G4RPGAntiSigmaPlusInelastic::ApplyYourself(), G4RPGAntiXiMinusInelastic::ApplyYourself(), G4RPGAntiXiZeroInelastic::ApplyYourself(), G4RPGKMinusInelastic::ApplyYourself(), G4RPGKPlusInelastic::ApplyYourself(), G4RPGKZeroInelastic::ApplyYourself(), G4RPGLambdaInelastic::ApplyYourself(), G4RPGNeutronInelastic::ApplyYourself(), G4RPGOmegaMinusInelastic::ApplyYourself(), G4RPGPiMinusInelastic::ApplyYourself(), G4RPGPiPlusInelastic::ApplyYourself(), G4RPGProtonInelastic::ApplyYourself(), G4RPGSigmaMinusInelastic::ApplyYourself(), G4RPGSigmaPlusInelastic::ApplyYourself(), G4RPGXiMinusInelastic::ApplyYourself(), and G4RPGXiZeroInelastic::ApplyYourself().

◆ CheckQnums()

void G4RPGInelastic::CheckQnums ( G4FastVector< G4ReactionProduct, 256 > &  vec,
G4int vecLen,
G4ReactionProduct currentParticle,
G4ReactionProduct targetParticle,
G4double  Q,
G4double  B,
G4double  S 
)
protected

Definition at line 545 of file G4RPGInelastic.cc.

550{
551 G4ParticleDefinition* projDef = currentParticle.GetDefinition();
552 G4ParticleDefinition* targDef = targetParticle.GetDefinition();
553 G4double chargeSum = projDef->GetPDGCharge() + targDef->GetPDGCharge();
554 G4double baryonSum = projDef->GetBaryonNumber() + targDef->GetBaryonNumber();
555 G4double strangenessSum = projDef->GetQuarkContent(3) -
556 projDef->GetAntiQuarkContent(3) +
557 targDef->GetQuarkContent(3) -
558 targDef->GetAntiQuarkContent(3);
559
560 G4ParticleDefinition* secDef = 0;
561 for (G4int i = 0; i < vecLen; i++) {
562 secDef = vec[i]->GetDefinition();
563 chargeSum += secDef->GetPDGCharge();
564 baryonSum += secDef->GetBaryonNumber();
565 strangenessSum += secDef->GetQuarkContent(3)
566 - secDef->GetAntiQuarkContent(3);
567 }
568
569 G4bool OK = true;
570 if (chargeSum != Q) {
571 G4cout << " Charge not conserved " << G4endl;
572 OK = false;
573 }
574 if (baryonSum != B) {
575 G4cout << " Baryon number not conserved " << G4endl;
576 OK = false;
577 }
578 if (strangenessSum != S) {
579 G4cout << " Strangeness not conserved " << G4endl;
580 OK = false;
581 }
582
583 if (!OK) {
584 G4cout << " projectile: " << projDef->GetParticleName()
585 << " target: " << targDef->GetParticleName() << G4endl;
586 for (G4int i = 0; i < vecLen; i++) {
587 secDef = vec[i]->GetDefinition();
588 G4cout << secDef->GetParticleName() << " " ;
589 }
590 G4cout << G4endl;
591 }
592
593}
G4int GetQuarkContent(G4int flavor) const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
G4int GetAntiQuarkContent(G4int flavor) const
G4ParticleDefinition * GetDefinition() const

◆ Factorial()

G4int G4RPGInelastic::Factorial ( G4int  n)
protected

Definition at line 86 of file G4RPGInelastic.cc.

87{
88 G4int j = std::min(n,10);
89 G4int result = 1;
90 if (j <= 1) return result;
91 for (G4int i = 2; i <= j; ++i) result *= i;
92 return result;
93}

◆ GetNormalizationConstant()

void G4RPGInelastic::GetNormalizationConstant ( const G4double  availableEnergy,
G4double n,
G4double anpn 
)
protected

Definition at line 158 of file G4RPGInelastic.cc.

162 {
163 const G4double expxu = 82.; // upper bound for arg. of exp
164 const G4double expxl = -expxu; // lower bound for arg. of exp
165 const G4int numSec = 60;
166 //
167 // the only difference between the calculation for annihilation channels
168 // and normal is the starting value, iBegin, for the loop below
169 //
170 G4int iBegin = 1;
171 G4double en = energy;
172 if( energy < 0.0 )
173 {
174 iBegin = 2;
175 en *= -1.0;
176 }
177 //
178 // number of total particles vs. centre of mass Energy - 2*proton mass
179 //
180 G4double aleab = std::log(en/GeV);
181 n = 3.62567 + aleab*(0.665843 + aleab*(0.336514 + aleab*(0.117712 + 0.0136912*aleab)));
182 n -= 2.0;
183 //
184 // normalization constant for kno-distribution
185 //
186 anpn = 0.0;
187 G4double test, temp;
188 for( G4int i=iBegin; i<=numSec; ++i )
189 {
190 temp = pi*i/(2.0*n*n);
191 test = std::exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(i*i)/(n*n) ) ) );
192 if( temp < 1.0 )
193 {
194 if( test >= 1.0e-10 )anpn += temp*test;
195 }
196 else
197 anpn += temp*test;
198 }
199 }
const G4double pi

◆ interpolateEnergy()

std::pair< G4int, G4double > G4RPGInelastic::interpolateEnergy ( G4double  ke) const
protected

Definition at line 506 of file G4RPGInelastic.cc.

507{
508 G4int index = 29;
509 G4double fraction = 0.0;
510
511 for (G4int i = 1; i < 30; i++) {
512 if (e < energyScale[i]) {
513 index = i-1;
514 fraction = (e - energyScale[index]) / (energyScale[i] - energyScale[index]);
515 break;
516 }
517 }
518 return std::pair<G4int, G4double>(index, fraction);
519}

Referenced by G4RPGNucleonInelastic::GetFSPartTypesForT0(), G4RPGNucleonInelastic::GetFSPartTypesForT1(), G4RPGPionInelastic::GetFSPartTypesForT12(), G4RPGPionInelastic::GetFSPartTypesForT32(), G4RPGNucleonInelastic::GetMultiplicityT0(), G4RPGNucleonInelastic::GetMultiplicityT1(), G4RPGPionInelastic::GetMultiplicityT12(), and G4RPGPionInelastic::GetMultiplicityT32().

◆ MarkLeadingStrangeParticle()

G4bool G4RPGInelastic::MarkLeadingStrangeParticle ( const G4ReactionProduct currentParticle,
const G4ReactionProduct targetParticle,
G4ReactionProduct leadParticle 
)
protected

Definition at line 96 of file G4RPGInelastic.cc.

100{
101 // The following was in GenerateXandPt and TwoCluster.
102 // Add a parameter to the GenerateXandPt function telling it about the
103 // strange particle.
104 //
105 // Assumes that the original particle was a strange particle
106 //
107 G4bool lead = false;
108 if( (currentParticle.GetMass() >= G4KaonPlus::KaonPlus()->GetPDGMass()) &&
109 (currentParticle.GetDefinition() != G4Proton::Proton()) &&
110 (currentParticle.GetDefinition() != G4Neutron::Neutron()) )
111 {
112 lead = true;
113 leadParticle = currentParticle; // set lead to the incident particle
114 }
115 else if( (targetParticle.GetMass() >= G4KaonPlus::KaonPlus()->GetPDGMass()) &&
116 (targetParticle.GetDefinition() != G4Proton::Proton()) &&
117 (targetParticle.GetDefinition() != G4Neutron::Neutron()) )
118 {
119 lead = true;
120 leadParticle = targetParticle; // set lead to the target particle
121 }
122 return lead;
123}

Referenced by CalculateMomenta().

◆ Pmltpc()

G4double G4RPGInelastic::Pmltpc ( G4int  np,
G4int  nm,
G4int  nz,
G4int  n,
G4double  b,
G4double  c 
)
protected

Definition at line 68 of file G4RPGInelastic.cc.

70{
71 const G4double expxu = 82.; // upper bound for arg. of exp
72 const G4double expxl = -expxu; // lower bound for arg. of exp
73 G4double npf = 0.0;
74 G4double nmf = 0.0;
75 G4double nzf = 0.0;
76 G4int i;
77 for( i=2; i<=np; i++ )npf += std::log((double)i);
78 for( i=2; i<=nneg; i++ )nmf += std::log((double)i);
79 for( i=2; i<=nz; i++ )nzf += std::log((double)i);
80 G4double r;
81 r = std::min( expxu, std::max( expxl, -(np-nneg+nz+b)*(np-nneg+nz+b)/(2*c*c*n*n)-npf-nmf-nzf ) );
82 return std::exp(r);
83}

◆ sampleFlat()

G4int G4RPGInelastic::sampleFlat ( std::vector< G4double sigma) const
protected

Definition at line 523 of file G4RPGInelastic.cc.

524{
525 G4int i;
526 G4double sum(0.);
527 for (i = 0; i < G4int(sigma.size()); i++) sum += sigma[i];
528
529 G4double fsum = sum*G4UniformRand();
530 G4double partialSum = 0.0;
531 G4int channel = 0;
532
533 for (i = 0; i < G4int(sigma.size()); i++) {
534 partialSum += sigma[i];
535 if (fsum < partialSum) {
536 channel = i;
537 break;
538 }
539 }
540
541 return channel;
542}

Referenced by G4RPGNucleonInelastic::GetFSPartTypesForT0(), G4RPGNucleonInelastic::GetFSPartTypesForT1(), G4RPGPionInelastic::GetFSPartTypesForT12(), G4RPGPionInelastic::GetFSPartTypesForT32(), G4RPGNucleonInelastic::GetMultiplicityT0(), G4RPGNucleonInelastic::GetMultiplicityT1(), G4RPGPionInelastic::GetMultiplicityT12(), and G4RPGPionInelastic::GetMultiplicityT32().

◆ SetUpChange()

void G4RPGInelastic::SetUpChange ( G4FastVector< G4ReactionProduct, 256 > &  vec,
G4int vecLen,
G4ReactionProduct currentParticle,
G4ReactionProduct targetParticle,
G4bool incidentHasChanged 
)
protected

Definition at line 403 of file G4RPGInelastic.cc.

408{
412 G4int i;
413
414 if (currentParticle.GetDefinition() == particleDef[k0]) {
415 if (G4UniformRand() < 0.5) {
416 currentParticle.SetDefinitionAndUpdateE(aKaonZL);
417 incidentHasChanged = true;
418 } else {
419 currentParticle.SetDefinitionAndUpdateE(aKaonZS);
420 }
421 } else if (currentParticle.GetDefinition() == particleDef[k0b]) {
422 if (G4UniformRand() < 0.5) {
423 currentParticle.SetDefinitionAndUpdateE(aKaonZL);
424 } else {
425 currentParticle.SetDefinitionAndUpdateE(aKaonZS);
426 incidentHasChanged = true;
427 }
428 }
429
430 if (targetParticle.GetDefinition() == particleDef[k0] ||
431 targetParticle.GetDefinition() == particleDef[k0b] ) {
432 if (G4UniformRand() < 0.5) {
433 targetParticle.SetDefinitionAndUpdateE(aKaonZL);
434 } else {
435 targetParticle.SetDefinitionAndUpdateE(aKaonZS);
436 }
437 }
438
439 for (i = 0; i < vecLen; ++i) {
440 if (vec[i]->GetDefinition() == particleDef[k0] ||
441 vec[i]->GetDefinition() == particleDef[k0b] ) {
442 if (G4UniformRand() < 0.5) {
443 vec[i]->SetDefinitionAndUpdateE(aKaonZL);
444 } else {
445 vec[i]->SetDefinitionAndUpdateE(aKaonZS);
446 }
447 }
448 }
449
450 if (incidentHasChanged) {
452 p0->SetDefinition(currentParticle.GetDefinition() );
453 p0->SetMomentum(currentParticle.GetMomentum() );
457
458 } else {
459 G4double p = currentParticle.GetMomentum().mag()/MeV;
460 G4ThreeVector mom = currentParticle.GetMomentum();
461 if (p > DBL_MIN)
462 theParticleChange.SetMomentumChange(mom.x()/p, mom.y()/p, mom.z()/p );
463 else
465
466 G4double aE = currentParticle.GetKineticEnergy();
467 if (std::fabs(aE)<.1*eV) aE=.1*eV;
469 }
470
471 if (targetParticle.GetMass() > 0.0) // Tgt particle can be eliminated in TwoBody
472 {
473 G4ThreeVector momentum = targetParticle.GetMomentum();
474 momentum = momentum.rotate(cache, what);
475 G4double targKE = targetParticle.GetKineticEnergy();
476 G4ThreeVector dir(0.0, 0.0, 1.0);
477 if (targKE < DBL_MIN)
478 targKE = DBL_MIN;
479 else
480 dir = momentum/momentum.mag();
481
482 G4DynamicParticle* p1 =
483 new G4DynamicParticle(targetParticle.GetDefinition(), dir, targKE);
484
486 }
487
489 for (i = 0; i < vecLen; ++i) {
490 G4double secKE = vec[i]->GetKineticEnergy();
491 G4ThreeVector momentum = vec[i]->GetMomentum();
492 G4ThreeVector dir(0.0, 0.0, 1.0);
493 if (secKE < DBL_MIN)
494 secKE = DBL_MIN;
495 else
496 dir = momentum/momentum.mag();
497
498 p = new G4DynamicParticle(vec[i]->GetDefinition(), dir, secKE);
500 delete vec[i];
501 }
502}
@ stopAndKill
double z() const
double x() const
double y() const
Hep3Vector & rotate(double, const Hep3Vector &)
Definition: ThreeVectorR.cc:28
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetMomentum(const G4ThreeVector &momentum)
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
void SetDefinitionAndUpdateE(G4ParticleDefinition *aParticleDefinition)
#define DBL_MIN
Definition: templates.hh:75

Referenced by G4RPGAntiKZeroInelastic::ApplyYourself(), G4RPGAntiLambdaInelastic::ApplyYourself(), G4RPGAntiNeutronInelastic::ApplyYourself(), G4RPGAntiOmegaMinusInelastic::ApplyYourself(), G4RPGAntiProtonInelastic::ApplyYourself(), G4RPGAntiSigmaMinusInelastic::ApplyYourself(), G4RPGAntiSigmaPlusInelastic::ApplyYourself(), G4RPGAntiXiMinusInelastic::ApplyYourself(), G4RPGAntiXiZeroInelastic::ApplyYourself(), G4RPGKMinusInelastic::ApplyYourself(), G4RPGKPlusInelastic::ApplyYourself(), G4RPGKZeroInelastic::ApplyYourself(), G4RPGLambdaInelastic::ApplyYourself(), G4RPGNeutronInelastic::ApplyYourself(), G4RPGOmegaMinusInelastic::ApplyYourself(), G4RPGPiMinusInelastic::ApplyYourself(), G4RPGPiPlusInelastic::ApplyYourself(), G4RPGProtonInelastic::ApplyYourself(), G4RPGSigmaMinusInelastic::ApplyYourself(), G4RPGSigmaPlusInelastic::ApplyYourself(), G4RPGXiMinusInelastic::ApplyYourself(), and G4RPGXiZeroInelastic::ApplyYourself().

◆ SetUpPions()

void G4RPGInelastic::SetUpPions ( const G4int  np,
const G4int  nm,
const G4int  nz,
G4FastVector< G4ReactionProduct, 256 > &  vec,
G4int vecLen 
)
protected

Definition at line 126 of file G4RPGInelastic.cc.

130 {
131 if( np+nneg+nz == 0 )return;
132 G4int i;
134 for( i=0; i<np; ++i )
135 {
136 p = new G4ReactionProduct;
138 (G4UniformRand() < 0.5) ? p->SetSide( -1 ) : p->SetSide( 1 );
139 vec.SetElement( vecLen++, p );
140 }
141 for( i=np; i<np+nneg; ++i )
142 {
143 p = new G4ReactionProduct;
145 (G4UniformRand() < 0.5) ? p->SetSide( -1 ) : p->SetSide( 1 );
146 vec.SetElement( vecLen++, p );
147 }
148 for( i=np+nneg; i<np+nneg+nz; ++i )
149 {
150 p = new G4ReactionProduct;
152 (G4UniformRand() < 0.5) ? p->SetSide( -1 ) : p->SetSide( 1 );
153 vec.SetElement( vecLen++, p );
154 }
155 }
void SetSide(const G4int sid)
void SetDefinition(G4ParticleDefinition *aParticleDefinition)

Member Data Documentation

◆ fragmentation

G4RPGFragmentation G4RPGInelastic::fragmentation
protected

Definition at line 101 of file G4RPGInelastic.hh.

Referenced by CalculateMomenta().

◆ particleDef

G4ParticleDefinition* G4RPGInelastic::particleDef[18]
protected

Definition at line 126 of file G4RPGInelastic.hh.

Referenced by G4RPGInelastic(), and SetUpChange().

◆ pionSuppression

G4RPGPionSuppression G4RPGInelastic::pionSuppression
protected

Definition at line 105 of file G4RPGInelastic.hh.

◆ strangeProduction

G4RPGStrangeProduction G4RPGInelastic::strangeProduction
protected

Definition at line 107 of file G4RPGInelastic.hh.

◆ twoBody

G4RPGTwoBody G4RPGInelastic::twoBody
protected

Definition at line 109 of file G4RPGInelastic.hh.

Referenced by CalculateMomenta().

◆ twoCluster

G4RPGTwoCluster G4RPGInelastic::twoCluster
protected

Definition at line 103 of file G4RPGInelastic.hh.

Referenced by CalculateMomenta().


The documentation for this class was generated from the following files: