Geant4  10.02.p03
G4VEmProcess Class Referenceabstract

#include <G4VEmProcess.hh>

Inheritance diagram for G4VEmProcess:
Collaboration diagram for G4VEmProcess:

Public Member Functions

 G4VEmProcess (const G4String &name, G4ProcessType type=fElectromagnetic)
 
virtual ~G4VEmProcess ()
 
virtual G4bool IsApplicable (const G4ParticleDefinition &p)=0
 
virtual void PrintInfo ()=0
 
virtual void ProcessDescription (std::ostream &outFile) const
 
virtual void PreparePhysicsTable (const G4ParticleDefinition &)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void StartTracking (G4Track *)
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
virtual G4VParticleChange * PostStepDoIt (const G4Track &, const G4Step &)
 
virtual G4bool StorePhysicsTable (const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false)
 
virtual G4bool RetrievePhysicsTable (const G4ParticleDefinition *, const G4String &directory, G4bool ascii)
 
G4double CrossSectionPerVolume (G4double kineticEnergy, const G4MaterialCutsCouple *couple)
 
G4double ComputeCrossSectionPerAtom (G4double kineticEnergy, G4double Z, G4double A=0., G4double cut=0.0)
 
G4double MeanFreePath (const G4Track &track)
 
G4double GetLambda (G4double &kinEnergy, const G4MaterialCutsCouple *couple)
 
void SetLambdaBinning (G4int nbins)
 
void SetMinKinEnergy (G4double e)
 
void SetMinKinEnergyPrim (G4double e)
 
void SetMaxKinEnergy (G4double e)
 
G4PhysicsTableLambdaTable () const
 
G4PhysicsTableLambdaTablePrim () const
 
const G4ParticleDefinitionParticle () const
 
const G4ParticleDefinitionSecondaryParticle () const
 
G4VEmModelSelectModelForMaterial (G4double kinEnergy, size_t &idxRegion) const
 
void AddEmModel (G4int, G4VEmModel *, const G4Region *region=0)
 
G4VEmModelEmModel (G4int index=1) const
 
void SetEmModel (G4VEmModel *, G4int index=1)
 
void UpdateEmModel (const G4String &, G4double, G4double)
 
G4VEmModelGetModelByIndex (G4int idx=0, G4bool ver=false) const
 
const G4ElementGetCurrentElement () const
 
const G4VEmModelGetCurrentModel () const
 
void SetCrossSectionBiasingFactor (G4double f, G4bool flag=true)
 
G4double CrossSectionBiasingFactor () const
 
void ActivateForcedInteraction (G4double length=0.0, const G4String &r="", G4bool flag=true)
 
void ActivateSecondaryBiasing (const G4String &region, G4double factor, G4double energyLimit)
 
void SetIntegral (G4bool val)
 
void SetBuildTableFlag (G4bool val)
 
- Public Member Functions inherited from G4VDiscreteProcess
 G4VDiscreteProcess (const G4String &, G4ProcessType aType=fNotDefined)
 
 G4VDiscreteProcess (G4VDiscreteProcess &)
 
virtual ~G4VDiscreteProcess ()
 
virtual G4double AlongStepGetPhysicalInteractionLength (const G4Track &, G4double, G4double, G4double &, G4GPILSelection *)
 
virtual G4double AtRestGetPhysicalInteractionLength (const G4Track &, G4ForceCondition *)
 
virtual G4VParticleChange * AtRestDoIt (const G4Track &, const G4Step &)
 
virtual G4VParticleChange * AlongStepDoIt (const G4Track &, const G4Step &)
 
- Public Member Functions inherited from G4VProcess
 G4VProcess (const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
 
 G4VProcess (const G4VProcess &right)
 
virtual ~G4VProcess ()
 
G4int operator== (const G4VProcess &right) const
 
G4int operator!= (const G4VProcess &right) const
 
G4double GetCurrentInteractionLength () const
 
void SetPILfactor (G4double value)
 
G4double GetPILfactor () const
 
G4double AlongStepGPIL (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection)
 
G4double AtRestGPIL (const G4Track &track, G4ForceCondition *condition)
 
G4double PostStepGPIL (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
const G4StringGetPhysicsTableFileName (const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
 
const G4StringGetProcessName () const
 
G4ProcessType GetProcessType () const
 
void SetProcessType (G4ProcessType)
 
G4int GetProcessSubType () const
 
void SetProcessSubType (G4int)
 
virtual void EndTracking ()
 
virtual void SetProcessManager (const G4ProcessManager *)
 
virtual const G4ProcessManagerGetProcessManager ()
 
virtual void ResetNumberOfInteractionLengthLeft ()
 
G4double GetNumberOfInteractionLengthLeft () const
 
G4double GetTotalNumberOfInteractionLengthTraversed () const
 
G4bool isAtRestDoItIsEnabled () const
 
G4bool isAlongStepDoItIsEnabled () const
 
G4bool isPostStepDoItIsEnabled () const
 
virtual void DumpInfo () const
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
virtual void SetMasterProcess (G4VProcess *masterP)
 
const G4VProcessGetMasterProcess () const
 
virtual void BuildWorkerPhysicsTable (const G4ParticleDefinition &part)
 
virtual void PrepareWorkerPhysicsTable (const G4ParticleDefinition &)
 

Protected Member Functions

virtual void InitialiseProcess (const G4ParticleDefinition *)=0
 
virtual G4double MinPrimaryEnergy (const G4ParticleDefinition *, const G4Material *)
 
G4VEmModelSelectModel (G4double &kinEnergy, size_t index)
 
virtual G4double GetMeanFreePath (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
G4PhysicsVectorLambdaPhysicsVector (const G4MaterialCutsCouple *)
 
G4int LambdaBinning () const
 
G4double MinKinEnergy () const
 
G4double MaxKinEnergy () const
 
G4double PolarAngleLimit () const
 
G4bool IsIntegral () const
 
G4double RecalculateLambda (G4double kinEnergy, const G4MaterialCutsCouple *couple)
 
G4ParticleChangeForGamma * GetParticleChange ()
 
void SetParticle (const G4ParticleDefinition *p)
 
void SetSecondaryParticle (const G4ParticleDefinition *p)
 
size_t CurrentMaterialCutsCoupleIndex () const
 
G4double GetGammaEnergyCut ()
 
G4double GetElectronEnergyCut ()
 
void SetStartFromNullFlag (G4bool val)
 
void SetSplineFlag (G4bool val)
 
const G4ElementGetTargetElement () const
 
const G4IsotopeGetTargetIsotope () const
 
- Protected Member Functions inherited from G4VProcess
void SubtractNumberOfInteractionLengthLeft (G4double previousStepSize)
 
void ClearNumberOfInteractionLengthLeft ()
 

Protected Attributes

G4ParticleChangeForGamma fParticleChange
 
- Protected Attributes inherited from G4VProcess
const G4ProcessManageraProcessManager
 
G4VParticleChange * pParticleChange
 
G4ParticleChange aParticleChange
 
G4double theNumberOfInteractionLengthLeft
 
G4double currentInteractionLength
 
G4double theInitialNumberOfInteractionLength
 
G4String theProcessName
 
G4String thePhysicsTableFileName
 
G4ProcessType theProcessType
 
G4int theProcessSubType
 
G4double thePILfactor
 
G4bool enableAtRestDoIt
 
G4bool enableAlongStepDoIt
 
G4bool enablePostStepDoIt
 
G4int verboseLevel
 

Private Member Functions

void Clear ()
 
void BuildLambdaTable ()
 
void PrintInfoProcess (const G4ParticleDefinition &)
 
void FindLambdaMax ()
 
void PrintWarning (G4String tit, G4double val)
 
void DefineMaterial (const G4MaterialCutsCouple *couple)
 
void ComputeIntegralLambda (G4double kinEnergy)
 
G4double GetLambdaFromTable (G4double kinEnergy)
 
G4double GetLambdaFromTablePrim (G4double kinEnergy)
 
G4double GetCurrentLambda (G4double kinEnergy)
 
G4double ComputeCurrentLambda (G4double kinEnergy)
 
 G4VEmProcess (G4VEmProcess &)
 
G4VEmProcessoperator= (const G4VEmProcess &right)
 

Private Attributes

G4LossTableManagerlManager
 
G4EmParameterstheParameters
 
G4EmModelManagermodelManager
 
G4EmBiasingManagerbiasManager
 
const G4ParticleDefinitiontheGamma
 
const G4ParticleDefinitiontheElectron
 
const G4ParticleDefinitionthePositron
 
const G4ParticleDefinitionsecondaryParticle
 
G4bool buildLambdaTable
 
std::vector< G4VEmModel * > emModels
 
G4int numberOfModels
 
G4PhysicsTabletheLambdaTable
 
G4PhysicsTabletheLambdaTablePrim
 
std::vector< G4doubletheEnergyOfCrossSectionMax
 
std::vector< G4doubletheCrossSectionMax
 
size_t idxLambda
 
size_t idxLambdaPrim
 
const std::vector< G4double > * theCuts
 
const std::vector< G4double > * theCutsGamma
 
const std::vector< G4double > * theCutsElectron
 
const std::vector< G4double > * theCutsPositron
 
const std::vector< G4double > * theDensityFactor
 
const std::vector< G4int > * theDensityIdx
 
G4int nLambdaBins
 
G4double minKinEnergy
 
G4double minKinEnergyPrim
 
G4double maxKinEnergy
 
G4double lambdaFactor
 
G4double biasFactor
 
G4bool integral
 
G4bool applyCuts
 
G4bool startFromNull
 
G4bool splineFlag
 
G4bool actMinKinEnergy
 
G4bool actMaxKinEnergy
 
G4bool actBinning
 
G4bool actSpline
 
std::vector< G4DynamicParticle * > secParticles
 
G4VEmModelcurrentModel
 
const G4ParticleDefinitionparticle
 
const G4ParticleDefinitioncurrentParticle
 
const G4MaterialbaseMaterial
 
const G4MaterialcurrentMaterial
 
const G4MaterialCutsCouplecurrentCouple
 
size_t currentCoupleIndex
 
size_t basedCoupleIndex
 
G4double mfpKinEnergy
 
G4double preStepKinEnergy
 
G4double preStepLambda
 
G4double fFactor
 
G4bool biasFlag
 
G4bool weightFlag
 
G4int mainSecondaries
 
G4int secID
 
G4int fluoID
 
G4int augerID
 
G4int biasID
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VProcess
static const G4StringGetProcessTypeName (G4ProcessType)
 

Detailed Description

Definition at line 93 of file G4VEmProcess.hh.

Constructor & Destructor Documentation

◆ G4VEmProcess() [1/2]

G4VEmProcess::G4VEmProcess ( const G4String name,
G4ProcessType  type = fElectromagnetic 
)

Definition at line 91 of file G4VEmProcess.cc.

91  :
92  G4VDiscreteProcess(name, type),
93  secondaryParticle(nullptr),
94  buildLambdaTable(true),
95  numberOfModels(0),
96  theLambdaTable(nullptr),
97  theLambdaTablePrim(nullptr),
98  theDensityFactor(nullptr),
99  theDensityIdx(nullptr),
100  integral(false),
101  applyCuts(false),
102  startFromNull(false),
103  splineFlag(true),
104  currentModel(nullptr),
105  particle(nullptr),
106  currentParticle(nullptr),
107  currentCouple(nullptr)
108 {
110  SetVerboseLevel(1);
111 
112  // Size of tables assuming spline
113  minKinEnergy = 0.1*keV;
114  maxKinEnergy = 10.0*TeV;
115  nLambdaBins = 77;
117  actBinning = false;
118  actSpline = false;
119  actMinKinEnergy = false;
120  actMaxKinEnergy = false;
121 
122  // default lambda factor
123  lambdaFactor = 0.8;
124 
125  // default limit on polar angle
126  biasFactor = fFactor = 1.0;
127 
128  // particle types
132 
134 
136  fParticleChange.SetSecondaryWeightByProcess(true);
137  secParticles.reserve(5);
138 
139  baseMaterial = currentMaterial = nullptr;
140 
143 
145  = basedCoupleIndex = 0;
146 
148  biasManager = nullptr;
149  biasFlag = false;
150  weightFlag = false;
152  lManager->Register(this);
153  secID = fluoID = augerID = biasID = -1;
154  mainSecondaries = 100;
155  if("phot" == GetProcessName() || "compt" == GetProcessName()) {
156  mainSecondaries = 1;
157  }
158 }
const std::vector< G4double > * theCutsGamma
G4bool weightFlag
static G4LossTableManager * Instance()
G4PhysicsTable * theLambdaTablePrim
G4VEmModel * currentModel
G4ParticleChangeForGamma fParticleChange
G4EmParameters * theParameters
const std::vector< G4double > * theCutsPositron
size_t basedCoupleIndex
const G4MaterialCutsCouple * currentCouple
G4double lambdaFactor
const G4Material * baseMaterial
G4double fFactor
G4PhysicsTable * theLambdaTable
G4double minKinEnergyPrim
G4bool applyCuts
G4double mfpKinEnergy
const G4ParticleDefinition * currentParticle
G4double minKinEnergy
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4bool splineFlag
G4bool startFromNull
const std::vector< G4int > * theDensityIdx
std::vector< G4DynamicParticle * > secParticles
G4bool actSpline
G4LossTableManager * lManager
void Register(G4VEnergyLossProcess *p)
const G4ParticleDefinition * secondaryParticle
G4bool actBinning
const G4ParticleDefinition * particle
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
const std::vector< G4double > * theCuts
static G4Positron * Positron()
Definition: G4Positron.cc:94
const G4Material * currentMaterial
size_t idxLambdaPrim
const G4ParticleDefinition * theElectron
G4bool actMaxKinEnergy
size_t idxLambda
G4EmModelManager * modelManager
static G4EmParameters * Instance()
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
G4double preStepLambda
G4EmBiasingManager * biasManager
static G4Electron * Electron()
Definition: G4Electron.cc:94
static const double TeV
Definition: G4SIunits.hh:215
G4int numberOfModels
const std::vector< G4double > * theDensityFactor
static const double keV
Definition: G4SIunits.hh:213
G4double biasFactor
size_t currentCoupleIndex
G4bool actMinKinEnergy
const std::vector< G4double > * theCutsElectron
#define DBL_MAX
Definition: templates.hh:83
G4double maxKinEnergy
G4double preStepKinEnergy
G4bool buildLambdaTable
const G4ParticleDefinition * theGamma
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:437
const G4ParticleDefinition * thePositron
G4int mainSecondaries
Here is the call graph for this function:

◆ ~G4VEmProcess()

G4VEmProcess::~G4VEmProcess ( )
virtual

Definition at line 162 of file G4VEmProcess.cc.

163 {
164  /*
165  if(1 < verboseLevel) {
166  G4cout << "G4VEmProcess destruct " << GetProcessName()
167  << " " << this << " " << theLambdaTable <<G4endl;
168  }
169  */
170  if(lManager->IsMaster()) {
171  if(theLambdaTable) {
173  delete theLambdaTable;
174  }
175  if(theLambdaTablePrim) {
177  delete theLambdaTablePrim;
178  }
179  }
180  delete modelManager;
181  delete biasManager;
182  lManager->DeRegister(this);
183  //G4cout << "G4VEmProcess removed " << G4endl;
184 }
G4PhysicsTable * theLambdaTablePrim
void DeRegister(G4VEnergyLossProcess *p)
G4PhysicsTable * theLambdaTable
G4LossTableManager * lManager
G4EmModelManager * modelManager
G4EmBiasingManager * biasManager
void clearAndDestroy()
Here is the call graph for this function:

◆ G4VEmProcess() [2/2]

G4VEmProcess::G4VEmProcess ( G4VEmProcess )
private

Member Function Documentation

◆ ActivateForcedInteraction()

void G4VEmProcess::ActivateForcedInteraction ( G4double  length = 0.0,
const G4String r = "",
G4bool  flag = true 
)

Definition at line 1128 of file G4VEmProcess.cc.

1130 {
1131  if(!biasManager) { biasManager = new G4EmBiasingManager(); }
1132  if(1 < verboseLevel) {
1133  G4cout << "### ActivateForcedInteraction: for "
1134  << particle->GetParticleName()
1135  << " and process " << GetProcessName()
1136  << " length(mm)= " << length/mm
1137  << " in G4Region <" << r
1138  << "> weightFlag= " << flag
1139  << G4endl;
1140  }
1141  weightFlag = flag;
1143 }
G4bool weightFlag
void ActivateForcedInteraction(G4double length=0.0, const G4String &r="")
G4int verboseLevel
Definition: G4VProcess.hh:368
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * particle
G4EmBiasingManager * biasManager
#define G4endl
Definition: G4ios.hh:61
static const double mm
Definition: G4SIunits.hh:114
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ActivateSecondaryBiasing()

void G4VEmProcess::ActivateSecondaryBiasing ( const G4String region,
G4double  factor,
G4double  energyLimit 
)

Definition at line 1148 of file G4VEmProcess.cc.

1151 {
1152  if (0.0 <= factor) {
1153 
1154  // Range cut can be applied only for e-
1155  if(0.0 == factor && secondaryParticle != G4Electron::Electron())
1156  { return; }
1157 
1158  if(!biasManager) { biasManager = new G4EmBiasingManager(); }
1159  biasManager->ActivateSecondaryBiasing(region, factor, energyLimit);
1160  if(1 < verboseLevel) {
1161  G4cout << "### ActivateSecondaryBiasing: for "
1162  << " process " << GetProcessName()
1163  << " factor= " << factor
1164  << " in G4Region <" << region
1165  << "> energyLimit(MeV)= " << energyLimit/MeV
1166  << G4endl;
1167  }
1168  }
1169 }
static const double MeV
Definition: G4SIunits.hh:211
G4int verboseLevel
Definition: G4VProcess.hh:368
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * secondaryParticle
void ActivateSecondaryBiasing(const G4String &region, G4double factor, G4double energyLimit)
static const G4double factor
G4EmBiasingManager * biasManager
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddEmModel()

void G4VEmProcess::AddEmModel ( G4int  order,
G4VEmModel p,
const G4Region region = 0 
)

Definition at line 206 of file G4VEmProcess.cc.

208 {
209  G4VEmFluctuationModel* fm = nullptr;
210  modelManager->AddEmModel(order, p, fm, region);
211  if(p) { p->SetParticleChange(pParticleChange); }
212 }
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *, const G4Region *)
void SetParticleChange(G4VParticleChange *, G4VEmFluctuationModel *f=0)
Definition: G4VEmModel.cc:410
G4EmModelManager * modelManager
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildLambdaTable()

void G4VEmProcess::BuildLambdaTable ( )
private

Definition at line 428 of file G4VEmProcess.cc.

429 {
430  if(1 < verboseLevel) {
431  G4cout << "G4EmProcess::BuildLambdaTable() for process "
432  << GetProcessName() << " and particle "
433  << particle->GetParticleName() << " " << this
434  << G4endl;
435  }
436 
437  // Access to materials
438  const G4ProductionCutsTable* theCoupleTable=
440  size_t numOfCouples = theCoupleTable->GetTableSize();
441 
443 
444  G4PhysicsLogVector* aVector = nullptr;
445  G4PhysicsLogVector* aVectorPrim = nullptr;
446  G4PhysicsLogVector* bVectorPrim = nullptr;
447 
448  G4double scale =
450  G4int nbin = theParameters->NumberOfBins();
451  if(actBinning) { nbin = std::max(nbin, nLambdaBins); }
454 
455  for(size_t i=0; i<numOfCouples; ++i) {
456 
457  if (bld->GetFlag(i)) {
458 
459  // create physics vector and fill it
460  const G4MaterialCutsCouple* couple =
461  theCoupleTable->GetMaterialCutsCouple(i);
462 
463  // build main table
464  if(buildLambdaTable) {
465  delete (*theLambdaTable)[i];
466 
467  // if start from zero then change the scale
468  G4double emin = minKinEnergy;
469  G4bool startNull = false;
470  if(startFromNull) {
472  if(e >= emin) {
473  emin = e;
474  startNull = true;
475  }
476  }
477  G4double emax = emax1;
478  if(emax <= emin) { emax = 2*emin; }
479  G4int bin = G4lrint(nbin*G4Log(emax/emin)/scale);
480  if(bin < 3) { bin = 3; }
481  aVector = new G4PhysicsLogVector(emin, emax, bin);
482  aVector->SetSpline(splineFlag);
483  modelManager->FillLambdaVector(aVector, couple, startNull);
484  if(splineFlag) { aVector->FillSecondDerivatives(); }
486  }
487  // build high energy table
489  delete (*theLambdaTablePrim)[i];
490 
491  // start not from zero
492  if(!bVectorPrim) {
493  G4int bin = G4lrint(nbin*G4Log(maxKinEnergy/minKinEnergyPrim)/scale);
494  if(bin < 3) { bin = 3; }
495  aVectorPrim =
497  bVectorPrim = aVectorPrim;
498  } else {
499  aVectorPrim = new G4PhysicsLogVector(*bVectorPrim);
500  }
501  // always use spline
502  aVectorPrim->SetSpline(splineFlag);
503  modelManager->FillLambdaVector(aVectorPrim, couple, false,
505  aVectorPrim->FillSecondDerivatives();
507  aVectorPrim);
508  }
509  }
510  }
511 
513 
514  if(1 < verboseLevel) {
515  G4cout << "Lambda table is built for "
517  << G4endl;
518  }
519 }
static void SetPhysicsVector(G4PhysicsTable *physTable, size_t idx, G4PhysicsVector *vec)
G4int verboseLevel
Definition: G4VProcess.hh:368
const G4Material * GetMaterial() const
G4PhysicsTable * theLambdaTablePrim
G4EmParameters * theParameters
float bin[41]
Definition: plottest35.C:14
G4PhysicsTable * theLambdaTable
void FillLambdaVector(G4PhysicsVector *, const G4MaterialCutsCouple *, G4bool startFromNull=true, G4EmTableType t=fRestricted)
G4double minKinEnergyPrim
int G4int
Definition: G4Types.hh:78
void FillSecondDerivatives()
G4LossTableBuilder * GetTableBuilder()
void SetSpline(G4bool)
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *, const G4Material *)
G4double minKinEnergy
G4bool Spline() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4bool splineFlag
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4bool startFromNull
bool G4bool
Definition: G4Types.hh:79
Double_t scale
G4double MinKinEnergy() const
G4bool actSpline
G4LossTableManager * lManager
G4bool actBinning
const G4ParticleDefinition * particle
G4int NumberOfBins() const
static const G4double emax
G4double G4Log(G4double x)
Definition: G4Log.hh:230
static G4ProductionCutsTable * GetProductionCutsTable()
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
void FindLambdaMax()
G4double MaxKinEnergy() const
int G4lrint(double ad)
Definition: templates.hh:163
G4EmModelManager * modelManager
G4bool GetFlag(size_t idx) const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4double maxKinEnergy
G4bool buildLambdaTable
Here is the call graph for this function:
Here is the caller graph for this function:

◆ BuildPhysicsTable()

void G4VEmProcess::BuildPhysicsTable ( const G4ParticleDefinition part)
virtual

Reimplemented from G4VProcess.

Reimplemented in G4PolarizedCompton, and G4eplusPolarizedAnnihilation.

Definition at line 352 of file G4VEmProcess.cc.

353 {
354  G4bool isMaster = true;
355  const G4VEmProcess* masterProc =
356  static_cast<const G4VEmProcess*>(GetMasterProcess());
357  if(masterProc && masterProc != this) { isMaster = false; }
358 
359  G4String num = part.GetParticleName();
360  if(1 < verboseLevel) {
361  G4cout << "### G4VEmProcess::BuildPhysicsTable() for "
362  << GetProcessName()
363  << " and particle " << num
364  << " buildLambdaTable= " << buildLambdaTable
365  << " isMaster= " << isMaster
366  << G4endl;
367  }
368 
369  if(particle == &part) {
370 
372 
373  // worker initialisation
374  if(!isMaster) {
375  theLambdaTable = masterProc->LambdaTable();
376  theLambdaTablePrim = masterProc->LambdaTablePrim();
377 
378  if(theLambdaTable) {
380  } else if(theLambdaTablePrim) {
382  }
385  if(theLambdaTable) { FindLambdaMax(); }
386 
387  // local initialisation of models
388  G4bool printing = true;
390  for(G4int i=0; i<numberOfModels; ++i) {
391  G4VEmModel* mod = GetModelByIndex(i, printing);
392  G4VEmModel* mod0= masterProc->GetModelByIndex(i, printing);
393  mod->InitialiseLocal(particle, mod0);
394  }
395  // master thread
396  } else {
401  }
402  }
403  }
404 
405  // explicitly defined printout by particle name
406  if(1 < verboseLevel ||
407  (0 < verboseLevel && (num == "gamma" || num == "e-" ||
408  num == "e+" || num == "mu+" ||
409  num == "mu-" || num == "proton"||
410  num == "pi+" || num == "pi-" ||
411  num == "kaon+" || num == "kaon-" ||
412  num == "alpha" || num == "anti_proton" ||
413  num == "GenericIon")))
414  {
415  PrintInfoProcess(part);
416  }
417 
418  if(1 < verboseLevel) {
419  G4cout << "### G4VEmProcess::BuildPhysicsTable() done for "
420  << GetProcessName()
421  << " and particle " << num
422  << G4endl;
423  }
424 }
const G4VProcess * GetMasterProcess() const
Definition: G4VProcess.hh:538
const std::vector< G4double > * GetDensityFactors()
G4int verboseLevel
Definition: G4VProcess.hh:368
G4PhysicsTable * theLambdaTablePrim
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
Definition: G4VEmModel.cc:219
G4PhysicsTable * theLambdaTable
G4double minKinEnergyPrim
int G4int
Definition: G4Types.hh:78
G4PhysicsTable * LambdaTable() const
G4LossTableBuilder * GetTableBuilder()
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const std::vector< G4int > * theDensityIdx
void PrintInfoProcess(const G4ParticleDefinition &)
G4LossTableManager * lManager
const G4ParticleDefinition * particle
void FindLambdaMax()
void InitialiseBaseMaterials(G4PhysicsTable *table)
G4EmModelManager * modelManager
#define G4endl
Definition: G4ios.hh:61
G4int numberOfModels
const std::vector< G4double > * theDensityFactor
G4int NumberOfModels() const
G4PhysicsTable * LambdaTablePrim() const
G4double maxKinEnergy
G4bool buildLambdaTable
G4VEmModel * GetModelByIndex(G4int idx=0, G4bool ver=false) const
void BuildLambdaTable()
const std::vector< G4int > * GetCoupleIndexes()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Clear()

