60 model(mod), material(mat), nbins(bins), cutEnergy(-1.0),
61 lowEnergy(emin), highEnergy(emax)
66 if(nElmMinusOne > 0) {
69 xSections.push_back(v0);
70 for(
G4int i=1; i<n; ++i) {
72 xSections.push_back(v);
98 if(0 == nElmMinusOne || cut == cutEnergy) {
return; }
104 const G4double* theAtomNumDensityVector =
108 for(
G4int j=0; j<=nbins; ++j) {
109 G4double e = (xSections[0])->Energy(j);
113 for (
G4int i=0; i<=nElmMinusOne; ++i) {
114 cross += theAtomNumDensityVector[i]*
117 xSections[i]->PutValue(j, cross);
121 if(0.0 == (*xSections[nElmMinusOne])[0]) {
122 for (
G4int i=0; i<=nElmMinusOne; ++i) {
123 xSections[i]->PutValue(0, (*xSections[i])[1]);
127 if(0.0 == (*xSections[nElmMinusOne])[nbins]) {
128 for (
G4int i=0; i<=nElmMinusOne; ++i) {
129 xSections[i]->PutValue(nbins, (*xSections[i])[nbins-1]);
133 for(
G4int j=0; j<=nbins; ++j) {
134 cross = (*xSections[nElmMinusOne])[j];
137 for (
G4int i=0; i<nElmMinusOne; ++i) {
138 G4double x = (*xSections[i])[j]/cross;
139 xSections[i]->PutValue(j, x);
159 const G4Element* element = (*theElementVector)[nElmMinusOne];
160 if (nElmMinusOne > 0) {
167 if(e <= (xSections[0])->Energy(0)) {
168 ekin = (xSections[0])->Energy(0);
169 }
else if(e < (xSections[0])->GetMaxEnergy()) {
170 idx = (xSections[0])->ComputeLogVectorBin(loge);
172 ekin = (xSections[0])->GetMaxEnergy();
173 idx = (xSections[0])->GetVectorLength() - 2;
176 const G4double x1 = (xSections[0])->Energy(idx);
177 const G4double a = (ekin - x1)/((xSections[0])->Energy(idx+1) - x1);
179 for (
G4int i = 0; i < nElmMinusOne; ++i) {
180 const G4double y1 = (*xSections[i])[idx];
181 if (urnd <= y1 + a*((*xSections[i])[idx+1] - y1)) {
182 element = (*theElementVector)[i];
const G4String & GetParticleName() const
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)