#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 60 of file G4PixeCrossSectionHandler.cc.
61{
62 crossSections = 0;
63 interpolation = 0;
64
65 Initialise(0,
"",
"",
"",1.*keV,0.1*GeV,200,MeV,barn,6,92);
66 ActiveElements();
67}
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 70 of file G4PixeCrossSectionHandler.cc.
81 : interpolation(algorithm), eMin(minE), eMax(maxE), nBins(bins),
82 unit1(unitE), unit2(unitData), zMin(minZ), zMax(maxZ)
83{
84 crossSections = 0;
85
86 crossModel.push_back(modelK);
87 crossModel.push_back(modelL);
88 crossModel.push_back(modelM);
89
90
91
92
93
94 ActiveElements();
95}
◆ ~G4PixeCrossSectionHandler()
G4PixeCrossSectionHandler::~G4PixeCrossSectionHandler |
( |
| ) |
|
|
virtual |
Definition at line 97 of file G4PixeCrossSectionHandler.cc.
98{
99 delete interpolation;
100 interpolation = 0;
101 std::map<G4int,G4IDataSet*,std::less<G4int> >::iterator
pos;
102
103 for (pos = dataMap.begin(); pos != dataMap.end(); ++pos)
104 {
105
106
107
108
110 delete dataSet;
111 }
112
113 if (crossSections != 0)
114 {
115 std::size_t
n = crossSections->size();
116 for (std::size_t i=0; i<
n; ++i)
117 {
118 delete (*crossSections)[i];
119 }
120 delete crossSections;
121 crossSections = 0;
122 }
123}
◆ Clear()
void G4PixeCrossSectionHandler::Clear |
( |
| ) |
|
Definition at line 209 of file G4PixeCrossSectionHandler.cc.
210{
211
212 std::map<G4int,G4IDataSet*,std::less<G4int> >::iterator
pos;
213
214 if(! dataMap.empty())
215 {
216 for (pos = dataMap.begin(); pos != dataMap.end(); ++pos)
217 {
218
219
220
221
223 delete dataSet;
224 dataSet = 0;
225 G4int i = (*pos).first;
226 dataMap[i] = 0;
227 }
228 dataMap.clear();
229 }
230
231 activeZ.clear();
232 ActiveElements();
233}
◆ FindValue() [1/2]
Definition at line 235 of file G4PixeCrossSectionHandler.cc.
236{
238
239 std::map<G4int,G4IDataSet*,std::less<G4int> >::const_iterator
pos;
240 pos = dataMap.find(
Z);
241 if (pos!= dataMap.end())
242 {
243
244
245
246
249 }
250 else
251 {
252 G4cout <<
"WARNING: G4PixeCrossSectionHandler::FindValue(Z,e) did not find Z = "
254 }
255 return value;
256}
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 258 of file G4PixeCrossSectionHandler.cc.
260{
262
263 std::map<G4int,G4IDataSet*,std::less<G4int> >::const_iterator
pos;
264 pos = dataMap.find(
Z);
265 if (pos!= dataMap.end())
266 {
267
268
269
270
272 if (shellIndex >= 0)
273 {
275 if(shellIndex < nComponents)
276
278 else
279 {
280 G4cout <<
"WARNING: G4PixeCrossSectionHandler::FindValue(Z,e,shell) did not find"
281 << " shellIndex= " << shellIndex
282 << " for Z= "
284 }
285 } else {
287 }
288 }
289 else
290 {
291 G4cout <<
"WARNING: G4PixeCrossSectionHandler::FindValue did not find Z = "
293 }
294 return value;
295}
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 125 of file G4PixeCrossSectionHandler.cc.
133{
134 if (algorithm != 0)
135 {
136 delete interpolation;
137 interpolation = algorithm;
138 }
139 else
140 {
141 interpolation = CreateInterpolation();
142 }
143
144 eMin = minE;
145 eMax = maxE;
146 nBins = numberOfBins;
147 unit1 = unitE;
148 unit2 = unitData;
149 zMin = minZ;
150 zMax = maxZ;
151
152 crossModel.push_back(modelK);
153 crossModel.push_back(modelL);
154 crossModel.push_back(modelM);
155
156}
Referenced by G4PixeCrossSectionHandler().
◆ LoadShellData()
void G4PixeCrossSectionHandler::LoadShellData |
( |
const G4String & |
dataFile | ) |
|
Definition at line 179 of file G4PixeCrossSectionHandler.cc.
180{
181 std::size_t nZ = activeZ.size();
182 for (std::size_t i=0; i<nZ; ++i)
183 {
187
188
189
190
191
192
193
194
195
196
198 dataMap[
Z] = dataSet;
199 }
200
201
202 if (! crossSections)
203 {
204 BuildForMaterials();
205 }
206
207}
virtual G4bool LoadData(const G4String &fileName)=0
virtual G4IInterpolator * Clone() const =0
Referenced by G4hImpactIonisation::PostStepDoIt().
◆ MicroscopicCrossSection()
Definition at line 693 of file G4PixeCrossSectionHandler.cc.
697{
698
699
700
701
702
704
705
708
709
711 G4double beta2 = 1. - 1. / (gamma * gamma);
712 G4double var = electron_mass_c2 / particleMass;
713 G4double tMax = 2. * electron_mass_c2 * (gamma*gamma - 1.) / (1. + 2.*gamma*var + var*var);
714
715
716
717 if ( tMax > deltaCut )
718 {
719 var = deltaCut / tMax;
720 cross = (1. - var * (1. - beta2 * std::log(var))) / deltaCut;
721
723
724
725 if (spin == 0.5)
726 {
727 cross += 0.5 * (tMax - deltaCut) / (energy*energy);
728 }
729
730 else if (spin > 0.9 )
731 {
732 cross += -std::log(var) / (3.*deltaCut) + (tMax-deltaCut) *
733 ((5.+1./var)*0.25 /(energy*energy) - beta2 / (tMax*deltaCut))/3.;
734 }
735 cross *= twopi_mc2_rcl2 *
Z / beta2 ;
736 }
737
738
739
740
741 return cross;
742}
G4double GetPDGMass() const
G4double GetPDGSpin() const
G4double energy(const ThreeVector &p, const G4double m)
◆ PrintData()
void G4PixeCrossSectionHandler::PrintData |
( |
| ) |
const |
Definition at line 158 of file G4PixeCrossSectionHandler.cc.
159{
160 std::map<G4int,G4IDataSet*,std::less<G4int> >::const_iterator
pos;
161
162 for (pos = dataMap.begin(); pos != dataMap.end(); pos++)
163 {
164
165
166
167
168
169 G4int z = (*pos).first;
171 G4cout <<
"---- Data set for Z = "
172 << z
175 G4cout <<
"--------------------------------------------------" <<
G4endl;
176 }
177}
virtual void PrintData(void) const =0
◆ SelectRandomAtom()
Definition at line 447 of file G4PixeCrossSectionHandler.cc.
449{
450
451
452
454
455
456 if (nElements == 1)
457 {
460 }
461
462
463
465 std::size_t materialIndex = material->
GetIndex();
466
467 G4IDataSet* materialSet = (*crossSections)[materialIndex];
468 G4double materialCrossSection0 = 0.0;
470 cross.clear();
471 for (
G4int i=0; i < nElements; ++i )
472 {
474 materialCrossSection0 += cr;
475 cross.push_back(materialCrossSection0);
476 }
477
479
480 for (
G4int k=0 ; k < nElements ; ++k )
481 {
482 if (random <= cross[k])
return (
G4int) (*elementVector)[k]->GetZ();
483 }
484
485 return 0;
486}
std::vector< const G4Element * > G4ElementVector
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
Referenced by G4hImpactIonisation::PostStepDoIt().
◆ SelectRandomShell()
Definition at line 537 of file G4PixeCrossSectionHandler.cc.
538{
539
540
541
542
543
544
546
550
552 std::map<G4int,G4IDataSet*,std::less<G4int> >::const_iterator
pos;
553 pos = dataMap.find(
Z);
554
555
556
557
558 if (pos != dataMap.end()) dataSet = (*pos).second;
559
561 for (
G4int i=0; i<nShells; ++i)
562 {
564 if (shellDataSet != 0)
565 {
567 partialSum += value;
568 if (random <= partialSum) return i;
569 }
570 }
571
572 return shell;
573}
G4double FindValue(G4int Z, G4double e) const
Referenced by G4hImpactIonisation::PostStepDoIt().
◆ ValueForMaterial()
Definition at line 298 of file G4PixeCrossSectionHandler.cc.
300{
302
306
307 for (std::size_t i=0 ; i<nElements ; ++i)
308 {
311 G4double nAtomsVol = nAtomsPerVolume[i];
312 value += nAtomsVol * elementValue;
313 }
314
315 return value;
316}
const G4double * GetVecNbOfAtomsPerVolume() const
The documentation for this class was generated from the following files: