G4ChipsNeutronElasticXS Class Reference

#include <G4ChipsNeutronElasticXS.hh>

Inheritance diagram for G4ChipsNeutronElasticXS:

G4VCrossSectionDataSet

Public Member Functions

 G4ChipsNeutronElasticXS ()
 ~G4ChipsNeutronElasticXS ()
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)
G4double GetExchangeT (G4int tZ, G4int tN, G4int pPDG)
G4double GetHMaxT ()

Static Public Member Functions

static const char * Default_Name ()

Detailed Description

Definition at line 47 of file G4ChipsNeutronElasticXS.hh.


Constructor & Destructor Documentation

G4ChipsNeutronElasticXS::G4ChipsNeutronElasticXS (  ) 

Definition at line 54 of file G4ChipsNeutronElasticXS.cc.

00054                                                 :G4VCrossSectionDataSet(Default_Name()), nPoints(128), nLast(nPoints-1) 
00055 {
00056   lPMin=-8.;  // Min tabulated log Momentum      (D)
00057   lPMax= 8.;  // Max tabulated log Momentum      (D)
00058   dlnP=(lPMax-lPMin)/nLast;// Log step in table  (D)
00059   onlyCS=true;// Flag to calc only CS (not Si/Bi)(L)
00060   lastSIG=0.; // Last calculated cross section   (L)
00061   lastLP=-10.;// Last log(momOfIncidentHadron)   (L)
00062   lastTM=0.;  // Last t_maximum                  (L)
00063   theSS=0.;   // The Last sq.slope of 1st difMax (L)
00064   theS1=0.;   // The Last mantissa of 1st difMax (L)
00065   theB1=0.;   // The Last slope of 1st difr. Max (L)
00066   theS2=0.;   // The Last mantissa of 2nd difMax (L)
00067   theB2=0.;   // The Last slope of 2nd difr. Max (L)
00068   theS3=0.;   // The Last mantissa of 3d difrMax (L)
00069   theB3=0.;   // The Last slope of 3d difructMax (L)
00070   theS4=0.;   // The Last mantissa of 4th difMax (L)
00071   theB4=0.;   // The Last slope of 4th difr. Max (L)
00072   lastTZ=0;   // Last atomic number of the target
00073   lastTN=0;   // Last # of neutrons in the target
00074   lastPIN=0.; // Last initialized max momentum
00075   lastCST=0;  // Elastic cross-section table
00076   lastPAR=0;  // Parameters of FunctionalCalculation
00077   lastSST=0;  // E-dep of sq.slope of the 1st difMax
00078   lastS1T=0;  // E-dep of mantissa of the 1st difMax
00079   lastB1T=0;  // E-dep of theSlope of the 1st difMax
00080   lastS2T=0;  // E-dep of mantissa of the 2nd difMax
00081   lastB2T=0;  // E-dep of theSlope of the 2nd difMax
00082   lastS3T=0;  // E-dep of mantissa of the 3d difrMax
00083   lastB3T=0;  // E-dep of the slope of the 3d difMax
00084   lastS4T=0;  // E-dep of mantissa of the 4th difMax
00085   lastB4T=0;  // E-dep of theSlope of the 4th difMax
00086   lastN=0;    // The last N of calculated nucleus
00087   lastZ=0;    // The last Z of calculated nucleus
00088   lastP=0.;   // Last used in cross section Momentum
00089   lastTH=0.;  // Last threshold momentum
00090   lastCS=0.;  // Last value of the Cross Section
00091   lastI=0;    // The last position in the DAMDB
00092 }

G4ChipsNeutronElasticXS::~G4ChipsNeutronElasticXS (  ) 

Definition at line 94 of file G4ChipsNeutronElasticXS.cc.

00095 {
00096   std::vector<G4double*>::iterator pos;
00097   for (pos=CST.begin(); pos<CST.end(); pos++)
00098   { delete [] *pos; }
00099   CST.clear();
00100   for (pos=PAR.begin(); pos<PAR.end(); pos++)
00101   { delete [] *pos; }
00102   PAR.clear();
00103   for (pos=SST.begin(); pos<SST.end(); pos++)
00104   { delete [] *pos; }
00105   SST.clear();
00106   for (pos=S1T.begin(); pos<S1T.end(); pos++)
00107   { delete [] *pos; }
00108   S1T.clear();
00109   for (pos=B1T.begin(); pos<B1T.end(); pos++)
00110   { delete [] *pos; }
00111   B1T.clear();
00112   for (pos=S2T.begin(); pos<S2T.end(); pos++)
00113   { delete [] *pos; }
00114   S2T.clear();
00115   for (pos=B2T.begin(); pos<B2T.end(); pos++)
00116   { delete [] *pos; }
00117   B2T.clear();
00118   for (pos=S3T.begin(); pos<S3T.end(); pos++)
00119   { delete [] *pos; }
00120   S3T.clear();
00121   for (pos=B3T.begin(); pos<B3T.end(); pos++)
00122   { delete [] *pos; }
00123   B3T.clear();
00124   for (pos=S4T.begin(); pos<S4T.end(); pos++)
00125   { delete [] *pos; }
00126   S4T.clear();
00127   for (pos=B4T.begin(); pos<B4T.end(); pos++)
00128   { delete [] *pos; }
00129   B4T.clear(); 
00130 }


