#include <G4PiData.hh>
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) |
Data Structures | |
struct | Delete |
Definition at line 35 of file G4PiData.hh.
G4PiData::G4PiData | ( | const G4double * | aTotal, | |
const G4double * | aInelastic, | |||
const G4double * | anEnergy, | |||
G4int | nPoints | |||
) |
Definition at line 37 of file G4PiData.cc.
00039 { 00040 G4int i=0; 00041 00042 for( i = 0; i < nP; i++ ) 00043 { 00044 std::pair<G4double, G4double> x; 00045 x.first=aT[i]*millibarn; 00046 x.second=aIn[i]*millibarn; 00047 std::pair<G4double, std::pair<G4double, G4double > > aP; 00048 aP.first=anE[i]*GeV; 00049 aP.second=x; 00050 push_back(aP); 00051 } 00052 }
Definition at line 56 of file G4PiData.cc.
00057 { 00058 G4bool result = true; 00059 if(kineticEnergy>back().first) result = false; 00060 return result; 00061 }
Definition at line 87 of file G4PiData.cc.
00088 { 00089 G4double result = 0; 00090 G4PiData::iterator it=begin(); 00091 while(it!=end()&&kineticEnergy>(*it).first) {it++;} 00092 if(it==end()) 00093 { 00094 throw G4HadronicException(__FILE__, __LINE__, 00095 "G4PiData::ElasticXSection: used outside validity range"); 00096 } 00097 if(it==begin()) it++; 00098 G4double x1,x2,e1,e2; 00099 e1=(*(it-1)).first; 00100 x1=(*(it-1)).second.first - (*(it-1)).second.second; 00101 e2=(*(it)).first; 00102 x2=(*(it)).second.first - (*(it)).second.second; 00103 result = std::max(0., x1 + (kineticEnergy-e1)*(x2-x1)/(e2-e1)); 00104 return result; 00105 }
Definition at line 65 of file G4PiData.cc.
00066 { 00067 G4double result = 0; 00068 G4PiData::iterator it=begin(); 00069 while(it!=end()&&kineticEnergy>(*it).first) {it++;} 00070 if(it==end()) 00071 { 00072 throw G4HadronicException(__FILE__, __LINE__, 00073 "G4PiData::ReactionXSection: used outside validity range"); 00074 } 00075 if(it==begin()) it++; 00076 G4double x1,x2,e1,e2; 00077 e1=(*(it-1)).first; 00078 x1=(*(it-1)).second.second; 00079 e2=(*(it)).first; 00080 x2=(*(it)).second.second; 00081 result = std::max(0., x1 + (kineticEnergy-e1)*(x2-x1)/(e2-e1)); 00082 return result; 00083 }
Definition at line 109 of file G4PiData.cc.
00110 { 00111 G4double result = 0; 00112 G4PiData::iterator it=begin(); 00113 while(it!=end()&&kineticEnergy>(*it).first) {it++;} 00114 if(it==end()) 00115 { 00116 throw G4HadronicException(__FILE__, __LINE__, 00117 "G4PiData::TotalXSection: used outside validity range"); 00118 } 00119 if(it==begin()) it++; 00120 G4double x1,x2,e1,e2; 00121 e1=(*(it-1)).first; 00122 x1=(*(it-1)).second.first; 00123 e2=(*(it)).first; 00124 x2=(*(it)).second.first; 00125 result = std::max(0., x1 + (kineticEnergy-e1)*(x2-x1)/(e2-e1)); 00126 return result; 00127 }