void G4VEmProcess::Clear ( )
private

Definition at line 188 of file G4VEmProcess.cc.

189 {
190  currentCouple = nullptr;
191  preStepLambda = 0.0;
193  idxLambda = idxLambdaPrim = 0;
194 }
const G4MaterialCutsCouple * currentCouple
G4double mfpKinEnergy
size_t idxLambdaPrim
size_t idxLambda
G4double preStepLambda
#define DBL_MAX
Definition: templates.hh:83
Here is the caller graph for this function:

◆ ComputeCrossSectionPerAtom()

G4double G4VEmProcess::ComputeCrossSectionPerAtom ( G4double  kineticEnergy,
G4double  Z,
G4double  A = 0.,
G4double  cut = 0.0 
)

Definition at line 1024 of file G4VEmProcess.cc.

1026 {
1027  SelectModel(kineticEnergy, currentCoupleIndex);
1028  G4double x = 0.0;
1029  if(currentModel) {
1031  Z,A,cut);
1032  }
1033  return x;
1034 }
G4VEmModel * SelectModel(G4double &kinEnergy, size_t index)
G4VEmModel * currentModel
const G4ParticleDefinition * currentParticle
double A(double temperature)
Float_t Z
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:313
size_t currentCoupleIndex
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ ComputeCurrentLambda()

G4double G4VEmProcess::ComputeCurrentLambda ( G4double  kinEnergy)
inlineprivate

Definition at line 495 of file G4VEmProcess.hh.

496 {
499 }
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:258
G4VEmModel * currentModel
const G4Material * baseMaterial
const G4ParticleDefinition * currentParticle
const std::vector< G4double > * theCuts
size_t currentCoupleIndex
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeIntegralLambda()

void G4VEmProcess::ComputeIntegralLambda ( G4double  kinEnergy)
inlineprivate

Definition at line 535 of file G4VEmProcess.hh.

536 {
538  if (e <= mfpKinEnergy) {
540 
541  } else {
543  if(e1 > mfpKinEnergy) {
545  G4double preStepLambda1 = GetCurrentLambda(e1);
546  if(preStepLambda1 > preStepLambda) {
547  mfpKinEnergy = e1;
548  preStepLambda = preStepLambda1;
549  }
550  } else {
552  }
553  }
554 }
std::vector< G4double > theCrossSectionMax
G4double lambdaFactor
G4double fFactor
G4double GetCurrentLambda(G4double kinEnergy)
G4double mfpKinEnergy
std::vector< G4double > theEnergyOfCrossSectionMax
static const G4double e1
G4double preStepLambda
size_t currentCoupleIndex
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CrossSectionBiasingFactor()

G4double G4VEmProcess::CrossSectionBiasingFactor ( ) const
inline

Definition at line 588 of file G4VEmProcess.hh.

589 {
590  return biasFactor;
591 }
G4double biasFactor

◆ CrossSectionPerVolume()

G4double G4VEmProcess::CrossSectionPerVolume ( G4double  kineticEnergy,
const G4MaterialCutsCouple couple 
)

Definition at line 981 of file G4VEmProcess.cc.

983 {
984  // Cross section per atom is calculated
985  DefineMaterial(couple);
986  G4double cross = 0.0;
988  cross = GetCurrentLambda(kineticEnergy);
989  } else {
990  SelectModel(kineticEnergy, currentCoupleIndex);
993  kineticEnergy);
994  }
995 
996  if(cross < 0.0) { cross = 0.0; }
997  return cross;
998 }
void DefineMaterial(const G4MaterialCutsCouple *couple)
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:258
G4VEmModel * SelectModel(G4double &kinEnergy, size_t index)
G4VEmModel * currentModel
G4double fFactor
G4PhysicsTable * theLambdaTable
G4double GetCurrentLambda(G4double kinEnergy)
const G4ParticleDefinition * currentParticle
const G4Material * currentMaterial
size_t currentCoupleIndex
double G4double
Definition: G4Types.hh:76
G4bool buildLambdaTable
Here is the call graph for this function:

◆ CurrentMaterialCutsCoupleIndex()

size_t G4VEmProcess::CurrentMaterialCutsCoupleIndex ( ) const
inlineprotected

Definition at line 422 of file G4VEmProcess.hh.

423 {
424  return currentCoupleIndex;
425 }
size_t currentCoupleIndex
Here is the caller graph for this function:

◆ DefineMaterial()

void G4VEmProcess::DefineMaterial ( const G4MaterialCutsCouple couple)
inlineprivate

Definition at line 443 of file G4VEmProcess.hh.

444 {
445  if(couple != currentCouple) {
446  currentCouple = couple;
447  currentMaterial = couple->GetMaterial();
449  currentCoupleIndex = couple->GetIndex();
450  basedCoupleIndex = (*theDensityIdx)[currentCoupleIndex];
451  fFactor = biasFactor*(*theDensityFactor)[currentCoupleIndex];
454  idxLambda = idxLambdaPrim = 0;
455  }
456 }
const G4Material * GetMaterial() const
size_t basedCoupleIndex
const G4MaterialCutsCouple * currentCouple
const G4Material * baseMaterial
G4double fFactor
G4double mfpKinEnergy
const G4Material * currentMaterial
size_t idxLambdaPrim
size_t idxLambda
G4double biasFactor
size_t currentCoupleIndex
#define DBL_MAX
Definition: templates.hh:83
const G4Material * GetBaseMaterial() const
Definition: G4Material.hh:233
Here is the call graph for this function:
Here is the caller graph for this function:

◆ EmModel()

G4VEmModel * G4VEmProcess::EmModel ( G4int  index = 1) const

Definition at line 225 of file G4VEmProcess.cc.

226 {
227  G4VEmModel* p = nullptr;
228  if(index >= 0 && index < G4int(emModels.size())) { p = emModels[index]; }
229  return p;
230 }
Int_t index
int G4int
Definition: G4Types.hh:78
std::vector< G4VEmModel * > emModels
Here is the caller graph for this function:

◆ FindLambdaMax()

void G4VEmProcess::FindLambdaMax ( )
private

Definition at line 1038 of file G4VEmProcess.cc.

1039 {
1040  if(1 < verboseLevel) {
1041  G4cout << "### G4VEmProcess::FindLambdaMax: "
1042  << particle->GetParticleName()
1043  << " and process " << GetProcessName() << " " << G4endl;
1044  }
1045  size_t n = theLambdaTable->length();
1046  G4PhysicsVector* pv;
1047  G4double e, ss, emax, smax;
1048 
1049  size_t i;
1050 
1051  // first loop on existing vectors
1052  for (i=0; i<n; ++i) {
1053  pv = (*theLambdaTable)[i];
1054  if(pv) {
1055  size_t nb = pv->GetVectorLength();
1056  emax = DBL_MAX;
1057  smax = 0.0;
1058  if(nb > 0) {
1059  for (size_t j=0; j<nb; ++j) {
1060  e = pv->Energy(j);
1061  ss = (*pv)(j);
1062  if(ss > smax) {
1063  smax = ss;
1064  emax = e;
1065  }
1066  }
1067  }
1069  theCrossSectionMax[i] = smax;
1070  if(1 < verboseLevel) {
1071  G4cout << "For " << particle->GetParticleName()
1072  << " Max CS at i= " << i << " emax(MeV)= " << emax/MeV
1073  << " lambda= " << smax << G4endl;
1074  }
1075  }
1076  }
1077  // second loop using base materials
1078  for (i=0; i<n; ++i) {
1079  pv = (*theLambdaTable)[i];
1080  if(!pv){
1081  G4int j = (*theDensityIdx)[i];
1083  theCrossSectionMax[i] = (*theDensityFactor)[i]*theCrossSectionMax[j];
1084  }
1085  }
1086 }
std::vector< G4double > theCrossSectionMax
static const double MeV
Definition: G4SIunits.hh:211
G4int verboseLevel
Definition: G4VProcess.hh:368
G4PhysicsTable * theLambdaTable
int G4int
Definition: G4Types.hh:78
const G4int smax
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
Char_t n[5]
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
std::vector< G4double > theEnergyOfCrossSectionMax
size_t GetVectorLength() const
const G4ParticleDefinition * particle
static const G4double emax
size_t length() const
#define G4endl
Definition: G4ios.hh:61
G4double Energy(size_t index) const
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCurrentElement()

const G4Element * G4VEmProcess::GetCurrentElement ( ) const

Definition at line 1101 of file G4VEmProcess.cc.

1102 {
1103  const G4Element* elm = nullptr;
1105  return elm;
1106 }
const G4Element * GetCurrentElement() const
Definition: G4VEmModel.hh:467
G4VEmModel * currentModel
Here is the call graph for this function:

◆ GetCurrentLambda()

G4double G4VEmProcess::GetCurrentLambda ( G4double  kinEnergy)
inlineprivate

Definition at line 503 of file G4VEmProcess.hh.

504 {
505  G4double x;
506  if(e >= minKinEnergyPrim) { x = GetLambdaFromTablePrim(e); }
507  else if(theLambdaTable) { x = GetLambdaFromTable(e); }
508  else { x = ComputeCurrentLambda(e); }
509  return fFactor*x;
510 }
G4double GetLambdaFromTable(G4double kinEnergy)
G4double fFactor
G4PhysicsTable * theLambdaTable
G4double minKinEnergyPrim
G4double ComputeCurrentLambda(G4double kinEnergy)
G4double GetLambdaFromTablePrim(G4double kinEnergy)
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCurrentModel()

const G4VEmModel * G4VEmProcess::GetCurrentModel ( ) const
inline

Definition at line 695 of file G4VEmProcess.hh.

696 {
697  return currentModel;
698 }
G4VEmModel * currentModel

◆ GetElectronEnergyCut()

G4double G4VEmProcess::GetElectronEnergyCut ( )
inlineprotected

Definition at line 436 of file G4VEmProcess.hh.

437 {
439 }
size_t currentCoupleIndex
const std::vector< G4double > * theCutsElectron

◆ GetGammaEnergyCut()

G4double G4VEmProcess::GetGammaEnergyCut ( )
inlineprotected

Definition at line 429 of file G4VEmProcess.hh.

430 {
431  return (*theCutsGamma)[currentCoupleIndex];
432 }
const std::vector< G4double > * theCutsGamma
size_t currentCoupleIndex

◆ GetLambda()

G4double G4VEmProcess::GetLambda ( G4double kinEnergy,
const G4MaterialCutsCouple couple 
)
inline

Definition at line 515 of file G4VEmProcess.hh.

517 {
518  DefineMaterial(couple);
519  SelectModel(kinEnergy, currentCoupleIndex);
520  return GetCurrentLambda(kinEnergy);
521 }
void DefineMaterial(const G4MaterialCutsCouple *couple)
G4VEmModel * SelectModel(G4double &kinEnergy, size_t index)
G4double GetCurrentLambda(G4double kinEnergy)
size_t currentCoupleIndex
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLambdaFromTable()

G4double G4VEmProcess::GetLambdaFromTable ( G4double  kinEnergy)
inlineprivate

Definition at line 481 of file G4VEmProcess.hh.

482 {
483  return ((*theLambdaTable)[basedCoupleIndex])->Value(e, idxLambda);
484 }
size_t basedCoupleIndex
G4PhysicsTable * theLambdaTable
size_t idxLambda
Here is the caller graph for this function:

◆ GetLambdaFromTablePrim()

G4double G4VEmProcess::GetLambdaFromTablePrim ( G4double  kinEnergy)
inlineprivate

Definition at line 488 of file G4VEmProcess.hh.

489 {
490  return ((*theLambdaTablePrim)[basedCoupleIndex])->Value(e, idxLambdaPrim)/e;
491 }
G4PhysicsTable * theLambdaTablePrim
size_t basedCoupleIndex
size_t idxLambdaPrim
Here is the caller graph for this function:

◆ GetMeanFreePath()

G4double G4VEmProcess::GetMeanFreePath ( const G4Track &  track,
G4double  previousStepSize,
G4ForceCondition *  condition 
)
protectedvirtual

Implements G4VDiscreteProcess.

Reimplemented in G4PolarizedCompton, and G4eplusPolarizedAnnihilation.

Definition at line 1002 of file G4VEmProcess.cc.

1005 {
1006  *condition = NotForced;
1008 }
G4double condition(const G4ErrorSymMatrix &m)
G4double MeanFreePath(const G4Track &track)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetModelByIndex()

G4VEmModel * G4VEmProcess::GetModelByIndex ( G4int  idx = 0,
G4bool  ver = false 
) const

Definition at line 242 of file G4VEmProcess.cc.

243 {
244  return modelManager->GetModel(idx, ver);
245 }
G4VEmModel * GetModel(G4int, G4bool ver=false)
G4EmModelManager * modelManager
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetParticleChange()

G4ParticleChangeForGamma * G4VEmProcess::GetParticleChange ( )
inlineprotected

Definition at line 644 of file G4VEmProcess.hh.

645 {
646  return &fParticleChange;
647 }
G4ParticleChangeForGamma fParticleChange

◆ GetTargetElement()

const G4Element * G4VEmProcess::GetTargetElement ( ) const
inlineprotected

Definition at line 681 of file G4VEmProcess.hh.

682 {
684 }
const G4Element * GetCurrentElement() const
Definition: G4VEmModel.hh:467
G4VEmModel * currentModel
Here is the call graph for this function:

◆ GetTargetIsotope()

const G4Isotope * G4VEmProcess::GetTargetIsotope ( ) const
inlineprotected

Definition at line 688 of file G4VEmProcess.hh.

689 {
691 }
G4VEmModel * currentModel
const G4Isotope * GetCurrentIsotope() const
Definition: G4VEmModel.hh:474
Here is the call graph for this function:

◆ InitialiseProcess()

◆ IsApplicable()

◆ IsIntegral()

G4bool G4VEmProcess::IsIntegral ( ) const
inlineprotected

Definition at line 630 of file G4VEmProcess.hh.

631 {
632  return integral;
633 }

◆ LambdaBinning()

G4int G4VEmProcess::LambdaBinning ( ) const
inlineprotected

Definition at line 560 of file G4VEmProcess.hh.

561 {
562  return nLambdaBins;
563 }
Here is the caller graph for this function:

◆ LambdaPhysicsVector()

G4PhysicsVector * G4VEmProcess::LambdaPhysicsVector ( const G4MaterialCutsCouple )
protected

Definition at line 1091 of file G4VEmProcess.cc.

1092 {
1093  G4PhysicsVector* v =
1096  return v;
1097 }
G4EmParameters * theParameters
void SetSpline(G4bool)
G4double minKinEnergy
G4bool Spline() const
G4double maxKinEnergy
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LambdaTable()

G4PhysicsTable * G4VEmProcess::LambdaTable ( ) const
inline

Definition at line 595 of file G4VEmProcess.hh.

596 {
597  return theLambdaTable;
598 }
G4PhysicsTable * theLambdaTable
Here is the caller graph for this function:

◆ LambdaTablePrim()

G4PhysicsTable * G4VEmProcess::LambdaTablePrim ( ) const
inline

Definition at line 602 of file G4VEmProcess.hh.

603 {
604  return theLambdaTablePrim;
605 }
G4PhysicsTable * theLambdaTablePrim
Here is the caller graph for this function:

◆ MaxKinEnergy()

G4double G4VEmProcess::MaxKinEnergy ( ) const
inlineprotected

Definition at line 574 of file G4VEmProcess.hh.

575 {
576  return maxKinEnergy;
577 }
G4double maxKinEnergy
Here is the caller graph for this function:

◆ MeanFreePath()

G4double G4VEmProcess::MeanFreePath ( const G4Track &  track)

Definition at line 1012 of file G4VEmProcess.cc.

1013 {
1014  DefineMaterial(track.GetMaterialCutsCouple());
1015  preStepLambda = GetCurrentLambda(track.GetKineticEnergy());
1016  G4double x = DBL_MAX;
1017  if(0.0 < preStepLambda) { x = 1.0/preStepLambda; }
1018  return x;
1019 }
void DefineMaterial(const G4MaterialCutsCouple *couple)
G4double GetCurrentLambda(G4double kinEnergy)
G4double preStepLambda
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MinKinEnergy()

G4double G4VEmProcess::MinKinEnergy ( ) const
inlineprotected

Definition at line 567 of file G4VEmProcess.hh.

568 {
569  return minKinEnergy;
570 }
G4double minKinEnergy
Here is the caller graph for this function:

◆ MinPrimaryEnergy()

G4double G4VEmProcess::MinPrimaryEnergy ( const G4ParticleDefinition ,
const G4Material  
)
protectedvirtual

Reimplemented in G4GammaConversion, and G4CoulombScattering.

Definition at line 198 of file G4VEmProcess.cc.

200 {
201  return 0.0;
202 }
Here is the caller graph for this function:

◆ operator=()

G4VEmProcess& G4VEmProcess::operator= ( const G4VEmProcess right)
private

◆ Particle()

const G4ParticleDefinition * G4VEmProcess::Particle ( ) const
inline

Definition at line 609 of file G4VEmProcess.hh.

610 {
611  return particle;
612 }
const G4ParticleDefinition * particle

◆ PolarAngleLimit()

G4double G4VEmProcess::PolarAngleLimit ( ) const
inlineprotected

Definition at line 581 of file G4VEmProcess.hh.

582 {
583  return theParameters->MscThetaLimit();
584 }
G4EmParameters * theParameters
G4double MscThetaLimit() const
Here is the call graph for this function:

◆ PostStepDoIt()

G4VParticleChange * G4VEmProcess::PostStepDoIt ( const G4Track &  track,
const G4Step &  step 
)
virtual

Reimplemented from G4VDiscreteProcess.

Definition at line 697 of file G4VEmProcess.cc.

699 {
700  // In all cases clear number of interaction lengths
703 
704  fParticleChange.InitializeForPostStep(track);
705 
706  // Do not make anything if particle is stopped, the annihilation then
707  // should be performed by the AtRestDoIt!
708  if (track.GetTrackStatus() == fStopButAlive) { return &fParticleChange; }
709 
710  G4double finalT = track.GetKineticEnergy();
711 
712  // forced process - should happen only once per track
713  if(biasFlag) {
715  biasFlag = false;
716  }
717  }
718 
719  // Integral approach
720  if (integral) {
721  G4double lx = GetLambda(finalT, currentCouple);
722  if(preStepLambda<lx && 1 < verboseLevel) {
723  G4cout << "WARNING: for " << currentParticle->GetParticleName()
724  << " and " << GetProcessName()
725  << " E(MeV)= " << finalT/MeV
726  << " preLambda= " << preStepLambda << " < "
727  << lx << " (postLambda) "
728  << G4endl;
729  }
730 
731  if(preStepLambda*G4UniformRand() > lx) {
733  return &fParticleChange;
734  }
735  }
736 
738  if(!currentModel->IsActive(finalT)) { return &fParticleChange; }
739 
740  // define new weight for primary and secondaries
741  G4double weight = fParticleChange.GetParentWeight();
742  if(weightFlag) {
743  weight /= biasFactor;
744  fParticleChange.ProposeWeight(weight);
745  }
746 
747  /*
748  if(0 < verboseLevel) {
749  G4cout << "G4VEmProcess::PostStepDoIt: Sample secondary; E= "
750  << finalT/MeV
751  << " MeV; model= (" << currentModel->LowEnergyLimit()
752  << ", " << currentModel->HighEnergyLimit() << ")"
753  << G4endl;
754  }
755  */
756 
757  // sample secondaries
758  secParticles.clear();
760  currentCouple,
761  track.GetDynamicParticle(),
762  (*theCuts)[currentCoupleIndex]);
763 
764  G4int num0 = secParticles.size();
765 
766  // splitting or Russian roulette
767  if(biasManager) {
769  G4double eloss = 0.0;
773  step.GetPostStepPoint()->GetSafety());
774  if(eloss > 0.0) {
775  eloss += fParticleChange.GetLocalEnergyDeposit();
776  fParticleChange.ProposeLocalEnergyDeposit(eloss);
777  }
778  }
779  }
780 
781  // save secondaries
782  G4int num = secParticles.size();
783  if(num > 0) {
784 
785  fParticleChange.SetNumberOfSecondaries(num);
786  G4double edep = fParticleChange.GetLocalEnergyDeposit();
787  G4double time = track.GetGlobalTime();
788 
789  for (G4int i=0; i<num; ++i) {
790  if (secParticles[i]) {
793  G4double e = dp->GetKineticEnergy();
794  G4bool good = true;
795  if(applyCuts) {
796  if (p == theGamma) {
797  if (e < (*theCutsGamma)[currentCoupleIndex]) { good = false; }
798 
799  } else if (p == theElectron) {
800  if (e < (*theCutsElectron)[currentCoupleIndex]) { good = false; }
801 
802  } else if (p == thePositron) {
803  if (electron_mass_c2 < (*theCutsGamma)[currentCoupleIndex] &&
804  e < (*theCutsPositron)[currentCoupleIndex]) {
805  good = false;
806  e += 2.0*electron_mass_c2;
807  }
808  }
809  // added secondary if it is good
810  }
811  if (good) {
812  G4Track* t = new G4Track(dp, time, track.GetPosition());
813  t->SetTouchableHandle(track.GetTouchableHandle());
814  t->SetWeight(weight);
815  pParticleChange->AddSecondary(t);
816 
817  // define type of secondary
818  if(i < mainSecondaries) { t->SetCreatorModelIndex(secID); }
819  else if(i < num0) {
820  if(p == theGamma) {
821  t->SetCreatorModelIndex(fluoID);
822  } else {
823  t->SetCreatorModelIndex(augerID);
824  }
825  } else {
826  t->SetCreatorModelIndex(biasID);
827  }
828 
829  //G4cout << "Secondary(post step) has weight " << t->GetWeight()
830  // << ", Ekin= " << t->GetKineticEnergy()/MeV << " MeV" <<G4endl;
831  } else {
832  delete dp;
833  edep += e;
834  }
835  }
836  }
837  fParticleChange.ProposeLocalEnergyDeposit(edep);
838  }
839 
840  if(0.0 == fParticleChange.GetProposedKineticEnergy() &&
841  fAlive == fParticleChange.GetTrackStatus()) {
843  { fParticleChange.ProposeTrackStatus(fStopButAlive); }
844  else { fParticleChange.ProposeTrackStatus(fStopAndKill); }
845  }
846 
847  return &fParticleChange;
848 }
const std::vector< G4double > * theCutsGamma
G4double GetLambda(G4double &kinEnergy, const G4MaterialCutsCouple *couple)
static const double MeV
Definition: G4SIunits.hh:211
G4VEmModel * SelectModel(G4double &kinEnergy, size_t index)
G4bool weightFlag
G4int verboseLevel
Definition: G4VProcess.hh:368
G4ProcessVector * GetAtRestProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4VEmModel * currentModel
G4bool SecondaryBiasingRegion(G4int coupleIdx)
G4ParticleChangeForGamma fParticleChange
G4bool ForcedInteractionRegion(G4int coupleIdx)
const std::vector< G4double > * theCutsPositron
G4double theNumberOfInteractionLengthLeft
Definition: G4VProcess.hh:293
const G4MaterialCutsCouple * currentCouple
G4ProcessManager * GetProcessManager() const
virtual void SampleSecondaries(std::vector< G4DynamicParticle *> *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double tmax=DBL_MAX)=0
double weight
Definition: plottest35.C:25
void ClearNumberOfInteractionLengthLeft()
Definition: G4VProcess.hh:447
int G4int
Definition: G4Types.hh:78
Double_t edep
G4bool applyCuts
G4double mfpKinEnergy
const G4ParticleDefinition * currentParticle
G4double ApplySecondaryBiasing(std::vector< G4DynamicParticle *> &, const G4Track &track, G4VEmModel *currentModel, G4ParticleChangeForGamma *pParticleChange, G4double &eloss, G4int coupleIdx, G4double tcut, G4double safety=0.0)
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4double GetKineticEnergy() const
const G4String & GetParticleName() const
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
std::vector< G4DynamicParticle * > secParticles
G4int size() const
float electron_mass_c2
Definition: hepunit.py:274
const G4ParticleDefinition * particle
const std::vector< G4double > * theCuts
G4bool IsActive(G4double kinEnergy)
Definition: G4VEmModel.hh:753
const G4ParticleDefinition * theElectron
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
G4double preStepLambda
G4EmBiasingManager * biasManager
#define G4endl
Definition: G4ios.hh:61
G4double biasFactor
size_t currentCoupleIndex
const G4ParticleDefinition * GetParticleDefinition() const
double G4double
Definition: G4Types.hh:76
const std::vector< G4double > * theCutsElectron
#define DBL_MAX
Definition: templates.hh:83
const G4ParticleDefinition * theGamma
const G4ParticleDefinition * thePositron
G4int mainSecondaries
Here is the call graph for this function:

◆ PostStepGetPhysicalInteractionLength()

G4double G4VEmProcess::PostStepGetPhysicalInteractionLength ( const G4Track &  track,
G4double  previousStepSize,
G4ForceCondition *  condition 
)
virtual

Reimplemented from G4VDiscreteProcess.

Reimplemented in G4PolarizedCompton, and G4eplusPolarizedAnnihilation.

Definition at line 615 of file G4VEmProcess.cc.

619 {
620  *condition = NotForced;
621  G4double x = DBL_MAX;
622 
623  preStepKinEnergy = track.GetKineticEnergy();
624  DefineMaterial(track.GetMaterialCutsCouple());
626 
630  return x;
631  }
632 
633  // forced biasing only for primary particles
634  if(biasManager) {
635  if(0 == track.GetParentID()) {
636  if(biasFlag &&
638  return biasManager->GetStepLimit(currentCoupleIndex, previousStepSize);
639  }
640  }
641  }
642 
643  // compute mean free path
647 
648  // zero cross section
649  if(preStepLambda <= 0.0) {
652  }
653  }
654 
655  // non-zero cross section
656  if(preStepLambda > 0.0) {
657 
659 
660  // beggining of tracking (or just after DoIt of this process)
663 
664  } else if(currentInteractionLength < DBL_MAX) {
665 
666  // subtract NumberOfInteractionLengthLeft using previous step
668  previousStepSize/currentInteractionLength;
669  //SubtractNumberOfInteractionLengthLeft(previousStepSize);
672  }
673 
674  // new mean free path and step limit for the next step
677  /*
678 #ifdef G4VERBOSE
679  if (verboseLevel>2){
680  G4cout << "G4VEmProcess::PostStepGetPhysicalInteractionLength ";
681  G4cout << "[ " << GetProcessName() << "]" << G4endl;
682  G4cout << " for " << currentParticle->GetParticleName()
683  << " in Material " << currentMaterial->GetName()
684  << " Ekin(MeV)= " << preStepKinEnergy/MeV
685  <<G4endl;
686  G4cout << " MeanFreePath = " << currentInteractionLength/cm << "[cm]"
687  << " InteractionLength= " << x/cm <<"[cm] " <<G4endl;
688  }
689 #endif
690  */
691  }
692  return x;
693 }
G4double condition(const G4ErrorSymMatrix &m)
void DefineMaterial(const G4MaterialCutsCouple *couple)
G4VEmModel * SelectModel(G4double &kinEnergy, size_t index)
G4VEmModel * currentModel
G4bool ForcedInteractionRegion(G4int coupleIdx)
G4double theNumberOfInteractionLengthLeft
Definition: G4VProcess.hh:293
G4double GetCurrentLambda(G4double kinEnergy)
G4double mfpKinEnergy
#define G4UniformRand()
Definition: Randomize.hh:97
G4double GetStepLimit(G4int coupleIdx, G4double previousStep)
G4double currentInteractionLength
Definition: G4VProcess.hh:297
G4bool IsActive(G4double kinEnergy)
Definition: G4VEmModel.hh:753
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double preStepLambda
void ComputeIntegralLambda(G4double kinEnergy)
G4EmBiasingManager * biasManager
size_t currentCoupleIndex
G4double theInitialNumberOfInteractionLength
Definition: G4VProcess.hh:300
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
G4double preStepKinEnergy
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PreparePhysicsTable()

void G4VEmProcess::PreparePhysicsTable ( const G4ParticleDefinition part)
virtual

Reimplemented from G4VProcess.

Definition at line 249 of file G4VEmProcess.cc.

250 {
251  G4bool isMaster = true;
252  const G4VEmProcess* masterProcess =
253  static_cast<const G4VEmProcess*>(GetMasterProcess());
254  if(masterProcess && masterProcess != this) { isMaster = false; }
255 
256  if(!particle) { SetParticle(&part); }
257 
258  if(part.GetParticleType() == "nucleus" &&
259  part.GetParticleSubType() == "generic") {
260 
261  G4String pname = part.GetParticleName();
262  if(pname != "deuteron" && pname != "triton" &&
263  pname != "alpha" && pname != "He3" &&
264  pname != "alpha+" && pname != "helium" &&
265  pname != "hydrogen") {
266 
268  }
269  }
270 
271  if(1 < verboseLevel) {
272  G4cout << "G4VEmProcess::PreparePhysicsTable() for "
273  << GetProcessName()
274  << " and particle " << part.GetParticleName()
275  << " local particle " << particle->GetParticleName()
276  << G4endl;
277  }
278 
279  if(particle != &part) { return; }
280 
282 
283  lManager->PreparePhysicsTable(&part, this, isMaster);
284 
285  Clear();
287 
288  const G4ProductionCutsTable* theCoupleTable=
290  size_t n = theCoupleTable->GetTableSize();
291 
292  theEnergyOfCrossSectionMax.resize(n, 0.0);
293  theCrossSectionMax.resize(n, DBL_MAX);
294 
295  // initialisation of the process
298  if(isMaster) { SetVerboseLevel(theParameters->Verbose()); }
302 
303  // initialisation of models
305  for(G4int i=0; i<numberOfModels; ++i) {
306  G4VEmModel* mod = modelManager->GetModel(i);
307  if(0 == i) { currentModel = mod; }
309  mod->SetMasterThread(isMaster);
310  if(mod->HighEnergyLimit() > maxKinEnergy) {
312  }
313  }
314 
317  2.,verboseLevel);
321 
322  // prepare tables
323  if(buildLambdaTable && isMaster){
324  theLambdaTable =
327  }
328  // high energy table
329  if(isMaster && minKinEnergyPrim < maxKinEnergy){
333  }
334  // forced biasing
335  if(biasManager) {
337  biasFlag = false;
338  }
339  // defined ID of secondary particles
340  G4String nam1 = GetProcessName();
341  G4String nam2 = nam1 + "_fluo" ;
342  G4String nam3 = nam1 + "_auger";
343  G4String nam4 = nam1 + "_split";
348 }
const std::vector< G4double > * theCutsGamma
std::vector< G4double > theCrossSectionMax
const G4VProcess * GetMasterProcess() const
Definition: G4VProcess.hh:538
G4int verboseLevel
Definition: G4VProcess.hh:368
G4PhysicsTable * theLambdaTablePrim
G4VEmModel * currentModel
G4VEmModel * GetModel(G4int, G4bool ver=false)
G4EmParameters * theParameters
const std::vector< G4double > * theCutsPositron
virtual void InitialiseProcess(const G4ParticleDefinition *)=0
const G4String & GetParticleType() const
G4double lambdaFactor
const std::vector< G4double > * GetEnergyCutsVector(size_t pcIdx) const
G4PhysicsTable * theLambdaTable
G4double minKinEnergyPrim
int G4int
Definition: G4Types.hh:78
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)
G4bool applyCuts
G4LossTableBuilder * GetTableBuilder()
G4int Verbose() const
void Initialise(const G4ParticleDefinition &part, const G4String &procName, G4int verbose)
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:725
G4double minKinEnergy
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
Char_t n[5]
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:634
bool G4bool
Definition: G4Types.hh:79
void SetParticle(const G4ParticleDefinition *p)
G4double MinKinEnergy() const
G4LossTableManager * lManager
const G4ParticleDefinition * secondaryParticle
std::vector< G4double > theEnergyOfCrossSectionMax
const G4ParticleDefinition * particle
const std::vector< G4double > * theCuts
string pname
Definition: eplot.py:33
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4double minSubRange, G4int verb)
G4double MscThetaLimit() const
void SetMasterThread(G4bool val)
Definition: G4VEmModel.hh:711
static G4ProductionCutsTable * GetProductionCutsTable()
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:93
G4double MaxKinEnergy() const
G4bool actMaxKinEnergy
void InitialiseBaseMaterials(G4PhysicsTable *table)
static G4int Register(const G4String &)
G4EmModelManager * modelManager
G4EmBiasingManager * biasManager
G4bool ApplyCuts() const
void PreparePhysicsTable(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p, G4bool theMaster)
#define G4endl
Definition: G4ios.hh:61
void SetFluoFlag(G4bool val)
G4int numberOfModels
G4VAtomDeexcitation * AtomDeexcitation()
G4bool actMinKinEnergy
G4int WorkerVerbose() const
const std::vector< G4double > * theCutsElectron
G4double LambdaFactor() const
#define DBL_MAX
Definition: templates.hh:83
G4int NumberOfModels() const
G4double maxKinEnergy
const G4String & GetParticleSubType() const
G4bool buildLambdaTable
void SetPolarAngleLimit(G4double)
Definition: G4VEmModel.hh:760
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:437
Here is the call graph for this function:

◆ PrintInfo()

◆ PrintInfoProcess()

void G4VEmProcess::PrintInfoProcess ( const G4ParticleDefinition part)
private

Definition at line 523 of file G4VEmProcess.cc.

524 {
525  if(verboseLevel > 0) {
526  G4cout << std::setprecision(6);
527  G4cout << G4endl << GetProcessName() << ": for "
528  << part.GetParticleName();
529  if(integral) { G4cout << ", integral: 1 "; }
530  if(applyCuts) { G4cout << ", applyCuts: 1 "; }
531  G4cout << " SubType= " << GetProcessSubType();;
532  if(biasFactor != 1.0) { G4cout << " BiasingFactor= " << biasFactor; }
533  G4cout << " BuildTable= " << buildLambdaTable;
534  G4cout << G4endl;
535  if(buildLambdaTable) {
536  if(particle == &part) {
537  size_t length = theLambdaTable->length();
538  for(size_t i=0; i<length; ++i) {
539  G4PhysicsVector* v = (*theLambdaTable)[i];
540  if(v) {
541  G4cout << " Lambda table from ";
542  G4double emin = v->Energy(0);
543  G4double emax = v->GetMaxEnergy();
544  G4int nbin = v->GetVectorLength() - 1;
545  if(emin > minKinEnergy) { G4cout << "threshold "; }
546  else { G4cout << G4BestUnit(emin,"Energy"); }
547  G4cout << " to "
548  << G4BestUnit(emax,"Energy")
549  << ", " << G4lrint(nbin/std::log10(emax/emin))
550  << " bins per decade, spline: "
551  << splineFlag
552  << G4endl;
553  break;
554  }
555  }
556  } else {
557  G4cout << " Used Lambda table of "
558  << particle->GetParticleName() << G4endl;;
559  }
560  }
562  if(particle == &part) {
563  size_t length = theLambdaTablePrim->length();
564  for(size_t i=0; i<length; ++i) {
565  G4PhysicsVector* v = (*theLambdaTablePrim)[i];
566  if(v) {
567  G4cout << " LambdaPrime table from "
568  << G4BestUnit(v->Energy(0),"Energy")
569  << " to "
570  << G4BestUnit(v->GetMaxEnergy(),"Energy")
571  << " in " << v->GetVectorLength()-1
572  << " bins "
573  << G4endl;
574  break;
575  }
576  }
577  } else {
578  G4cout << " Used LambdaPrime table of "
579  << particle->GetParticleName() << G4endl;;
580  }
581  }
582  PrintInfo();
584  }
585 
586  if(verboseLevel > 2 && buildLambdaTable) {
587  G4cout << " LambdaTable address= " << theLambdaTable << G4endl;
588  if(theLambdaTable && particle == &part) {
589  G4cout << (*theLambdaTable) << G4endl;
590  }
591  }
592 }
virtual void PrintInfo()=0
G4int verboseLevel
Definition: G4VProcess.hh:368
G4PhysicsTable * theLambdaTablePrim
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4PhysicsTable * theLambdaTable
G4double minKinEnergyPrim
int G4int
Definition: G4Types.hh:78
G4int GetProcessSubType() const
Definition: G4VProcess.hh:426
G4bool applyCuts
G4double minKinEnergy
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4bool splineFlag
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
size_t GetVectorLength() const
const G4ParticleDefinition * particle
void DumpModelList(G4int verb)
static const G4double emax
G4double GetMaxEnergy() const
int G4lrint(double ad)
Definition: templates.hh:163
G4EmModelManager * modelManager
size_t length() const
#define G4endl
Definition: G4ios.hh:61
G4double biasFactor
G4double Energy(size_t index) const
double G4double
Definition: G4Types.hh:76
G4double maxKinEnergy
G4bool buildLambdaTable
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintWarning()

void G4VEmProcess::PrintWarning ( G4String  tit,
G4double  val 
)
private

Definition at line 1219 of file G4VEmProcess.cc.

