#include <G4PixeCrossSectionHandler.hh>
|
| G4PixeCrossSectionHandler () |
|
| G4PixeCrossSectionHandler (G4IInterpolator *interpolation, const G4String &modelK="ecpssr", const G4String &modelL="ecpssr", const G4String &modelM="ecpssr", G4double minE=1 *CLHEP::keV, G4double maxE=0.1 *CLHEP::GeV, G4int nBins=200, G4double unitE=CLHEP::MeV, G4double unitData=CLHEP::barn, G4int minZ=6, G4int maxZ=92) |
|
virtual | ~G4PixeCrossSectionHandler () |
|
void | Initialise (G4IInterpolator *interpolation, const G4String &modelK="ecpssr", const G4String &modelL="ecpssr", const G4String &modelM="ecpssr", G4double minE=1 *CLHEP::keV, G4double maxE=0.1 *CLHEP::GeV, G4int nBins=200, G4double unitE=CLHEP::MeV, G4double unitData=CLHEP::barn, G4int minZ=6, G4int maxZ=92) |
|
G4int | SelectRandomAtom (const G4Material *material, G4double e) const |
|
G4int | SelectRandomShell (G4int Z, G4double e) const |
|
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 | LoadShellData (const G4String &dataFile) |
|
G4double | MicroscopicCrossSection (const G4ParticleDefinition *particleDef, G4double kineticEnergy, G4double Z, G4double deltaCut) const |
|
void | PrintData () const |
|
void | Clear () |
|
◆ G4PixeCrossSectionHandler() [1/2]
G4PixeCrossSectionHandler::G4PixeCrossSectionHandler |
( |
| ) |
|
Definition at line 61 of file G4PixeCrossSectionHandler.cc.
62{
63 crossSections = 0;
64 interpolation = 0;
65
66 Initialise(0,
"",
"",
"",1.*keV,0.1*GeV,200,MeV,barn,6,92);
67 ActiveElements();
68}
void Initialise(G4IInterpolator *interpolation, const G4String &modelK="ecpssr", const G4String &modelL="ecpssr", const G4String &modelM="ecpssr", G4double minE=1 *CLHEP::keV, G4double maxE=0.1 *CLHEP::GeV, G4int nBins=200, G4double unitE=CLHEP::MeV, G4double unitData=CLHEP::barn, G4int minZ=6, G4int maxZ=92)
◆ G4PixeCrossSectionHandler() [2/2]
G4PixeCrossSectionHandler::G4PixeCrossSectionHandler |
( |
G4IInterpolator * | interpolation, |
|
|
const G4String & | modelK = "ecpssr", |
|
|
const G4String & | modelL = "ecpssr", |
|
|
const G4String & | modelM = "ecpssr", |
|
|
G4double | minE = 1*CLHEP::keV, |
|
|
G4double | maxE = 0.1*CLHEP::GeV, |
|
|
G4int | nBins = 200, |
|
|
G4double | unitE = CLHEP::MeV, |
|
|
G4double | unitData = CLHEP::barn, |
|
|
G4int | minZ = 6, |
|
|
G4int | maxZ = 92 ) |
Definition at line 71 of file G4PixeCrossSectionHandler.cc.
82 : interpolation(algorithm), eMin(minE), eMax(maxE), nBins(bins),
83 unit1(unitE), unit2(unitData), zMin(minZ), zMax(maxZ)
84{
85 crossSections = 0;
86
87 crossModel.push_back(modelK);
88 crossModel.push_back(modelL);
89 crossModel.push_back(modelM);
90
91
92
93
94
95 ActiveElements();
96}
◆ ~G4PixeCrossSectionHandler()
G4PixeCrossSectionHandler::~G4PixeCrossSectionHandler |
( |
| ) |
|
|
virtual |
Definition at line 98 of file G4PixeCrossSectionHandler.cc.
99{
100 delete interpolation;
101 interpolation = 0;
102 std::map<G4int,G4IDataSet*,std::less<G4int> >::iterator
pos;
103
104 for (pos = dataMap.begin(); pos != dataMap.end(); ++pos)
105 {
106
107
108
109
111 delete dataSet;
112 }
113
114 if (crossSections != 0)
115 {
116 std::size_t
n = crossSections->size();
117 for (std::size_t i=0; i<
n; ++i)
118 {
119 delete (*crossSections)[i];
120 }
121 delete crossSections;
122 crossSections = 0;
123 }
124}
◆ Clear()
void G4PixeCrossSectionHandler::Clear |
( |
| ) |
|
Definition at line 210 of file G4PixeCrossSectionHandler.cc.
211{
212
213 std::map<G4int,G4IDataSet*,std::less<G4int> >::iterator
pos;
214
215 if(! dataMap.empty())
216 {
217 for (pos = dataMap.begin(); pos != dataMap.end(); ++pos)
218 {
219
220
221
222
224 delete dataSet;
225 dataSet = 0;
226 G4int i = (*pos).first;
227 dataMap[i] = 0;
228 }
229 dataMap.clear();
230 }
231
232 activeZ.clear();
233 ActiveElements();
234}
◆ FindValue() [1/2]
Definition at line 236 of file G4PixeCrossSectionHandler.cc.
237{
239
240 std::map<G4int,G4IDataSet*,std::less<G4int> >::const_iterator
pos;
241 pos = dataMap.find(Z);
242 if (pos!= dataMap.end())
243 {
244
245
246
247
250 }
251 else
252 {
253 G4cout <<
"WARNING: G4PixeCrossSectionHandler::FindValue(Z,e) did not find Z = "
255 }
256 return value;
257}
G4GLOB_DLL std::ostream G4cout
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
Referenced by SelectRandomShell(), and ValueForMaterial().
◆ FindValue() [2/2]
Definition at line 259 of file G4PixeCrossSectionHandler.cc.
261{
263
264 std::map<G4int,G4IDataSet*,std::less<G4int> >::const_iterator
pos;
265 pos = dataMap.find(Z);
266 if (pos!= dataMap.end())
267 {
268
269
270
271
273 if (shellIndex >= 0)
274 {
276 if(shellIndex < nComponents)
277
279 else
280 {
281 G4cout <<
"WARNING: G4PixeCrossSectionHandler::FindValue(Z,e,shell) did not find"
282 << " shellIndex= " << shellIndex
283 << " for Z= "
285 }
286 } else {
288 }
289 }
290 else
291 {
292 G4cout <<
"WARNING: G4PixeCrossSectionHandler::FindValue did not find Z = "
294 }
295 return value;
296}
virtual const G4IDataSet * GetComponent(G4int componentId) const =0
virtual size_t NumberOfComponents(void) const =0
◆ Initialise()
void G4PixeCrossSectionHandler::Initialise |
( |
G4IInterpolator * | interpolation, |
|
|
const G4String & | modelK = "ecpssr", |
|
|
const G4String & | modelL = "ecpssr", |
|
|
const G4String & | modelM = "ecpssr", |
|
|
G4double | minE = 1*CLHEP::keV, |
|
|
G4double | maxE = 0.1*CLHEP::GeV, |
|
|
G4int | nBins = 200, |
|
|
G4double | unitE = CLHEP::MeV, |
|
|
G4double | unitData = CLHEP::barn, |
|
|
G4int | minZ = 6, |
|
|
G4int | maxZ = 92 ) |
Definition at line 126 of file G4PixeCrossSectionHandler.cc.
134{
135 if (algorithm != 0)
136 {
137 delete interpolation;
138 interpolation = algorithm;
139 }
140 else
141 {
142 interpolation = CreateInterpolation();
143 }
144
145 eMin = minE;
146 eMax = maxE;
147 nBins = numberOfBins;
148 unit1 = unitE;
149 unit2 = unitData;
150 zMin = minZ;
151 zMax = maxZ;
152
153 crossModel.push_back(modelK);
154 crossModel.push_back(modelL);
155 crossModel.push_back(modelM);
156
157}
Referenced by G4PixeCrossSectionHandler().
◆ LoadShellData()
void G4PixeCrossSectionHandler::LoadShellData |
( |
const G4String & | dataFile | ) |
|
Definition at line 180 of file G4PixeCrossSectionHandler.cc.
181{
182 std::size_t nZ = activeZ.size();
183 for (std::size_t i=0; i<nZ; ++i)
184 {
188
189
190
191
192
193
194
195
196
197
199 dataMap[Z] = dataSet;
200 }
201
202
203 if (! crossSections)
204 {
205 BuildForMaterials();
206 }
207
208}
virtual G4bool LoadData(const G4String &fileName)=0
virtual G4IInterpolator * Clone() const =0
Referenced by G4hImpactIonisation::PostStepDoIt().
◆ MicroscopicCrossSection()
Definition at line 695 of file G4PixeCrossSectionHandler.cc.
699{
700
701
702
703
704
706
707
710
711
713 G4double beta2 = 1. - 1. / (gamma * gamma);
714 G4double var = electron_mass_c2 / particleMass;
715 G4double tMax = 2. * electron_mass_c2 * (gamma*gamma - 1.) / (1. + 2.*gamma*var + var*var);
716
717
718
719 if ( tMax > deltaCut )
720 {
721 var = deltaCut / tMax;
722 cross = (1. - var * (1. - beta2 * std::log(var))) / deltaCut;
723
725
726
727 if (spin == 0.5)
728 {
729 cross += 0.5 * (tMax - deltaCut) / (energy*energy);
730 }
731
732 else if (spin > 0.9 )
733 {
734 cross += -std::log(var) / (3.*deltaCut) + (tMax-deltaCut) *
735 ((5.+1./var)*0.25 /(
energy*
energy) - beta2 / (tMax*deltaCut))/3.;
736 }
737 cross *= twopi_mc2_rcl2 * Z / beta2 ;
738 }
739
740
741
742
743 return cross;
744}
G4double GetPDGMass() const
G4double GetPDGSpin() const
G4double energy(const ThreeVector &p, const G4double m)
◆ PrintData()
void G4PixeCrossSectionHandler::PrintData |
( |
| ) |
const |
Definition at line 159 of file G4PixeCrossSectionHandler.cc.
160{
161 std::map<G4int,G4IDataSet*,std::less<G4int> >::const_iterator
pos;
162
163 for (pos = dataMap.begin(); pos != dataMap.end(); pos++)
164 {
165
166
167
168
169
170 G4int z = (*pos).first;
172 G4cout <<
"---- Data set for Z = "
173 << z
176 G4cout <<
"--------------------------------------------------" <<
G4endl;
177 }
178}
virtual void PrintData(void) const =0
◆ SelectRandomAtom()
Definition at line 448 of file G4PixeCrossSectionHandler.cc.
450{
451
452
453
455
456
457 if (nElements == 1)
458 {
460 return Z;
461 }
462
463
464
466 std::size_t materialIndex = material->
GetIndex();
467
468 G4IDataSet* materialSet = (*crossSections)[materialIndex];
469 G4double materialCrossSection0 = 0.0;
471 cross.clear();
472 for (
G4int i=0; i < nElements; ++i )
473 {
475 materialCrossSection0 += cr;
476 cross.push_back(materialCrossSection0);
477 }
478
480
481 for (
G4int k=0 ; k < nElements ; ++k )
482 {
483 if (random <= cross[k])
return (
G4int) (*elementVector)[k]->GetZ();
484 }
485
486 return 0;
487}
std::vector< const G4Element * > G4ElementVector
const G4ElementVector * GetElementVector() const
std::size_t GetIndex() const
std::size_t GetNumberOfElements() const
Referenced by G4hImpactIonisation::PostStepDoIt().
◆ SelectRandomShell()
Definition at line 538 of file G4PixeCrossSectionHandler.cc.
539{
540
541
542
543
544
545
547
551
553 auto pos = dataMap.find(Z);
554
555
556
557
558 if (pos != dataMap.end()) dataSet = (*pos).second;
559
560 if (dataSet != nullptr) {
562 for (
G4int i=0; i<nShells; ++i)
563 {
565 if (shellDataSet != 0)
566 {
568 partialSum += value;
569 if (random <= partialSum) return i;
570 }
571 }
572 }
573
574 return shell;
575}
G4double FindValue(G4int Z, G4double e) const
Referenced by G4hImpactIonisation::PostStepDoIt().
◆ ValueForMaterial()
Definition at line 299 of file G4PixeCrossSectionHandler.cc.
301{
303
307
308 for (std::size_t i=0 ; i<nElements ; ++i)
309 {
310 G4int Z = (
G4int) (*elementVector)[i]->GetZ();
312 G4double nAtomsVol = nAtomsPerVolume[i];
313 value += nAtomsVol * elementValue;
314 }
315
316 return value;
317}
const G4double * GetVecNbOfAtomsPerVolume() const
The documentation for this class was generated from the following files: