Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4RPGInelastic Class Reference

#include <G4RPGInelastic.hh>

Inheritance diagram for G4RPGInelastic:
Collaboration 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 &aTrack, G4Nucleus &targetNucleus)
 
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)
 
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
 
virtual const std::pair
< G4double, G4double
GetFatalEnergyCheckLevels () const
 
virtual std::pair< G4double,
G4double
GetEnergyMomentumCheckLevels () const
 
void SetEnergyMomentumCheckLevels (G4double relativeLevel, G4double absoluteLevel)
 
virtual void ModelDescription (std::ostream &outFile) const
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void InitialiseModel ()
 

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 55 of file G4RPGInelastic.hh.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 39 of file G4RPGInelastic.cc.

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

Here is the call graph for this function:

virtual G4RPGInelastic::~G4RPGInelastic ( )
inlinevirtual

Definition at line 61 of file G4RPGInelastic.hh.

62  { }

Member Function Documentation

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 203 of file G4RPGInelastic.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 546 of file G4RPGInelastic.cc.

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

Here is the call graph for this function:

G4int G4RPGInelastic::Factorial ( G4int  n)
protected

Definition at line 87 of file G4RPGInelastic.cc.

88 {
89  G4int j = std::min(n,10);
90  G4int result = 1;
91  if (j <= 1) return result;
92  for (G4int i = 2; i <= j; ++i) result *= i;
93  return result;
94 }
G4double G4ParticleHPJENDLHEData::G4double result
int G4int
Definition: G4Types.hh:78
T min(const T t1, const T t2)
brief Return the smallest of the two arguments

Here is the call graph for this function:

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

Definition at line 159 of file G4RPGInelastic.cc.

163  {
164  const G4double expxu = 82.; // upper bound for arg. of exp
165  const G4double expxl = -expxu; // lower bound for arg. of exp
166  const G4int numSec = 60;
167  //
168  // the only difference between the calculation for annihilation channels
169  // and normal is the starting value, iBegin, for the loop below
170  //
171  G4int iBegin = 1;
172  G4double en = energy;
173  if( energy < 0.0 )
174  {
175  iBegin = 2;
176  en *= -1.0;
177  }
178  //
179  // number of total particles vs. centre of mass Energy - 2*proton mass
180  //
181  G4double aleab = G4Log(en/GeV);
182  n = 3.62567 + aleab*(0.665843 + aleab*(0.336514 + aleab*(0.117712 + 0.0136912*aleab)));
183  n -= 2.0;
184  //
185  // normalization constant for kno-distribution
186  //
187  anpn = 0.0;
188  G4double test, temp;
189  for( G4int i=iBegin; i<=numSec; ++i )
190  {
191  temp = pi*i/(2.0*n*n);
192  test = G4Exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(i*i)/(n*n) ) ) );
193  if( temp < 1.0 )
194  {
195  if( test >= 1.0e-10 )anpn += temp*test;
196  }
197  else
198  anpn += temp*test;
199  }
200  }
int G4int
Definition: G4Types.hh:78
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double energy(const ThreeVector &p, const G4double m)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
static constexpr double GeV
Definition: G4SIunits.hh:217
static constexpr double pi
Definition: G4SIunits.hh:75
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

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

Definition at line 507 of file G4RPGInelastic.cc.

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

Here is the caller graph for this function:

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

Definition at line 97 of file G4RPGInelastic.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 69 of file G4RPGInelastic.cc.

71 {
72  const G4double expxu = 82.; // upper bound for arg. of exp
73  const G4double expxl = -expxu; // lower bound for arg. of exp
74  G4double npf = 0.0;
75  G4double nmf = 0.0;
76  G4double nzf = 0.0;
77  G4int i;
78  for( i=2; i<=np; i++ )npf += G4Log((double)i);
79  for( i=2; i<=nneg; i++ )nmf += G4Log((double)i);
80  for( i=2; i<=nz; i++ )nzf += G4Log((double)i);
81  G4double r;
82  r = std::min( expxu, std::max( expxl, -(np-nneg+nz+b)*(np-nneg+nz+b)/(2*c*c*n*n)-npf-nmf-nzf ) );
83  return G4Exp(r);
84 }
int G4int
Definition: G4Types.hh:78
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

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

Definition at line 524 of file G4RPGInelastic.cc.

525 {
526  G4int i;
527  G4double sum(0.);
528  for (i = 0; i < G4int(sigma.size()); i++) sum += sigma[i];
529 
530  G4double fsum = sum*G4UniformRand();
531  G4double partialSum = 0.0;
532  G4int channel = 0;
533 
534  for (i = 0; i < G4int(sigma.size()); i++) {
535  partialSum += sigma[i];
536  if (fsum < partialSum) {
537  channel = i;
538  break;
539  }
540  }
541 
542  return channel;
543 }
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:97
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

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

Definition at line 404 of file G4RPGInelastic.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 127 of file G4RPGInelastic.cc.

131  {
132  if( np+nneg+nz == 0 )return;
133  G4int i;
135  for( i=0; i<np; ++i )
136  {
137  p = new G4ReactionProduct;
139  (G4UniformRand() < 0.5) ? p->SetSide( -1 ) : p->SetSide( 1 );
140  vec.SetElement( vecLen++, p );
141  }
142  for( i=np; i<np+nneg; ++i )
143  {
144  p = new G4ReactionProduct;
146  (G4UniformRand() < 0.5) ? p->SetSide( -1 ) : p->SetSide( 1 );
147  vec.SetElement( vecLen++, p );
148  }
149  for( i=np+nneg; i<np+nneg+nz; ++i )
150  {
151  p = new G4ReactionProduct;
153  (G4UniformRand() < 0.5) ? p->SetSide( -1 ) : p->SetSide( 1 );
154  vec.SetElement( vecLen++, p );
155  }
156  }
void SetElement(G4int anIndex, Type *anElement)
Definition: G4FastVector.hh:76
const char * p
Definition: xmltok.h:285
void SetSide(const G4int sid)
int G4int
Definition: G4Types.hh:78
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
#define G4UniformRand()
Definition: Randomize.hh:97
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:98
static G4PionZero * PionZero()
Definition: G4PionZero.cc:108
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:98

Here is the call graph for this function:

Member Data Documentation

G4RPGFragmentation G4RPGInelastic::fragmentation
protected

Definition at line 103 of file G4RPGInelastic.hh.

G4ParticleDefinition* G4RPGInelastic::particleDef[18]
protected

Definition at line 128 of file G4RPGInelastic.hh.

G4RPGPionSuppression G4RPGInelastic::pionSuppression
protected

Definition at line 107 of file G4RPGInelastic.hh.

G4RPGStrangeProduction G4RPGInelastic::strangeProduction
protected

Definition at line 109 of file G4RPGInelastic.hh.

G4RPGTwoBody G4RPGInelastic::twoBody
protected

Definition at line 111 of file G4RPGInelastic.hh.

G4RPGTwoCluster G4RPGInelastic::twoCluster
protected

Definition at line 105 of file G4RPGInelastic.hh.


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