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)

Static Public Member Functions

static const char * Default_Name ()

Detailed Description

Definition at line 48 of file G4ChipsProtonInelasticXS.hh.


Constructor & Destructor Documentation

G4ChipsProtonInelasticXS::G4ChipsProtonInelasticXS (  ) 

Definition at line 54 of file G4ChipsProtonInelasticXS.cc.

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

G4ChipsProtonInelasticXS::~G4ChipsProtonInelasticXS (  ) 

Definition at line 70 of file G4ChipsProtonInelasticXS.cc.

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


Member Function Documentation

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

Definition at line 57 of file G4ChipsProtonInelasticXS.hh.

Referenced by G4ChipsComponentXS::G4ChipsComponentXS().

00057 {return "ChipsProtonInelasticXS";}

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

Definition at line 105 of file G4ChipsProtonInelasticXS.cc.

Referenced by GetIsoCrossSection().

00106 {
00107   static G4int j;                      // A#0f Z/N-records already tested in AMDB
00108   static std::vector <G4int>    colN;  // Vector of N for calculated nuclei (isotops)
00109   static std::vector <G4int>    colZ;  // Vector of Z for calculated nuclei (isotops)
00110   static std::vector <G4double> colP;  // Vector of last momenta for the reaction
00111   static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
00112   static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
00113   // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
00114 
00115   G4bool in=false;                     // By default the isotope must be found in the AMDB
00116   if(tgN!=lastN || tgZ!=lastZ)         // The nucleus was not the last used isotope
00117   {
00118     in      = false;                   // By default the isotope haven't been found in AMDB
00119     lastP   = 0.;                      // New momentum history (nothing to compare with)
00120     lastN   = tgN;                     // The last N of the calculated nucleus
00121     lastZ   = tgZ;                     // The last Z of the calculated nucleus
00122     lastI   = colN.size();             // Size of the Associative Memory DB in the heap
00123     j  = 0;                            // A#0f records found in DB for this projectile
00124     if(lastI) for(G4int i=0; i<lastI; i++) // AMDB exists, try to find the (Z,N) isotope
00125     {
00126       if(colN[i]==tgN && colZ[i]==tgZ) // Try the record "i" in the AMDB
00127       {
00128         lastI=i;                       // Remember the index for future fast/last use
00129         lastTH =colTH[i];              // The last THreshold (A-dependent)
00130         if(pMom<=lastTH)
00131         {
00132           return 0.;                   // Energy is below the Threshold value
00133         }
00134         lastP  =colP [i];              // Last Momentum  (A-dependent)
00135         lastCS =colCS[i];              // Last CrossSect (A-dependent)
00136         in = true;                     // This is the case when the isotop is found in DB
00137         // Momentum pMom is in IU ! @@ Units
00138         lastCS=CalculateCrossSection(-1,j,2212,lastZ,lastN,pMom); // read & update
00139         if(lastCS<=0. && pMom>lastTH)  // Correct the threshold (@@ No intermediate Zeros)
00140         {
00141           lastCS=0.;
00142           lastTH=pMom;
00143         }
00144         break;                         // Go out of the LOOP
00145       }
00146       j++;                             // Increment a#0f records found in DB
00147     }
00148     if(!in)                            // This isotope has not been calculated previously
00149     {
00151       lastCS=CalculateCrossSection(0,j,2212,lastZ,lastN,pMom); //calculate & create
00152       //if(lastCS>0.)                   // It means that the AMBD was initialized
00153       //{
00154 
00155       lastTH = 0; //ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
00156         colN.push_back(tgN);
00157         colZ.push_back(tgZ);
00158         colP.push_back(pMom);
00159         colTH.push_back(lastTH);
00160         colCS.push_back(lastCS);
00161         //} // M.K. Presence of H1 with high threshold breaks the syncronization
00162       return lastCS*millibarn;
00163     } // End of creation of the new set of parameters
00164     else
00165     {
00166       colP[lastI]=pMom;
00167       colCS[lastI]=lastCS;
00168     }
00169   } // End of parameters udate
00170   else if(pMom<=lastTH)
00171   {
00172     return 0.;                         // Momentum is below the Threshold Value -> CS=0
00173   }
00174   else                                 // It is the last used -> use the current tables
00175   {
00176     lastCS=CalculateCrossSection(1,j,2212,lastZ,lastN,pMom); // Only read and UpdateDB
00177     lastP=pMom;
00178   }
00179   return lastCS*millibarn;
00180 }

G4double G4ChipsProtonInelasticXS::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 94 of file G4ChipsProtonInelasticXS.cc.

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

00098 {
00099   G4double pMom=Pt->GetTotalMomentum();
00100   G4int tgN = A - tgZ;
00101 
00102   return GetChipsCrossSection(pMom, tgZ, tgN, 2212);
00103 }

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.

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

00085 {
00086   G4ParticleDefinition* particle = Pt->GetDefinition();
00087   if (particle == G4Proton::Proton()      ) return true;
00088   return false;
00089 }


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