Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4eIonisationCrossSectionHandler Class Reference

#include <G4eIonisationCrossSectionHandler.hh>

+ Inheritance diagram for G4eIonisationCrossSectionHandler:

Public Member Functions

 G4eIonisationCrossSectionHandler (const G4VEnergySpectrum *spec, G4VDataSetAlgorithm *alg, G4double emin, G4double emax, G4int nbin)
 
 ~G4eIonisationCrossSectionHandler ()
 
G4double GetCrossSectionAboveThresholdForElement (G4double energy, G4double cutEnergy, G4int Z)
 
G4eIonisationCrossSectionHandleroperator= (const G4eIonisationCrossSectionHandler &right)=delete
 
 G4eIonisationCrossSectionHandler (const G4eIonisationCrossSectionHandler &)=delete
 
- Public Member Functions inherited from G4VCrossSectionHandler
 G4VCrossSectionHandler ()
 
 G4VCrossSectionHandler (G4VDataSetAlgorithm *interpolation, G4double minE=250 *CLHEP::eV, G4double maxE=100 *CLHEP::GeV, G4int nBins=200, G4double unitE=CLHEP::MeV, G4double unitData=CLHEP::barn, G4int minZ=1, G4int maxZ=99)
 
virtual ~G4VCrossSectionHandler ()
 
void Initialise (G4VDataSetAlgorithm *interpolation=nullptr, G4double minE=250 *CLHEP::eV, G4double maxE=100 *CLHEP::GeV, G4int numberOfBins=200, G4double unitE=CLHEP::MeV, G4double unitData=CLHEP::barn, G4int minZ=1, G4int maxZ=99)
 
G4int SelectRandomAtom (const G4MaterialCutsCouple *couple, G4double e) const
 
const G4ElementSelectRandomElement (const G4MaterialCutsCouple *material, G4double e) const
 
G4int SelectRandomShell (G4int Z, G4double e) const
 
G4VEMDataSetBuildMeanFreePathForMaterials (const G4DataVector *energyCuts=nullptr)
 
G4double FindValue (G4int Z, G4double e) const
 
G4double FindValue (G4int Z, G4double e, G4int shellIndex) const
 
G4double ValueForMaterial (const G4Material *material, G4double e) const
 
void LoadData (const G4String &dataFile)
 
void LoadNonLogData (const G4String &dataFile)
 
void LoadShellData (const G4String &dataFile)
 
void PrintData () const
 
void Clear ()
 
 G4VCrossSectionHandler (const G4VCrossSectionHandler &)=delete
 
G4VCrossSectionHandleroperator= (const G4VCrossSectionHandler &right)=delete
 

Protected Member Functions

std::vector< G4VEMDataSet * > * BuildCrossSectionsForMaterials (const G4DataVector &energyVector, const G4DataVector *energyCuts) override
 
- Protected Member Functions inherited from G4VCrossSectionHandler
G4int NumberOfComponents (G4int Z) const
 
void ActiveElements ()
 
virtual G4VDataSetAlgorithmCreateInterpolation ()
 
const G4VDataSetAlgorithmGetInterpolation () const
 

Detailed Description

Definition at line 59 of file G4eIonisationCrossSectionHandler.hh.

Constructor & Destructor Documentation

◆ G4eIonisationCrossSectionHandler() [1/2]

G4eIonisationCrossSectionHandler::G4eIonisationCrossSectionHandler ( const G4VEnergySpectrum * spec,
G4VDataSetAlgorithm * alg,
G4double emin,
G4double emax,
G4int nbin )
explicit

Definition at line 72 of file G4eIonisationCrossSectionHandler.cc.

76 theParam(spec),verbose(0)
77{
78 G4VCrossSectionHandler::Initialise(alg, emin, emax, nbin);
79 interp = new G4LinLogLogInterpolation();
80}
void Initialise(G4VDataSetAlgorithm *interpolation=nullptr, G4double minE=250 *CLHEP::eV, G4double maxE=100 *CLHEP::GeV, G4int numberOfBins=200, G4double unitE=CLHEP::MeV, G4double unitData=CLHEP::barn, G4int minZ=1, G4int maxZ=99)

◆ ~G4eIonisationCrossSectionHandler()

G4eIonisationCrossSectionHandler::~G4eIonisationCrossSectionHandler ( )

Definition at line 84 of file G4eIonisationCrossSectionHandler.cc.

85{
86 delete interp;
87}

◆ G4eIonisationCrossSectionHandler() [2/2]

G4eIonisationCrossSectionHandler::G4eIonisationCrossSectionHandler ( const G4eIonisationCrossSectionHandler & )
delete

Member Function Documentation

◆ BuildCrossSectionsForMaterials()

std::vector< G4VEMDataSet * > * G4eIonisationCrossSectionHandler::BuildCrossSectionsForMaterials ( const G4DataVector & energyVector,
const G4DataVector * energyCuts )
overrideprotectedvirtual

Implements G4VCrossSectionHandler.

