65 Initialise(0,
"",
"",
"",1.*
keV,0.1*
GeV,200,
MeV,
barn,6,92);
81 : interpolation(algorithm), eMin(minE), eMax(maxE), nBins(
bins),
82 unit1(unitE), unit2(unitData), zMin(minZ), zMax(
maxZ)
101 std::map<G4int,G4IDataSet*,std::less<G4int> >::iterator
pos;
116 for (
size_t i=0; i<
n; i++)
118 delete (*crossSections)[i];
146 nBins = numberOfBins;
160 std::map<G4int,G4IDataSet*,std::less<G4int> >::const_iterator
pos;
169 G4int z = (*pos).first;
171 G4cout <<
"---- Data set for Z = "
175 G4cout <<
"--------------------------------------------------" <<
G4endl;
182 for (
size_t i=0; i<nZ; i++)
212 std::map<G4int,G4IDataSet*,std::less<G4int> >::iterator
pos;
225 G4int i = (*pos).first;
239 std::map<G4int,G4IDataSet*,std::less<G4int> >::const_iterator
pos;
252 G4cout <<
"WARNING: G4PixeCrossSectionHandler::FindValue(Z,e) did not find Z = "
259 G4int shellIndex)
const
263 std::map<G4int,G4IDataSet*,std::less<G4int> >::const_iterator
pos;
275 if(shellIndex < nComponents)
280 G4cout <<
"WARNING: G4PixeCrossSectionHandler::FindValue(Z,e,shell) did not find"
281 <<
" shellIndex= " << shellIndex
291 G4cout <<
"WARNING: G4PixeCrossSectionHandler::FindValue did not find Z = "
307 for (
G4int i=0 ; i<nElements ; i++)
311 G4double nAtomsVol = nAtomsPerVolume[i];
312 value += nAtomsVol * elementValue;
415 energyVector.push_back(std::pow(10., std::log10(
eMin)+i*dBin));
420 std::vector<G4IDataSet*>::iterator mat;
438 G4Exception(
"G4PixeCrossSectionHandler::BuildForMaterials",
441 ", crossSections = 0");
465 size_t materialIndex =
material->GetIndex();
467 G4IDataSet* materialSet = (*crossSections)[materialIndex];
468 G4double materialCrossSection0 = 0.0;
471 for (
G4int i=0; i < nElements; i++ )
474 materialCrossSection0 += cr;
475 cross.push_back(materialCrossSection0);
480 for (
G4int k=0 ; k < nElements ; k++ )
482 if (random <= cross[k])
return (
G4int) (*elementVector)[k]->GetZ();
552 std::map<G4int,G4IDataSet*,std::less<G4int> >::const_iterator
pos;
558 if (
pos !=
dataMap.end()) dataSet = (*pos).second;
561 for (
size_t i=0; i<nShells; i++)
564 if (shellDataSet != 0)
568 if (random <= partialSum)
return i;
578 if (materialTable == 0)
579 G4Exception(
"G4PixeCrossSectionHandler::ActiveElements",
582 "no MaterialTable found");
586 for (
G4int mat=0; mat<nMaterials; mat++)
592 for (
G4int iEl=0; iEl<nElements; iEl++)
594 G4double Z = (*elementVector)[iEl]->GetZ();
613 std::map<G4int,G4IDataSet*,std::less<G4int> >::const_iterator
pos;
622 G4cout <<
"WARNING: G4PixeCrossSectionHandler::NumberOfComponents did not "
630std::vector<G4IDataSet*>*
636 std::vector<G4IDataSet*>* matCrossSections =
new std::vector<G4IDataSet*>;
641 size_t nOfBins = energyVector.size();
645 if (materialTable == 0)
646 G4Exception(
"G4PixeCrossSectionHandler::BuildCrossSectionsForMaterials",
649 "no MaterialTable found");
653 for (
G4int mat=0; mat<nMaterials; mat++)
664 for (
G4int i=0; i<nElements; i++) {
667 G4double density = nAtomsPerVolume[i];
673 for (
size_t bin=0; bin<nOfBins; bin++)
676 energies->push_back(e);
679 data->push_back(cross);
687 matCrossSections->push_back(setForMat);
689 return matCrossSections;
711 G4double beta2 = 1. - 1. / (gamma * gamma);
717 if ( tMax > deltaCut )
719 var = deltaCut / tMax;
720 cross = (1. - var * (1. - beta2 * std::log(var))) / deltaCut;
730 else if (spin > 0.9 )
732 cross += -std::log(var) / (3.*deltaCut) + (tMax-deltaCut) *
733 ((5.+1./var)*0.25 /(
energy*
energy) - beta2 / (tMax*deltaCut))/3.;
static const G4double pos
std::vector< const G4Element * > G4ElementVector
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::vector< G4Material * > G4MaterialTable
static constexpr double barn
static constexpr double keV
static constexpr double GeV
static constexpr double MeV
G4GLOB_DLL std::ostream G4cout
G4bool contains(const G4double &) const
virtual const G4IDataSet * GetComponent(G4int componentId) const =0
virtual G4bool LoadData(const G4String &fileName)=0
virtual size_t NumberOfComponents(void) const =0
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
virtual void AddComponent(G4IDataSet *dataSet)=0
virtual void PrintData(void) const =0
virtual G4IInterpolator * Clone() const =0
static size_t GetNumberOfMaterials()
static G4MaterialTable * GetMaterialTable()
G4double GetPDGMass() const
G4double GetPDGSpin() const
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 NumberOfComponents(G4int Z) const
G4IInterpolator * interpolation
std::vector< G4IDataSet * > * BuildCrossSectionsForMaterials(const G4DataVector &energyVector)
std::map< G4int, G4IDataSet *, std::less< G4int > > dataMap
std::vector< G4String > crossModel
G4double MicroscopicCrossSection(const G4ParticleDefinition *particleDef, G4double kineticEnergy, G4double Z, G4double deltaCut) const
G4double FindValue(G4int Z, G4double e) const
G4int SelectRandomShell(G4int Z, G4double e) const
G4IInterpolator * CreateInterpolation()
void LoadShellData(const G4String &dataFile)
G4double ValueForMaterial(const G4Material *material, G4double e) const
G4PixeCrossSectionHandler()
std::vector< G4IDataSet * > * crossSections
G4int SelectRandomAtom(const G4Material *material, G4double e) const
G4double energy(const ThreeVector &p, const G4double m)
static const G4double bins[31]