Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PiData Class Reference

#include <G4PiData.hh>

+ Inheritance diagram for G4PiData:

Classes

struct  Delete
 

Public Member Functions

 G4PiData (const G4double *aTotal, const G4double *aInelastic, const G4double *anEnergy, G4int nPoints)
 
G4bool AppliesTo (G4double kineticEnergy)
 
G4double ReactionXSection (G4double kineticEnergy)
 
G4double ElasticXSection (G4double kineticEnergy)
 
G4double TotalXSection (G4double kineticEnergy)
 

Detailed Description

Definition at line 35 of file G4PiData.hh.

Constructor & Destructor Documentation

◆ G4PiData()

G4PiData::G4PiData ( const G4double aTotal,
const G4double aInelastic,
const G4double anEnergy,
G4int  nPoints 
)

Definition at line 37 of file G4PiData.cc.

39{
40 G4int i=0;
41
42 for( i = 0; i < nP; i++ )
43 {
44 std::pair<G4double, G4double> x;
45 x.first=aT[i]*millibarn;
46 x.second=aIn[i]*millibarn;
47 std::pair<G4double, std::pair<G4double, G4double > > aP;
48 aP.first=anE[i]*GeV;
49 aP.second=x;
50 push_back(aP);
51 }
52}
int G4int
Definition: G4Types.hh:66

Member Function Documentation

◆ AppliesTo()

G4bool G4PiData::AppliesTo ( G4double  kineticEnergy)

Definition at line 56 of file G4PiData.cc.

57{
58 G4bool result = true;
59 if(kineticEnergy>back().first) result = false;
60 return result;
61}
bool G4bool
Definition: G4Types.hh:67

◆ ElasticXSection()

G4double G4PiData::ElasticXSection ( G4double  kineticEnergy)

Definition at line 87 of file G4PiData.cc.

88{
89 G4double result = 0;
90 G4PiData::iterator it=begin();
91 while(it!=end()&&kineticEnergy>(*it).first) {it++;}
92 if(it==end())
93 {
94 throw G4HadronicException(__FILE__, __LINE__,
95 "G4PiData::ElasticXSection: used outside validity range");
96 }
97 if(it==begin()) it++;
98 G4double x1,x2,e1,e2;
99 e1=(*(it-1)).first;
100 x1=(*(it-1)).second.first - (*(it-1)).second.second;
101 e2=(*(it)).first;
102 x2=(*(it)).second.first - (*(it)).second.second;
103 result = std::max(0., x1 + (kineticEnergy-e1)*(x2-x1)/(e2-e1));
104 return result;
105}
double G4double
Definition: G4Types.hh:64

◆ ReactionXSection()

G4double G4PiData::ReactionXSection ( G4double  kineticEnergy)

Definition at line 65 of file G4PiData.cc.

66{
67 G4double result = 0;
68 G4PiData::iterator it=begin();
69 while(it!=end()&&kineticEnergy>(*it).first) {it++;}
70 if(it==end())
71 {
72 throw G4HadronicException(__FILE__, __LINE__,
73 "G4PiData::ReactionXSection: used outside validity range");
74 }
75 if(it==begin()) it++;
76 G4double x1,x2,e1,e2;
77 e1=(*(it-1)).first;
78 x1=(*(it-1)).second.second;
79 e2=(*(it)).first;
80 x2=(*(it)).second.second;
81 result = std::max(0., x1 + (kineticEnergy-e1)*(x2-x1)/(e2-e1));
82 return result;
83}

◆ TotalXSection()

G4double G4PiData::TotalXSection ( G4double  kineticEnergy)

Definition at line 109 of file G4PiData.cc.

110{
111 G4double result = 0;
112 G4PiData::iterator it=begin();
113 while(it!=end()&&kineticEnergy>(*it).first) {it++;}
114 if(it==end())
115 {
116 throw G4HadronicException(__FILE__, __LINE__,
117 "G4PiData::TotalXSection: used outside validity range");
118 }
119 if(it==begin()) it++;
120 G4double x1,x2,e1,e2;
121 e1=(*(it-1)).first;
122 x1=(*(it-1)).second.first;
123 e2=(*(it)).first;
124 x2=(*(it)).second.first;
125 result = std::max(0., x1 + (kineticEnergy-e1)*(x2-x1)/(e2-e1));
126 return result;
127}

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