Member Function Documentation

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

Definition at line 56 of file G4ChipsNeutronElasticXS.hh.

Referenced by G4HadronElasticPhysics::ConstructProcess(), G4ChipsComponentXS::G4ChipsComponentXS(), G4ChipsElasticModel::G4ChipsElasticModel(), and G4QuasiElRatios::G4QuasiElRatios().

00056 {return "ChipsNeutronElasticXS";}

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

Definition at line 154 of file G4ChipsNeutronElasticXS.cc.

Referenced by G4QuasiElRatios::ChExer(), GetIsoCrossSection(), G4ChipsElasticModel::SampleInvariantT(), and G4QuasiElRatios::Scatter().

00155 {
00156   static std::vector <G4int>    colN;  // Vector of N for calculated nuclei (isotops)
00157   static std::vector <G4int>    colZ;  // Vector of Z for calculated nuclei (isotops)
00158   static std::vector <G4double> colP;  // Vector of last momenta for the reaction
00159   static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
00160   static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
00161   // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
00162 
00163   G4double pEn=pMom;
00164   onlyCS=false;
00165 
00166   G4bool in=false;                     // By default the isotope must be found in the AMDB
00167   lastP   = 0.;                      // New momentum history (nothing to compare with)
00168   lastN   = tgN;                     // The last N of the calculated nucleus
00169   lastZ   = tgZ;                     // The last Z of the calculated nucleus
00170   lastI   = colN.size();             // Size of the Associative Memory DB in the heap
00171   if(lastI) for(G4int i=0; i<lastI; i++) // Loop over proj/tgZ/tgN lines of DB
00172   {                                  // The nucleus with projPDG is found in AMDB
00173     if(colN[i]==tgN && colZ[i]==tgZ) // Isotope is foind in AMDB
00174     {
00175       lastI=i;
00176       lastTH =colTH[i];              // Last THreshold (A-dependent)
00177       if(pEn<=lastTH)
00178       {
00179         return 0.;                   // Energy is below the Threshold value
00180       }
00181       lastP  =colP [i];                // Last Momentum  (A-dependent)
00182       lastCS =colCS[i];                // Last CrossSect (A-dependent)
00183       //  if(std::fabs(lastP/pMom-1.)<tolerance) //VI (do not use tolerance)
00184       if(lastP == pMom)              // Do not recalculate
00185       {
00186         CalculateCrossSection(false,-1,i,2112,lastZ,lastN,pMom); // Update param's only
00187         return lastCS*millibarn;     // Use theLastCS
00188       }
00189       in = true;                       // This is the case when the isotop is found in DB
00190       // Momentum pMom is in IU ! @@ Units
00191       lastCS=CalculateCrossSection(false,-1,i,2112,lastZ,lastN,pMom); // read & update
00192       if(lastCS<=0. && pEn>lastTH)    // Correct the threshold
00193       {
00194         lastTH=pEn;
00195       }
00196       break;                           // Go out of the LOOP with found lastI
00197     }
00198   }
00199   if(!in)                            // This nucleus has not been calculated previously
00200   {
00202     lastCS=CalculateCrossSection(false,0,lastI,2112,lastZ,lastN,pMom);//calculate&create
00203     if(lastCS<=0.)
00204     {
00205       lastTH = 0; // ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
00206       if(pEn>lastTH)
00207       {
00208         lastTH=pEn;
00209       }
00210     }
00211     colN.push_back(tgN);
00212     colZ.push_back(tgZ);
00213     colP.push_back(pMom);
00214     colTH.push_back(lastTH);
00215     colCS.push_back(lastCS);
00216     return lastCS*millibarn;
00217   } // End of creation of the new set of parameters
00218   else
00219   {
00220     colP[lastI]=pMom;
00221     colCS[lastI]=lastCS;
00222   }
00223   return lastCS*millibarn;
00224 }

G4double G4ChipsNeutronElasticXS::GetExchangeT ( G4int  tZ,
G4int  tN,
G4int  pPDG 
)

Definition at line 1853 of file G4ChipsNeutronElasticXS.cc.

References G4cout, and G4UniformRand.

Referenced by G4QuasiElRatios::ChExer(), G4ChipsElasticModel::SampleInvariantT(), and G4QuasiElRatios::Scatter().