1220 {
1221  G4String ss = "G4VEmProcess::" + tit;
1223  ed << "Parameter is out of range: " << val
1224  << " it will have no effect!\n" << " Process "
1225  << GetProcessName() << " nbins= " << theParameters->NumberOfBins()
1226  << " Emin(keV)= " << theParameters->MinKinEnergy()/keV
1227  << " Emax(GeV)= " << theParameters->MaxKinEnergy()/GeV;
1228  G4Exception(ss, "em0044", JustWarning, ed);
1229 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4EmParameters * theParameters
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4double MinKinEnergy() const
static const double GeV
Definition: G4SIunits.hh:214
G4int NumberOfBins() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4double MaxKinEnergy() const
static const double keV
Definition: G4SIunits.hh:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessDescription()

void G4VEmProcess::ProcessDescription ( std::ostream &  outFile) const
virtual

Definition at line 1233 of file G4VEmProcess.cc.

1234 {
1235  outFile << "EM process <" << GetProcessName() << ">" << G4endl;
1236 }
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:

◆ RecalculateLambda()

G4double G4VEmProcess::RecalculateLambda ( G4double  kinEnergy,
const G4MaterialCutsCouple couple 
)
inlineprotected

Definition at line 526 of file G4VEmProcess.hh.

527 {
528  DefineMaterial(couple);
531 }
void DefineMaterial(const G4MaterialCutsCouple *couple)
G4VEmModel * SelectModel(G4double &kinEnergy, size_t index)
G4double fFactor
G4double ComputeCurrentLambda(G4double kinEnergy)
size_t currentCoupleIndex
Here is the call graph for this function:

◆ RetrievePhysicsTable()

G4bool G4VEmProcess::RetrievePhysicsTable ( const G4ParticleDefinition part,
const G4String directory,
G4bool  ascii 
)
virtual

Reimplemented from G4VProcess.

Definition at line 903 of file G4VEmProcess.cc.

906 {
907  if(1 < verboseLevel) {
908  G4cout << "G4VEmProcess::RetrievePhysicsTable() for "
909  << part->GetParticleName() << " and process "
910  << GetProcessName() << G4endl;
911  }
912  G4bool yes = true;
913 
915  || particle != part) { return yes; }
916 
917  const G4String particleName = part->GetParticleName();
918  G4String filename;
919 
920  if(buildLambdaTable) {
921  filename = GetPhysicsTableFileName(part,directory,"Lambda",ascii);
923  filename,ascii);
924  if ( yes ) {
925  if (0 < verboseLevel) {
926  G4cout << "Lambda table for " << particleName
927  << " is Retrieved from <"
928  << filename << ">"
929  << G4endl;
930  }
931  if(theParameters->Spline()) {
932  size_t n = theLambdaTable->length();
933  for(size_t i=0; i<n; ++i) {
934  if((* theLambdaTable)[i]) {
935  (* theLambdaTable)[i]->SetSpline(true);
936  }
937  }
938  }
939  } else {
940  if (1 < verboseLevel) {
941  G4cout << "Lambda table for " << particleName << " in file <"
942  << filename << "> is not exist"
943  << G4endl;
944  }
945  }
946  }
948  filename = GetPhysicsTableFileName(part,directory,"LambdaPrim",ascii);
950  filename,ascii);
951  if ( yes ) {
952  if (0 < verboseLevel) {
953  G4cout << "Lambda table prim for " << particleName
954  << " is Retrieved from <"
955  << filename << ">"
956  << G4endl;
957  }
958  if(theParameters->Spline()) {
959  size_t n = theLambdaTablePrim->length();
960  for(size_t i=0; i<n; ++i) {
961  if((* theLambdaTablePrim)[i]) {
962  (* theLambdaTablePrim)[i]->SetSpline(true);
963  }
964  }
965  }
966  } else {
967  if (1 < verboseLevel) {
968  G4cout << "Lambda table prim for " << particleName << " in file <"
969  << filename << "> is not exist"
970  << G4endl;
971  }
972  }
973  }
974 
975  return yes;
976 }
G4int verboseLevel
Definition: G4VProcess.hh:368
G4PhysicsTable * theLambdaTablePrim
G4EmParameters * theParameters
G4PhysicsTable * theLambdaTable
G4double minKinEnergyPrim
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
Definition: G4VProcess.cc:186
G4bool Spline() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
Char_t n[5]
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4ParticleDefinition * particle
size_t length() const
#define G4endl
Definition: G4ios.hh:61
static G4bool RetrievePhysicsTable(G4PhysicsTable *physTable, const G4String &fileName, G4bool ascii)
G4double maxKinEnergy
G4bool buildLambdaTable
Here is the call graph for this function:

◆ SecondaryParticle()

const G4ParticleDefinition * G4VEmProcess::SecondaryParticle ( ) const
inline

Definition at line 616 of file G4VEmProcess.hh.

617 {
618  return secondaryParticle;
619 }
const G4ParticleDefinition * secondaryParticle

◆ SelectModel()

G4VEmModel * G4VEmProcess::SelectModel ( G4double kinEnergy,
size_t  index 
)
inlineprotected

Definition at line 461 of file G4VEmProcess.hh.

462 {
463  if(1 < numberOfModels) {
465  }
467  return currentModel;
468 }
Int_t index
G4VEmModel * currentModel
const G4MaterialCutsCouple * currentCouple
void SetCurrentCouple(const G4MaterialCutsCouple *)
Definition: G4VEmModel.hh:445
G4EmModelManager * modelManager
G4VEmModel * SelectModel(G4double &energy, size_t &index)
G4int numberOfModels
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SelectModelForMaterial()

G4VEmModel * G4VEmProcess::SelectModelForMaterial ( G4double  kinEnergy,
size_t &  idxRegion 
) const
inline

Definition at line 473 of file G4VEmProcess.hh.

475 {
476  return modelManager->SelectModel(kinEnergy, idxRegion);
477 }
G4EmModelManager * modelManager
G4VEmModel * SelectModel(G4double &energy, size_t &index)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetBuildTableFlag()

void G4VEmProcess::SetBuildTableFlag ( G4bool  val)
inline

Definition at line 637 of file G4VEmProcess.hh.

638 {
639  buildLambdaTable = val;
640 }
G4bool buildLambdaTable
Here is the caller graph for this function:

◆ SetCrossSectionBiasingFactor()

void G4VEmProcess::SetCrossSectionBiasingFactor ( G4double  f,
G4bool  flag = true 
)

Definition at line 1110 of file G4VEmProcess.cc.

1111 {
1112  if(f > 0.0) {
1113  biasFactor = f;
1114  weightFlag = flag;
1115  if(1 < verboseLevel) {
1116  G4cout << "### SetCrossSectionBiasingFactor: for "
1117  << particle->GetParticleName()
1118  << " and process " << GetProcessName()
1119  << " biasFactor= " << f << " weightFlag= " << flag
1120  << G4endl;
1121  }
1122  }
1123 }
G4bool weightFlag
G4int verboseLevel
Definition: G4VProcess.hh:368
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * particle
#define G4endl
Definition: G4ios.hh:61
G4double biasFactor
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetEmModel()

void G4VEmProcess::SetEmModel ( G4VEmModel p,
G4int  index = 1 
)

Definition at line 216 of file G4VEmProcess.cc.

217 {
218  G4int n = emModels.size();
219  if(index >= n) { for(G4int i=n; i<=index; ++i) {emModels.push_back(0);} }
220  emModels[index] = p;
221 }
Int_t index
int G4int
Definition: G4Types.hh:78
Char_t n[5]
std::vector< G4VEmModel * > emModels

◆ SetIntegral()

void G4VEmProcess::SetIntegral ( G4bool  val)
inline

Definition at line 623 of file G4VEmProcess.hh.

624 {
625  integral = val;
626 }
Here is the caller graph for this function:

◆ SetLambdaBinning()

void G4VEmProcess::SetLambdaBinning ( G4int  nbins)

Definition at line 1173 of file G4VEmProcess.cc.

1174 {
1175  if(5 < n && n < 10000000) {
1176  nLambdaBins = n;
1177  actBinning = true;
1178  } else {
1179  G4double e = (G4double)n;
1180  PrintWarning("SetLambdaBinning", e);
1181  }
1182 }
Char_t n[5]
G4bool actBinning
double G4double
Definition: G4Types.hh:76
void PrintWarning(G4String tit, G4double val)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetMaxKinEnergy()

void G4VEmProcess::SetMaxKinEnergy ( G4double  e)

Definition at line 1198 of file G4VEmProcess.cc.

1199 {
1200  if(minKinEnergy < e && e < 1.e+6*TeV) {
1203  maxKinEnergy = e;
1204  actMaxKinEnergy = true;
1205  } else { PrintWarning("SetMaxKinEnergy", e); }
1206 }
G4double minKinEnergy
G4double G4Log(G4double x)
Definition: G4Log.hh:230
int G4lrint(double ad)
Definition: templates.hh:163
G4bool actMaxKinEnergy
static const double TeV
Definition: G4SIunits.hh:215
void PrintWarning(G4String tit, G4double val)
G4double maxKinEnergy
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetMinKinEnergy()

void G4VEmProcess::SetMinKinEnergy ( G4double  e)

Definition at line 1186 of file G4VEmProcess.cc.

1187 {
1188  if(1.e-3*eV < e && e < maxKinEnergy) {
1191  minKinEnergy = e;
1192  actMinKinEnergy = true;
1193  } else { PrintWarning("SetMinKinEnergy", e); }
1194 }
G4double minKinEnergy
G4double G4Log(G4double x)
Definition: G4Log.hh:230
static const double eV
Definition: G4SIunits.hh:212
int G4lrint(double ad)
Definition: templates.hh:163
G4bool actMinKinEnergy
void PrintWarning(G4String tit, G4double val)
G4double maxKinEnergy
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetMinKinEnergyPrim()

void G4VEmProcess::SetMinKinEnergyPrim ( G4double  e)

Definition at line 1210 of file G4VEmProcess.cc.

