60 model(mod), material(mat), nbins(bins), cutEnergy(-1.0),
61 lowEnergy(emin), highEnergy(emax)
66 if(nElmMinusOne > 0) {
69 xSections.push_back(v0);
71 for(
G4int i=1; i<n; ++i) {
73 xSections.push_back(v);
87 if(nElmMinusOne > 0) {
88 for(
G4int i=0; i<=nElmMinusOne; ++i) {
delete xSections[i]; }
99 if(0 == nElmMinusOne || cut == cutEnergy) {
return; }
105 const G4double* theAtomNumDensityVector =
109 for(
G4int j=0; j<=nbins; ++j) {
110 G4double e = (xSections[0])->Energy(j);
114 for (
G4int i=0; i<=nElmMinusOne; ++i) {
115 cross += theAtomNumDensityVector[i]*
118 xSections[i]->PutValue(j, cross);
123 if(0.0 == (*xSections[nElmMinusOne])[0]) {
124 for (
G4int i=0; i<=nElmMinusOne; ++i) {
125 xSections[i]->PutValue(0, (*xSections[i])[1]);
129 if(0.0 == (*xSections[nElmMinusOne])[nbins]) {
130 for (
G4int i=0; i<=nElmMinusOne; ++i) {
131 xSections[i]->PutValue(nbins, (*xSections[i])[nbins-1]);
135 for(
G4int j=0; j<=nbins; ++j) {
136 cross = (*xSections[nElmMinusOne])[j];
139 for (
G4int i=0; i<nElmMinusOne; ++i) {
140 G4double x = (*xSections[i])[j]/cross;
141 xSections[i]->PutValue(j, x);
153 G4cout <<
"======== G4EmElementSelector for the " << model->
GetName();
156 if(0 < nElmMinusOne) {
157 for(
G4int i=0; i<nElmMinusOne; i++) {
158 G4cout <<
" " << (*theElementVector)[i]->GetName() <<
" : " <<
G4endl;
162 G4cout <<
"Last Element in element vector "
163 << (*theElementVector)[nElmMinusOne]->GetName()
G4GLOB_DLL std::ostream G4cout
void Initialise(const G4ParticleDefinition *, G4double cut=0.0)
void Dump(const G4ParticleDefinition *p=nullptr)
G4EmElementSelector(G4VEmModel *, const G4Material *, G4int bins, G4double emin, G4double emax, G4bool spline=true)
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
const G4double * GetVecNbOfAtomsPerVolume() const
const G4String & GetName() const
const G4String & GetParticleName() const
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
virtual void SetupForMaterial(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
const G4String & GetName() const