Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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) override=0
 
virtual void PrintInfo ()=0
 
virtual void ProcessDescription (std::ostream &outFile) const
 
virtual void PreparePhysicsTable (const G4ParticleDefinition &) override
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &) override
 
virtual void StartTracking (G4Track *) override
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
 
virtual G4VParticleChangePostStepDoIt (const G4Track &, const G4Step &) override
 
virtual G4bool StorePhysicsTable (const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false) override
 
virtual G4bool RetrievePhysicsTable (const G4ParticleDefinition *, const G4String &directory, G4bool ascii) override
 
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=nullptr)
 
G4VEmModelEmModel (G4int index=1) const
 
void SetEmModel (G4VEmModel *, G4int index=1)
 
void UpdateEmModel (const G4String &, G4double, G4double)
 
G4int GetNumberOfModels () const
 
G4int GetNumberOfRegionModels (size_t couple_index) const
 
G4VEmModelGetRegionModel (G4int idx, size_t couple_index) const
 
G4VEmModelGetModelByIndex (G4int idx=0, G4bool ver=false) const
 
const G4VEmModelGetCurrentModel () const
 
const G4ElementGetCurrentElement () 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 G4VParticleChangeAtRestDoIt (const G4Track &, const G4Step &)
 
virtual G4VParticleChangeAlongStepDoIt (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) override
 
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)
 
G4ParticleChangeForGammaGetParticleChange ()
 
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
 
G4VParticleChangepParticleChange
 
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
 

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::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 {
109  theParameters = G4EmParameters::Instance();
110  SetVerboseLevel(1);
111 
112  // Size of tables assuming spline
113  minKinEnergy = 0.1*keV;
114  maxKinEnergy = 100.0*TeV;
115  nLambdaBins = 77;
116  minKinEnergyPrim = DBL_MAX;
117  actBinning = actSpline = actMinKinEnergy = actMaxKinEnergy = false;
118 
119  // default lambda factor
120  lambdaFactor = 0.8;
121 
122  // default limit on polar angle
123  biasFactor = fFactor = 1.0;
124 
125  // particle types
126  theGamma = G4Gamma::Gamma();
127  theElectron = G4Electron::Electron();
128  thePositron = G4Positron::Positron();
129 
130  theCuts = theCutsGamma = theCutsElectron = theCutsPositron = nullptr;
131 
134  secParticles.reserve(5);
135 
136  baseMaterial = currentMaterial = nullptr;
137 
138  preStepLambda = preStepKinEnergy = 0.0;
139  mfpKinEnergy = DBL_MAX;
140 
141  idxLambda = idxLambdaPrim = currentCoupleIndex
142  = basedCoupleIndex = 0;
143 
144  modelManager = new G4EmModelManager();
145  biasManager = nullptr;
146  biasFlag = false;
147  weightFlag = false;
148  lManager = G4LossTableManager::Instance();
149  lManager->Register(this);
150  secID = fluoID = augerID = biasID = -1;
151  mainSecondaries = 100;
152  if("phot" == GetProcessName() || "compt" == GetProcessName()) {
153  mainSecondaries = 1;
154  }
155 }
static G4LossTableManager * Instance()
G4ParticleChangeForGamma fParticleChange
static constexpr double TeV
Definition: G4SIunits.hh:218
void SetSecondaryWeightByProcess(G4bool)
void Register(G4VEnergyLossProcess *p)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
static G4Positron * Positron()
Definition: G4Positron.cc:94
static G4EmParameters * Instance()
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define DBL_MAX
Definition: templates.hh:83
static constexpr double keV
Definition: G4SIunits.hh:216
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:437

Here is the call graph for this function:

G4VEmProcess::~G4VEmProcess ( )
virtual

Definition at line 159 of file G4VEmProcess.cc.

160 {
161  /*
162  if(1 < verboseLevel) {
163  G4cout << "G4VEmProcess destruct " << GetProcessName()
164  << " " << this << " " << theLambdaTable <<G4endl;
165  }
166  */
167  if(lManager->IsMaster()) {
168  if(theLambdaTable) {
169  theLambdaTable->clearAndDestroy();
170  delete theLambdaTable;
171  }
172  if(theLambdaTablePrim) {
173  theLambdaTablePrim->clearAndDestroy();
174  delete theLambdaTablePrim;
175  }
176  }
177  delete modelManager;
178  delete biasManager;
179  lManager->DeRegister(this);
180  //G4cout << "G4VEmProcess removed " << G4endl;
181 }
void DeRegister(G4VEnergyLossProcess *p)
G4bool IsMaster() const
void clearAndDestroy()

Here is the call graph for this function:

Member Function Documentation

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

Definition at line 1149 of file G4VEmProcess.cc.

1151 {
1152  if(!biasManager) { biasManager = new G4EmBiasingManager(); }
1153  if(1 < verboseLevel) {
1154  G4cout << "### ActivateForcedInteraction: for "
1155  << particle->GetParticleName()
1156  << " and process " << GetProcessName()
1157  << " length(mm)= " << length/mm
1158  << " in G4Region <" << r
1159  << "> weightFlag= " << flag
1160  << G4endl;
1161  }
1162  weightFlag = flag;
1163  biasManager->ActivateForcedInteraction(length, r);
1164 }
void ActivateForcedInteraction(G4double length=0.0, const G4String &r="")
static constexpr double mm
Definition: G4SIunits.hh:115
G4int verboseLevel
Definition: G4VProcess.hh:368
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1169 of file G4VEmProcess.cc.

1172 {
1173  if (0.0 <= factor) {
1174 
1175  // Range cut can be applied only for e-
1176  if(0.0 == factor && secondaryParticle != G4Electron::Electron())
1177  { return; }
1178 
1179  if(!biasManager) { biasManager = new G4EmBiasingManager(); }
1180  biasManager->ActivateSecondaryBiasing(region, factor, energyLimit);
1181  if(1 < verboseLevel) {
1182  G4cout << "### ActivateSecondaryBiasing: for "
1183  << " process " << GetProcessName()
1184  << " factor= " << factor
1185  << " in G4Region <" << region
1186  << "> energyLimit(MeV)= " << energyLimit/MeV
1187  << G4endl;
1188  }
1189  }
1190 }
G4int verboseLevel
Definition: G4VProcess.hh:368
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
void ActivateSecondaryBiasing(const G4String &region, G4double factor, G4double energyLimit)
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 203 of file G4VEmProcess.cc.

205 {
206  G4VEmFluctuationModel* fm = nullptr;
207  modelManager->AddEmModel(order, p, fm, region);
208  if(p) { p->SetParticleChange(pParticleChange); }
209 }
void SetParticleChange(G4VParticleChange *, G4VEmFluctuationModel *f=nullptr)
Definition: G4VEmModel.cc:418
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *, const G4Region *)
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VEmProcess::BuildPhysicsTable ( const G4ParticleDefinition part)
overridevirtual

Reimplemented from G4VProcess.

Reimplemented in G4PolarizedCompton, and G4eplusPolarizedAnnihilation.

Definition at line 375 of file G4VEmProcess.cc.

376 {
377  G4bool isMaster = true;
378  const G4VEmProcess* masterProc =
379  static_cast<const G4VEmProcess*>(GetMasterProcess());
380  if(masterProc && masterProc != this) { isMaster = false; }
381 
382  G4String num = part.GetParticleName();
383  if(1 < verboseLevel) {
384  G4cout << "### G4VEmProcess::BuildPhysicsTable() for "
385  << GetProcessName()
386  << " and particle " << num
387  << " buildLambdaTable= " << buildLambdaTable
388  << " isMaster= " << isMaster
389  << G4endl;
390  }
391 
392  if(particle == &part) {
393 
394  G4LossTableBuilder* bld = lManager->GetTableBuilder();
395 
396  // worker initialisation
397  if(!isMaster) {
398  theLambdaTable = masterProc->LambdaTable();
399  theLambdaTablePrim = masterProc->LambdaTablePrim();
400 
401  if(theLambdaTable) {
402  bld->InitialiseBaseMaterials(theLambdaTable);
403  } else if(theLambdaTablePrim) {
404  bld->InitialiseBaseMaterials(theLambdaTablePrim);
405  }
406  theDensityFactor = bld->GetDensityFactors();
407  theDensityIdx = bld->GetCoupleIndexes();
408  if(theLambdaTable) { FindLambdaMax(); }
409 
410  // local initialisation of models
411  G4bool printing = true;
412  numberOfModels = modelManager->NumberOfModels();
413  for(G4int i=0; i<numberOfModels; ++i) {
414  G4VEmModel* mod = GetModelByIndex(i, printing);
415  G4VEmModel* mod0= masterProc->GetModelByIndex(i, printing);
416  mod->InitialiseLocal(particle, mod0);
417  }
418  // master thread
419  } else {
420  theDensityFactor = bld->GetDensityFactors();
421  theDensityIdx = bld->GetCoupleIndexes();
422  if(buildLambdaTable || minKinEnergyPrim < maxKinEnergy) {
423  BuildLambdaTable();
424  }
425  }
426  }
427 
428  // explicitly defined printout by particle name
429  if(1 < verboseLevel ||
430  (0 < verboseLevel && (num == "gamma" || num == "e-" ||
431  num == "e+" || num == "mu+" ||
432  num == "mu-" || num == "proton"||
433  num == "pi+" || num == "pi-" ||
434  num == "kaon+" || num == "kaon-" ||
435  num == "alpha" || num == "anti_proton" ||
436  num == "GenericIon")))
437  {
438  PrintInfoProcess(part);
439  }
440 
441  if(1 < verboseLevel) {
442  G4cout << "### G4VEmProcess::BuildPhysicsTable() done for "
443  << GetProcessName()
444  << " and particle " << num
445  << G4endl;
446  }
447 }
G4PhysicsTable * LambdaTable() const
const G4VProcess * GetMasterProcess() const
Definition: G4VProcess.hh:538
G4PhysicsTable * LambdaTablePrim() const
const std::vector< G4double > * GetDensityFactors()
G4int verboseLevel
Definition: G4VProcess.hh:368
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel)
Definition: G4VEmModel.cc:218
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4LossTableBuilder * GetTableBuilder()
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4int NumberOfModels() const
void InitialiseBaseMaterials(G4PhysicsTable *table)
#define G4endl
Definition: G4ios.hh:61
G4VEmModel * GetModelByIndex(G4int idx=0, G4bool ver=false) const
const std::vector< G4int > * GetCoupleIndexes()

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1045 of file G4VEmProcess.cc.

1047 {
1048  SelectModel(kineticEnergy, currentCoupleIndex);
1049  G4double x = 0.0;
1050  if(currentModel) {
1051  x = currentModel->ComputeCrossSectionPerAtom(currentParticle,kineticEnergy,
1052  Z,A,cut);
1053  }
1054  return x;
1055 }
G4VEmModel * SelectModel(G4double &kinEnergy, size_t index)
double A(double temperature)
virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:321
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

G4double G4VEmProcess::CrossSectionBiasingFactor ( ) const
inline

Definition at line 592 of file G4VEmProcess.hh.

593 {
594  return biasFactor;
595 }
G4double G4VEmProcess::CrossSectionPerVolume ( G4double  kineticEnergy,
const G4MaterialCutsCouple couple 
)

Definition at line 1002 of file G4VEmProcess.cc.

1004 {
1005  // Cross section per atom is calculated
1006  DefineMaterial(couple);
1007  G4double cross = 0.0;
1008  if(buildLambdaTable && theLambdaTable) {
1009  cross = GetCurrentLambda(kineticEnergy);
1010  } else {
1011  SelectModel(kineticEnergy, currentCoupleIndex);
1012  cross = fFactor*currentModel->CrossSectionPerVolume(currentMaterial,
1013  currentParticle,
1014  kineticEnergy);
1015  }
1016 
1017  if(cross < 0.0) { cross = 0.0; }
1018  return cross;
1019 }
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:257
G4VEmModel * SelectModel(G4double &kinEnergy, size_t index)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

size_t G4VEmProcess::CurrentMaterialCutsCoupleIndex ( ) const
inlineprotected

Definition at line 426 of file G4VEmProcess.hh.

427 {
428  return currentCoupleIndex;
429 }
G4VEmModel * G4VEmProcess::EmModel ( G4int  index = 1) const

Definition at line 224 of file G4VEmProcess.cc.

225 {
226  G4VEmModel* p = nullptr;
227  if(index >= 0 && index < G4int(emModels.size())) { p = emModels[index]; }
228  return p;
229 }
const char * p
Definition: xmltok.h:285
int G4int
Definition: G4Types.hh:78

Here is the caller graph for this function:

const G4Element * G4VEmProcess::GetCurrentElement ( ) const

Definition at line 1122 of file G4VEmProcess.cc.

1123 {
1124  const G4Element* elm = nullptr;
1125  if(currentModel) {elm = currentModel->GetCurrentElement(); }
1126  return elm;
1127 }
const G4Element * GetCurrentElement() const
Definition: G4VEmModel.hh:466

Here is the call graph for this function:

const G4VEmModel * G4VEmProcess::GetCurrentModel ( ) const
inline

Definition at line 699 of file G4VEmProcess.hh.

700 {
701  return currentModel;
702 }
G4double G4VEmProcess::GetElectronEnergyCut ( )
inlineprotected

Definition at line 440 of file G4VEmProcess.hh.

441 {
442  return (*theCutsElectron)[currentCoupleIndex];
443 }
G4double G4VEmProcess::GetGammaEnergyCut ( )
inlineprotected

Definition at line 433 of file G4VEmProcess.hh.

434 {
435  return (*theCutsGamma)[currentCoupleIndex];
436 }
G4double G4VEmProcess::GetLambda ( G4double kinEnergy,
const G4MaterialCutsCouple couple 
)
inline

Definition at line 519 of file G4VEmProcess.hh.

521 {
522  DefineMaterial(couple);
523  SelectModel(kinEnergy, currentCoupleIndex);
524  return GetCurrentLambda(kinEnergy);
525 }
G4VEmModel * SelectModel(G4double &kinEnergy, size_t index)

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4VEmProcess::GetMeanFreePath ( const G4Track track,
G4double  previousStepSize,
G4ForceCondition condition 
)
overrideprotectedvirtual

Implements G4VDiscreteProcess.

Reimplemented in G4PolarizedCompton, and G4eplusPolarizedAnnihilation.

Definition at line 1023 of file G4VEmProcess.cc.

1026 {
1027  *condition = NotForced;
1028  return G4VEmProcess::MeanFreePath(track);
1029 }
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:

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

Definition at line 262 of file G4VEmProcess.cc.

263 {
264  return modelManager->GetModel(idx, ver);
265 }
G4VEmModel * GetModel(G4int idx, G4bool ver=false)

Here is the call graph for this function:

Here is the caller graph for this function:

G4int G4VEmProcess::GetNumberOfModels ( ) const

Definition at line 241 of file G4VEmProcess.cc.

242 {
243  return modelManager->NumberOfModels();
244 }
G4int NumberOfModels() const

Here is the call graph for this function:

G4int G4VEmProcess::GetNumberOfRegionModels ( size_t  couple_index) const

Definition at line 248 of file G4VEmProcess.cc.

249 {
250  return modelManager->NumberOfRegionModels(couple_index);
251 }
G4int NumberOfRegionModels(size_t index_couple) const

Here is the call graph for this function:

G4ParticleChangeForGamma * G4VEmProcess::GetParticleChange ( )
inlineprotected

Definition at line 648 of file G4VEmProcess.hh.

649 {
650  return &fParticleChange;
651 }
G4ParticleChangeForGamma fParticleChange
G4VEmModel * G4VEmProcess::GetRegionModel ( G4int  idx,
size_t  couple_index 
) const

Definition at line 255 of file G4VEmProcess.cc.

256 {
257  return modelManager->GetRegionModel(idx, couple_index);
258 }
G4VEmModel * GetRegionModel(G4int idx, size_t index_couple)

Here is the call graph for this function:

const G4Element * G4VEmProcess::GetTargetElement ( ) const
inlineprotected

Definition at line 685 of file G4VEmProcess.hh.

686 {
687  return currentModel->GetCurrentElement();
688 }
const G4Element * GetCurrentElement() const
Definition: G4VEmModel.hh:466

Here is the call graph for this function:

const G4Isotope * G4VEmProcess::GetTargetIsotope ( ) const
inlineprotected

Definition at line 692 of file G4VEmProcess.hh.

693 {
694  return currentModel->GetCurrentIsotope();
695 }
const G4Isotope * GetCurrentIsotope() const
Definition: G4VEmModel.hh:473

Here is the call graph for this function:

G4bool G4VEmProcess::IsIntegral ( ) const
inlineprotected

Definition at line 634 of file G4VEmProcess.hh.

635 {
636  return integral;
637 }
G4int G4VEmProcess::LambdaBinning ( ) const
inlineprotected

Definition at line 564 of file G4VEmProcess.hh.

565 {
566  return nLambdaBins;
567 }
G4PhysicsVector * G4VEmProcess::LambdaPhysicsVector ( const G4MaterialCutsCouple )
protected

Definition at line 1112 of file G4VEmProcess.cc.

1113 {
1114  G4PhysicsVector* v =
1115  new G4PhysicsLogVector(minKinEnergy, maxKinEnergy, nLambdaBins);
1116  v->SetSpline(theParameters->Spline());
1117  return v;
1118 }
G4bool Spline() const
void SetSpline(G4bool)

Here is the call graph for this function:

G4PhysicsTable * G4VEmProcess::LambdaTable ( ) const
inline

Definition at line 599 of file G4VEmProcess.hh.

600 {
601  return theLambdaTable;
602 }

Here is the caller graph for this function:

G4PhysicsTable * G4VEmProcess::LambdaTablePrim ( ) const
inline

Definition at line 606 of file G4VEmProcess.hh.

607 {
608  return theLambdaTablePrim;
609 }

Here is the caller graph for this function:

G4double G4VEmProcess::MaxKinEnergy ( ) const
inlineprotected

Definition at line 578 of file G4VEmProcess.hh.

579 {
580  return maxKinEnergy;
581 }

Here is the caller graph for this function:

G4double G4VEmProcess::MeanFreePath ( const G4Track track)

Definition at line 1033 of file G4VEmProcess.cc.

1034 {
1035  DefineMaterial(track.GetMaterialCutsCouple());
1036  preStepLambda = GetCurrentLambda(track.GetKineticEnergy());
1037  G4double x = DBL_MAX;
1038  if(0.0 < preStepLambda) { x = 1.0/preStepLambda; }
1039  return x;
1040 }
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4double GetKineticEnergy() 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:

G4double G4VEmProcess::MinKinEnergy ( ) const
inlineprotected

Definition at line 571 of file G4VEmProcess.hh.

572 {
573  return minKinEnergy;
574 }

Here is the caller graph for this function:

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

Reimplemented in G4GammaConversion, and G4CoulombScattering.

Definition at line 195 of file G4VEmProcess.cc.

197 {
198  return 0.0;
199 }
const G4ParticleDefinition * G4VEmProcess::Particle ( ) const
inline

Definition at line 613 of file G4VEmProcess.hh.

614 {
615  return particle;
616 }
G4double G4VEmProcess::PolarAngleLimit ( ) const
inlineprotected

Definition at line 585 of file G4VEmProcess.hh.

586 {
587  return theParameters->MscThetaLimit();
588 }
G4double MscThetaLimit() const

Here is the call graph for this function:

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

Reimplemented from G4VDiscreteProcess.

Definition at line 718 of file G4VEmProcess.cc.

720 {
721  // In all cases clear number of interaction lengths
723  mfpKinEnergy = DBL_MAX;
724 
726 
727  // Do not make anything if particle is stopped, the annihilation then
728  // should be performed by the AtRestDoIt!
729  if (track.GetTrackStatus() == fStopButAlive) { return &fParticleChange; }
730 
731  G4double finalT = track.GetKineticEnergy();
732 
733  // forced process - should happen only once per track
734  if(biasFlag) {
735  if(biasManager->ForcedInteractionRegion(currentCoupleIndex)) {
736  biasFlag = false;
737  }
738  }
739 
740  // Integral approach
741  if (integral) {
742  G4double lx = GetLambda(finalT, currentCouple);
743  if(preStepLambda<lx && 1 < verboseLevel) {
744  G4cout << "WARNING: for " << currentParticle->GetParticleName()
745  << " and " << GetProcessName()
746  << " E(MeV)= " << finalT/MeV
747  << " preLambda= " << preStepLambda << " < "
748  << lx << " (postLambda) "
749  << G4endl;
750  }
751 
752  if(preStepLambda*G4UniformRand() > lx) {
754  return &fParticleChange;
755  }
756  }
757 
758  SelectModel(finalT, currentCoupleIndex);
759  if(!currentModel->IsActive(finalT)) { return &fParticleChange; }
760 
761  // define new weight for primary and secondaries
763  if(weightFlag) {
764  weight /= biasFactor;
766  }
767 
768  /*
769  if(0 < verboseLevel) {
770  G4cout << "G4VEmProcess::PostStepDoIt: Sample secondary; E= "
771  << finalT/MeV
772  << " MeV; model= (" << currentModel->LowEnergyLimit()
773  << ", " << currentModel->HighEnergyLimit() << ")"
774  << G4endl;
775  }
776  */
777 
778  // sample secondaries
779  secParticles.clear();
780  currentModel->SampleSecondaries(&secParticles,
781  currentCouple,
782  track.GetDynamicParticle(),
783  (*theCuts)[currentCoupleIndex]);
784 
785  G4int num0 = secParticles.size();
786 
787  // splitting or Russian roulette
788  if(biasManager) {
789  if(biasManager->SecondaryBiasingRegion(currentCoupleIndex)) {
790  G4double eloss = 0.0;
791  weight *= biasManager->ApplySecondaryBiasing(
792  secParticles, track, currentModel, &fParticleChange, eloss,
793  currentCoupleIndex, (*theCuts)[currentCoupleIndex],
794  step.GetPostStepPoint()->GetSafety());
795  if(eloss > 0.0) {
798  }
799  }
800  }
801 
802  // save secondaries
803  G4int num = secParticles.size();
804  if(num > 0) {
805 
808  G4double time = track.GetGlobalTime();
809 
810  for (G4int i=0; i<num; ++i) {
811  if (secParticles[i]) {
812  G4DynamicParticle* dp = secParticles[i];
814  G4double e = dp->GetKineticEnergy();
815  G4bool good = true;
816  if(applyCuts) {
817  if (p == theGamma) {
818  if (e < (*theCutsGamma)[currentCoupleIndex]) { good = false; }
819 
820  } else if (p == theElectron) {
821  if (e < (*theCutsElectron)[currentCoupleIndex]) { good = false; }
822 
823  } else if (p == thePositron) {
824  if (electron_mass_c2 < (*theCutsGamma)[currentCoupleIndex] &&
825  e < (*theCutsPositron)[currentCoupleIndex]) {
826  good = false;
827  e += 2.0*electron_mass_c2;
828  }
829  }
830  // added secondary if it is good
831  }
832  if (good) {
833  G4Track* t = new G4Track(dp, time, track.GetPosition());
835  t->SetWeight(weight);
837 
838  // define type of secondary
839  if(i < mainSecondaries) { t->SetCreatorModelIndex(secID); }
840  else if(i < num0) {
841  if(p == theGamma) {
842  t->SetCreatorModelIndex(fluoID);
843  } else {
844  t->SetCreatorModelIndex(augerID);
845  }
846  } else {
847  t->SetCreatorModelIndex(biasID);
848  }
849 
850  //G4cout << "Secondary(post step) has weight " << t->GetWeight()
851  // << ", Ekin= " << t->GetKineticEnergy()/MeV << " MeV" <<G4endl;
852  } else {
853  delete dp;
854  edep += e;
855  }
856  }
857  }
859  }
860 
863  if(particle->GetProcessManager()->GetAtRestProcessVector()->size() > 0)
866  }
867 
868  return &fParticleChange;
869 }
G4double GetLambda(G4double &kinEnergy, const G4MaterialCutsCouple *couple)
G4VEmModel * SelectModel(G4double &kinEnergy, size_t index)
G4double ApplySecondaryBiasing(std::vector< G4DynamicParticle * > &, const G4Track &track, G4VEmModel *currentModel, G4ParticleChangeForGamma *pParticleChange, G4double &eloss, G4int coupleIdx, G4double tcut, G4double safety=0.0)
G4int verboseLevel
Definition: G4VProcess.hh:368
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double tmax=DBL_MAX)=0
G4double GetKineticEnergy() const
const G4DynamicParticle * GetDynamicParticle() const
G4bool SecondaryBiasingRegion(G4int coupleIdx)
const char * p
Definition: xmltok.h:285
const G4ThreeVector & GetPosition() const
G4ParticleChangeForGamma fParticleChange
G4TrackStatus GetTrackStatus() const
G4bool ForcedInteractionRegion(G4int coupleIdx)
G4double theNumberOfInteractionLengthLeft
Definition: G4VProcess.hh:293
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4double GetParentWeight() const
void ClearNumberOfInteractionLengthLeft()
Definition: G4VProcess.hh:447
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
void SetWeight(G4double aValue)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void SetCreatorModelIndex(G4int idx)
static constexpr double electron_mass_c2
void ProposeWeight(G4double finalWeight)
G4ProcessVector * GetAtRestProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4double GetKineticEnergy() const
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4ParticleDefinition * GetParticleDefinition() const
G4double GetGlobalTime() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
void AddSecondary(G4Track *aSecondary)
const G4TouchableHandle & GetTouchableHandle() const
G4bool IsActive(G4double kinEnergy)
Definition: G4VEmModel.hh:752
G4int size() const
G4double GetProposedKineticEnergy() const
G4ProcessManager * GetProcessManager() const
void SetNumberOfSecondaries(G4int totSecondaries)
G4double GetLocalEnergyDeposit() const
G4StepPoint * GetPostStepPoint() const
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
G4double GetSafety() const
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
G4TrackStatus GetTrackStatus() const
double G4double
Definition: G4Types.hh:76
void ProposeTrackStatus(G4TrackStatus status)
void InitializeForPostStep(const G4Track &)
#define DBL_MAX
Definition: templates.hh:83

Here is the call graph for this function:

G4double G4VEmProcess::PostStepGetPhysicalInteractionLength ( const G4Track track,
G4double  previousStepSize,
G4ForceCondition condition 
)
overridevirtual

Reimplemented from G4VDiscreteProcess.

Reimplemented in G4PolarizedCompton, and G4eplusPolarizedAnnihilation.

Definition at line 638 of file G4VEmProcess.cc.

642 {
643  *condition = NotForced;
644  G4double x = DBL_MAX;
645 
646  preStepKinEnergy = track.GetKineticEnergy();
647  DefineMaterial(track.GetMaterialCutsCouple());
648  SelectModel(preStepKinEnergy, currentCoupleIndex);
649 
650  if(!currentModel->IsActive(preStepKinEnergy)) {
653  return x;
654  }
655 
656  // forced biasing only for primary particles
657  if(biasManager) {
658  if(0 == track.GetParentID()) {
659  if(biasFlag &&
660  biasManager->ForcedInteractionRegion(currentCoupleIndex)) {
661  return biasManager->GetStepLimit(currentCoupleIndex, previousStepSize);
662  }
663  }
664  }
665 
666  // compute mean free path
667  if(preStepKinEnergy < mfpKinEnergy) {
668  if (integral) { ComputeIntegralLambda(preStepKinEnergy); }
669  else { preStepLambda = GetCurrentLambda(preStepKinEnergy); }
670 
671  // zero cross section
672  if(preStepLambda <= 0.0) {
675  }
676  }
677 
678  // non-zero cross section
679  if(preStepLambda > 0.0) {
680 
682 
683  // beggining of tracking (or just after DoIt of this process)
686 
687  } else if(currentInteractionLength < DBL_MAX) {
688 
690  previousStepSize/currentInteractionLength;
693  }
694 
695  // new mean free path and step limit for the next step
696  currentInteractionLength = 1.0/preStepLambda;
698  /*
699 #ifdef G4VERBOSE
700  if (verboseLevel>2){
701  G4cout << "G4VEmProcess::PostStepGetPhysicalInteractionLength ";
702  G4cout << "[ " << GetProcessName() << "]" << G4endl;
703  G4cout << " for " << currentParticle->GetParticleName()
704  << " in Material " << currentMaterial->GetName()
705  << " Ekin(MeV)= " << preStepKinEnergy/MeV
706  <<G4endl;
707  G4cout << " MeanFreePath = " << currentInteractionLength/cm << "[cm]"
708  << " InteractionLength= " << x/cm <<"[cm] " <<G4endl;
709  }
710 #endif
711  */
712  }
713  return x;
714 }
G4double condition(const G4ErrorSymMatrix &m)
G4int GetParentID() const
G4VEmModel * SelectModel(G4double &kinEnergy, size_t index)
G4bool ForcedInteractionRegion(G4int coupleIdx)
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4double theNumberOfInteractionLengthLeft
Definition: G4VProcess.hh:293
G4double GetKineticEnergy() const
#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:752
G4double G4Log(G4double x)
Definition: G4Log.hh:230
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double theInitialNumberOfInteractionLength
Definition: G4VProcess.hh:300
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:

void G4VEmProcess::PreparePhysicsTable ( const G4ParticleDefinition part)
overridevirtual

Reimplemented from G4VProcess.

Definition at line 269 of file G4VEmProcess.cc.

270 {
271  G4bool isMaster = true;
272  const G4VEmProcess* masterProcess =
273  static_cast<const G4VEmProcess*>(GetMasterProcess());
274  if(masterProcess && masterProcess != this) { isMaster = false; }
275 
276  if(!particle) { SetParticle(&part); }
277 
278  if(part.GetParticleType() == "nucleus" &&
279  part.GetParticleSubType() == "generic") {
280 
281  G4String pname = part.GetParticleName();
282  if(pname != "deuteron" && pname != "triton" &&
283  pname != "alpha" && pname != "He3" &&
284  pname != "alpha+" && pname != "helium" &&
285  pname != "hydrogen") {
286 
287  particle = G4GenericIon::GenericIon();
288  }
289  }
290 
291  if(1 < verboseLevel) {
292  G4cout << "G4VEmProcess::PreparePhysicsTable() for "
293  << GetProcessName()
294  << " and particle " << part.GetParticleName()
295  << " local particle " << particle->GetParticleName()
296  << G4endl;
297  }
298 
299  if(particle != &part) { return; }
300 
301  G4LossTableBuilder* bld = lManager->GetTableBuilder();
302 
303  lManager->PreparePhysicsTable(&part, this, isMaster);
304 
305  Clear();
306  InitialiseProcess(particle);
307 
308  const G4ProductionCutsTable* theCoupleTable=
310  size_t n = theCoupleTable->GetTableSize();
311 
312  theEnergyOfCrossSectionMax.resize(n, 0.0);
313  theCrossSectionMax.resize(n, DBL_MAX);
314 
315  // initialisation of the process
316  if(!actMinKinEnergy) { minKinEnergy = theParameters->MinKinEnergy(); }
317  if(!actMaxKinEnergy) { maxKinEnergy = theParameters->MaxKinEnergy(); }
318  if(!actSpline) { splineFlag = theParameters->Spline(); }
319 
320  if(isMaster) { SetVerboseLevel(theParameters->Verbose()); }
321  else { SetVerboseLevel(theParameters->WorkerVerbose()); }
322  applyCuts = theParameters->ApplyCuts();
323  lambdaFactor = theParameters->LambdaFactor();
324  theParameters->DefineRegParamForEM(this);
325 
326  // initialisation of models
327  numberOfModels = modelManager->NumberOfModels();
328  for(G4int i=0; i<numberOfModels; ++i) {
329  G4VEmModel* mod = modelManager->GetModel(i);
330  if(0 == i) { currentModel = mod; }
331  mod->SetPolarAngleLimit(theParameters->MscThetaLimit());
332  mod->SetMasterThread(isMaster);
333  if(mod->HighEnergyLimit() > maxKinEnergy) {
334  mod->SetHighEnergyLimit(maxKinEnergy);
335  }
336  }
337 
338  if(lManager->AtomDeexcitation()) { modelManager->SetFluoFlag(true); }
339  theCuts = modelManager->Initialise(particle,secondaryParticle,
340  2.,verboseLevel);
341  theCutsGamma = theCoupleTable->GetEnergyCutsVector(idxG4GammaCut);
342  theCutsElectron = theCoupleTable->GetEnergyCutsVector(idxG4ElectronCut);
343  theCutsPositron = theCoupleTable->GetEnergyCutsVector(idxG4PositronCut);
344 
345  // prepare tables
346  if(buildLambdaTable && isMaster){
347  theLambdaTable =
349  bld->InitialiseBaseMaterials(theLambdaTable);
350  }
351  // high energy table
352  if(isMaster && minKinEnergyPrim < maxKinEnergy){
353  theLambdaTablePrim =
354  G4PhysicsTableHelper::PreparePhysicsTable(theLambdaTablePrim);
355  bld->InitialiseBaseMaterials(theLambdaTablePrim);
356  }
357  // forced biasing
358  if(biasManager) {
359  biasManager->Initialise(part,GetProcessName(),verboseLevel);
360  biasFlag = false;
361  }
362  // defined ID of secondary particles
363  G4String nam1 = GetProcessName();
364  G4String nam2 = nam1 + "_fluo" ;
365  G4String nam3 = nam1 + "_auger";
366  G4String nam4 = nam1 + "_split";
367  secID = G4PhysicsModelCatalog::Register(nam1);
368  fluoID = G4PhysicsModelCatalog::Register(nam2);
369  augerID = G4PhysicsModelCatalog::Register(nam3);
370  biasID = G4PhysicsModelCatalog::Register(nam4);
371 }
const G4VProcess * GetMasterProcess() const
Definition: G4VProcess.hh:538
const std::vector< G4double > * GetEnergyCutsVector(size_t pcIdx) const
G4bool Spline() const
G4int WorkerVerbose() const
G4double MaxKinEnergy() const
G4int verboseLevel
Definition: G4VProcess.hh:368
G4VEmModel * GetModel(G4int idx, G4bool ver=false)
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:633
G4double MscThetaLimit() const
virtual void InitialiseProcess(const G4ParticleDefinition *)=0
G4bool ApplyCuts() const
const G4String & GetParticleSubType() const
int G4int
Definition: G4Types.hh:78
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)
const G4String & GetParticleName() const
G4LossTableBuilder * GetTableBuilder()
void Initialise(const G4ParticleDefinition &part, const G4String &procName, G4int verbose)
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:724
G4double LambdaFactor() const
G4GLOB_DLL std::ostream G4cout
G4int Verbose() const
bool G4bool
Definition: G4Types.hh:79
void SetParticle(const G4ParticleDefinition *p)
const G4String & GetParticleType() const
G4double MinKinEnergy() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4double minSubRange, G4int verb)
void SetMasterThread(G4bool val)
Definition: G4VEmModel.hh:710
static G4ProductionCutsTable * GetProductionCutsTable()
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:93
G4int NumberOfModels() const
void InitialiseBaseMaterials(G4PhysicsTable *table)
static G4int Register(const G4String &)
void PreparePhysicsTable(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p, G4bool theMaster)
#define G4endl
Definition: G4ios.hh:61
void SetFluoFlag(G4bool val)
G4VAtomDeexcitation * AtomDeexcitation()
void DefineRegParamForEM(G4VEmProcess *) const
#define DBL_MAX
Definition: templates.hh:83
void SetPolarAngleLimit(G4double)
Definition: G4VEmModel.hh:759
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:437

Here is the call graph for this function:

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

Definition at line 1254 of file G4VEmProcess.cc.

1255 {
1256  outFile << "EM process <" << GetProcessName() << ">" << G4endl;
1257 }
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

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

Definition at line 530 of file G4VEmProcess.hh.

531 {
532  DefineMaterial(couple);
533  SelectModel(e, currentCoupleIndex);
534  return fFactor*ComputeCurrentLambda(e);
535 }
G4VEmModel * SelectModel(G4double &kinEnergy, size_t index)

Here is the call graph for this function:

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

Reimplemented from G4VProcess.

Definition at line 924 of file G4VEmProcess.cc.

927 {
928  if(1 < verboseLevel) {
929  G4cout << "G4VEmProcess::RetrievePhysicsTable() for "
930  << part->GetParticleName() << " and process "
931  << GetProcessName() << G4endl;
932  }
933  G4bool yes = true;
934 
935  if((!buildLambdaTable && minKinEnergyPrim > maxKinEnergy)
936  || particle != part) { return yes; }
937 
938  const G4String particleName = part->GetParticleName();
939  G4String filename;
940 
941  if(buildLambdaTable) {
942  filename = GetPhysicsTableFileName(part,directory,"Lambda",ascii);
943  yes = G4PhysicsTableHelper::RetrievePhysicsTable(theLambdaTable,
944  filename,ascii);
945  if ( yes ) {
946  if (0 < verboseLevel) {
947  G4cout << "Lambda table for " << particleName
948  << " is Retrieved from <"
949  << filename << ">"
950  << G4endl;
951  }
952  if(theParameters->Spline()) {
953  size_t n = theLambdaTable->length();
954  for(size_t i=0; i<n; ++i) {
955  if((* theLambdaTable)[i]) {
956  (* theLambdaTable)[i]->SetSpline(true);
957  }
958  }
959  }
960  } else {
961  if (1 < verboseLevel) {
962  G4cout << "Lambda table for " << particleName << " in file <"
963  << filename << "> is not exist"
964  << G4endl;
965  }
966  }
967  }
968  if(minKinEnergyPrim < maxKinEnergy) {
969  filename = GetPhysicsTableFileName(part,directory,"LambdaPrim",ascii);
970  yes = G4PhysicsTableHelper::RetrievePhysicsTable(theLambdaTablePrim,
971  filename,ascii);
972  if ( yes ) {
973  if (0 < verboseLevel) {
974  G4cout << "Lambda table prim for " << particleName
975  << " is Retrieved from <"
976  << filename << ">"
977  << G4endl;
978  }
979  if(theParameters->Spline()) {
980  size_t n = theLambdaTablePrim->length();
981  for(size_t i=0; i<n; ++i) {
982  if((* theLambdaTablePrim)[i]) {
983  (* theLambdaTablePrim)[i]->SetSpline(true);
984  }
985  }
986  }
987  } else {
988  if (1 < verboseLevel) {
989  G4cout << "Lambda table prim for " << particleName << " in file <"
990  << filename << "> is not exist"
991  << G4endl;
992  }
993  }
994  }
995 
996  return yes;
997 }
G4bool Spline() const
G4int verboseLevel
Definition: G4VProcess.hh:368
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
Definition: G4VProcess.cc:186
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
size_t length() const
#define G4endl
Definition: G4ios.hh:61
static G4bool RetrievePhysicsTable(G4PhysicsTable *physTable, const G4String &fileName, G4bool ascii)

Here is the call graph for this function:

const G4ParticleDefinition * G4VEmProcess::SecondaryParticle ( ) const
inline

Definition at line 620 of file G4VEmProcess.hh.

621 {
622  return secondaryParticle;
623 }
G4VEmModel * G4VEmProcess::SelectModel ( G4double kinEnergy,
size_t  index 
)
inlineprotected

Definition at line 465 of file G4VEmProcess.hh.

466 {
467  if(1 < numberOfModels) {
468  currentModel = modelManager->SelectModel(kinEnergy, index);
469  }
470  currentModel->SetCurrentCouple(currentCouple);
471  return currentModel;
472 }
void SetCurrentCouple(const G4MaterialCutsCouple *)
Definition: G4VEmModel.hh:444
G4VEmModel * SelectModel(G4double &energy, size_t &index)

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 477 of file G4VEmProcess.hh.

479 {
480  return modelManager->SelectModel(kinEnergy, idxRegion);
481 }
G4VEmModel * SelectModel(G4double &energy, size_t &index)

Here is the call graph for this function:

void G4VEmProcess::SetBuildTableFlag ( G4bool  val)
inline

Definition at line 641 of file G4VEmProcess.hh.

642 {
643  buildLambdaTable = val;
644 }

Here is the caller graph for this function:

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

Definition at line 1131 of file G4VEmProcess.cc.

1132 {
1133  if(f > 0.0) {
1134  biasFactor = f;
1135  weightFlag = flag;
1136  if(1 < verboseLevel) {
1137  G4cout << "### SetCrossSectionBiasingFactor: for "
1138  << particle->GetParticleName()
1139  << " and process " << GetProcessName()
1140  << " biasFactor= " << f << " weightFlag= " << flag
1141  << G4endl;
1142  }
1143  }
1144 }
G4int verboseLevel
Definition: G4VProcess.hh:368
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 213 of file G4VEmProcess.cc.

214 {
215  G4int n = emModels.size();
216  if(index >= n) {
217  for(G4int i=n; i<=index; ++i) {emModels.push_back(nullptr);}
218  }
219  emModels[index] = p;
220 }
const char * p
Definition: xmltok.h:285
int G4int
Definition: G4Types.hh:78

Here is the caller graph for this function:

void G4VEmProcess::SetIntegral ( G4bool  val)
inline

Definition at line 627 of file G4VEmProcess.hh.

628 {
629  integral = val;
630 }

Here is the caller graph for this function:

void G4VEmProcess::SetLambdaBinning ( G4int  nbins)

Definition at line 1194 of file G4VEmProcess.cc.

1195 {
1196  if(5 < n && n < 10000000) {
1197  nLambdaBins = n;
1198  actBinning = true;
1199  } else {
1200  G4double e = (G4double)n;
1201  PrintWarning("SetLambdaBinning", e);
1202  }
1203 }
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

void G4VEmProcess::SetMaxKinEnergy ( G4double  e)

Definition at line 1219 of file G4VEmProcess.cc.

1220 {
1221  if(minKinEnergy < e && e < 1.e+6*TeV) {
1222  nLambdaBins = G4lrint(nLambdaBins*G4Log(e/minKinEnergy)
1223  /G4Log(maxKinEnergy/minKinEnergy));
1224  maxKinEnergy = e;
1225  actMaxKinEnergy = true;
1226  } else { PrintWarning("SetMaxKinEnergy", e); }
1227 }
static constexpr double TeV
Definition: G4SIunits.hh:218
G4double G4Log(G4double x)
Definition: G4Log.hh:230
int G4lrint(double ad)
Definition: templates.hh:163

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VEmProcess::SetMinKinEnergy ( G4double  e)

Definition at line 1207 of file G4VEmProcess.cc.

1208 {
1209  if(1.e-3*eV < e && e < maxKinEnergy) {
1210  nLambdaBins = G4lrint(nLambdaBins*G4Log(maxKinEnergy/e)
1211  /G4Log(maxKinEnergy/minKinEnergy));
1212  minKinEnergy = e;
1213  actMinKinEnergy = true;
1214  } else { PrintWarning("SetMinKinEnergy", e); }
1215 }
static constexpr double eV
Definition: G4SIunits.hh:215
G4double G4Log(G4double x)
Definition: G4Log.hh:230
int G4lrint(double ad)
Definition: templates.hh:163

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VEmProcess::SetMinKinEnergyPrim ( G4double  e)

Definition at line 1231 of file G4VEmProcess.cc.

1232 {
1233  if(theParameters->MinKinEnergy() <= e &&
1234  e <= theParameters->MaxKinEnergy()) { minKinEnergyPrim = e; }
1235  else { PrintWarning("SetMinKinEnergyPrim", e); }
1236 }
G4double MaxKinEnergy() const
G4double MinKinEnergy() const

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VEmProcess::SetParticle ( const G4ParticleDefinition p)
inlineprotected

Definition at line 655 of file G4VEmProcess.hh.

656 {
657  particle = p;
658  currentParticle = p;
659 }
const char * p
Definition: xmltok.h:285

Here is the caller graph for this function:

void G4VEmProcess::SetSecondaryParticle ( const G4ParticleDefinition p)
inlineprotected

Definition at line 663 of file G4VEmProcess.hh.

664 {
665  secondaryParticle = p;
666 }
const char * p
Definition: xmltok.h:285

Here is the caller graph for this function:

void G4VEmProcess::SetSplineFlag ( G4bool  val)
inlineprotected

Definition at line 677 of file G4VEmProcess.hh.

678 {
679  splineFlag = val;
680  actSpline = true;
681 }

Here is the caller graph for this function:

void G4VEmProcess::SetStartFromNullFlag ( G4bool  val)
inlineprotected

Definition at line 670 of file G4VEmProcess.hh.

671 {
672  startFromNull = val;
673 }

Here is the caller graph for this function:

void G4VEmProcess::StartTracking ( G4Track track)
overridevirtual

Reimplemented from G4VProcess.

Definition at line 619 of file G4VEmProcess.cc.

620 {
621  // reset parameters for the new track
622  currentParticle = track->GetParticleDefinition();
624  mfpKinEnergy = DBL_MAX;
625 
626  // forced biasing only for primary particles
627  if(biasManager) {
628  if(0 == track->GetParentID()) {
629  // primary particle
630  biasFlag = true;
631  biasManager->ResetForcedInteraction();
632  }
633  }
634 }
G4int GetParentID() const
G4double theNumberOfInteractionLengthLeft
Definition: G4VProcess.hh:293
const G4ParticleDefinition * GetParticleDefinition() const
#define DBL_MAX
Definition: templates.hh:83

Here is the call graph for this function:

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

Reimplemented from G4VProcess.

Definition at line 873 of file G4VEmProcess.cc.

876 {
877  G4bool yes = true;
878  const G4VEmProcess* masterProc =
879  static_cast<const G4VEmProcess*>(GetMasterProcess());
880  if(masterProc && masterProc != this) { return yes; }
881 
882  if ( theLambdaTable && part == particle) {
883  const G4String name =
884  GetPhysicsTableFileName(part,directory,"Lambda",ascii);
885  yes = theLambdaTable->StorePhysicsTable(name,ascii);
886 
887  if ( yes ) {
888  G4cout << "Physics table is stored for " << particle->GetParticleName()
889  << " and process " << GetProcessName()
890  << " in the directory <" << directory
891  << "> " << G4endl;
892  } else {
893  G4cout << "Fail to store Physics Table for "
894  << particle->GetParticleName()
895  << " and process " << GetProcessName()
896  << " in the directory <" << directory
897  << "> " << G4endl;
898  }
899  }
900  if ( theLambdaTablePrim && part == particle) {
901  const G4String name =
902  GetPhysicsTableFileName(part,directory,"LambdaPrim",ascii);
903  yes = theLambdaTablePrim->StorePhysicsTable(name,ascii);
904 
905  if ( yes ) {
906  G4cout << "Physics table prim is stored for "
907  << particle->GetParticleName()
908  << " and process " << GetProcessName()
909  << " in the directory <" << directory
910  << "> " << G4endl;
911  } else {
912  G4cout << "Fail to store Physics Table Prim for "
913  << particle->GetParticleName()
914  << " and process " << GetProcessName()
915  << " in the directory <" << directory
916  << "> " << G4endl;
917  }
918  }
919  return yes;
920 }
const G4VProcess * GetMasterProcess() const
Definition: G4VProcess.hh:538
const XML_Char * name
Definition: expat.h:151
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
Definition: G4VProcess.cc:186
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
#define G4endl
Definition: G4ios.hh:61
G4bool StorePhysicsTable(const G4String &filename, G4bool ascii=false)

Here is the call graph for this function:

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

Definition at line 233 of file G4VEmProcess.cc.

235 {
236  modelManager->UpdateEmModel(nam, emin, emax);
237 }
void UpdateEmModel(const G4String &model_name, G4double emin, G4double emax)
static const G4double emax

Here is the call graph for this function:

Member Data Documentation

G4ParticleChangeForGamma G4VEmProcess::fParticleChange
protected

Definition at line 392 of file G4VEmProcess.hh.


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