60 model(mod), material(mat), nbins(bins), cutEnergy(-1.0),
61 lowEnergy(emin), highEnergy(emax)
66 element = (*theElementVector)[0];
67 if(nElmMinusOne > 0) {
70 xSections.push_back(v0);
72 for(
G4int i=1; i<n; ++i) {
74 xSections.push_back(v);
84 if(nElmMinusOne > 0) {
85 for(
G4int i=0; i<=nElmMinusOne; ++i) {
97 if(0 == nElmMinusOne || cut == cutEnergy) {
return; }
106 for(
G4int j=0; j<=nbins; ++j) {
107 G4double e = (xSections[0])->Energy(j);
111 for (
G4int i=0; i<=nElmMinusOne; ++i) {
112 cross += theAtomNumDensityVector[i]*
115 xSections[i]->PutValue(j, cross);
120 if(0.0 == (*xSections[nElmMinusOne])[0]) {
121 for (
G4int i=0; i<=nElmMinusOne; ++i) {
122 xSections[i]->PutValue(0, (*xSections[i])[1]);
126 if(0.0 == (*xSections[nElmMinusOne])[nbins]) {
127 for (
G4int i=0; i<=nElmMinusOne; ++i) {
128 xSections[i]->PutValue(nbins, (*xSections[i])[nbins-1]);
132 for(
G4int j=0; j<=nbins; ++j) {
133 cross = (*xSections[nElmMinusOne])[j];
136 for (
G4int i=0; i<nElmMinusOne; ++i) {
137 G4double x = (*xSections[i])[j]/cross;
138 xSections[i]->PutValue(j, x);
149 G4cout <<
"======== G4EmElementSelector for the " << model->
GetName();
152 if(0 < nElmMinusOne) {
153 for(
G4int i=0; i<nElmMinusOne; i++) {
154 G4cout <<
" " << (*theElementVector)[i]->GetName() <<
" : " <<
G4endl;
158 G4cout <<
"Last Element in element vector "
159 << (*theElementVector)[nElmMinusOne]->GetName()
G4DLLIMPORT std::ostream G4cout
void Initialise(const G4ParticleDefinition *, G4double cut=0.0)
void Dump(const G4ParticleDefinition *p=0)
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