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

#include <G4ChipsHyperonInelasticXS.hh>

Inheritance diagram for G4ChipsHyperonInelasticXS:
G4VCrossSectionDataSet

Public Member Functions

 G4ChipsHyperonInelasticXS ()
 
 ~G4ChipsHyperonInelasticXS ()
 
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 45 of file G4ChipsHyperonInelasticXS.hh.

Constructor & Destructor Documentation

G4ChipsHyperonInelasticXS::G4ChipsHyperonInelasticXS ( )

Definition at line 52 of file G4ChipsHyperonInelasticXS.cc.

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

Definition at line 67 of file G4ChipsHyperonInelasticXS.cc.

68 {
69  G4int lens=LEN->size();
70  for(G4int i=0; i<lens; ++i) delete[] (*LEN)[i];
71  delete LEN;
72 
73  G4int hens=HEN->size();
74  for(G4int i=0; i<hens; ++i) delete[] (*HEN)[i];
75  delete HEN;
76 }
int G4int
Definition: G4Types.hh:78
Definition: inflate.h:41

Member Function Documentation

static const char* G4ChipsHyperonInelasticXS::Default_Name ( )
inlinestatic
G4double G4ChipsHyperonInelasticXS::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 128 of file G4ChipsHyperonInelasticXS.cc.

References G4ThreadLocal, and python.hepunit::millibarn.

Referenced by GetIsoCrossSection().

129 {
130  static G4ThreadLocal G4int j; // A#0f Z/N-records already tested in AMDB
131  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)
132  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)
133  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
134  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
135  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
136  // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
137 
138  G4bool in=false; // By default the isotope must be found in the AMDB
139  if(tgN!=lastN || tgZ!=lastZ) // The nucleus was not the last used isotope
140  {
141  in = false; // By default the isotope haven't be found in AMDB
142  lastP = 0.; // New momentum history (nothing to compare with)
143  lastN = tgN; // The last N of the calculated nucleus
144  lastZ = tgZ; // The last Z of the calculated nucleus
145  lastI = colN.size(); // Size of the Associative Memory DB in the heap
146  j = 0; // A#0f records found in DB for this projectile
147 
148  if(lastI) for(G4int i=0; i<lastI; i++) // AMDB exists, try to find the (Z,N) isotope
149  {
150  if(colN[i]==tgN && colZ[i]==tgZ) // Try the record "i" in the AMDB
151  {
152  lastI=i; // Remember the index for future fast/last use
153  lastTH =colTH[i]; // The last THreshold (A-dependent)
154 
155  if(pMom<=lastTH)
156  {
157  return 0.; // Energy is below the Threshold value
158  }
159  lastP =colP [i]; // Last Momentum (A-dependent)
160  lastCS =colCS[i]; // Last CrossSect (A-dependent)
161  in = true; // This is the case when the isotop is found in DB
162  // Momentum pMom is in IU ! @@ Units
163  lastCS=CalculateCrossSection(-1,j,PDG,lastZ,lastN,pMom); // read & update
164 
165  if(lastCS<=0. && pMom>lastTH) // Correct the threshold (@@ No intermediate Zeros)
166  {
167  lastCS=0.;
168  lastTH=pMom;
169  }
170  break; // Go out of the LOOP
171  }
172  j++; // Increment a#0f records found in DB
173  }
174  if(!in) // This isotope has not been calculated previously
175  {
176  //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
177  lastCS=CalculateCrossSection(0,j,PDG,lastZ,lastN,pMom); //calculate & create
178  //if(lastCS>0.) // It means that the AMBD was initialized
179  //{
180 
181  lastTH = 0; //ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
182  colN.push_back(tgN);
183  colZ.push_back(tgZ);
184  colP.push_back(pMom);
185  colTH.push_back(lastTH);
186  colCS.push_back(lastCS);
187  //} // M.K. Presence of H1 with high threshold breaks the syncronization
188  return lastCS*millibarn;
189  } // End of creation of the new set of parameters
190  else
191  {
192  colP[lastI]=pMom;
193  colCS[lastI]=lastCS;
194  }
195  } // End of parameters udate
196  else if(pMom<=lastTH)
197  {
198  return 0.; // Momentum is below the Threshold Value -> CS=0
199  }
200  else // It is the last used -> use the current tables
201  {
202  lastCS=CalculateCrossSection(1,j,PDG,lastZ,lastN,pMom); // Only read and UpdateDB
203  lastP=pMom;
204  }
205  return lastCS*millibarn;
206 }
#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 G4ChipsHyperonInelasticXS::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 116 of file G4ChipsHyperonInelasticXS.cc.

References GetChipsCrossSection(), G4DynamicParticle::GetDefinition(), G4ParticleDefinition::GetPDGEncoding(), and G4DynamicParticle::GetTotalMomentum().

120 {
121  G4double pMom=Pt->GetTotalMomentum();
122  G4int tgN = A - tgZ;
123  G4int pdg = Pt->GetDefinition()->GetPDGEncoding();
124 
125  return GetChipsCrossSection(pMom, tgZ, tgN, pdg);
126 }
virtual G4double GetChipsCrossSection(G4double momentum, G4int Z, G4int N, G4int pdg)
G4ParticleDefinition * GetDefinition() const
int G4int
Definition: G4Types.hh:78
G4double GetTotalMomentum() const
double G4double
Definition: G4Types.hh:76
G4bool G4ChipsHyperonInelasticXS::IsIsoApplicable ( const G4DynamicParticle Pt,
G4int  Z,
G4int  A,
const G4Element elm,
const G4Material mat 
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 78 of file G4ChipsHyperonInelasticXS.cc.

References G4DynamicParticle::GetDefinition(), G4Lambda::Lambda(), G4OmegaMinus::OmegaMinus(), G4SigmaMinus::SigmaMinus(), G4SigmaPlus::SigmaPlus(), G4SigmaZero::SigmaZero(), G4XiMinus::XiMinus(), and G4XiZero::XiZero().

81 {
82  G4ParticleDefinition* particle = Pt->GetDefinition();
83  if (particle == G4Lambda::Lambda())
84  {
85  return true;
86  }
87  else if(particle == G4SigmaPlus::SigmaPlus())
88  {
89  return true;
90  }
91  else if(particle == G4SigmaMinus::SigmaMinus())
92  {
93  return true;
94  }
95  else if(particle == G4SigmaZero::SigmaZero())
96  {
97  return true;
98  }
99  else if(particle == G4XiMinus::XiMinus())
100  {
101  return true;
102  }
103  else if(particle == G4XiZero::XiZero())
104  {
105  return true;
106  }
107  else if(particle == G4OmegaMinus::OmegaMinus())
108  {
109  return true;
110  }
111  return false;
112 }
static G4OmegaMinus * OmegaMinus()
G4ParticleDefinition * GetDefinition() const
static G4SigmaZero * SigmaZero()
Definition: G4SigmaZero.cc:99
static G4XiZero * XiZero()
Definition: G4XiZero.cc:106
static G4XiMinus * XiMinus()
Definition: G4XiMinus.cc:106
static G4SigmaMinus * SigmaMinus()
static G4SigmaPlus * SigmaPlus()
Definition: G4SigmaPlus.cc:108
static G4Lambda * Lambda()
Definition: G4Lambda.cc:108

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