79 MeanFreePath = (*theMeanFreePathTable)(aMaterial->
GetIndex())->
80 GetValue(kineticEnergy, isOutRange);
90 char* path = getenv(
"G4LEDATA");
95 "variable G4LEDATA not defined");
111 std::vector<G4Material*>::const_iterator matite;
112 for( matite = materialTable->begin(); matite != materialTable->end(); matite++ ) {
117 std::string dirName = std::string(path) +
"/lepts/";
118 std::string fnParam = dirName + mateName +
"." + aParticleName +
".param.dat";
119 std::string baseName = std::string(path) +
"/lepts/" + mateName +
"." + aParticleName;
121 if( !bData )
continue;
124 std::string fnIXS = baseName +
".IXS.dat";
126 std::map< G4int, std::vector<G4double> > integralXS =
ReadIXS(fnIXS, aMaterial);
129 if( integralXS.size() == 0 ) {
130 G4cerr <<
" Integral cross sections will be set to 0. for material " << mateName <<
G4endl;
135 unsigned int matIdx = aMaterial->
GetIndex();
141 std::map< G4int, std::vector<G4double> >::const_iterator itei;
142 for( itei = integralXS.begin(); itei != integralXS.end(); itei++ ){
149 std::string fnDXS = baseName +
".DXS.dat";
150 std::string fnRMT = baseName +
".RMT.dat";
151 std::string fnEloss = baseName +
".Eloss.dat";
152 std::string fnEloss2 = baseName +
".Eloss2.dat";
155 if( !
theDiffXS[aMaterial]->IsFileFound() ) {
159 (
G4String(
"File not found :" + fnDXS).c_str()));
170 (
G4String(
"File not found :" + fnEloss).c_str()));
183 unsigned int matIdx = aMaterial->
GetIndex();
203 if(eVEnergy < integralXS[0][1] ) {
210 if( eVEnergy > integralXS[0][jj]) {
216 aa = integralXS[0][Bin];
217 bb = integralXS[0][Bin+1];
223 SIGMA = NbOfMoleculesPerVolume * crossSection;
225 <<
" Bin " << Bin <<
" TOTAL " << aa <<
" " << bb
248 x =
theDiffXS[aMaterial]->SampleAngleMT(e, el);
254 G4double Pi = std::sqrt( std::pow( (Ei/27.2/137),2) +2*Ei/27.2);
255 G4double Pd = std::sqrt( std::pow( (Ed/27.2/137),2) +2*Ed/27.2);
262 G4double co = (Pi*Pi + Pd*Pd - KR*KR) / (2*Pi*Pd);
263 if( co > 1. ) co = 1.;
275 G4double sinTeta = std::sqrt(1.0-cosTeta*cosTeta);
277 G4double dirx = sinTeta*std::cos(Phi) , diry = sinTeta*std::sin(Phi) , dirz = cosTeta ;
296 G4double sinTeta = std::sqrt(1.0-cosTeta*cosTeta);
298 G4double dirx = sinTeta*std::cos(Phi) , diry = sinTeta*std::sin(Phi) , dirz = cosTeta ;
324 std::ifstream
fin(fnParam);
325 if (!fin.is_open()) {
329 (
G4String(
"File not found: ")+ fnParam).c_str());
335 fin >> IonisPot >> IonisPotInt;
336 if(
verboseLevel >= 1 )
G4cout <<
"Read param (" << fnParam <<
")\t IonisPot: " << IonisPot
337 <<
" IonisPotInt: " << IonisPotInt <<
G4endl;
345 for(
size_t ii = 0; ii < nelem; ii++ ) {
354 <<
" IonisPotInt: " << IonisPotInt/CLHEP::eV <<
" eV"
363 std::map< G4int, std::vector<G4double> > integralXS;
366 std::ifstream
fin(fnIXS);
367 if (!fin.is_open()) {
371 (
G4String(
"File not found: ")+ fnIXS).c_str());
375 G4int nXSdat, nXSsub;
376 fin >> nXSdat >> nXSsub;
378 <<
" nXSsub: " << nXSsub <<
G4endl;
383 for (
G4int ip=0; ip<=nXSsub; ip++) {
384 integralXS[ip].push_back(0.);
386 for (
G4int ie=1; ie<=nXSdat; ie++) {
387 for (
G4int ip=0; ip<=nXSsub; ip++) {
389 integralXS[ip].push_back(xsdat);
static size_t GetNumberOfMaterials()
std::map< const G4Material *, G4LEPTSDistribution * > theRMTDistr
G4double GetLowEdgeEnergy(size_t binNumber) const
void SetHighEnergyLimit(G4double)
std::map< const G4Material *, G4LEPTSElossDistr * > theElostDistr
static G4MaterialTable * GetMaterialTable()
G4double SampleAngle(const G4Material *aMaterial, G4double e, G4double el)
static constexpr double g
static constexpr double mole
const G4String & GetParticleName() const
G4PhysicsTable * theMeanFreePathTable
Hep3Vector & rotateUz(const Hep3Vector &)
void insertAt(size_t, G4PhysicsVector *)
const G4int * GetAtomsVector() const
G4double GetMeanFreePath(const G4Material *mate, const G4ParticleDefinition *aParticle, G4double kineticEnergy)
void BuildPhysicsTable(const G4ParticleDefinition &aParticleType)
G4VLEPTSModel(const G4String &processName)
std::map< const G4Material *, G4double > theIonisPotInt
const G4String & GetName() const
static constexpr double Avogadro
virtual std::map< G4int, std::vector< G4double > > ReadIXS(G4String fileName, const G4Material *aMaterial)
std::map< const G4Material *, G4LEPTSDiffXS * > theDiffXS
std::map< const G4Material *, G4int > theNXSdat
static constexpr double MeV
static constexpr double eV
G4GLOB_DLL std::ostream G4cerr
std::vector< G4Material * > G4MaterialTable
static constexpr double cm2
static constexpr double twopi
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
const G4String & GetName() const
std::map< const G4Material *, G4double > theIonisPot
void SetLowEnergyLimit(G4double)
void BuildMeanFreePathTable(const G4Material *aMaterial, std::map< G4int, std::vector< G4double > > &integralXS)
G4double theHighestEnergyLimit
G4GLOB_DLL std::ostream G4cout
std::map< const G4Material *, G4int > theNXSsub
G4ThreeVector SampleNewDirection(const G4Material *aMaterial, G4ThreeVector Dir, G4double e, G4double el)
G4bool ReadParam(G4String fileName, const G4Material *aMaterial)
G4double theLowestEnergyLimit
G4double SampleEnergyLoss(const G4Material *aMaterial, G4double eMin, G4double eMax)
const G4Element * GetElement(G4int iel) const
std::map< const G4Material *, G4double > theMolecularMass
void PutValue(size_t index, G4double theValue)
size_t GetNumberOfElements() const
G4double GetDensity() const