G4ChipsNeutronInelasticXS Class Reference

#include <G4ChipsNeutronInelasticXS.hh>

Inheritance diagram for G4ChipsNeutronInelasticXS:

G4VCrossSectionDataSet

Public Member Functions

 G4ChipsNeutronInelasticXS ()
 ~G4ChipsNeutronInelasticXS ()
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 49 of file G4ChipsNeutronInelasticXS.hh.


Constructor & Destructor Documentation

G4ChipsNeutronInelasticXS::G4ChipsNeutronInelasticXS (  ) 

Definition at line 54 of file G4ChipsNeutronInelasticXS.cc.

00054                                                     :G4VCrossSectionDataSet(Default_Name())
00055 {
00056   lastLEN=0; // Pointer to the lastArray of LowEn CS
00057   lastHEN=0; // Pointer to the lastArray of HighEnCS
00058   lastN=0;   // The last N of calculated nucleus
00059   lastZ=0;   // The last Z of calculated nucleus
00060   lastP=0.;  // Last used in 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   HEthresh=0.;// HE threshold for the CS calculation
00065   LEN = new std::vector<G4double*>;
00066   HEN = new std::vector<G4double*>;
00067 }

G4ChipsNeutronInelasticXS::~G4ChipsNeutronInelasticXS (  ) 

Definition at line 69 of file G4ChipsNeutronInelasticXS.cc.

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


Member Function Documentation

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

Definition at line 59 of file G4ChipsNeutronInelasticXS.hh.

Referenced by G4ChipsComponentXS::G4ChipsComponentXS().

00059 {return "ChipsNeutronInelasticXS";}

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

Definition at line 102 of file G4ChipsNeutronInelasticXS.cc.

Referenced by GetIsoCrossSection().

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

G4double G4ChipsNeutronInelasticXS::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 89 of file G4ChipsNeutronInelasticXS.cc.

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

00093 {
00094   G4double pMom=Pt->GetTotalMomentum();
00095   G4int tgN = A - tgZ;
00096 
00097   return GetChipsCrossSection(pMom, tgZ, tgN, 2112);
00098 }

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 79 of file G4ChipsNeutronInelasticXS.cc.

References G4DynamicParticle::GetDefinition(), and G4Neutron::Neutron().

00082 {
00083   G4ParticleDefinition* particle = Pt->GetDefinition();
00084   if (particle == G4Neutron::Neutron()      ) return true;
00085   return false;
00086 }


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