01854 {
01855   static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
01856   static const G4double third=1./3.;
01857   static const G4double fifth=1./5.;
01858   static const G4double sevth=1./7.;
01859   if(PDG!=2112) G4cout<<"*Warning*G4ChipsNeutronElasticXS::GetExT:PDG="<<PDG<<G4endl;
01860   if(onlyCS) G4cout<<"*Warning*G4ChipsNeutronElasticXS::GetExchangeT:onCS=1"<<G4endl;
01861   if(lastLP<-4.3) return lastTM*GeVSQ*G4UniformRand();// S-wave for p<14 MeV/c (kinE<.1MeV)
01862   G4double q2=0.;
01863   if(tgZ==1 && tgN==0)                // ===> n+p=n+p
01864   {
01865     G4double E1=lastTM*theB1;
01866     G4double R1=(1.-std::exp(-E1));
01867     G4double E2=lastTM*theB2;
01868     G4double R2=(1.-std::exp(-E2));
01869     G4double I1=R1*theS1;
01870     G4double I2=R2*theS2/theB2;
01871     //G4double I3=R3*theS3/theB3;
01872     G4double I12=I1+I2;
01873     //G4double rand=(I12+I3)*G4UniformRand();
01874     G4double rand=I12*G4UniformRand();
01875     if     (rand<I1 )
01876     {
01877       G4double ran=R1*G4UniformRand();
01878       if(ran>1.) ran=1.;
01879       q2=-std::log(1.-ran)/theB1;       // t-chan
01880     }
01881     else
01882     {
01883       G4double ran=R2*G4UniformRand();
01884       if(ran>1.) ran=1.;
01885       q2=lastTM+std::log(1.-ran)/theB2; // u-chan (ChEx)
01886     }
01887   }
01888   else
01889   {
01890     G4double a=tgZ+tgN;
01891     G4double E1=lastTM*(theB1+lastTM*theSS);
01892     G4double R1=(1.-std::exp(-E1));
01893     G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
01894     G4double tm2=lastTM*lastTM;
01895     G4double E2=lastTM*tm2*theB2;                   // power 3 for lowA, 5 for HighA (1st)
01896     if(a>6.5)E2*=tm2;                               // for heavy nuclei
01897     G4double R2=(1.-std::exp(-E2));
01898     G4double E3=lastTM*theB3;
01899     if(a>6.5)E3*=tm2*tm2*tm2;                       // power 1 for lowA, 7 (2nd) for HighA
01900     G4double R3=(1.-std::exp(-E3));
01901     G4double E4=lastTM*theB4;
01902     G4double R4=(1.-std::exp(-E4));
01903     G4double I1=R1*theS1;
01904     G4double I2=R2*theS2;
01905     G4double I3=R3*theS3;
01906     G4double I4=R4*theS4;
01907     G4double I12=I1+I2;
01908     G4double I13=I12+I3;
01909     G4double rand=(I13+I4)*G4UniformRand();
01910     if(rand<I1)
01911     {
01912       G4double ran=R1*G4UniformRand();
01913       if(ran>1.) ran=1.;
01914       q2=-std::log(1.-ran)/theB1;
01915       if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss;
01916     }
01917     else if(rand<I12)
01918     {
01919       G4double ran=R2*G4UniformRand();
01920       if(ran>1.) ran=1.;
01921       q2=-std::log(1.-ran)/theB2;
01922       if(q2<0.) q2=0.;
01923       if(a<6.5) q2=std::pow(q2,third);
01924       else      q2=std::pow(q2,fifth);
01925     }
01926     else if(rand<I13)
01927     {
01928       G4double ran=R3*G4UniformRand();
01929       if(ran>1.) ran=1.;
01930       q2=-std::log(1.-ran)/theB3;
01931       if(q2<0.) q2=0.;
01932       if(a>6.5) q2=std::pow(q2,sevth);
01933     }
01934     else
01935     {
01936       G4double ran=R4*G4UniformRand();
01937       if(ran>1.) ran=1.;
01938       q2=-std::log(1.-ran)/theB4;
01939       if(a<6.5) q2=lastTM-q2;                    // u reduced for lightA (starts from 0)
01940     }
01941   }
01942   if(q2<0.) q2=0.;
01943   if(!(q2>=-1.||q2<=1.)) G4cout<<"*NAN*G4QNeutronElCroSect::GetExchangeT: -t="<<q2<<G4endl;
01944   if(q2>lastTM)
01945   {
01946     q2=lastTM;
01947   }
01948   return q2*GeVSQ;
01949 }

G4double G4ChipsNeutronElasticXS::GetHMaxT (  ) 

Definition at line 1975 of file G4ChipsNeutronElasticXS.cc.

Referenced by G4QuasiElRatios::ChExer(), and G4QuasiElRatios::Scatter().

01976 {
01977   static const G4double HGeVSQ=gigaelectronvolt*gigaelectronvolt/2.;
01978   return lastTM*HGeVSQ;
01979 }

G4double G4ChipsNeutronElasticXS::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 141 of file G4ChipsNeutronElasticXS.cc.

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

00145 {
00146   G4double pMom=Pt->GetTotalMomentum();
00147   G4int tgN = A - tgZ;
00148 
00149   return GetChipsCrossSection(pMom, tgZ, tgN, 2112);
00150 }

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 132 of file G4ChipsNeutronElasticXS.cc.

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

00135 {
00136   G4ParticleDefinition* particle = Pt->GetDefinition();
00137   if (particle == G4Proton::Proton()      ) return true;
00138   return false;
00139 }


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