Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4GammaGeneralProcess Class Reference

#include <G4GammaGeneralProcess.hh>

+ Inheritance diagram for G4GammaGeneralProcess:

Public Member Functions

 G4GammaGeneralProcess (const G4String &pname="GammaGeneralProc")
 
 ~G4GammaGeneralProcess () override
 
G4bool IsApplicable (const G4ParticleDefinition &) override
 
void AddEmProcess (G4VEmProcess *)
 
void AddMMProcess (G4GammaConversionToMuons *)
 
void AddHadProcess (G4HadronicProcess *)
 
void ProcessDescription (std::ostream &outFile) const override
 
void PreparePhysicsTable (const G4ParticleDefinition &) override
 
void BuildPhysicsTable (const G4ParticleDefinition &) override
 
void StartTracking (G4Track *) override
 
G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
 
G4VParticleChangePostStepDoIt (const G4Track &, const G4Step &) override
 
G4bool StorePhysicsTable (const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false) override
 
G4bool RetrievePhysicsTable (const G4ParticleDefinition *, const G4String &directory, G4bool ascii) override
 
const G4VProcessGetCreatorProcess () const override
 
const G4VProcessGetSelectedProcess () const
 
const G4StringGetSubProcessName () const
 
G4int GetSubProcessSubType () const
 
G4VEmProcessGetEmProcess (const G4String &name) override
 
G4HadronicProcessGetGammaNuclear () const
 
 G4GammaGeneralProcess (G4GammaGeneralProcess &)=delete
 
G4GammaGeneralProcessoperator= (const G4GammaGeneralProcess &right)=delete
 
- Public Member Functions inherited from G4VEmProcess
 G4VEmProcess (const G4String &name, G4ProcessType type=fElectromagnetic)
 
 ~G4VEmProcess () override
 
void ProcessDescription (std::ostream &outFile) const override
 
void PreparePhysicsTable (const G4ParticleDefinition &) override
 
void BuildPhysicsTable (const G4ParticleDefinition &) override
 
void StartTracking (G4Track *) override
 
G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
 
G4VParticleChangePostStepDoIt (const G4Track &, const G4Step &) override
 
G4bool StorePhysicsTable (const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false) override
 
G4bool RetrievePhysicsTable (const G4ParticleDefinition *, const G4String &directory, G4bool ascii) override
 
G4double GetLambda (G4double kinEnergy, const G4MaterialCutsCouple *couple, G4double logKinEnergy)
 
G4double GetCrossSection (const G4double kinEnergy, const G4MaterialCutsCouple *couple) override
 
G4double ComputeCrossSectionPerAtom (G4double kineticEnergy, G4double Z, G4double A=0., G4double cut=0.0)
 
G4double MeanFreePath (const G4Track &track)
 
void SetLambdaBinning (G4int nbins)
 
void SetMinKinEnergy (G4double e)
 
void SetMinKinEnergyPrim (G4double e)
 
void SetMaxKinEnergy (G4double e)
 
G4PhysicsTableLambdaTable () const
 
G4PhysicsTableLambdaTablePrim () const
 
void SetLambdaTable (G4PhysicsTable *)
 
void SetLambdaTablePrim (G4PhysicsTable *)
 
std::vector< G4double > * EnergyOfCrossSectionMax () const
 
void SetEnergyOfCrossSectionMax (std::vector< G4double > *)
 
G4CrossSectionType CrossSectionType () const
 
void SetCrossSectionType (G4CrossSectionType val)
 
const G4ParticleDefinitionParticle () const
 
const G4ParticleDefinitionSecondaryParticle () const
 
G4VEmModelSelectModelForMaterial (G4double kinEnergy, size_t idxCouple) const
 
void AddEmModel (G4int, G4VEmModel *, const G4Region *region=nullptr)
 
void SetEmModel (G4VEmModel *, G4int index=0)
 
G4int NumberOfModels () const
 
G4VEmModelEmModel (size_t index=0) const
 
const G4VEmModelGetCurrentModel () const
 
G4VEmModelGetModelByIndex (G4int idx=0, G4bool ver=false) 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 SetEmMasterProcess (const G4VEmProcess *)
 
void SetBuildTableFlag (G4bool val)
 
void CurrentSetup (const G4MaterialCutsCouple *, G4double energy)
 
G4bool UseBaseMaterial () const
 
void BuildLambdaTable ()
 
void StreamInfo (std::ostream &outFile, const G4ParticleDefinition &, G4bool rst=false) const
 
 G4VEmProcess (G4VEmProcess &)=delete
 
G4VEmProcessoperator= (const G4VEmProcess &right)=delete
 
- Public Member Functions inherited from G4VDiscreteProcess
 G4VDiscreteProcess (const G4String &aName, G4ProcessType aType=fNotDefined)
 
 G4VDiscreteProcess (G4VDiscreteProcess &)
 
virtual ~G4VDiscreteProcess ()
 
G4VDiscreteProcessoperator= (const G4VDiscreteProcess &)=delete
 
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 &)
 
virtual G4double MinPrimaryEnergy (const G4ParticleDefinition *, const G4Material *)
 
- Public Member Functions inherited from G4VProcess
 G4VProcess (const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
 
 G4VProcess (const G4VProcess &right)
 
virtual ~G4VProcess ()
 
G4VProcessoperator= (const G4VProcess &)=delete
 
G4bool operator== (const G4VProcess &right) const
 
G4bool 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

void InitialiseProcess (const G4ParticleDefinition *) override
 
G4double GetMeanFreePath (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
 
G4double ComputeGeneralLambda (size_t idxe, size_t idxt)
 
G4double GetProbability (size_t idxt)
 
void SelectedProcess (const G4Step &step, G4VProcess *ptr)
 
void SelectEmProcess (const G4Step &, G4VEmProcess *)
 
void SelectHadProcess (const G4Track &, const G4Step &, G4HadronicProcess *)
 
G4double TotalCrossSectionPerVolume ()
 
- Protected Member Functions inherited from G4VEmProcess
virtual void StreamProcessInfo (std::ostream &) const
 
G4VEmModelSelectModel (G4double kinEnergy, size_t)
 
G4double GetMeanFreePath (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
 
G4PhysicsVectorLambdaPhysicsVector (const G4MaterialCutsCouple *)
 
void DefineMaterial (const G4MaterialCutsCouple *couple)
 
G4int LambdaBinning () const
 
G4double MinKinEnergy () const
 
G4double MaxKinEnergy () const
 
G4double PolarAngleLimit () const
 
G4ParticleChangeForGammaGetParticleChange ()
 
void SetParticle (const G4ParticleDefinition *p)
 
void SetSecondaryParticle (const G4ParticleDefinition *p)
 
size_t CurrentMaterialCutsCoupleIndex () const
 
const G4MaterialCutsCoupleMaterialCutsCouple () const
 
G4bool ApplyCuts () const
 
G4double GetGammaEnergyCut ()
 
G4double GetElectronEnergyCut ()
 
void SetStartFromNullFlag (G4bool val)
 
void SetSplineFlag (G4bool val)
 
const G4ElementGetTargetElement () const
 
const G4IsotopeGetTargetIsotope () const
 
G4int DensityIndex (G4int idx) const
 
G4double DensityFactor (G4int idx) const
 
- Protected Member Functions inherited from G4VDiscreteProcess
- Protected Member Functions inherited from G4VProcess
void SubtractNumberOfInteractionLengthLeft (G4double prevStepSize)
 
void ClearNumberOfInteractionLengthLeft ()
 

Protected Attributes

G4HadronicProcesstheGammaNuclear = nullptr
 
G4VProcessselectedProc = nullptr
 
G4double preStepLogE = 1.0
 
G4double factor = 1.0
 
- Protected Attributes inherited from G4VEmProcess
const G4MaterialCutsCouplecurrentCouple = nullptr
 
const G4MaterialcurrentMaterial = nullptr
 
G4EmBiasingManagerbiasManager = nullptr
 
std::vector< G4double > * theEnergyOfCrossSectionMax = nullptr
 
G4double mfpKinEnergy = DBL_MAX
 
G4double preStepKinEnergy = 0.0
 
G4double preStepLambda = 0.0
 
G4int mainSecondaries = 1
 
G4int secID = _EM
 
G4int fluoID = _Fluorescence
 
G4int augerID = _AugerElectron
 
G4int biasID = _EM
 
G4int tripletID = _TripletElectron
 
size_t currentCoupleIndex = 0
 
size_t basedCoupleIndex = 0
 
size_t coupleIdxLambda = 0
 
size_t idxLambda = 0
 
G4bool isTheMaster = true
 
G4bool baseMat = false
 
std::vector< G4DynamicParticle * > secParticles
 
G4ParticleChangeForGamma fParticleChange
 
- Protected Attributes inherited from G4VProcess
const G4ProcessManageraProcessManager = nullptr
 
G4VParticleChangepParticleChange = nullptr
 
G4ParticleChange aParticleChange
 
G4double theNumberOfInteractionLengthLeft = -1.0
 
G4double currentInteractionLength = -1.0
 
G4double theInitialNumberOfInteractionLength = -1.0
 
G4String theProcessName
 
G4String thePhysicsTableFileName
 
G4ProcessType theProcessType = fNotDefined
 
G4int theProcessSubType = -1
 
G4double thePILfactor = 1.0
 
G4int verboseLevel = 0
 
G4bool enableAtRestDoIt = true
 
G4bool enableAlongStepDoIt = true
 
G4bool enablePostStepDoIt = true
 

Additional Inherited Members

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

Detailed Description

Definition at line 64 of file G4GammaGeneralProcess.hh.

Constructor & Destructor Documentation

◆ G4GammaGeneralProcess() [1/2]

G4GammaGeneralProcess::G4GammaGeneralProcess ( const G4String & pname = "GammaGeneralProc")
explicit

Definition at line 86 of file G4GammaGeneralProcess.cc.

86 :
88 minPEEnergy(150*CLHEP::keV),
89 minEEEnergy(2*CLHEP::electron_mass_c2),
90 minMMEnergy(100*CLHEP::MeV)
91{
95}
@ fGammaGeneralProcess
@ fElectromagnetic
static G4Gamma * Gamma()
Definition G4Gamma.cc:81
G4VEmProcess(const G4String &name, G4ProcessType type=fElectromagnetic)
void SetParticle(const G4ParticleDefinition *p)
void SetVerboseLevel(G4int value)
void SetProcessSubType(G4int)

◆ ~G4GammaGeneralProcess()

G4GammaGeneralProcess::~G4GammaGeneralProcess ( )
override

Definition at line 99 of file G4GammaGeneralProcess.cc.

100{
101 if(isTheMaster) {
102 delete theHandler;
103 theHandler = nullptr;
104 }
105}

◆ G4GammaGeneralProcess() [2/2]

G4GammaGeneralProcess::G4GammaGeneralProcess ( G4GammaGeneralProcess & )
delete

Member Function Documentation

◆ AddEmProcess()

void G4GammaGeneralProcess::AddEmProcess ( G4VEmProcess * ptr)

Definition at line 116 of file G4GammaGeneralProcess.cc.

117{
118 if(nullptr == ptr) { return; }
119 G4int stype = ptr->GetProcessSubType();
120 if(stype == fRayleigh) { theRayleigh = ptr; }
121 else if(stype == fPhotoElectricEffect) { thePhotoElectric = ptr; }
122 else if(stype == fComptonScattering) { theCompton = ptr; }
123 else if(stype == fGammaConversion) { theConversionEE = ptr; }
124}
@ fGammaConversion
@ fRayleigh
@ fComptonScattering
@ fPhotoElectricEffect
int G4int
Definition G4Types.hh:85
G4int GetProcessSubType() const

◆ AddHadProcess()

void G4GammaGeneralProcess::AddHadProcess ( G4HadronicProcess * ptr)

Definition at line 135 of file G4GammaGeneralProcess.cc.

136{
137 theGammaNuclear = ptr;
138}
G4HadronicProcess * theGammaNuclear

◆ AddMMProcess()

void G4GammaGeneralProcess::AddMMProcess ( G4GammaConversionToMuons * ptr)

Definition at line 128 of file G4GammaGeneralProcess.cc.

129{
130 theConversionMM = ptr;
131}

◆ BuildPhysicsTable()

void G4GammaGeneralProcess::BuildPhysicsTable ( const G4ParticleDefinition & part)
overridevirtual

Reimplemented from G4VProcess.

Definition at line 252 of file G4GammaGeneralProcess.cc.

253{
254 if(1 < verboseLevel) {
255 G4cout << "### G4VEmProcess::BuildPhysicsTable() for "
256 << GetProcessName()
257 << " and particle " << part.GetParticleName()
258 << G4endl;
259 }
260 if(!isTheMaster) {
261 thePhotoElectric->SetEmMasterProcess(theHandler->GetMasterProcess(0));
262 baseMat = theHandler->GetMasterProcess(0)->UseBaseMaterial();
263 }
264 thePhotoElectric->BuildPhysicsTable(part);
265
266 if(!isTheMaster) {
267 theCompton->SetEmMasterProcess(theHandler->GetMasterProcess(1));
268 }
269 theCompton->BuildPhysicsTable(part);
270
271 if(!isTheMaster) {
272 theConversionEE->SetEmMasterProcess(theHandler->GetMasterProcess(2));
273 }
274 theConversionEE->BuildPhysicsTable(part);
275
276 if(theRayleigh != nullptr) {
277 if(!isTheMaster) {
278 theRayleigh->SetEmMasterProcess(theHandler->GetMasterProcess(3));
279 }
280 theRayleigh->BuildPhysicsTable(part);
281 }
282 if(theGammaNuclear != nullptr) { theGammaNuclear->BuildPhysicsTable(part); }
283 if(theConversionMM != nullptr) { theConversionMM->BuildPhysicsTable(part); }
284
285 if(isTheMaster) {
286 const G4ProductionCutsTable* theCoupleTable=
288 G4int numOfCouples = (G4int)theCoupleTable->GetTableSize();
289
291 const std::vector<G4PhysicsTable*>& tables = theHandler->GetTables();
292
295 G4DynamicParticle* dynParticle =
297
298 G4double sigComp(0.), sigPE(0.), sigConv(0.), sigR(0.),
299 sigN(0.), sigM(0.), val(0.);
300
301 for(G4int i=0; i<numOfCouples; ++i) {
302
303 if (bld->GetFlag(i)) {
304 G4int idx = (!baseMat) ? i : DensityIndex(i);
305 const G4MaterialCutsCouple* couple =
306 theCoupleTable->GetMaterialCutsCouple(i);
307 const G4Material* material = couple->GetMaterial();
308
309 // energy interval 0
310 std::size_t nn = (*(tables[0]))[idx]->GetVectorLength();
311 if(1 < verboseLevel) {
312 G4cout << "======= Zone 0 ======= N= " << nn
313 << " for " << material->GetName() << G4endl;
314 }
315 for(std::size_t j=0; j<nn; ++j) {
316 G4double e = (*(tables[0]))[idx]->Energy(j);
317 G4double loge = G4Log(e);
318 sigComp = theCompton->GetLambda(e, couple, loge);
319 sigR = (nullptr != theRayleigh) ?
320 theRayleigh->GetLambda(e, couple, loge) : 0.0;
321 G4double sum = sigComp + sigR;
322 if(1 < verboseLevel) {
323 G4cout << j << ". E= " << e << " xs= " << sum
324 << " compt= " << sigComp << " Rayl= " << sigR << G4endl;
325 }
326 (*(tables[0]))[idx]->PutValue(j, sum);
327 if(theT[1]) {
328 val = sigR/sum;
329 (*(tables[1]))[idx]->PutValue(j, val);
330 }
331 }
332
333 // energy interval 1
334 nn = (*(tables[2]))[idx]->GetVectorLength();
335 if(1 < verboseLevel) {
336 G4cout << "======= Zone 1 ======= N= " << nn << G4endl;
337 }
338 for(std::size_t j=0; j<nn; ++j) {
339 G4double e = (*(tables[2]))[idx]->Energy(j);
340 G4double loge = G4Log(e);
341 sigComp = theCompton->GetLambda(e, couple, loge);
342 sigR = (nullptr != theRayleigh) ?
343 theRayleigh->GetLambda(e, couple, loge) : 0.0;
344 sigPE = thePhotoElectric->GetLambda(e, couple, loge);
345 G4double sum = sigComp + sigR + sigPE;
346 if(1 < verboseLevel) {
347 G4cout << j << ". E= " << e << " xs= " << sum
348 << " compt= " << sigComp << " conv= " << sigConv
349 << " PE= " << sigPE << " Rayl= " << sigR
350 << " GN= " << sigN << G4endl;
351 }
352 (*(tables[2]))[idx]->PutValue(j, sum);
353
354 val = sigPE/sum;
355 (*(tables[3]))[idx]->PutValue(j, val);
356
357 val = (sigR > 0.0) ? (sigComp + sigPE)/sum : 1.0;
358 (*(tables[4]))[idx]->PutValue(j, val);
359 }
360
361 // energy interval 2
362 nn = (*(tables[6]))[idx]->GetVectorLength();
363 if(1 < verboseLevel) {
364 G4cout << "======= Zone 2 ======= N= " << nn << G4endl;
365 }
366 for(std::size_t j=0; j<nn; ++j) {
367 G4double e = (*(tables[6]))[idx]->Energy(j);
368 G4double loge = G4Log(e);
369 sigComp = theCompton->GetLambda(e, couple, loge);
370 sigConv = theConversionEE->GetLambda(e, couple, loge);
371 sigPE = thePhotoElectric->GetLambda(e, couple, loge);
372 sigN = 0.0;
373 if(nullptr != gn) {
374 dynParticle->SetKineticEnergy(e);
375 sigN = gn->ComputeCrossSection(dynParticle, material);
376 }
377 G4double sum = sigComp + sigConv + sigPE + sigN;
378 if(1 < verboseLevel) {
379 G4cout << j << ". E= " << e << " xs= " << sum
380 << " compt= " << sigComp << " conv= " << sigConv
381 << " PE= " << sigPE
382 << " GN= " << sigN << G4endl;
383 }
384 (*(tables[6]))[idx]->PutValue(j, sum);
385
386 val = sigConv/sum;
387 (*(tables[7]))[idx]->PutValue(j, val);
388
389 val = (sigConv + sigComp)/sum;
390 (*(tables[8]))[idx]->PutValue(j, val);
391
392 val = (sigN > 0.0) ? (sigConv + sigComp + sigPE)/sum : 1.0;
393 (*(tables[9]))[idx]->PutValue(j, val);
394 }
395
396 // energy interval 3
397 nn = (*(tables[10]))[idx]->GetVectorLength();
398 if(1 < verboseLevel) {
399 G4cout << "======= Zone 3 ======= N= " << nn
400 << " for " << material->GetName() << G4endl;
401 }
402 for(std::size_t j=0; j<nn; ++j) {
403 G4double e = (*(tables[10]))[idx]->Energy(j);
404 G4double loge = G4Log(e);
405 sigComp = theCompton->GetLambda(e, couple, loge);
406 sigConv = theConversionEE->GetLambda(e, couple, loge);
407 sigPE = thePhotoElectric->GetLambda(e, couple, loge);
408 sigN = 0.0;
409 if(nullptr != gn) {
410 dynParticle->SetKineticEnergy(e);
411 sigN = gn->ComputeCrossSection(dynParticle, material);
412 }
413 sigM = 0.0;
414 if(nullptr != theConversionMM) {
415 val = theConversionMM->ComputeMeanFreePath(e, material);
416 sigM = (val < DBL_MAX) ? 1./val : 0.0;
417 }
418 G4double sum = sigComp + sigConv + sigPE + sigN + sigM;
419 if(1 < verboseLevel) {
420 G4cout << j << ". E= " << e << " xs= " << sum
421 << " compt= " << sigComp << " conv= " << sigConv
422 << " PE= " << sigPE
423 << " GN= " << sigN << G4endl;
424 }
425 (*(tables[10]))[idx]->PutValue(j, sum);
426
427 val = (sigComp + sigPE + sigN + sigM)/sum;
428 (*(tables[11]))[idx]->PutValue(j, val);
429
430 val = (sigPE + sigN + sigM)/sum;
431 (*(tables[12]))[idx]->PutValue(j, val);
432
433 val = (sigN + sigM)/sum;
434 (*(tables[13]))[idx]->PutValue(j, val);
435
436 val = sigM/sum;
437 (*(tables[14]))[idx]->PutValue(j, val);
438 }
439 for(std::size_t k=0; k<nTables; ++k) {
440 if(theT[k] && (k <= 1 || k >= 10)) {
441 //G4cout <<"BuildPhysTable spline iTable="<<k<<" jCouple="<< idx << G4endl;
442 (*(tables[k]))[idx]->FillSecondDerivatives();
443 }
444 }
445 }
446 }
447 delete dynParticle;
448 }
449
450 if(1 < verboseLevel) {
451 G4cout << "### G4VEmProcess::BuildPhysicsTable() done for "
452 << GetProcessName()
453 << " and particle " << part.GetParticleName()
454 << G4endl;
455 }
456}
G4double G4Log(G4double x)
Definition G4Log.hh:227
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition G4Types.hh:83
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4double ComputeCrossSection(const G4DynamicParticle *, const G4Material *)
void SetKineticEnergy(G4double aEnergy)
const G4VEmProcess * GetMasterProcess(size_t idx) const
const std::vector< G4PhysicsTable * > & GetTables() const
G4double ComputeMeanFreePath(G4double GammaEnergy, const G4Material *aMaterial)
void BuildPhysicsTable(const G4ParticleDefinition &) override
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4CrossSectionDataStore * GetCrossSectionDataStore()
G4bool GetFlag(size_t idx)
static G4LossTableManager * Instance()
G4LossTableBuilder * GetTableBuilder()
const G4Material * GetMaterial() const
const G4String & GetName() const
const G4String & GetParticleName() const
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4int DensityIndex(G4int idx) const
void SetEmMasterProcess(const G4VEmProcess *)
G4bool UseBaseMaterial() const
G4double GetLambda(G4double kinEnergy, const G4MaterialCutsCouple *couple, G4double logKinEnergy)
G4int verboseLevel
const G4String & GetProcessName() const
#define DBL_MAX
Definition templates.hh:62

◆ ComputeGeneralLambda()

G4double G4GammaGeneralProcess::ComputeGeneralLambda ( size_t idxe,
size_t idxt )
inlineprotected

Definition at line 195 of file G4GammaGeneralProcess.hh.

196{
197 idxEnergy = idxe;
198 return factor*theHandler->GetVector(idxt, basedCoupleIndex)
200}
const G4PhysicsVector * GetVector(size_t itable, size_t ivec) const
G4double LogVectorValue(const G4double energy, const G4double theLogEnergy) const
size_t basedCoupleIndex
G4double preStepKinEnergy

Referenced by TotalCrossSectionPerVolume().

◆ GetCreatorProcess()

const G4VProcess * G4GammaGeneralProcess::GetCreatorProcess ( ) const
overridevirtual

Reimplemented from G4VProcess.

Definition at line 785 of file G4GammaGeneralProcess.cc.

786{
787 return selectedProc;
788}

◆ GetEmProcess()

G4VEmProcess * G4GammaGeneralProcess::GetEmProcess ( const G4String & name)
overridevirtual

Reimplemented from G4VEmProcess.

Definition at line 768 of file G4GammaGeneralProcess.cc.

769{
770 G4VEmProcess* proc = nullptr;
771 if(name == thePhotoElectric->GetProcessName()) {
772 proc = thePhotoElectric;
773 } else if(name == theCompton->GetProcessName()) {
774 proc = theCompton;
775 } else if(name == theConversionEE->GetProcessName()) {
776 proc = theConversionEE;
777 } else if(theRayleigh != nullptr && name == theRayleigh->GetProcessName()) {
778 proc = theRayleigh;
779 }
780 return proc;
781}

◆ GetGammaNuclear()

G4HadronicProcess * G4GammaGeneralProcess::GetGammaNuclear ( ) const
inline

Definition at line 237 of file G4GammaGeneralProcess.hh.

238{
239 return theGammaNuclear;
240}

◆ GetMeanFreePath()

G4double G4GammaGeneralProcess::GetMeanFreePath ( const G4Track & track,
G4double previousStepSize,
G4ForceCondition * condition )
overrideprotectedvirtual

Implements G4VDiscreteProcess.

Definition at line 730 of file G4GammaGeneralProcess.cc.

733{
735 return MeanFreePath(track);
736}
G4double condition(const G4ErrorSymMatrix &m)
@ NotForced
G4double MeanFreePath(const G4Track &track)

◆ GetProbability()

G4double G4GammaGeneralProcess::GetProbability ( size_t idxt)
inlineprotected

Definition at line 204 of file G4GammaGeneralProcess.hh.

205{
206 return theHandler->GetVector(idxt, basedCoupleIndex)
208}

Referenced by PostStepDoIt().

◆ GetSelectedProcess()

const G4VProcess * G4GammaGeneralProcess::GetSelectedProcess ( ) const
inline

Definition at line 229 of file G4GammaGeneralProcess.hh.

230{
231 return selectedProc;
232}

◆ GetSubProcessName()

const G4String & G4GammaGeneralProcess::GetSubProcessName ( ) const

Definition at line 752 of file G4GammaGeneralProcess.cc.

◆ GetSubProcessSubType()

G4int G4GammaGeneralProcess::GetSubProcessSubType ( ) const

Definition at line 760 of file G4GammaGeneralProcess.cc.

◆ InitialiseProcess()

void G4GammaGeneralProcess::InitialiseProcess ( const G4ParticleDefinition * )
overrideprotectedvirtual

Implements G4VEmProcess.

Definition at line 190 of file G4GammaGeneralProcess.cc.

191{
192 if(isTheMaster) {
193
196
197 // tables are created and its size is defined only once
198 if(nullptr == theHandler) {
199 theHandler = new G4EmDataHandler(nTables);
200 if(theRayleigh) { theT[1] = true; }
201
202 theHandler->SetMasterProcess(thePhotoElectric);
203 theHandler->SetMasterProcess(theCompton);
204 theHandler->SetMasterProcess(theConversionEE);
205 theHandler->SetMasterProcess(theRayleigh);
206 }
207 auto bld = man->GetTableBuilder();
208
209 const G4ProductionCutsTable* theCoupleTable=
211 std::size_t numOfCouples = theCoupleTable->GetTableSize();
212
213 G4double mine = param->MinKinEnergy();
214 G4double maxe = param->MaxKinEnergy();
215 G4int nd = param->NumberOfBinsPerDecade();
216 std::size_t nbin1 = std::max(5, nd*G4lrint(std::log10(minPEEnergy/mine)));
217 std::size_t nbin2 = std::max(5, nd*G4lrint(std::log10(maxe/minMMEnergy)));
218
219 G4PhysicsVector* vec = nullptr;
220 G4PhysicsLogVector aVector(mine,minPEEnergy,nbin1,true);
221 G4PhysicsLogVector bVector(minPEEnergy,minEEEnergy,nLowE,false);
222 G4PhysicsLogVector cVector(minEEEnergy,minMMEnergy,nHighE,false);
223 G4PhysicsLogVector dVector(minMMEnergy,maxe,nbin2,true);
224
225 for(std::size_t i=0; i<nTables; ++i) {
226 if(!theT[i]) { continue; }
227 //G4cout << "## PreparePhysTable " << i << "." << G4endl;
228 G4PhysicsTable* table = theHandler->MakeTable(i);
229 //G4cout << " make table " << table << G4endl;
230 for(std::size_t j=0; j<numOfCouples; ++j) {
231 vec = (*table)[j];
232 if (bld->GetFlag(j) && nullptr == vec) {
233 //G4cout <<"InitialiseProcess iTable="<<i<<" jCouple="<< j <<" make new vector"<< G4endl;
234 if(i<=1) {
235 vec = new G4PhysicsVector(aVector);
236 } else if(i<=5) {
237 vec = new G4PhysicsVector(bVector);
238 } else if(i<=9) {
239 vec = new G4PhysicsVector(cVector);
240 } else {
241 vec = new G4PhysicsVector(dVector);
242 }
244 }
245 }
246 }
247 }
248}
void SetMasterProcess(const G4VEmProcess *)
G4PhysicsTable * MakeTable(size_t idx)
static G4EmParameters * Instance()
G4double MinKinEnergy() const
G4int NumberOfBinsPerDecade() const
G4double MaxKinEnergy() const
static void SetPhysicsVector(G4PhysicsTable *physTable, std::size_t idx, G4PhysicsVector *vec)
int G4lrint(double ad)
Definition templates.hh:134

Referenced by PreparePhysicsTable().

◆ IsApplicable()

G4bool G4GammaGeneralProcess::IsApplicable ( const G4ParticleDefinition & )
overridevirtual

Implements G4VEmProcess.

Definition at line 109 of file G4GammaGeneralProcess.cc.

110{
111 return true;
112}

◆ operator=()

G4GammaGeneralProcess & G4GammaGeneralProcess::operator= ( const G4GammaGeneralProcess & right)
delete

◆ PostStepDoIt()

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

Reimplemented from G4VDiscreteProcess.

Definition at line 575 of file G4GammaGeneralProcess.cc.

577{
578 // In all cases clear number of interaction lengths
580 selectedProc = nullptr;
582 /*
583 G4cout << "PostStep: preStepLambda= " << preStepLambda
584 << " PE= " << peLambda << " q= " << q << " idxE= " << idxEnergy
585 << G4endl;
586 */
587 switch (idxEnergy) {
588 case 0:
589 if(preStepLambda*q <= peLambda) {
590 SelectEmProcess(step, thePhotoElectric);
591 } else {
592 if(theT[1] && preStepLambda*q < (preStepLambda - peLambda)*GetProbability(1) + peLambda) {
593 SelectEmProcess(step, theRayleigh);
594 } else {
595 SelectEmProcess(step, theCompton);
596 }
597 }
598 break;
599
600 case 1:
601 if(q <= GetProbability(3)) {
602 SelectEmProcess(step, thePhotoElectric);
603 } else if(q <= GetProbability(4)) {
604 SelectEmProcess(step, theCompton);
605 } else if(theRayleigh) {
606 SelectEmProcess(step, theRayleigh);
607 } else {
608 SelectEmProcess(step, thePhotoElectric);
609 }
610 break;
611
612 case 2:
613 if(q <= GetProbability(7)) {
614 SelectEmProcess(step, theConversionEE);
615 } else if(q <= GetProbability(8)) {
616 SelectEmProcess(step, theCompton);
617 } else if(q <= GetProbability(9)) {
618 SelectEmProcess(step, thePhotoElectric);
619 } else if(theGammaNuclear) {
620 SelectHadProcess(track, step, theGammaNuclear);
621 } else {
622 SelectEmProcess(step, theConversionEE);
623 }
624 break;
625
626 case 3:
627 if(q + GetProbability(11) <= 1.0) {
628 SelectEmProcess(step, theConversionEE);
629 } else if(q + GetProbability(12) <= 1.0) {
630 SelectEmProcess(step, theCompton);
631 } else if(q + GetProbability(13) <= 1.0) {
632 SelectEmProcess(step, thePhotoElectric);
633 } else if(theGammaNuclear && q + GetProbability(14) <= 1.0) {
634 SelectHadProcess(track, step, theGammaNuclear);
635 } else if(theConversionMM) {
636 SelectedProcess(step, theConversionMM);
637 } else {
638 SelectEmProcess(step, theConversionEE);
639 }
640 break;
641 }
642 // sample secondaries
643 if(selectedProc != nullptr) {
644 return selectedProc->PostStepDoIt(track, step);
645 }
646 // no interaction - exception case
648 return &fParticleChange;
649}
#define G4UniformRand()
Definition Randomize.hh:52
void SelectedProcess(const G4Step &step, G4VProcess *ptr)
void SelectHadProcess(const G4Track &, const G4Step &, G4HadronicProcess *)
G4double GetProbability(size_t idxt)
void SelectEmProcess(const G4Step &, G4VEmProcess *)
void InitializeForPostStep(const G4Track &)
G4double preStepLambda
G4ParticleChangeForGamma fParticleChange
virtual G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &stepData)=0
G4double theNumberOfInteractionLengthLeft

◆ PostStepGetPhysicalInteractionLength()

G4double G4GammaGeneralProcess::PostStepGetPhysicalInteractionLength ( const G4Track & track,
G4double previousStepSize,
G4ForceCondition * condition )
overridevirtual

Reimplemented from G4VDiscreteProcess.

Definition at line 467 of file G4GammaGeneralProcess.cc.

471{
473 G4double x = DBL_MAX;
474
476 const G4MaterialCutsCouple* couple = track.GetMaterialCutsCouple();
477
478 // compute mean free path
479 G4bool recompute = false;
480 if(couple != currentCouple) {
481 currentCouple = couple;
483 currentMaterial = couple->GetMaterial();
484 factor = 1.0;
485 if(baseMat) {
488 }
489 recompute = true;
490 }
491 if(energy != preStepKinEnergy) {
494 recompute = true;
495 }
496 if(recompute) {
498
499 // zero cross section
500 if(preStepLambda <= 0.0) {
503 }
504 }
505
506 // non-zero cross section
507 if(preStepLambda > 0.0) {
508
510
511 // beggining of tracking (or just after DoIt of this process)
514
515 } else if(currentInteractionLength < DBL_MAX) {
516
518 previousStepSize/currentInteractionLength;
521 }
522
523 // new mean free path and step limit for the next step
526 }
527 /*
528 G4cout << "PostStepGetPhysicalInteractionLength: e= " << energy
529 << " idxe= " << idxEnergy << " xs= " << preStepLambda
530 << " x= " << x << G4endl;
531 */
532 return x;
533}
bool G4bool
Definition G4Types.hh:86
G4double GetLogKineticEnergy() const
const G4DynamicParticle * GetDynamicParticle() const
G4double GetKineticEnergy() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4double DensityFactor(G4int idx) const
const G4MaterialCutsCouple * currentCouple
size_t currentCoupleIndex
const G4Material * currentMaterial
G4double currentInteractionLength
G4double theInitialNumberOfInteractionLength
G4double energy(const ThreeVector &p, const G4double m)

◆ PreparePhysicsTable()

void G4GammaGeneralProcess::PreparePhysicsTable ( const G4ParticleDefinition & part)
overridevirtual

Reimplemented from G4VProcess.

Definition at line 142 of file G4GammaGeneralProcess.cc.

143{
144 SetParticle(&part);
145 preStepLambda = 0.0;
146 idxEnergy = 0;
147 currentCouple = nullptr;
148
151
152 isTheMaster = man->IsMaster();
153 if(isTheMaster) { SetVerboseLevel(param->Verbose()); }
154 else { SetVerboseLevel(param->WorkerVerbose()); }
155
158
159 if(1 < verboseLevel) {
160 G4cout << "G4GammaGeneralProcess::PreparePhysicsTable() for "
161 << GetProcessName()
162 << " and particle " << part.GetParticleName()
163 << " isMaster: " << isTheMaster << G4endl;
164 }
165
166 // 3 sub-processes must be always defined
167 if(thePhotoElectric == nullptr || theCompton == nullptr ||
168 theConversionEE == nullptr) {
170 ed << "### G4GeneralGammaProcess is initialized incorrectly"
171 << "\n Photoelectric: " << thePhotoElectric
172 << "\n Compton: " << theCompton
173 << "\n Conversion: " << theConversionEE;
174 G4Exception("G4GeneralGammaProcess","em0004",
175 FatalException, ed,"");
176 }
177
178 if(thePhotoElectric) { thePhotoElectric->PreparePhysicsTable(part); }
179 if(theCompton) { theCompton->PreparePhysicsTable(part); }
180 if(theConversionEE) { theConversionEE->PreparePhysicsTable(part); }
181 if(theRayleigh) { theRayleigh->PreparePhysicsTable(part); }
183 if(theConversionMM) { theConversionMM->PreparePhysicsTable(part); }
184
185 InitialiseProcess(&part);
186}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4int Verbose() const
G4int WorkerVerbose() const
void InitialiseProcess(const G4ParticleDefinition *) override
void PreparePhysicsTable(const G4ParticleDefinition &) override
void PreparePhysicsTable(const G4ParticleDefinition &) override
virtual void PreparePhysicsTable(const G4ParticleDefinition &)

◆ ProcessDescription()

void G4GammaGeneralProcess::ProcessDescription ( std::ostream & outFile) const
overridevirtual

Reimplemented from G4VProcess.

Definition at line 740 of file G4GammaGeneralProcess.cc.

741{
742 thePhotoElectric->ProcessDescription(out);
743 theCompton->ProcessDescription(out);
744 theConversionEE->ProcessDescription(out);
745 if(theRayleigh) { theRayleigh->ProcessDescription(out); }
747 if(theConversionMM) { theConversionMM->ProcessDescription(out); }
748}
void ProcessDescription(std::ostream &outFile) const override
void ProcessDescription(std::ostream &outFile) const override
virtual void ProcessDescription(std::ostream &outfile) const

◆ RetrievePhysicsTable()

G4bool G4GammaGeneralProcess::RetrievePhysicsTable ( const G4ParticleDefinition * part,
const G4String & directory,
G4bool ascii )
overridevirtual

Reimplemented from G4VProcess.

Definition at line 693 of file G4GammaGeneralProcess.cc.

696{
697 if(1 < verboseLevel) {
698 G4cout << "G4GammaGeneralProcess::RetrievePhysicsTable() for "
699 << part->GetParticleName() << " and process "
700 << GetProcessName() << G4endl;
701 }
702 G4bool yes = true;
703 if(!thePhotoElectric->RetrievePhysicsTable(part, directory, ascii))
704 { yes = false; }
705 if(!theCompton->RetrievePhysicsTable(part, directory, ascii))
706 { yes = false; }
707 if(!theConversionEE->RetrievePhysicsTable(part, directory, ascii))
708 { yes = false; }
709 if(theRayleigh != nullptr &&
710 !theRayleigh->RetrievePhysicsTable(part, directory, ascii))
711 { yes = false; }
712
713 for(std::size_t i=0; i<nTables; ++i) {
714 if(theT[i]) {
715 G4String nam = (0==i || 2==i || 6==i || 10==i)
716 ? "LambdaGeneral" + nameT[i] : "ProbGeneral" + nameT[i];
717 G4String fnam = GetPhysicsTableFileName(part,directory,nam,ascii);
718 G4bool spline = (i <= 1 || i >= 10);
719 if(!theHandler->RetrievePhysicsTable(i, part, fnam, ascii, spline))
720 { yes = false; }
721 }
722 }
723 if(yes) {
724 }
725 return yes;
726}
G4bool RetrievePhysicsTable(size_t idx, const G4ParticleDefinition *part, const G4String &fname, G4bool ascii, G4bool spline)
G4bool RetrievePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii) override
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)

◆ SelectedProcess()

void G4GammaGeneralProcess::SelectedProcess ( const G4Step & step,
G4VProcess * ptr )
inlineprotected

Definition at line 213 of file G4GammaGeneralProcess.hh.

214{
215 selectedProc = ptr;
217}
void SetProcessDefinedStep(const G4VProcess *aValue)
G4StepPoint * GetPostStepPoint() const

Referenced by PostStepDoIt(), SelectEmProcess(), and SelectHadProcess().

◆ SelectEmProcess()

void G4GammaGeneralProcess::SelectEmProcess ( const G4Step & step,
G4VEmProcess * proc )
inlineprotected

Definition at line 221 of file G4GammaGeneralProcess.hh.

222{
224 SelectedProcess(step, proc);
225}
void CurrentSetup(const G4MaterialCutsCouple *, G4double energy)

Referenced by PostStepDoIt().

◆ SelectHadProcess()

void G4GammaGeneralProcess::SelectHadProcess ( const G4Track & track,
const G4Step & step,
G4HadronicProcess * proc )
protected

Definition at line 653 of file G4GammaGeneralProcess.cc.

655{
656 SelectedProcess(step, proc);
659}

Referenced by PostStepDoIt().

◆ StartTracking()

void G4GammaGeneralProcess::StartTracking ( G4Track * )
overridevirtual

Reimplemented from G4VProcess.

Definition at line 460 of file G4GammaGeneralProcess.cc.

461{
463}

◆ StorePhysicsTable()

G4bool G4GammaGeneralProcess::StorePhysicsTable ( const G4ParticleDefinition * part,
const G4String & directory,
G4bool ascii = false )
overridevirtual

Reimplemented from G4VProcess.

Definition at line 663 of file G4GammaGeneralProcess.cc.

666{
667 G4bool yes = true;
668 if(!isTheMaster) { return yes; }
669 if(!thePhotoElectric->StorePhysicsTable(part, directory, ascii))
670 { yes = false; }
671 if(!theCompton->StorePhysicsTable(part, directory, ascii))
672 { yes = false; }
673 if(!theConversionEE->StorePhysicsTable(part, directory, ascii))
674 { yes = false; }
675 if(theRayleigh != nullptr &&
676 !theRayleigh->StorePhysicsTable(part, directory, ascii))
677 { yes = false; }
678
679 for(std::size_t i=0; i<nTables; ++i) {
680 if(theT[i]) {
681 G4String nam = (0==i || 2==i || 6==i || 10==i)
682 ? "LambdaGeneral" + nameT[i] : "ProbGeneral" + nameT[i];
683 G4String fnam = GetPhysicsTableFileName(part,directory,nam,ascii);
684 if(!theHandler->StorePhysicsTable(i, part, fnam, ascii)) { yes = false; }
685 }
686 }
687 return yes;
688}
G4bool StorePhysicsTable(size_t idx, const G4ParticleDefinition *part, const G4String &fname, G4bool ascii)
G4bool StorePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false) override

◆ TotalCrossSectionPerVolume()

G4double G4GammaGeneralProcess::TotalCrossSectionPerVolume ( )
protected

Definition at line 537 of file G4GammaGeneralProcess.cc.

538{
539 G4double cross = 0.0;
540 /*
541 G4cout << "#Total: " << preStepKinEnergy << " " << minPEEnergy << " "
542 << minEEEnergy << " " << minMMEnergy<< G4endl;
543 G4cout << " idxE= " << idxEnergy
544 << " idxC= " << currentCoupleIndex << G4endl;
545 */
546 if(preStepKinEnergy < minPEEnergy) {
547 cross = ComputeGeneralLambda(0, 0);
548 //G4cout << "XS1: " << cross << G4endl;
549 peLambda = thePhotoElectric->GetLambda(preStepKinEnergy, currentCouple, preStepLogE);
550 cross += peLambda;
551 //G4cout << "XS2: " << peLambda << G4endl;
552
553 } else if(preStepKinEnergy < minEEEnergy) {
554 cross = ComputeGeneralLambda(1, 2);
555 //G4cout << "XS3: " << cross << G4endl;
556
557 } else if(preStepKinEnergy < minMMEnergy) {
558 cross = ComputeGeneralLambda(2, 6);
559 //G4cout << "XS4: " << cross << G4endl;
560
561 } else {
562 cross = ComputeGeneralLambda(3, 10);
563 //G4cout << "XS5: " << cross << G4endl;
564 }
565 /*
566 G4cout << "xs= " << cross << " idxE= " << idxEnergy
567 << " idxC= " << currentCoupleIndex
568 << " E= " << preStepKinEnergy << G4endl;
569 */
570 return cross;
571}
G4double ComputeGeneralLambda(size_t idxe, size_t idxt)

Referenced by PostStepGetPhysicalInteractionLength().

Member Data Documentation

◆ factor

G4double G4GammaGeneralProcess::factor = 1.0
protected

◆ preStepLogE

G4double G4GammaGeneralProcess::preStepLogE = 1.0
protected

◆ selectedProc

G4VProcess* G4GammaGeneralProcess::selectedProc = nullptr
protected

◆ theGammaNuclear

G4HadronicProcess* G4GammaGeneralProcess::theGammaNuclear = nullptr
protected

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