65 for(
G4int i=0; i<nModels; ++i) {
67 if(
nullptr == mod) {
continue; }
101 G4cout <<
"### G4EmTableUtil::PreparePhysicsTable() done for "
121 G4cout <<
"### G4EmTableUtil::BuildPhysicsTable() for "
123 <<
" buildLambdaTable=" << toBuild <<
" master= " << master
127 if(firstPart == part) {
139 for(
G4int i=0; i<nModels; ++i) {
154 if(
nullptr == table) {
165 if(isLocked) {
return; }
168 if(1 < verb || (0 < verb && (num ==
"gamma" || num ==
"e-" ||
169 num ==
"e+" || num ==
"mu+" ||
170 num ==
"mu-" || num ==
"proton"||
171 num ==
"pi+" || num ==
"pi-" ||
172 num ==
"kaon+" || num ==
"kaon-" ||
173 num ==
"alpha" || num ==
"anti_proton" ||
174 num ==
"GenericIon" ||
175 num ==
"alpha+" || num ==
"helium" ||
176 num ==
"hydrogen"))) {
181 G4cout <<
"### G4EmTableUtil::BuildPhysicsTable() done for "
183 <<
" baseMat=" << baseMat <<
G4endl;
199 const G4int verboseLevel,
200 const G4bool startFromNull,
203 if(1 < verboseLevel) {
204 G4cout <<
"G4EmTableUtil::BuildLambdaTable() for process "
212 std::size_t numOfCouples = theCoupleTable->
GetTableSize();
218 G4double emax1 = std::min(maxKinEnergy, minKinEnergyPrim);
220 for(std::size_t i=0; i<numOfCouples; ++i) {
228 if(
nullptr != theLambdaTable) {
229 delete (*theLambdaTable)[i];
242 if(emax <= emin) { emax = 2*emin; }
244 bin = std::max(bin, 5);
251 if(
nullptr != theLambdaTablePrim) {
252 delete (*theLambdaTablePrim)[i];
255 if(
nullptr == bVectorPrim) {
257 bin = std::max(bin, 5);
260 bVectorPrim = aVectorPrim;
273 if(1 < verboseLevel) {
289 const G4int verboseLevel,
292 if(1 < verboseLevel) {
293 G4cout <<
"G4EmTableUtil::BuildLambdaTable() for process "
300 std::size_t numOfCouples = theCoupleTable->
GetTableSize();
303 for(std::size_t i=0; i<numOfCouples; ++i) {
309 delete (*theLambdaTable)[i];
313 if(minKinEnergy > emin) {
319 if(emax <= emin) { emax = 2*emin; }
321 bin = std::max(bin, 5);
329 if(1 < verboseLevel) {
343 G4cout <<
"G4EmTableUtil::CheckIon for "
345 <<
" should be called from G4VEnergyLossProcess::PreparePhysicsTable"
351 if(
nullptr == particle) { particle = part; }
354 if(pname !=
"deuteron" && pname !=
"triton" &&
355 pname !=
"alpha+" && pname !=
"alpha") {
362 if(particle != theGIon) {
366 for(
G4int j=0; j<n; ++j) {
367 if((*v)[j] == proc) {
399 for(
G4int i=0; i<nModels; ++i) {
434 for(
G4int i=0; i<nModels; ++i) {
459 std::size_t numOfCouples = theCoupleTable->
GetTableSize();
462 G4cout << numOfCouples <<
" couples" <<
" minKinEnergy(MeV)= " << emin
463 <<
" maxKinEnergy(MeV)= " << emax <<
" nbins= " << nbins <<
G4endl;
468 for(std::size_t i=0; i<numOfCouples; ++i) {
471 G4cout <<
"G4EmTableUtil::BuildDEDXVector idx= " << i
472 <<
" flagTable=" << table->
GetFlag(i)
481 if(
nullptr != bVector) {
497 G4cout <<
"G4EmTableUtil::BuildDEDXTable(): table is built for "
516 G4int verb = (master) ? param->Verbose() : param->WorkerVerbose();
523 G4cout <<
"### G4EmTableUtil::PrepearPhysicsTable() for "
526 <<
" isIon: " << isIon <<
" isMaster: " << master
535 stepLimit = param->MscMuHadStepLimitType();
536 facrange = param->MscMuHadRangeFactor();
537 latDisplacement = param->MuHadLateralDisplacement();
539 stepLimit = param->MscStepLimitType();
540 facrange = param->MscRangeFactor();
541 latDisplacement = param->LateralDisplacement();
546 for(
G4int i=0; i<numberOfModels; ++i) {
555 modelManager->
Initialise(&part,
nullptr, verb);
567 G4int verb = param->Verbose();
569 if(!master && firstPart == &part) {
572 for(
G4int i=0; i<nModels; ++i) {
580 if(!param->IsPrintLocked()) {
584 if(1 < verb || (0 < verb && (num ==
"e-" ||
585 num ==
"e+" || num ==
"mu+" ||
586 num ==
"mu-" || num ==
"proton"||
587 num ==
"pi+" || num ==
"pi-" ||
588 num ==
"kaon+" || num ==
"kaon-" ||
589 num ==
"alpha" || num ==
"anti_proton" ||
590 num ==
"GenericIon" || num ==
"alpha+" ||
596 G4cout <<
"### G4EmTableUtil::BuildPhysicsTable() done for "
611 for(
G4int i=0; i<nModels; ++i) {
614 if (
nullptr != table) {
622 G4cout <<
"Physics table are stored for "
625 <<
" with a name <" << name <<
"> " <<
G4endl;
628 G4cout <<
"Fail to store Physics Table for "
631 <<
" in the directory <" << dir
650 if (
nullptr != aTable) {
657 G4cout <<
"G4EmTableUtil::StoreTable fail to store: " << name <<
G4endl;
673 if (
nullptr == aTable) {
return res; }
676 <<
" will be retrieved " <<
G4endl;
682 for(
auto & v : *aTable) {
683 if(
nullptr != v) { v->FillSecondDerivatives(); }
688 <<
" is Retrieved from <" << name <<
">"
693 G4cout <<
"G4EmTableUtil::RetrieveTable fail to retrieve: " << tname
G4double G4Log(G4double x)
G4GLOB_DLL std::ostream G4cout
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4int verb)
G4int NumberOfModels() const
G4VEmModel * GetModel(G4int idx, G4bool ver=false) const
void FillLambdaVector(G4PhysicsVector *, const G4MaterialCutsCouple *, G4bool startFromNull=true, G4EmTableType t=fRestricted)
void FillDEDXVector(G4PhysicsVector *, const G4MaterialCutsCouple *, G4EmTableType t=fRestricted)
static G4EmParameters * Instance()
G4double MscThetaLimit() const
G4int WorkerVerbose() const
static void BuildEmProcess(G4VEmProcess *proc, const G4VEmProcess *masterProc, const G4ParticleDefinition *firstPart, const G4ParticleDefinition *part, const G4int nModels, const G4int verb, const G4bool master, const G4bool isLocked, const G4bool toBuild, G4bool &baseMat)
static G4bool RetrieveTable(G4VProcess *ptr, const G4ParticleDefinition *part, G4PhysicsTable *aTable, const G4String &dir, const G4String &tname, const G4int verb, const G4bool ascii, const G4bool spline)
static void PrepareMscProcess(G4VMultipleScattering *proc, const G4ParticleDefinition &part, G4EmModelManager *modelManager, G4MscStepLimitType &stepLimit, G4double &facrange, G4bool &latDisplacement, G4bool &master, G4bool &isIon, G4bool &baseMat)
static void BuildMscProcess(G4VMultipleScattering *proc, const G4VMultipleScattering *masterProc, const G4ParticleDefinition &part, const G4ParticleDefinition *firstPart, G4int nModels, G4bool master)
static void UpdateModels(G4VEnergyLossProcess *proc, G4EmModelManager *modelManager, const G4double maxKinEnergy, const G4int nModels, G4int &secID, G4int &biasID, G4int &mainSecondaries, const G4bool baseMat, const G4bool isMaster, const G4bool useAGen)
static const G4DataVector * PrepareEmProcess(G4VEmProcess *proc, const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4EmModelManager *modelManager, const G4double &maxKinEnergy, G4int &secID, G4int &tripletID, G4int &mainSec, const G4int &verb, const G4bool &master)
static void BuildLocalElossProcess(G4VEnergyLossProcess *proc, const G4VEnergyLossProcess *masterProc, const G4ParticleDefinition *part, const G4int nModels)
static G4bool StoreTable(G4VProcess *, const G4ParticleDefinition *, G4PhysicsTable *, const G4String &dir, const G4String &tname, G4int verb, G4bool ascii)
static void BuildDEDXTable(G4VEnergyLossProcess *proc, const G4ParticleDefinition *part, G4EmModelManager *modelManager, G4LossTableBuilder *bld, G4PhysicsTable *table, const G4double minKinEnergy, const G4double maxKinEnergy, const G4int nbins, const G4int verbose, const G4EmTableType tType, const G4bool splineFlag)
static const G4ParticleDefinition * CheckIon(G4VEnergyLossProcess *proc, const G4ParticleDefinition *part, const G4ParticleDefinition *particle, const G4int verboseLevel, G4bool &isIon)
static G4bool StoreMscTable(G4VMultipleScattering *proc, const G4ParticleDefinition *part, const G4String &directory, const G4int nModels, const G4int verb, const G4bool ascii)
static void BuildLambdaTable(G4VEmProcess *proc, const G4ParticleDefinition *part, G4EmModelManager *modelManager, G4LossTableBuilder *bld, G4PhysicsTable *theLambdaTable, G4PhysicsTable *theLambdaTablePrim, const G4double minKinEnergy, const G4double minKinEnergyPrim, const G4double maxKinEnergy, const G4double scale, const G4int verbose, const G4bool startFromNull, const G4bool splineFlag)
static std::vector< G4double > * FindCrossSectionMax(G4PhysicsTable *)
static G4GenericIon * GenericIon()
G4bool GetFlag(size_t idx)
const G4Material * GetMaterial() const
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleType() const
G4double GetPDGMass() const
const G4String & GetParticleName() const
static G4bool RetrievePhysicsTable(G4PhysicsTable *physTable, const G4String &fileName, G4bool ascii, G4bool spline)
static void SetPhysicsVector(G4PhysicsTable *physTable, std::size_t idx, G4PhysicsVector *vec)
G4bool GetFlag(std::size_t i) const
G4bool StorePhysicsTable(const G4String &filename, G4bool ascii=false)
void FillSecondDerivatives(const G4SplineType=G4SplineType::Base, const G4double dir1=0.0, const G4double dir2=0.0)
G4ProcessVector * GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
static G4String ConvertToString(G4bool boolVal)
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *, const G4Material *)
void SetCrossSectionTable(G4PhysicsTable *, G4bool isLocal)
void SetPolarAngleLimit(G4double)
void SetHighEnergyLimit(G4double)
void SetMasterThread(G4bool val)
void SetAngularGeneratorFlag(G4bool)
G4double HighEnergyLimit() const
G4PhysicsTable * GetCrossSectionTable()
void SetUseBaseMaterials(G4bool val)
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
G4CrossSectionType CrossSectionType() const
G4VEmModel * GetModelByIndex(G4int idx=0, G4bool ver=false) const
void SetLambdaTablePrim(G4PhysicsTable *)
void SetEnergyOfCrossSectionMax(std::vector< G4double > *)
G4PhysicsTable * LambdaTable() const
void SetEmModel(G4VEmModel *, G4int index=0)
void StreamInfo(std::ostream &outFile, const G4ParticleDefinition &, G4bool rst=false) const
std::vector< G4double > * EnergyOfCrossSectionMax() const
G4bool UseBaseMaterial() const
void SetCrossSectionType(G4CrossSectionType val)
G4PhysicsTable * LambdaTablePrim() const
void SetLambdaTable(G4PhysicsTable *)
G4PhysicsTable * RangeTableForLoss() const
G4bool UseBaseMaterial() const
std::vector< G4double > * EnergyOfCrossSectionMax() const
G4PhysicsTable * InverseRangeTable() const
G4PhysicsTable * CSDARangeTable() const
void SetRangeTableForLoss(G4PhysicsTable *p)
G4VEmModel * GetModelByIndex(std::size_t idx=0, G4bool ver=false) const
void SetTwoPeaksXS(std::vector< G4TwoPeaksXS * > *)
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *, const G4Material *, G4double cut)
std::vector< G4TwoPeaksXS * > * TwoPeaksXS() const
void SetCrossSectionType(G4CrossSectionType val)
void SetInverseRangeTable(G4PhysicsTable *p)
G4CrossSectionType CrossSectionType() const
G4bool IsIonisationProcess() const
void SetEnergyOfCrossSectionMax(std::vector< G4double > *)
void SetDEDXTable(G4PhysicsTable *p, G4EmTableType tType)
void SetIonisation(G4bool val)
void SetLambdaTable(G4PhysicsTable *p)
G4PhysicsTable * IonisationTable() const
G4PhysicsTable * LambdaTable() const
void SetCSDARangeTable(G4PhysicsTable *pRange)
G4PhysicsTable * DEDXunRestrictedTable() const
G4PhysicsTable * DEDXTable() const
void SetIonisation(G4VEnergyLossProcess *, const G4ParticleDefinition *part)
G4VMscModel * GetModelByIndex(G4int idx, G4bool ver=false) const
virtual void InitialiseProcess(const G4ParticleDefinition *)=0
void StreamInfo(std::ostream &outFile, const G4ParticleDefinition &, G4bool rst=false) const
G4bool UseBaseMaterial() const
void SetVerboseLevel(G4int value)
G4int GetProcessSubType() const
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
const G4String & GetProcessName() const