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

#include <G4ChipsProtonInelasticXS.hh>

+ Inheritance diagram for G4ChipsProtonInelasticXS:

Public Member Functions

 G4ChipsProtonInelasticXS ()
 
 ~G4ChipsProtonInelasticXS ()
 
virtual G4bool IsIsoApplicable (const G4DynamicParticle *Pt, G4int Z, G4int A, const G4Element *elm, const G4Material *mat)
 
virtual G4double GetIsoCrossSection (const G4DynamicParticle *, G4int tgZ, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0)
 
virtual G4double GetChipsCrossSection (G4double momentum, G4int Z, G4int N, G4int pdg)
 
- Public Member Functions inherited from G4VCrossSectionDataSet
 G4VCrossSectionDataSet (const G4String &nam="")
 
virtual ~G4VCrossSectionDataSet ()
 
virtual G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
virtual G4bool IsIsoApplicable (const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=0, const G4Material *mat=0)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
virtual G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
virtual G4double GetIsoCrossSection (const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0)
 
virtual G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual void CrossSectionDescription (std::ostream &) const
 
void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
const G4StringGetName () const
 

Static Public Member Functions

static const char * Default_Name ()
 

Additional Inherited Members

- Protected Member Functions inherited from G4VCrossSectionDataSet
void SetName (const G4String &)
 
- Protected Attributes inherited from G4VCrossSectionDataSet
G4int verboseLevel
 

Detailed Description

Definition at line 48 of file G4ChipsProtonInelasticXS.hh.

Constructor & Destructor Documentation

◆ G4ChipsProtonInelasticXS()

G4ChipsProtonInelasticXS::G4ChipsProtonInelasticXS ( )

Definition at line 54 of file G4ChipsProtonInelasticXS.cc.

55{
56 // Initialization of the
57 lastLEN=0; // Pointer to the lastArray of LowEn CS
58 lastHEN=0; // Pointer to the lastArray of HighEn CS
59 lastN=0; // The last N of calculated nucleus
60 lastZ=0; // The last Z of calculated nucleus
61 lastP=0.; // Last used in cross section Momentum
62 lastTH=0.; // Last threshold momentum
63 lastCS=0.; // Last value of the Cross Section
64 lastI=0; // The last position in the DAMDB
65
66 LEN = new std::vector<G4double*>;
67 HEN = new std::vector<G4double*>;
68}
static const char * Default_Name()

◆ ~G4ChipsProtonInelasticXS()

G4ChipsProtonInelasticXS::~G4ChipsProtonInelasticXS ( )

Definition at line 70 of file G4ChipsProtonInelasticXS.cc.

71{
72 /*
73 G4int lens=LEN->size();
74 for(G4int i=0; i<lens; ++i) delete[] (*LEN)[i];
75 delete LEN;
76 G4int hens=HEN->size();
77 for(G4int i=0; i<hens; ++i) delete[] (*HEN)[i];
78 delete HEN;
79 */
80}

Member Function Documentation

◆ Default_Name()

static const char * G4ChipsProtonInelasticXS::Default_Name ( )
inlinestatic

Definition at line 57 of file G4ChipsProtonInelasticXS.hh.

57{return "ChipsProtonInelasticXS";}

Referenced by G4ChipsComponentXS::G4ChipsComponentXS().

◆ GetChipsCrossSection()

G4double G4ChipsProtonInelasticXS::GetChipsCrossSection ( G4double  momentum,
G4int  Z,
G4int  N,
G4int  pdg 
)
virtual

!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)

Definition at line 105 of file G4ChipsProtonInelasticXS.cc.

106{
107 static G4int j; // A#0f Z/N-records already tested in AMDB
108 static std::vector <G4int> colN; // Vector of N for calculated nuclei (isotops)
109 static std::vector <G4int> colZ; // Vector of Z for calculated nuclei (isotops)
110 static std::vector <G4double> colP; // Vector of last momenta for the reaction
111 static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
112 static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
113 // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
114
115 G4bool in=false; // By default the isotope must be found in the AMDB
116 if(tgN!=lastN || tgZ!=lastZ) // The nucleus was not the last used isotope
117 {
118 in = false; // By default the isotope haven't been found in AMDB
119 lastP = 0.; // New momentum history (nothing to compare with)
120 lastN = tgN; // The last N of the calculated nucleus
121 lastZ = tgZ; // The last Z of the calculated nucleus
122 lastI = colN.size(); // Size of the Associative Memory DB in the heap
123 j = 0; // A#0f records found in DB for this projectile
124 if(lastI) for(G4int i=0; i<lastI; i++) // AMDB exists, try to find the (Z,N) isotope
125 {
126 if(colN[i]==tgN && colZ[i]==tgZ) // Try the record "i" in the AMDB
127 {
128 lastI=i; // Remember the index for future fast/last use
129 lastTH =colTH[i]; // The last THreshold (A-dependent)
130 if(pMom<=lastTH)
131 {
132 return 0.; // Energy is below the Threshold value
133 }
134 lastP =colP [i]; // Last Momentum (A-dependent)
135 lastCS =colCS[i]; // Last CrossSect (A-dependent)
136 in = true; // This is the case when the isotop is found in DB
137 // Momentum pMom is in IU ! @@ Units
138 lastCS=CalculateCrossSection(-1,j,2212,lastZ,lastN,pMom); // read & update
139 if(lastCS<=0. && pMom>lastTH) // Correct the threshold (@@ No intermediate Zeros)
140 {
141 lastCS=0.;
142 lastTH=pMom;
143 }
144 break; // Go out of the LOOP
145 }
146 j++; // Increment a#0f records found in DB
147 }
148 if(!in) // This isotope has not been calculated previously
149 {
150 //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
151 lastCS=CalculateCrossSection(0,j,2212,lastZ,lastN,pMom); //calculate & create
152 //if(lastCS>0.) // It means that the AMBD was initialized
153 //{
154
155 lastTH = 0; //ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
156 colN.push_back(tgN);
157 colZ.push_back(tgZ);
158 colP.push_back(pMom);
159 colTH.push_back(lastTH);
160 colCS.push_back(lastCS);
161 //} // M.K. Presence of H1 with high threshold breaks the syncronization
162 return lastCS*millibarn;
163 } // End of creation of the new set of parameters
164 else
165 {
166 colP[lastI]=pMom;
167 colCS[lastI]=lastCS;
168 }
169 } // End of parameters udate
170 else if(pMom<=lastTH)
171 {
172 return 0.; // Momentum is below the Threshold Value -> CS=0
173 }
174 else // It is the last used -> use the current tables
175 {
176 lastCS=CalculateCrossSection(1,j,2212,lastZ,lastN,pMom); // Only read and UpdateDB
177 lastP=pMom;
178 }
179 return lastCS*millibarn;
180}
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67

Referenced by G4ChipsComponentXS::GetInelasticElementCrossSection(), GetIsoCrossSection(), and G4ChipsComponentXS::GetTotalElementCrossSection().

◆ GetIsoCrossSection()

G4double G4ChipsProtonInelasticXS::GetIsoCrossSection ( const G4DynamicParticle Pt,
G4int  tgZ,
G4int  A,
const G4Isotope iso = 0,
const G4Element elm = 0,
const G4Material mat = 0 
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 94 of file G4ChipsProtonInelasticXS.cc.

98{
99 G4double pMom=Pt->GetTotalMomentum();
100 G4int tgN = A - tgZ;
101
102 return GetChipsCrossSection(pMom, tgZ, tgN, 2212);
103}
double G4double
Definition: G4Types.hh:64
virtual G4double GetChipsCrossSection(G4double momentum, G4int Z, G4int N, G4int pdg)
G4double GetTotalMomentum() const

◆ IsIsoApplicable()

G4bool G4ChipsProtonInelasticXS::IsIsoApplicable ( const G4DynamicParticle Pt,
G4int  Z,
G4int  A,
const G4Element elm,
const G4Material mat 
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 82 of file G4ChipsProtonInelasticXS.cc.

85{
86 G4ParticleDefinition* particle = Pt->GetDefinition();
87 if (particle == G4Proton::Proton() ) return true;
88 return false;
89}
G4ParticleDefinition * GetDefinition() const
static G4Proton * Proton()
Definition: G4Proton.cc:93

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