Definition at line 91 of file G4eIonisationCrossSectionHandler.cc.

94{
95 std::vector<G4VEMDataSet*>* set = new std::vector<G4VEMDataSet*>;
96
97 G4DataVector* energies;
98 G4DataVector* cs;
99
100 G4DataVector* log_energies;
101 G4DataVector* log_cs;
102
103 std::size_t nOfBins = energyVector.size();
104
105 const G4ProductionCutsTable* theCoupleTable=
107 G4int numOfCouples = (G4int)theCoupleTable->GetTableSize();
108
109 for (G4int mLocal=0; mLocal<numOfCouples; ++mLocal) {
110
111 const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(mLocal);
112 const G4Material* material= couple->GetMaterial();
113 const G4ElementVector* elementVector = material->GetElementVector();
114 const G4double* nAtomsPerVolume = material->GetAtomicNumDensityVector();
115 G4int nElements = (G4int)material->GetNumberOfElements();
116
117 if(verbose > 0)
118 {
119 G4cout << "eIonisation CS for " << mLocal << "th material "
120 << material->GetName()
121 << " eEl= " << nElements << G4endl;
122 }
123
124 G4double tcut = (*energyCuts)[mLocal];
125
126 G4VDataSetAlgorithm* algo = interp->Clone();
127 G4VEMDataSet* setForMat = new G4CompositeEMDataSet(algo,1.,1.);
128
129 for (G4int i=0; i<nElements; ++i) {
130
131 G4int Z = (G4int) (*elementVector)[i]->GetZ();
132 G4int nShells = NumberOfComponents(Z);
133
134 energies = new G4DataVector;
135 cs = new G4DataVector;
136
137 log_energies = new G4DataVector;
138 log_cs = new G4DataVector;
139
140 G4double density = nAtomsPerVolume[i];
141
142 for (std::size_t bin=0; bin<nOfBins; ++bin) {
143
144 G4double e = energyVector[bin];
145 energies->push_back(e);
146 log_energies->push_back(std::log10(e));
147 G4double value = 0.0;
148 G4double log_value = -300;
149
150 if(e > tcut) {
151 for (G4int n=0; n<nShells; n++) {
152 G4double cross = FindValue(Z, e, n);
153 G4double p = theParam->Probability(Z, tcut, e, e, n);
154 value += cross * p * density;
155
156 if(verbose>0 && mLocal == 0 && e>=1. && e<=0.)
157 {
158 G4cout << "G4eIonCrossSH: e(MeV)= " << e/MeV
159 << " n= " << n
160 << " cross= " << cross
161 << " p= " << p
162 << " value= " << value
163 << " tcut(MeV)= " << tcut/MeV
164 << " rho= " << density
165 << " Z= " << Z
166 << G4endl;
167 }
168 }
169 if (value == 0.) value = 1e-300;
170 log_value = std::log10(value);
171 }
172 cs->push_back(value);
173 log_cs->push_back(log_value);
174 }
175 G4VDataSetAlgorithm* algoLocal = interp->Clone();
176 G4VEMDataSet* elSet = new G4EMDataSet(i,energies,cs,log_energies,log_cs,algoLocal,1.,1.);
177
178 setForMat->AddComponent(elSet);
179 }
180 set->push_back(setForMat);
181 }
182
183 return set;
184}
std::vector< const G4Element * > G4ElementVector
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
const G4Material * GetMaterial() const
const G4ElementVector * GetElementVector() const
const G4double * GetAtomicNumDensityVector() const
std::size_t GetNumberOfElements() const
const G4String & GetName() const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
G4double FindValue(G4int Z, G4double e) const
G4int NumberOfComponents(G4int Z) const
virtual G4VDataSetAlgorithm * Clone() const =0
virtual void AddComponent(G4VEMDataSet *dataSet)=0
virtual G4double Probability(G4int Z, G4double minKineticEnergy, G4double maxKineticEnergy, G4double kineticEnergy, G4int shell=0, const G4ParticleDefinition *pd=nullptr) const =0

◆ GetCrossSectionAboveThresholdForElement()

G4double G4eIonisationCrossSectionHandler::GetCrossSectionAboveThresholdForElement ( G4double energy,
G4double cutEnergy,
G4int Z )

Definition at line 188 of file G4eIonisationCrossSectionHandler.cc.

191{
192 G4int nShells = NumberOfComponents(Z);
193 G4double value = 0.;
194 if(energy > cutEnergy)
195 {
196 for (G4int n=0; n<nShells; ++n) {
197 G4double cross = FindValue(Z, energy, n);
198 G4double p = theParam->Probability(Z, cutEnergy, energy, energy, n);
199 value += cross * p;
200 }
201 }
202 return value;
203}

Referenced by G4LivermoreIonisationModel::ComputeCrossSectionPerAtom().

◆ operator=()

G4eIonisationCrossSectionHandler & G4eIonisationCrossSectionHandler::operator= ( const G4eIonisationCrossSectionHandler & right)
delete

The documentation for this class was generated from the following files: