Import Geant4 8.3.0 source tree
This commit is contained in:
@@ -23,18 +23,21 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
// --------------------------------------------------------------------
|
||||
// by J.P Wellisch, Sun Sep 15 2002.
|
||||
|
||||
#include "G4PiData.hh"
|
||||
|
||||
G4PiData::
|
||||
G4PiData(const G4double * aT, const G4double * aIn, const G4double * anE, G4int nP)
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
G4PiData::G4PiData(const G4double * aT, const G4double * aIn,
|
||||
const G4double * anE, G4int nP)
|
||||
{
|
||||
G4int i=0;
|
||||
for(i=0; i<nP; i++)
|
||||
|
||||
for( i = 0; i < nP; i++ )
|
||||
{
|
||||
std::pair<G4double, G4double> x;
|
||||
x.first=aT[i]*millibarn;
|
||||
@@ -46,16 +49,18 @@ G4PiData(const G4double * aT, const G4double * aIn, const G4double * anE, G4int
|
||||
}
|
||||
}
|
||||
|
||||
G4bool G4PiData::
|
||||
AppliesTo(G4double kineticEnergy)
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
G4bool G4PiData::AppliesTo(G4double kineticEnergy)
|
||||
{
|
||||
G4bool result = true;
|
||||
if(kineticEnergy>back().first) result = false;
|
||||
return result;
|
||||
}
|
||||
|
||||
G4double G4PiData::
|
||||
ReactionXSection(G4double kineticEnergy)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
G4double G4PiData::ReactionXSection(G4double kineticEnergy)
|
||||
{
|
||||
G4double result = 0;
|
||||
G4PiData::iterator it=begin();
|
||||
@@ -75,8 +80,9 @@ ReactionXSection(G4double kineticEnergy)
|
||||
return result;
|
||||
}
|
||||
|
||||
G4double G4PiData::
|
||||
ElasticXSection(G4double kineticEnergy)
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
G4double G4PiData::ElasticXSection(G4double kineticEnergy)
|
||||
{
|
||||
G4double result = 0;
|
||||
G4PiData::iterator it=begin();
|
||||
@@ -95,3 +101,25 @@ ElasticXSection(G4double kineticEnergy)
|
||||
result = std::max(0., x1 + (kineticEnergy-e1)*(x2-x1)/(e2-e1));
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
G4double G4PiData::TotalXSection(G4double kineticEnergy)
|
||||
{
|
||||
G4double result = 0;
|
||||
G4PiData::iterator it=begin();
|
||||
while(it!=end()&&kineticEnergy>(*it).first) {it++;}
|
||||
if(it==end())
|
||||
{
|
||||
G4Exception("G4PiData", "007", FatalException,
|
||||
"ElasticXSection used outside validity range");
|
||||
}
|
||||
if(it==begin()) it++;
|
||||
G4double x1,x2,e1,e2;
|
||||
e1=(*(it-1)).first;
|
||||
x1=(*(it-1)).second.first;
|
||||
e2=(*(it)).first;
|
||||
x2=(*(it)).second.first;
|
||||
result = std::max(0., x1 + (kineticEnergy-e1)*(x2-x1)/(e2-e1));
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user