26#ifndef G4CrossSectionBuffer_h
27#define G4CrossSectionBuffer_h
41 : theA(aA), theB(aB) {}
48 if(aB == theB) result =
true;
52 if(aB == theA) result =
true;
59 std::pair<G4double, G4double> aNew;
62 theData.push_back(aNew);
70 if(theData.size()==1)
return theData[theData.size()-1].second;
72 for(
size_t i=0; i<theData.size(); i++)
74 if(theData[i].first>sqrts)
78 x1 = theData[i].first;
79 y1 = theData[i].second;
80 x2 = theData[i+1].first;
81 y2 = theData[i+1].second;
83 else if(theData.size()-1==i)
85 x1 = theData[theData.size()-2].first;
86 y1 = theData[theData.size()-2].second;
87 x2 = theData[theData.size()-1].first;
88 y2 = theData[theData.size()-1].second;
92 x1 = theData[i-1].first;
93 y1 = theData[i-1].second;
94 x2 = theData[i].first;
95 y2 = theData[i].second;
102 G4double result = y1 + (sqrts-x1) * (y2-y1)/(x2-x1);
103 if(result<0) result = 0;
104 if(y1<0.01*CLHEP::millibarn) result = 0;
110 for(
size_t i=0;i<theData.size(); i++)
112 G4cerr <<
"sqrts = "<<theData[i].first<<
", X = "<<theData[i].second/CLHEP::millibarn<<
G4endl;
117 std::vector<std::pair<G4double, G4double> > theData;
G4DLLIMPORT std::ostream G4cerr
G4bool InCharge(const G4ParticleDefinition *aA, const G4ParticleDefinition *aB) const
void push_back(G4double S, G4double x)
G4CrossSectionBuffer(const G4ParticleDefinition *aA, const G4ParticleDefinition *aB)
G4double CrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
const G4LorentzVector & Get4Momentum() const