Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ChipsProtonElasticXS Class Reference

#include <G4ChipsProtonElasticXS.hh>

Inheritance diagram for G4ChipsProtonElasticXS:
Collaboration diagram for G4ChipsProtonElasticXS:

Public Member Functions

 G4ChipsProtonElasticXS ()
 
 ~G4ChipsProtonElasticXS ()
 
virtual void CrossSectionDescription (std::ostream &) const
 
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 ()
 
- Public Member Functions inherited from G4VCrossSectionDataSet
 G4VCrossSectionDataSet (const G4String &nam="")
 
virtual ~G4VCrossSectionDataSet ()
 
virtual G4bool IsElementApplicable (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
G4double GetCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
G4double ComputeCrossSection (const G4DynamicParticle *, const G4Element *, const G4Material *mat=0)
 
virtual G4double GetElementCrossSection (const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
 
virtual G4IsotopeSelectIsotope (const G4Element *, G4double kinEnergy)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
 
virtual G4int GetVerboseLevel () const
 
virtual void SetVerboseLevel (G4int value)
 
G4double GetMinKinEnergy () const
 
void SetMinKinEnergy (G4double value)
 
G4double GetMaxKinEnergy () const
 
void SetMaxKinEnergy (G4double value)
 
const G4StringGetName () const
 

Static Public Member Functions

static const char * Default_Name ()
 

Additional Inherited Members

- Protected Member Functions inherited from G4VCrossSectionDataSet
void SetName (const G4String &)
 
- Protected Attributes inherited from G4VCrossSectionDataSet
G4int verboseLevel
 

Detailed Description

Definition at line 45 of file G4ChipsProtonElasticXS.hh.

Constructor & Destructor Documentation

G4ChipsProtonElasticXS::G4ChipsProtonElasticXS ( )

Definition at line 60 of file G4ChipsProtonElasticXS.cc.

60  :G4VCrossSectionDataSet(Default_Name()), nPoints(128), nLast(nPoints-1)
61 {
62  // Initialization of the parameters
63  lPMin=-8.; // Min tabulated logarithmicMomentum(D)
64  lPMax= 8.; // Max tabulated logarithmicMomentum(D)
65  dlnP=(lPMax-lPMin)/nLast;// LogStep in the table(D)
66  onlyCS=false;// Flag toCalculateOnlyCS(not Si/Bi)(L)
67  lastSIG=0.; // Last calculated cross section (L)
68  lastLP=-10.;// Last log(mom_ofTheIncidentHadron)(L)
69  lastTM=0.; // Last t_maximum (L)
70  theSS=0.; // The Last sq.slope of 1st difr.Max(L)
71  theS1=0.; // The Last mantissa of 1st difr.Max(L)
72  theB1=0.; // The Last slope of 1st difruct.Max(L)
73  theS2=0.; // The Last mantissa of 2nd difr.Max(L)
74  theB2=0.; // The Last slope of 2nd difruct.Max(L)
75  theS3=0.; // The Last mantissa of 3d difr. Max(L)
76  theB3=0.; // The Last slope of 3d difruct. Max(L)
77  theS4=0.; // The Last mantissa of 4th difr.Max(L)
78  theB4=0.; // The Last slope of 4th difruct.Max(L)
79  lastTZ=0; // Last atomic number of the target
80  lastTN=0; // Last # of neutrons in the target
81  lastPIN=0.; // Last initialized max momentum
82  lastCST=0; // Elastic cross-section table
83  lastPAR=0; // Parameters for FunctionalCalculation
84  lastSST=0; // E-dep of sq.slope of the 1st dif.Max
85  lastS1T=0; // E-dep of mantissa of the 1st dif.Max
86  lastB1T=0; // E-dep of the slope of the 1st difMax
87  lastS2T=0; // E-dep of mantissa of the 2nd difrMax
88  lastB2T=0; // E-dep of the slope of the 2nd difMax
89  lastS3T=0; // E-dep of mantissa of the 3d difr.Max
90  lastB3T=0; // E-dep of the slope of the 3d difrMax
91  lastS4T=0; // E-dep of mantissa of the 4th difrMax
92  lastB4T=0; // E-dep of the slope of the 4th difMax
93  lastN=0; // The last N of calculated nucleus
94  lastZ=0; // The last Z of calculated nucleus
95  lastP=0.; // Last used in cross section Momentum
96  lastTH=0.; // Last threshold momentum
97  lastCS=0.; // Last value of the Cross Section
98  lastI=0; // The last position in the DAMDB
99 
100  mProt= G4Proton::Proton()->GetPDGMass()*.001; // MeV to GeV
101  mProt2= mProt*mProt;
102 
103 
104 }
G4VCrossSectionDataSet(const G4String &nam="")
static G4Proton * Proton()
Definition: G4Proton.cc:93
G4double GetPDGMass() const
static const char * Default_Name()

Here is the call graph for this function:

G4ChipsProtonElasticXS::~G4ChipsProtonElasticXS ( )

Definition at line 107 of file G4ChipsProtonElasticXS.cc.

108 {
109  std::vector<G4double*>::iterator pos;
110  for (pos=CST.begin(); pos<CST.end(); pos++)
111  { delete [] *pos; }
112  CST.clear();
113  for (pos=PAR.begin(); pos<PAR.end(); pos++)
114  { delete [] *pos; }
115  PAR.clear();
116  for (pos=SST.begin(); pos<SST.end(); pos++)
117  { delete [] *pos; }
118  SST.clear();
119  for (pos=S1T.begin(); pos<S1T.end(); pos++)
120  { delete [] *pos; }
121  S1T.clear();
122  for (pos=B1T.begin(); pos<B1T.end(); pos++)
123  { delete [] *pos; }
124  B1T.clear();
125  for (pos=S2T.begin(); pos<S2T.end(); pos++)
126  { delete [] *pos; }
127  S2T.clear();
128  for (pos=B2T.begin(); pos<B2T.end(); pos++)
129  { delete [] *pos; }
130  B2T.clear();
131  for (pos=S3T.begin(); pos<S3T.end(); pos++)
132  { delete [] *pos; }
133  S3T.clear();
134  for (pos=B3T.begin(); pos<B3T.end(); pos++)
135  { delete [] *pos; }
136  B3T.clear();
137  for (pos=S4T.begin(); pos<S4T.end(); pos++)
138  { delete [] *pos; }
139  S4T.clear();
140  for (pos=B4T.begin(); pos<B4T.end(); pos++)
141  { delete [] *pos; }
142  B4T.clear();
143 
144 }
static const G4double pos

Member Function Documentation

void G4ChipsProtonElasticXS::CrossSectionDescription ( std::ostream &  outFile) const
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 147 of file G4ChipsProtonElasticXS.cc.

148 {
149  outFile << "G4ChipsProtonElasticXS provides the elastic cross\n"
150  << "section for proton nucleus scattering as a function of incident\n"
151  << "momentum. The cross section is calculated using M. Kossov's\n"
152  << "CHIPS parameterization of cross section data.\n";
153 }
static const char* G4ChipsProtonElasticXS::Default_Name ( )
inlinestatic

Definition at line 53 of file G4ChipsProtonElasticXS.hh.

53 {return "ChipsProtonElasticXS";}

Here is the caller graph for this function:

G4double G4ChipsProtonElasticXS::GetChipsCrossSection ( G4double  momentum,
G4int  Z,
G4int  N,
G4int  pdg 
)
virtual

!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)

Definition at line 177 of file G4ChipsProtonElasticXS.cc.

178 {
179 
180  G4double pEn=pMom;
181  onlyCS=false;
182 
183  G4bool in=false; // By default the isotope must be found in the AMDB
184  lastP = 0.; // New momentum history (nothing to compare with)
185  lastN = tgN; // The last N of the calculated nucleus
186  lastZ = tgZ; // The last Z of the calculated nucleus
187  lastI = colN.size(); // Size of the Associative Memory DB in the heap
188  if(lastI) for(G4int i=0; i<lastI; i++) // Loop over proj/tgZ/tgN lines of DB
189  { // The nucleus with projPDG is found in AMDB
190  if(colN[i]==tgN && colZ[i]==tgZ) // Isotope is foind in AMDB
191  {
192  lastI=i;
193  lastTH =colTH[i]; // Last THreshold (A-dependent)
194  if(pEn<=lastTH)
195  {
196  return 0.; // Energy is below the Threshold value
197  }
198  lastP =colP [i]; // Last Momentum (A-dependent)
199  lastCS =colCS[i]; // Last CrossSect (A-dependent)
200  if(lastP == pMom) // Do not recalculate
201  {
202  CalculateCrossSection(onlyCS,-1,i,2212,lastZ,lastN,pMom); // Update param's only
203  return lastCS*millibarn; // Use theLastCS
204  }
205  in = true; // This is the case when the isotop is found in DB
206  // Momentum pMom is in IU ! @@ Units
207  lastCS=CalculateCrossSection(onlyCS,-1,i,2212,lastZ,lastN,pMom); // read & update
208  if(lastCS<=0. && pEn>lastTH) // Correct the threshold
209  {
210  lastTH=pEn;
211  }
212  break; // Go out of the LOOP with found lastI
213  }
214  } // End of attampt to find the nucleus in DB
215  if(!in) // This nucleus has not been calculated previously
216  {
218  lastCS=CalculateCrossSection(onlyCS,0,lastI,2212,lastZ,lastN,pMom);//calculate&create
219  if(lastCS<=0.)
220  {
221  lastTH = 0; //ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
222  if(pEn>lastTH)
223  {
224  lastTH=pEn;
225  }
226  }
227  colN.push_back(tgN);
228  colZ.push_back(tgZ);
229  colP.push_back(pMom);
230  colTH.push_back(lastTH);
231  colCS.push_back(lastCS);
232  return lastCS*millibarn;
233  } // End of creation of the new set of parameters
234  else
235  {
236  colP[lastI]=pMom;
237  colCS[lastI]=lastCS;
238  }
239  return lastCS*millibarn;
240 }
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
static constexpr double millibarn
Definition: G4SIunits.hh:106

Here is the caller graph for this function:

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

Definition at line 622 of file G4ChipsProtonElasticXS.cc.

623 {
624  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
625  static const G4double third=1./3.;
626  static const G4double fifth=1./5.;
627  static const G4double sevth=1./7.;
628  if(PDG!=2212) G4cout<<"**Warning*G4ChipsProtonElasticXS::GetExT:PDG="<<PDG<<G4endl;
629  if(onlyCS) G4cout<<"**Warning*G4ChipsProtonElasticXS::GetExchanT:onlyCS=1"<<G4endl;
630  if(lastLP<-4.3) return lastTM*GeVSQ*G4UniformRand();// S-wave for p<14 MeV/c (kinE<.1MeV)
631  G4double q2=0.;
632  if(tgZ==1 && tgN==0) // ===> p+p=p+p
633  {
634  G4double E1=lastTM*theB1;
635  G4double R1=(1.-std::exp(-E1));
636  G4double E2=lastTM*theB2;
637  G4double R2=(1.-std::exp(-E2*E2*E2));
638  G4double E3=lastTM*theB3;
639  G4double R3=(1.-std::exp(-E3));
640  G4double I1=R1*theS1/theB1;
641  G4double I2=R2*theS2;
642  G4double I3=R3*theS3;
643  G4double I12=I1+I2;
644  G4double rand=(I12+I3)*G4UniformRand();
645  if (rand<I1 )
646  {
647  G4double ran=R1*G4UniformRand();
648  if(ran>1.) ran=1.;
649  q2=-std::log(1.-ran)/theB1;
650  }
651  else if(rand<I12)
652  {
653  G4double ran=R2*G4UniformRand();
654  if(ran>1.) ran=1.;
655  q2=-std::log(1.-ran);
656  if(q2<0.) q2=0.;
657  q2=std::pow(q2,third)/theB2;
658  }
659  else
660  {
661  G4double ran=R3*G4UniformRand();
662  if(ran>1.) ran=1.;
663  q2=-std::log(1.-ran)/theB3;
664  }
665  }
666  else
667  {
668  G4double a=tgZ+tgN;
669  G4double E1=lastTM*(theB1+lastTM*theSS);
670  G4double R1=(1.-std::exp(-E1));
671  G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
672  G4double tm2=lastTM*lastTM;
673  G4double E2=lastTM*tm2*theB2; // power 3 for lowA, 5 for HighA (1st)
674  if(a>6.5)E2*=tm2; // for heavy nuclei
675  G4double R2=(1.-std::exp(-E2));
676  G4double E3=lastTM*theB3;
677  if(a>6.5)E3*=tm2*tm2*tm2; // power 1 for lowA, 7 (2nd) for HighA
678  G4double R3=(1.-std::exp(-E3));
679  G4double E4=lastTM*theB4;
680  G4double R4=(1.-std::exp(-E4));
681  G4double I1=R1*theS1;
682  G4double I2=R2*theS2;
683  G4double I3=R3*theS3;
684  G4double I4=R4*theS4;
685  G4double I12=I1+I2;
686  G4double I13=I12+I3;
687  G4double rand=(I13+I4)*G4UniformRand();
688  if(rand<I1)
689  {
690  G4double ran=R1*G4UniformRand();
691  if(ran>1.) ran=1.;
692  q2=-std::log(1.-ran)/theB1;
693  if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss;
694  }
695  else if(rand<I12)
696  {
697  G4double ran=R2*G4UniformRand();
698  if(ran>1.) ran=1.;
699  q2=-std::log(1.-ran)/theB2;
700  if(q2<0.) q2=0.;
701  if(a<6.5) q2=std::pow(q2,third);
702  else q2=std::pow(q2,fifth);
703  }
704  else if(rand<I13)
705  {
706  G4double ran=R3*G4UniformRand();
707  if(ran>1.) ran=1.;
708  q2=-std::log(1.-ran)/theB3;
709  if(q2<0.) q2=0.;
710  if(a>6.5) q2=std::pow(q2,sevth);
711  }
712  else
713  {
714  G4double ran=R4*G4UniformRand();
715  if(ran>1.) ran=1.;
716  q2=-std::log(1.-ran)/theB4;
717  if(a<6.5) q2=lastTM-q2; // u reduced for lightA (starts from 0)
718  }
719  }
720  if(q2<0.) q2=0.;
721  if(!(q2>=-1.||q2<=1.)) G4cout<<"*NAN*G4QElasticCrossSect::GetExchangeT: -t="<<q2<<G4endl;
722  if(q2>lastTM)
723  {
724  q2=lastTM;
725  }
726  return q2*GeVSQ;
727 }
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
static constexpr double gigaelectronvolt
Definition: G4SIunits.hh:209
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

G4double G4ChipsProtonElasticXS::GetHMaxT ( )

Definition at line 752 of file G4ChipsProtonElasticXS.cc.

753 {
754  static const G4double HGeVSQ=gigaelectronvolt*gigaelectronvolt/2.;
755  return lastTM*HGeVSQ;
756 }
static constexpr double gigaelectronvolt
Definition: G4SIunits.hh:209
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

G4double G4ChipsProtonElasticXS::GetIsoCrossSection ( const G4DynamicParticle Pt,
G4int  tgZ,
G4int  A,
const G4Isotope iso = 0,
const G4Element elm = 0,
const G4Material mat = 0 
)
virtual

Reimplemented from G4VCrossSectionDataSet.

Definition at line 163 of file G4ChipsProtonElasticXS.cc.

167 {
168  G4double pMom=Pt->GetTotalMomentum();
169  G4int tgN = A - tgZ;
170 
171  return GetChipsCrossSection(pMom, tgZ, tgN, 2212);
172 }
int G4int
Definition: G4Types.hh:78
G4double GetTotalMomentum() const
double A(double temperature)
double G4double
Definition: G4Types.hh:76
virtual G4double GetChipsCrossSection(G4double momentum, G4int Z, G4int N, G4int pdg)

Here is the call graph for this function:

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

Reimplemented from G4VCrossSectionDataSet.

Definition at line 155 of file G4ChipsProtonElasticXS.cc.

158 {
159  return true;
160 }

The documentation for this class was generated from the following files: