77 MeanFreePath = (*theMeanFreePathTable)(aMaterial->
GetIndex())->
Value(kineticEnergy);
92 "variable G4LEDATA not defined");
108 std::vector<G4Material*>::const_iterator matite;
109 for( matite = materialTable->begin(); matite != materialTable->end(); matite++ ) {
114 std::string dirName = std::string(path) +
"/lepts/";
115 std::string fnParam = dirName + mateName +
"." + aParticleName +
".param.dat";
116 std::string baseName = std::string(path) +
"/lepts/" + mateName +
"." + aParticleName;
118 if( !bData )
continue;
121 std::string fnIXS = baseName +
".IXS.dat";
123 std::map< G4int, std::vector<G4double> > integralXS =
ReadIXS(fnIXS, aMaterial);
126 if( integralXS.size() == 0 ) {
127 G4cerr <<
" Integral cross sections will be set to 0. for material " << mateName <<
G4endl;
132 std::size_t matIdx = aMaterial->
GetIndex();
138 std::map< G4int, std::vector<G4double> >::const_iterator itei;
139 for( itei = integralXS.begin(); itei != integralXS.end(); itei++ ){
140 G4cout <<
GetName() <<
" : " << (*itei).first <<
" INTEGRALXS NDATA " << (*itei).second.size() <<
G4endl;
146 std::string fnDXS = baseName +
".DXS.dat";
147 std::string fnRMT = baseName +
".RMT.dat";
148 std::string fnEloss = baseName +
".Eloss.dat";
149 std::string fnEloss2 = baseName +
".Eloss2.dat";
152 if( !
theDiffXS[aMaterial]->IsFileFound() ) {
156 (
G4String(
"File not found :" + fnDXS).c_str()));
167 (
G4String(
"File not found :" + fnEloss).c_str()));
180 std::size_t matIdx = aMaterial->
GetIndex();
184 LowEdgeEnergy = ptrVector->
Energy(ii);
196 G4double eVEnergy = LowEdgeEnergy/CLHEP::eV;
200 if(eVEnergy < integralXS[0][1] ) {
207 if( eVEnergy > integralXS[0][jj]) {
213 aa = integralXS[0][Bin];
214 bb = integralXS[0][Bin+1];
215 crossSection = (integralXS[
theXSType][Bin] + (integralXS[
theXSType][Bin+1]-integralXS[
theXSType][Bin])/(bb-aa)*(eVEnergy-aa) ) * 1.e-16*CLHEP::cm2;
217 if(
verboseLevel >= 3 )
G4cout <<
" crossSection " << crossSection <<
" " <<integralXS[
theXSType][Bin] <<
" + " << (integralXS[
theXSType][Bin+1]-integralXS[
theXSType][Bin]) <<
" / " << (bb-aa) <<
" *" << (eVEnergy-aa) <<
" * " << 1.e-16*CLHEP::cm2 <<
G4endl;;
220 SIGMA = NbOfMoleculesPerVolume * crossSection;
222 <<
" Bin " << Bin <<
" TOTAL " << aa <<
" " << bb
245 x =
theDiffXS[aMaterial]->SampleAngleMT(e, el);
251 G4double Pi = std::sqrt( std::pow( (Ei/27.2/137),2) +2*Ei/27.2);
252 G4double Pd = std::sqrt( std::pow( (Ed/27.2/137),2) +2*Ed/27.2);
259 G4double co = (Pi*Pi + Pd*Pd - KR*KR) / (2*Pi*Pd);
260 if( co > 1. ) co = 1.;
272 G4double sinTeta = std::sqrt(1.0-cosTeta*cosTeta);
274 G4double dirx = sinTeta*std::cos(Phi) , diry = sinTeta*std::sin(Phi) , dirz = cosTeta ;
293 G4double sinTeta = std::sqrt(1.0-cosTeta*cosTeta);
295 G4double dirx = sinTeta*std::cos(Phi) , diry = sinTeta*std::sin(Phi) , dirz = cosTeta ;
308 el =
theElostDistr[aMaterial]->Sample(eMin/CLHEP::eV, eMax/CLHEP::eV)*CLHEP::eV;
311 if(
verboseLevel >= 2 )
G4cout << aMaterial->
GetName() <<
"SampleEnergyLoss/eV " << el/CLHEP::eV <<
" eMax/eV " << eMax/CLHEP::eV <<
" "
321 std::ifstream fin(fnParam);
322 if (!fin.is_open()) {
326 (
G4String(
"File not found: ")+ fnParam).c_str());
332 fin >> IonisPot >> IonisPotInt;
333 if(
verboseLevel >= 1 )
G4cout <<
"Read param (" << fnParam <<
")\t IonisPot: " << IonisPot
334 <<
" IonisPotInt: " << IonisPotInt <<
G4endl;
342 for(
G4int ii = 0; ii < nelem; ++ii ) {
343 MolecularMass += aMaterial->
GetElement(ii)->
GetA()*atomsV[ii]/CLHEP::g;
351 <<
" IonisPotInt: " << IonisPotInt/CLHEP::eV <<
" eV"
352 <<
" MolecularMass " << MolecularMass/(CLHEP::g/CLHEP::mole) <<
" g/mole" <<
G4endl;
360 std::map< G4int, std::vector<G4double> > integralXS;
363 std::ifstream fin(fnIXS);
364 if (!fin.is_open()) {
368 (
G4String(
"File not found: ")+ fnIXS).c_str());
372 G4int nXSdat, nXSsub;
373 fin >> nXSdat >> nXSsub;
375 <<
" nXSsub: " << nXSsub <<
G4endl;
380 for (
G4int ip=0; ip<=nXSsub; ip++) {
381 integralXS[ip].push_back(0.);
383 for (
G4int ie=1; ie<=nXSdat; ie++) {
384 for (
G4int ip=0; ip<=nXSsub; ip++) {
386 integralXS[ip].push_back(xsdat);
const char * G4FindDataDir(const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::vector< G4Material * > G4MaterialTable
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
Hep3Vector & rotateUz(const Hep3Vector &)
G4double GetDensity() const
static size_t GetNumberOfMaterials()
const G4Element * GetElement(G4int iel) const
size_t GetNumberOfElements() const
const G4int * GetAtomsVector() const
static G4MaterialTable * GetMaterialTable()
const G4String & GetName() const
const G4String & GetParticleName() const
void insertAt(std::size_t, G4PhysicsVector *)
void PutValue(const std::size_t index, const G4double value)
G4double Energy(const std::size_t index) const
void SetHighEnergyLimit(G4double)
virtual G4double Value(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
void SetLowEnergyLimit(G4double)
const G4String & GetName() const
G4bool ReadParam(G4String fileName, const G4Material *aMaterial)
std::map< const G4Material *, G4LEPTSDiffXS * > theDiffXS
G4ThreeVector SampleNewDirection(const G4Material *aMaterial, G4ThreeVector Dir, G4double e, G4double el)
G4double SampleEnergyLoss(const G4Material *aMaterial, G4double eMin, G4double eMax)
std::map< const G4Material *, G4double > theMolecularMass
G4double GetMeanFreePath(const G4Material *mate, const G4ParticleDefinition *aParticle, G4double kineticEnergy)
std::map< const G4Material *, G4int > theNXSsub
G4VLEPTSModel(const G4String &processName)
std::map< const G4Material *, G4LEPTSElossDistr * > theElostDistr
std::map< const G4Material *, G4double > theIonisPotInt
std::map< const G4Material *, G4double > theIonisPot
G4PhysicsTable * theMeanFreePathTable
G4double theHighestEnergyLimit
void BuildPhysicsTable(const G4ParticleDefinition &aParticleType)
virtual std::map< G4int, std::vector< G4double > > ReadIXS(G4String fileName, const G4Material *aMaterial)
G4double theLowestEnergyLimit
std::map< const G4Material *, G4LEPTSDistribution * > theRMTDistr
void BuildMeanFreePathTable(const G4Material *aMaterial, std::map< G4int, std::vector< G4double > > &integralXS)
std::map< const G4Material *, G4int > theNXSdat
G4double SampleAngle(const G4Material *aMaterial, G4double e, G4double el)