1211 {
1212  if(theParameters->MinKinEnergy() <= e &&
1214  else { PrintWarning("SetMinKinEnergyPrim", e); }
1215 }
G4EmParameters * theParameters
G4double minKinEnergyPrim
G4double MinKinEnergy() const
G4double MaxKinEnergy() const
void PrintWarning(G4String tit, G4double val)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetParticle()

void G4VEmProcess::SetParticle ( const G4ParticleDefinition p)
inlineprotected

Definition at line 651 of file G4VEmProcess.hh.

652 {
653  particle = p;
654  currentParticle = p;
655 }
const G4ParticleDefinition * currentParticle
const G4ParticleDefinition * particle
Here is the caller graph for this function:

◆ SetSecondaryParticle()

void G4VEmProcess::SetSecondaryParticle ( const G4ParticleDefinition p)
inlineprotected

Definition at line 659 of file G4VEmProcess.hh.

660 {
661  secondaryParticle = p;
662 }
const G4ParticleDefinition * secondaryParticle
Here is the caller graph for this function:

◆ SetSplineFlag()

void G4VEmProcess::SetSplineFlag ( G4bool  val)
inlineprotected

Definition at line 673 of file G4VEmProcess.hh.

674 {
675  splineFlag = val;
676  actSpline = true;
677 }
G4bool splineFlag
G4bool actSpline
Here is the caller graph for this function:

◆ SetStartFromNullFlag()

void G4VEmProcess::SetStartFromNullFlag ( G4bool  val)
inlineprotected

Definition at line 666 of file G4VEmProcess.hh.

667 {
668  startFromNull = val;
669 }
G4bool startFromNull
Here is the caller graph for this function:

◆ StartTracking()

void G4VEmProcess::StartTracking ( G4Track *  track)
virtual

Reimplemented from G4VProcess.

Definition at line 596 of file G4VEmProcess.cc.

597 {
598  // reset parameters for the new track
599  currentParticle = track->GetParticleDefinition();
602 
603  // forced biasing only for primary particles
604  if(biasManager) {
605  if(0 == track->GetParentID()) {
606  // primary particle
607  biasFlag = true;
609  }
610  }
611 }
G4double theNumberOfInteractionLengthLeft
Definition: G4VProcess.hh:293
G4double mfpKinEnergy
const G4ParticleDefinition * currentParticle
G4EmBiasingManager * biasManager
#define DBL_MAX
Definition: templates.hh:83
Here is the call graph for this function:

◆ StorePhysicsTable()

G4bool G4VEmProcess::StorePhysicsTable ( const G4ParticleDefinition part,
const G4String directory,
G4bool  ascii = false 
)
virtual

Reimplemented from G4VProcess.

Definition at line 852 of file G4VEmProcess.cc.

855 {
856  G4bool yes = true;
857  const G4VEmProcess* masterProc =
858  static_cast<const G4VEmProcess*>(GetMasterProcess());
859  if(masterProc && masterProc != this) { return yes; }
860 
861  if ( theLambdaTable && part == particle) {
862  const G4String name =
863  GetPhysicsTableFileName(part,directory,"Lambda",ascii);
864  yes = theLambdaTable->StorePhysicsTable(name,ascii);
865 
866  if ( yes ) {
867  G4cout << "Physics table is stored for " << particle->GetParticleName()
868  << " and process " << GetProcessName()
869  << " in the directory <" << directory
870  << "> " << G4endl;
871  } else {
872  G4cout << "Fail to store Physics Table for "
874  << " and process " << GetProcessName()
875  << " in the directory <" << directory
876  << "> " << G4endl;
877  }
878  }
879  if ( theLambdaTablePrim && part == particle) {
880  const G4String name =
881  GetPhysicsTableFileName(part,directory,"LambdaPrim",ascii);
882  yes = theLambdaTablePrim->StorePhysicsTable(name,ascii);
883 
884  if ( yes ) {
885  G4cout << "Physics table prim is stored for "
887  << " and process " << GetProcessName()
888  << " in the directory <" << directory
889  << "> " << G4endl;
890  } else {
891  G4cout << "Fail to store Physics Table Prim for "
893  << " and process " << GetProcessName()
894  << " in the directory <" << directory
895  << "> " << G4endl;
896  }
897  }
898  return yes;
899 }
const G4VProcess * GetMasterProcess() const
Definition: G4VProcess.hh:538
G4PhysicsTable * theLambdaTablePrim
G4String name
Definition: TRTMaterials.hh:40
G4PhysicsTable * theLambdaTable
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
Definition: G4VProcess.cc:186
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4ParticleDefinition * particle
#define G4endl
Definition: G4ios.hh:61
G4bool StorePhysicsTable(const G4String &filename, G4bool ascii=false)
Here is the call graph for this function:

◆ UpdateEmModel()

void G4VEmProcess::UpdateEmModel ( const G4String nam,
G4double  emin,
G4double  emax 
)

Definition at line 234 of file G4VEmProcess.cc.

236 {
237  modelManager->UpdateEmModel(nam, emin, emax);
238 }
void UpdateEmModel(const G4String &, G4double, G4double)
static const G4double emax
G4EmModelManager * modelManager
Here is the call graph for this function:

Member Data Documentation

◆ actBinning

G4bool G4VEmProcess::actBinning
private

Definition at line 381 of file G4VEmProcess.hh.

◆ actMaxKinEnergy

G4bool G4VEmProcess::actMaxKinEnergy
private

Definition at line 380 of file G4VEmProcess.hh.

◆ actMinKinEnergy

G4bool G4VEmProcess::actMinKinEnergy
private

Definition at line 379 of file G4VEmProcess.hh.

◆ actSpline

G4bool G4VEmProcess::actSpline
private

Definition at line 382 of file G4VEmProcess.hh.

◆ applyCuts

G4bool G4VEmProcess::applyCuts
private

Definition at line 376 of file G4VEmProcess.hh.

◆ augerID

G4int G4VEmProcess::augerID
private

Definition at line 416 of file G4VEmProcess.hh.

◆ basedCoupleIndex

size_t G4VEmProcess::basedCoupleIndex
private

Definition at line 404 of file G4VEmProcess.hh.

◆ baseMaterial

const G4Material* G4VEmProcess::baseMaterial
private

Definition at line 400 of file G4VEmProcess.hh.

◆ biasFactor

G4double G4VEmProcess::biasFactor
private

Definition at line 373 of file G4VEmProcess.hh.

◆ biasFlag

G4bool G4VEmProcess::biasFlag
private

Definition at line 410 of file G4VEmProcess.hh.

◆ biasID

G4int G4VEmProcess::biasID
private

Definition at line 417 of file G4VEmProcess.hh.

◆ biasManager

G4EmBiasingManager* G4VEmProcess::biasManager
private

Definition at line 338 of file G4VEmProcess.hh.

◆ buildLambdaTable

G4bool G4VEmProcess::buildLambdaTable
private

Definition at line 344 of file G4VEmProcess.hh.

◆ currentCouple

const G4MaterialCutsCouple* G4VEmProcess::currentCouple
private

Definition at line 402 of file G4VEmProcess.hh.

◆ currentCoupleIndex

size_t G4VEmProcess::currentCoupleIndex
private

Definition at line 403 of file G4VEmProcess.hh.

◆ currentMaterial

const G4Material* G4VEmProcess::currentMaterial
private

Definition at line 401 of file G4VEmProcess.hh.

◆ currentModel

G4VEmModel* G4VEmProcess::currentModel
private

Definition at line 394 of file G4VEmProcess.hh.

◆ currentParticle

const G4ParticleDefinition* G4VEmProcess::currentParticle
private

Definition at line 397 of file G4VEmProcess.hh.

◆ emModels

std::vector<G4VEmModel*> G4VEmProcess::emModels
private

Definition at line 348 of file G4VEmProcess.hh.

◆ fFactor

G4double G4VEmProcess::fFactor
private

Definition at line 409 of file G4VEmProcess.hh.

◆ fluoID

G4int G4VEmProcess::fluoID
private

Definition at line 415 of file G4VEmProcess.hh.

◆ fParticleChange

G4ParticleChangeForGamma G4VEmProcess::fParticleChange
protected

Definition at line 388 of file G4VEmProcess.hh.

◆ idxLambda

size_t G4VEmProcess::idxLambda
private

Definition at line 357 of file G4VEmProcess.hh.

◆ idxLambdaPrim

size_t G4VEmProcess::idxLambdaPrim
private

Definition at line 358 of file G4VEmProcess.hh.

◆ integral

G4bool G4VEmProcess::integral
private

Definition at line 375 of file G4VEmProcess.hh.

◆ lambdaFactor

G4double G4VEmProcess::lambdaFactor
private

Definition at line 372 of file G4VEmProcess.hh.

◆ lManager

G4LossTableManager* G4VEmProcess::lManager
private

Definition at line 335 of file G4VEmProcess.hh.

◆ mainSecondaries

G4int G4VEmProcess::mainSecondaries
private

Definition at line 413 of file G4VEmProcess.hh.

◆ maxKinEnergy

G4double G4VEmProcess::maxKinEnergy
private

Definition at line 371 of file G4VEmProcess.hh.

◆ mfpKinEnergy

G4double G4VEmProcess::mfpKinEnergy
private

Definition at line 406 of file G4VEmProcess.hh.

◆ minKinEnergy

G4double G4VEmProcess::minKinEnergy
private

Definition at line 369 of file G4VEmProcess.hh.

◆ minKinEnergyPrim

G4double G4VEmProcess::minKinEnergyPrim
private

Definition at line 370 of file G4VEmProcess.hh.

◆ modelManager

G4EmModelManager* G4VEmProcess::modelManager
private

Definition at line 337 of file G4VEmProcess.hh.

◆ nLambdaBins

G4int G4VEmProcess::nLambdaBins
private

Definition at line 367 of file G4VEmProcess.hh.

◆ numberOfModels

G4int G4VEmProcess::numberOfModels
private

Definition at line 349 of file G4VEmProcess.hh.

◆ particle

const G4ParticleDefinition* G4VEmProcess::particle
private

Definition at line 396 of file G4VEmProcess.hh.

◆ preStepKinEnergy

G4double G4VEmProcess::preStepKinEnergy
private

Definition at line 407 of file G4VEmProcess.hh.

◆ preStepLambda

G4double G4VEmProcess::preStepLambda
private

Definition at line 408 of file G4VEmProcess.hh.

◆ secID

G4int G4VEmProcess::secID
private

Definition at line 414 of file G4VEmProcess.hh.

◆ secondaryParticle

const G4ParticleDefinition* G4VEmProcess::secondaryParticle
private

Definition at line 342 of file G4VEmProcess.hh.

◆ secParticles

std::vector<G4DynamicParticle*> G4VEmProcess::secParticles
private

Definition at line 392 of file G4VEmProcess.hh.

◆ splineFlag

G4bool G4VEmProcess::splineFlag
private

Definition at line 378 of file G4VEmProcess.hh.

◆ startFromNull

G4bool G4VEmProcess::startFromNull
private

Definition at line 377 of file G4VEmProcess.hh.

◆ theCrossSectionMax

std::vector<G4double> G4VEmProcess::theCrossSectionMax
private

Definition at line 355 of file G4VEmProcess.hh.

◆ theCuts

const std::vector<G4double>* G4VEmProcess::theCuts
private

Definition at line 360 of file G4VEmProcess.hh.

◆ theCutsElectron

const std::vector<G4double>* G4VEmProcess::theCutsElectron
private

Definition at line 362 of file G4VEmProcess.hh.

◆ theCutsGamma

const std::vector<G4double>* G4VEmProcess::theCutsGamma
private

Definition at line 361 of file G4VEmProcess.hh.

◆ theCutsPositron

const std::vector<G4double>* G4VEmProcess::theCutsPositron
private

Definition at line 363 of file G4VEmProcess.hh.

◆ theDensityFactor

const std::vector<G4double>* G4VEmProcess::theDensityFactor
private

Definition at line 364 of file G4VEmProcess.hh.

◆ theDensityIdx

const std::vector<G4int>* G4VEmProcess::theDensityIdx
private

Definition at line 365 of file G4VEmProcess.hh.

◆ theElectron

const G4ParticleDefinition* G4VEmProcess::theElectron
private

Definition at line 340 of file G4VEmProcess.hh.

◆ theEnergyOfCrossSectionMax

std::vector<G4double> G4VEmProcess::theEnergyOfCrossSectionMax
private

Definition at line 354 of file G4VEmProcess.hh.

◆ theGamma

const G4ParticleDefinition* G4VEmProcess::theGamma
private

Definition at line 339 of file G4VEmProcess.hh.

◆ theLambdaTable

G4PhysicsTable* G4VEmProcess::theLambdaTable
private

Definition at line 352 of file G4VEmProcess.hh.

◆ theLambdaTablePrim

G4PhysicsTable* G4VEmProcess::theLambdaTablePrim
private

Definition at line 353 of file G4VEmProcess.hh.

◆ theParameters

G4EmParameters* G4VEmProcess::theParameters
private

Definition at line 336 of file G4VEmProcess.hh.

◆ thePositron

const G4ParticleDefinition* G4VEmProcess::thePositron
private

Definition at line 341 of file G4VEmProcess.hh.

◆ weightFlag

G4bool G4VEmProcess::weightFlag
private

Definition at line 411 of file G4VEmProcess.hh.


The documentation for this class was generated from the following files: