Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions
G4ChipsProtonInelasticXS Class Reference

#include <G4ChipsProtonInelasticXS.hh>

Inheritance diagram for G4ChipsProtonInelasticXS:
G4VCrossSectionDataSet

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)
 
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 G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual void CrossSectionDescription (std::ostream &) const
 
virtual G4int GetVerboseLevel () const
 
virtual 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 44 of file G4ChipsProtonInelasticXS.hh.

Constructor & Destructor Documentation

G4ChipsProtonInelasticXS::G4ChipsProtonInelasticXS ( )

Definition at line 53 of file G4ChipsProtonInelasticXS.cc.

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

Definition at line 69 of file G4ChipsProtonInelasticXS.cc.

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

Member Function Documentation

static const char* G4ChipsProtonInelasticXS::Default_Name ( )
inlinestatic

Definition at line 53 of file G4ChipsProtonInelasticXS.hh.

Referenced by G4ChipsComponentXS::G4ChipsComponentXS().

53 {return "ChipsProtonInelasticXS";}
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 104 of file G4ChipsProtonInelasticXS.cc.

References G4ThreadLocal, and python.hepunit::millibarn.

Referenced by GetIsoCrossSection().

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

References GetChipsCrossSection(), and G4DynamicParticle::GetTotalMomentum().

97 {
98  G4double pMom=Pt->GetTotalMomentum();
99  G4int tgN = A - tgZ;
100 
101  return GetChipsCrossSection(pMom, tgZ, tgN, 2212);
102 }
virtual G4double GetChipsCrossSection(G4double momentum, G4int Z, G4int N, G4int pdg)
int G4int
Definition: G4Types.hh:78
G4double GetTotalMomentum() const
double G4double
Definition: G4Types.hh:76
G4bool G4ChipsProtonInelasticXS::IsIsoApplicable ( const G4DynamicParticle Pt,
G4int  Z,
G4int  A,
const G4Element elm,
const G4Material mat 
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 81 of file G4ChipsProtonInelasticXS.cc.

References G4DynamicParticle::GetDefinition(), and G4Proton::Proton().

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

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