#include <G4ChipsPionMinusInelasticXS.hh>
Inheritance diagram for G4ChipsPionMinusInelasticXS:
Public Member Functions | |
G4ChipsPionMinusInelasticXS () | |
~G4ChipsPionMinusInelasticXS () | |
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) |
Static Public Member Functions | |
static const char * | Default_Name () |
Definition at line 48 of file G4ChipsPionMinusInelasticXS.hh.
G4ChipsPionMinusInelasticXS::G4ChipsPionMinusInelasticXS | ( | ) |
Definition at line 53 of file G4ChipsPionMinusInelasticXS.cc.
00053 :G4VCrossSectionDataSet("ChipsPionMinusInelasticXS") 00054 { 00055 // Initialization of the 00056 lastLEN=0; // Pointer to lastArray of LowEn CS 00057 lastHEN=0; // Pointer to lastArray of HighEn CS 00058 lastN=0; // The last N of calculated nucleus 00059 lastZ=0; // The last Z of calculated nucleus 00060 lastP=0.; // Last used cross section Momentum 00061 lastTH=0.; // Last threshold momentum 00062 lastCS=0.; // Last value of the Cross Section 00063 lastI=0; // The last position in the DAMDB 00064 LEN = new std::vector<G4double*>; 00065 HEN = new std::vector<G4double*>; 00066 }
G4ChipsPionMinusInelasticXS::~G4ChipsPionMinusInelasticXS | ( | ) |
static const char* G4ChipsPionMinusInelasticXS::Default_Name | ( | ) | [inline, static] |
Definition at line 56 of file G4ChipsPionMinusInelasticXS.hh.
Referenced by G4ChipsComponentXS::G4ChipsComponentXS().
G4double G4ChipsPionMinusInelasticXS::GetChipsCrossSection | ( | G4double | momentum, | |
G4int | Z, | |||
G4int | N, | |||
G4int | pdg | |||
) | [virtual] |
Definition at line 101 of file G4ChipsPionMinusInelasticXS.cc.
Referenced by GetIsoCrossSection().
00102 { 00103 static G4int j; // A#0f Z/N-records already tested in AMDB 00104 static std::vector <G4int> colN; // Vector of N for calculated nuclei (isotops) 00105 static std::vector <G4int> colZ; // Vector of Z for calculated nuclei (isotops) 00106 static std::vector <G4double> colP; // Vector of last momenta for the reaction 00107 static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction 00108 static std::vector <G4double> colCS; // Vector of last cross sections for the reaction 00109 // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---*** 00110 00111 G4bool in=false; // By default the isotope must be found in the AMDB 00112 if(tgN!=lastN || tgZ!=lastZ) // The nucleus was not the last used isotope 00113 { 00114 in = false; // By default the isotope haven't be found in AMDB 00115 lastP = 0.; // New momentum history (nothing to compare with) 00116 lastN = tgN; // The last N of the calculated nucleus 00117 lastZ = tgZ; // The last Z of the calculated nucleus 00118 lastI = colN.size(); // Size of the Associative Memory DB in the heap 00119 j = 0; // A#0f records found in DB for this projectile 00120 if(lastI) for(G4int i=0; i<lastI; i++) // AMDB exists, try to find the (Z,N) isotope 00121 { 00122 if(colN[i]==tgN && colZ[i]==tgZ) // Try the record "i" in the AMDB 00123 { 00124 lastI=i; // Remember the index for future fast/last use 00125 lastTH =colTH[i]; // The last THreshold (A-dependent) 00126 if(pMom<=lastTH) 00127 { 00128 return 0.; // Energy is below the Threshold value 00129 } 00130 lastP =colP [i]; // Last Momentum (A-dependent) 00131 lastCS =colCS[i]; // Last CrossSect (A-dependent) 00132 in = true; // This is the case when the isotop is found in DB 00133 // Momentum pMom is in IU ! @@ Units 00134 lastCS=CalculateCrossSection(-1,j,-211,lastZ,lastN,pMom); // read & update 00135 if(lastCS<=0. && pMom>lastTH) // Correct the threshold (@@ No intermediate Zeros) 00136 { 00137 lastCS=0.; 00138 lastTH=pMom; 00139 } 00140 break; // Go out of the LOOP 00141 } 00142 j++; // Increment a#0f records found in DB 00143 } 00144 if(!in) // This isotope has not been calculated previously 00145 { 00147 lastCS=CalculateCrossSection(0,j,-211,lastZ,lastN,pMom); //calculate & create 00148 //if(lastCS>0.) // It means that the AMBD was initialized 00149 //{ 00150 00151 lastTH = 0; //ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last 00152 colN.push_back(tgN); 00153 colZ.push_back(tgZ); 00154 colP.push_back(pMom); 00155 colTH.push_back(lastTH); 00156 colCS.push_back(lastCS); 00157 //} // M.K. Presence of H1 with high threshold breaks the syncronization 00158 return lastCS*millibarn; 00159 } // End of creation of the new set of parameters 00160 else 00161 { 00162 colP[lastI]=pMom; 00163 colCS[lastI]=lastCS; 00164 } 00165 } // End of parameters udate 00166 else if(pMom<=lastTH) 00167 { 00168 return 0.; // Momentum is below the Threshold Value -> CS=0 00169 } 00170 else // It is the last used -> use the current tables 00171 { 00172 lastCS=CalculateCrossSection(1,j,-211,lastZ,lastN,pMom); // Only read and UpdateDB 00173 lastP=pMom; 00174 } 00175 return lastCS*millibarn; 00176 }
G4double G4ChipsPionMinusInelasticXS::GetIsoCrossSection | ( | const G4DynamicParticle * | , | |
G4int | tgZ, | |||
G4int | A, | |||
const G4Isotope * | iso = 0 , |
|||
const G4Element * | elm = 0 , |
|||
const G4Material * | mat = 0 | |||
) | [virtual] |
Reimplemented from G4VCrossSectionDataSet.
Definition at line 90 of file G4ChipsPionMinusInelasticXS.cc.
References GetChipsCrossSection(), and G4DynamicParticle::GetTotalMomentum().
00094 { 00095 G4double pMom=Pt->GetTotalMomentum(); 00096 G4int tgN = A - tgZ; 00097 00098 return GetChipsCrossSection(pMom, tgZ, tgN, -211); 00099 }
G4bool G4ChipsPionMinusInelasticXS::IsIsoApplicable | ( | const G4DynamicParticle * | Pt, | |
G4int | Z, | |||
G4int | A, | |||
const G4Element * | elm, | |||
const G4Material * | mat | |||
) | [virtual] |
Reimplemented from G4VCrossSectionDataSet.
Definition at line 79 of file G4ChipsPionMinusInelasticXS.cc.
References G4DynamicParticle::GetDefinition(), and G4PionMinus::PionMinus().
00082 { 00083 G4ParticleDefinition* particle = Pt->GetDefinition(); 00084 if (particle == G4PionMinus::PionMinus() ) return true; 00085 return false; 00086 }