G4ChipsAntiBaryonInelasticXS Class Reference

#include <G4ChipsAntiBaryonInelasticXS.hh>

Inheritance diagram for G4ChipsAntiBaryonInelasticXS:

G4VCrossSectionDataSet

Public Member Functions

 G4ChipsAntiBaryonInelasticXS ()
 ~G4ChipsAntiBaryonInelasticXS ()
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 ()

Detailed Description

Definition at line 48 of file G4ChipsAntiBaryonInelasticXS.hh.


Constructor & Destructor Documentation

G4ChipsAntiBaryonInelasticXS::G4ChipsAntiBaryonInelasticXS (  ) 

Definition at line 60 of file G4ChipsAntiBaryonInelasticXS.cc.

00060                                                           :G4VCrossSectionDataSet(Default_Name())
00061 {
00062   lastLEN=0; // Pointer to lastArray of LowEn CS
00063   lastHEN=0; // Pointer to lastArray of HighEn CS
00064   lastN=0;   // The last N of calculated nucleus
00065   lastZ=0;   // The last Z of calculated nucleus
00066   lastP=0.;  // Last used Cross Section Momentum
00067   lastTH=0.; // Last threshold momentum
00068   lastCS=0.; // Last value of the Cross Section
00069   lastI=0;   // The last position in the DAMDB
00070   LEN = new std::vector<G4double*>;
00071   HEN = new std::vector<G4double*>;
00072 }

G4ChipsAntiBaryonInelasticXS::~G4ChipsAntiBaryonInelasticXS (  ) 

Definition at line 74 of file G4ChipsAntiBaryonInelasticXS.cc.

00075 {
00076   G4int lens=LEN->size();
00077   for(G4int i=0; i<lens; ++i) delete[] (*LEN)[i];
00078   delete LEN;
00079   G4int hens=HEN->size();
00080   for(G4int i=0; i<hens; ++i) delete[] (*HEN)[i];
00081   delete HEN;
00082 }


Member Function Documentation

static const char* G4ChipsAntiBaryonInelasticXS::Default_Name (  )  [inline, static]

Definition at line 56 of file G4ChipsAntiBaryonInelasticXS.hh.

Referenced by G4ChipsComponentXS::G4ChipsComponentXS().

00056 {return "ChipsAntiBaryonInelasticXS";}

G4double G4ChipsAntiBaryonInelasticXS::GetChipsCrossSection ( G4double  momentum,
G4int  Z,
G4int  N,
G4int  pdg 
) [virtual]

Definition at line 143 of file G4ChipsAntiBaryonInelasticXS.cc.

Referenced by GetIsoCrossSection().

00144 {
00145   static G4int j;                      // A#0f Z/N-records already tested in AMDB
00146   static std::vector <G4int>    colN;  // Vector of N for calculated nuclei (isotops)
00147   static std::vector <G4int>    colZ;  // Vector of Z for calculated nuclei (isotops)
00148   static std::vector <G4double> colP;  // Vector of last momenta for the reaction
00149   static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
00150   static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
00151   // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
00152 
00153   G4bool in=false;                     // By default the isotope must be found in the AMDB
00154   if(tgN!=lastN || tgZ!=lastZ)         // The nucleus was not the last used isotope
00155   {
00156     in = false;                        // By default the isotope haven't be found in AMDB  
00157     lastP   = 0.;                      // New momentum history (nothing to compare with)
00158     lastN   = tgN;                     // The last N of the calculated nucleus
00159     lastZ   = tgZ;                     // The last Z of the calculated nucleus
00160     lastI   = colN.size();             // Size of the Associative Memory DB in the heap
00161     j  = 0;                            // A#0f records found in DB for this projectile
00162     if(lastI) for(G4int i=0; i<lastI; i++) // AMDB exists, try to find the (Z,N) isotope
00163     {
00164       if(colN[i]==tgN && colZ[i]==tgZ) // Try the record "i" in the AMDB
00165       {
00166         lastI=i;                       // Remember the index for future fast/last use
00167         lastTH =colTH[i];              // The last THreshold (A-dependent)
00168         if(pMom<=lastTH)
00169         {
00170           return 0.;                   // Energy is below the Threshold value
00171         }
00172         lastP  =colP [i];              // Last Momentum  (A-dependent)
00173         lastCS =colCS[i];              // Last CrossSect (A-dependent)
00174         in = true;                     // This is the case when the isotop is found in DB
00175         // Momentum pMom is in IU ! @@ Units
00176         lastCS=CalculateCrossSection(-1,j,cPDG,lastZ,lastN,pMom); // read & update
00177         if(lastCS<=0. && pMom>lastTH)  // Correct the threshold (@@ No intermediate Zeros)
00178         {
00179           lastCS=0.;
00180           lastTH=pMom;
00181         }
00182         break;                         // Go out of the LOOP
00183       }
00184       j++;                             // Increment a#0f records found in DB
00185     }
00186     if(!in)                            // This isotope has not been calculated previously
00187     {
00189       lastCS=CalculateCrossSection(0,j,cPDG,lastZ,lastN,pMom); //calculate & create
00190       //if(lastCS>0.)                   // It means that the AMBD was initialized
00191       //{
00192 
00193       lastTH = 0; //ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
00194         colN.push_back(tgN);
00195         colZ.push_back(tgZ);
00196         colP.push_back(pMom);
00197         colTH.push_back(lastTH);
00198         colCS.push_back(lastCS);
00199       //} // M.K. Presence of H1 with high threshold breaks the syncronization
00200       return lastCS*millibarn;
00201     } // End of creation of the new set of parameters
00202     else
00203     {
00204       colP[lastI]=pMom;
00205       colCS[lastI]=lastCS;
00206     }
00207   } // End of parameters udate
00208   else if(pMom<=lastTH)
00209   {
00210     return 0.;                         // Momentum is below the Threshold Value -> CS=0
00211   }
00212   else                                 // It is the last used -> use the current tables
00213   {
00214     lastCS=CalculateCrossSection(1,j,cPDG,lastZ,lastN,pMom); // Only read and UpdateDB
00215     lastP=pMom;
00216   }
00217   return lastCS*millibarn;
00218 }

G4double G4ChipsAntiBaryonInelasticXS::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 131 of file G4ChipsAntiBaryonInelasticXS.cc.

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

00135 {
00136   G4double pMom=Pt->GetTotalMomentum();
00137   G4int tgN = A - tgZ;
00138   G4int pdg = Pt->GetDefinition()->GetPDGEncoding();
00139   
00140   return GetChipsCrossSection(pMom, tgZ, tgN, pdg);
00141 }

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 84 of file G4ChipsAntiBaryonInelasticXS.cc.

References G4AntiLambda::AntiLambda(), G4AntiNeutron::AntiNeutron(), G4AntiOmegaMinus::AntiOmegaMinus(), G4AntiProton::AntiProton(), G4AntiSigmaMinus::AntiSigmaMinus(), G4AntiSigmaPlus::AntiSigmaPlus(), G4AntiSigmaZero::AntiSigmaZero(), G4AntiXiMinus::AntiXiMinus(), G4AntiXiZero::AntiXiZero(), and G4DynamicParticle::GetDefinition().

00087 {
00088   G4ParticleDefinition* particle = Pt->GetDefinition();
00089 
00090   if(particle == G4AntiNeutron::AntiNeutron())
00091   {
00092     return true;
00093   }
00094   else if(particle == G4AntiProton::AntiProton())
00095   {
00096     return true;
00097   }
00098   else if(particle == G4AntiLambda::AntiLambda())
00099   {
00100     return true;
00101   }
00102   else if(particle == G4AntiSigmaPlus::AntiSigmaPlus())
00103   {
00104     return true;
00105   }
00106   else if(particle == G4AntiSigmaMinus::AntiSigmaMinus())
00107   {
00108     return true;
00109   }
00110   else if(particle == G4AntiSigmaZero::AntiSigmaZero())
00111   {
00112     return true;
00113   }
00114   else if(particle == G4AntiXiMinus::AntiXiMinus())
00115   {
00116     return true;
00117   }
00118   else if(particle == G4AntiXiZero::AntiXiZero())
00119   {
00120     return true;
00121   }
00122   else if(particle == G4AntiOmegaMinus::AntiOmegaMinus())
00123   {
00124     return true;
00125   }
00126   return false;
00127 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:51:37 2013 for Geant4 by  doxygen 1.4.7