65 for(
G4int i=0; i<nModels; ++i) {
67 if(
nullptr == mod) {
continue; }
101 G4cout <<
"### G4VEmProcess::PreparePhysicsTable() done for "
121 G4cout <<
"### G4VEmProcess::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 <<
"### G4VEmProcess::BuildPhysicsTable() done for "
183 <<
" baseMat=" << baseMat <<
G4endl;
199 const G4int verboseLevel,
200 const G4bool startFromNull,
203 if(1 < verboseLevel) {
204 G4cout <<
"G4EmProcess::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 <<
"G4EnergyLossProcess::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 <<
"G4VEnergyLossProcess::PreparePhysicsTable for "
350 if(
nullptr == particle) { particle = part; }
353 if(pname !=
"deuteron" && pname !=
"triton" &&
354 pname !=
"alpha+" && pname !=
"alpha") {
359 if(particle != theGIon) {
363 for(
G4int j=0; j<n; ++j) {
364 if((*v)[j] == proc) {
396 for(
G4int i=0; i<nModels; ++i) {
431 for(
G4int i=0; i<nModels; ++i) {
456 std::size_t numOfCouples = theCoupleTable->
GetTableSize();
459 G4cout << numOfCouples <<
" couples" <<
" minKinEnergy(MeV)= " << emin
460 <<
" maxKinEnergy(MeV)= " << emax <<
" nbins= " << nbins <<
G4endl;
465 for(std::size_t i=0; i<numOfCouples; ++i) {
468 G4cout <<
"G4VEnergyLossProcess::BuildDEDXVector idx= " << i
469 <<
" flagTable=" << table->
GetFlag(i)
478 if(
nullptr != bVector) {
494 G4cout <<
"G4VEnergyLossProcess::BuildDEDXTable(): table is built for "
513 G4int verb = (master) ? param->Verbose() : param->WorkerVerbose();
520 G4cout <<
"### G4VMultipleScattering::PrepearPhysicsTable() for "
523 <<
" isIon: " << isIon <<
" isMaster: " << master
532 stepLimit = param->MscMuHadStepLimitType();
533 facrange = param->MscMuHadRangeFactor();
534 latDisplacement = param->MuHadLateralDisplacement();
536 stepLimit = param->MscStepLimitType();
537 facrange = param->MscRangeFactor();
538 latDisplacement = param->LateralDisplacement();
543 for(
G4int i=0; i<numberOfModels; ++i) {
552 modelManager->
Initialise(&part,
nullptr, verb);
564 G4int verb = param->Verbose();
566 if(!master && firstPart == &part) {
569 for(
G4int i=0; i<nModels; ++i) {
577 if(!param->IsPrintLocked()) {
581 if(1 < verb || (0 < verb && (num ==
"e-" ||
582 num ==
"e+" || num ==
"mu+" ||
583 num ==
"mu-" || num ==
"proton"||
584 num ==
"pi+" || num ==
"pi-" ||
585 num ==
"kaon+" || num ==
"kaon-" ||
586 num ==
"alpha" || num ==
"anti_proton" ||
587 num ==
"GenericIon" || num ==
"alpha+" ||
593 G4cout <<
"### G4VMultipleScattering::BuildPhysicsTable() done for "
608 for(
G4int i=0; i<nModels; ++i) {
611 if (
nullptr != table) {
619 G4cout <<
"Physics table are stored for "
622 <<
" with a name <" << name <<
"> " <<
G4endl;
625 G4cout <<
"Fail to store Physics Table for "
628 <<
" in the directory <" << dir
647 if (
nullptr != aTable) {
670 if (
nullptr == aTable) {
return res; }
672 <<
" will be retrieved " <<
G4endl;
677 for(
auto & v : *aTable) {
678 if(
nullptr != v) { v->FillSecondDerivatives(); }
683 <<
" is Retrieved from <" << name <<
">"
688 G4cout <<
"Fail to retrieve: " << tname <<
" from " << name <<
" for "
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