Geant4 11.3.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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, std::size_t idxCouple) const
 
void AddEmModel (G4int, G4VEmModel *, const G4Region *region=nullptr)
 
void SetEmModel (G4VEmModel *, G4int index=0)
 
G4int NumberOfModels () const
 
G4VEmModelEmModel (std::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 (std::size_t idxe, std::size_t idxt)
 
G4double GetProbability (std::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, std::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)
 
std::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 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
 
std::size_t currentCoupleIndex = 0
 
std::size_t basedCoupleIndex = 0
 
std::size_t coupleIdxLambda = 0
 
std::size_t idxLambda = 0
 
G4bool isTheMaster = false
 
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 if (nullptr == theHandler) {
96 theHandler = new G4EmDataHandler(nTables);
97 }
98}
@ 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)

Referenced by G4GammaGeneralProcess(), and operator=().

◆ ~G4GammaGeneralProcess()

G4GammaGeneralProcess::~G4GammaGeneralProcess ( )
override

Definition at line 102 of file G4GammaGeneralProcess.cc.

103{
104 if(isTheMaster) {
105 delete theHandler;
106 theHandler = nullptr;
107 }
108}

◆ G4GammaGeneralProcess() [2/2]

G4GammaGeneralProcess::G4GammaGeneralProcess ( G4GammaGeneralProcess & )
delete

Member Function Documentation

◆ AddEmProcess()

void G4GammaGeneralProcess::AddEmProcess ( G4VEmProcess * ptr)

Definition at line 119 of file G4GammaGeneralProcess.cc.

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

◆ AddHadProcess()

void G4GammaGeneralProcess::AddHadProcess ( G4HadronicProcess * ptr)

Definition at line 138 of file G4GammaGeneralProcess.cc.

139{
140 theGammaNuclear = ptr;
141}
G4HadronicProcess * theGammaNuclear

◆ AddMMProcess()

void G4GammaGeneralProcess::AddMMProcess ( G4GammaConversionToMuons * ptr)

Definition at line 131 of file G4GammaGeneralProcess.cc.

132{
133 theConversionMM = ptr;
134}

◆ BuildPhysicsTable()

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

Reimplemented from G4VProcess.

Definition at line 250 of file G4GammaGeneralProcess.cc.

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

◆ ComputeGeneralLambda()

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

Definition at line 195 of file G4GammaGeneralProcess.hh.

196{
197 idxEnergy = idxe;
198 return factor*theHandler->GetVector(idxt, basedCoupleIndex)
199 ->LogVectorValue(preStepKinEnergy, preStepLogE);
200}
std::size_t basedCoupleIndex
G4double preStepKinEnergy

Referenced by TotalCrossSectionPerVolume().

◆ GetCreatorProcess()

const G4VProcess * G4GammaGeneralProcess::GetCreatorProcess ( ) const
overridevirtual

Reimplemented from G4VProcess.

Definition at line 782 of file G4GammaGeneralProcess.cc.

783{
784 return selectedProc;
785}

◆ GetEmProcess()

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

Reimplemented from G4VEmProcess.

Definition at line 765 of file G4GammaGeneralProcess.cc.

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

◆ GetGammaNuclear()

G4HadronicProcess * G4GammaGeneralProcess::GetGammaNuclear ( ) const
inline

Definition at line 238 of file G4GammaGeneralProcess.hh.

239{
240 return theGammaNuclear;
241}

◆ GetMeanFreePath()

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

Implements G4VDiscreteProcess.

Definition at line 727 of file G4GammaGeneralProcess.cc.

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

◆ GetProbability()

G4double G4GammaGeneralProcess::GetProbability ( std::size_t idxt)
inlineprotected

Definition at line 204 of file G4GammaGeneralProcess.hh.

205{
206 return theHandler->GetVector(idxt, basedCoupleIndex)
207 ->LogVectorValue(preStepKinEnergy, preStepLogE);
208}

Referenced by PostStepDoIt().

◆ GetSelectedProcess()

const G4VProcess * G4GammaGeneralProcess::GetSelectedProcess ( ) const
inline

Definition at line 230 of file G4GammaGeneralProcess.hh.

231{
232 return selectedProc;
233}

◆ GetSubProcessName()

const G4String & G4GammaGeneralProcess::GetSubProcessName ( ) const

Definition at line 749 of file G4GammaGeneralProcess.cc.

750{
751 return (selectedProc) ? selectedProc->GetProcessName()
753}

◆ GetSubProcessSubType()

G4int G4GammaGeneralProcess::GetSubProcessSubType ( ) const

Definition at line 757 of file G4GammaGeneralProcess.cc.

758{
759 return (selectedProc) ? selectedProc->GetProcessSubType()
761}

◆ InitialiseProcess()

void G4GammaGeneralProcess::InitialiseProcess ( const G4ParticleDefinition * )
overrideprotectedvirtual

Implements G4VEmProcess.

Definition at line 191 of file G4GammaGeneralProcess.cc.

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

Reimplemented from G4VProcess.

Definition at line 112 of file G4GammaGeneralProcess.cc.

113{
114 return true;
115}

◆ 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 573 of file G4GammaGeneralProcess.cc.

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

◆ PostStepGetPhysicalInteractionLength()

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

Reimplemented from G4VDiscreteProcess.

Definition at line 465 of file G4GammaGeneralProcess.cc.

469{
471 G4double x = DBL_MAX;
472
474 const G4MaterialCutsCouple* couple = track.GetMaterialCutsCouple();
475
476 // compute mean free path
477 G4bool recompute = false;
478 if(couple != currentCouple) {
479 currentCouple = couple;
481 currentMaterial = couple->GetMaterial();
482 factor = 1.0;
483 if(baseMat) {
486 }
487 recompute = true;
488 }
489 if(energy != preStepKinEnergy) {
492 recompute = true;
493 }
494 if(recompute) {
496
497 // zero cross section
498 if(preStepLambda <= 0.0) {
501 }
502 }
503
504 // non-zero cross section
505 if(preStepLambda > 0.0) {
506
508
509 // beggining of tracking (or just after DoIt of this process)
512
513 } else if(currentInteractionLength < DBL_MAX) {
514
516 previousStepSize/currentInteractionLength;
519 }
520
521 // new mean free path and step limit for the next step
524 }
525 /*
526 G4cout << "PostStepGetPhysicalInteractionLength: e= " << energy
527 << " idxe= " << idxEnergy << " xs= " << preStepLambda
528 << " x= " << x << G4endl;
529 */
530 return x;
531}
bool G4bool
Definition G4Types.hh:86
G4double GetLogKineticEnergy() const
const G4DynamicParticle * GetDynamicParticle() const
G4double GetKineticEnergy() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
std::size_t currentCoupleIndex
G4double DensityFactor(G4int idx) const
const G4MaterialCutsCouple * currentCouple
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 145 of file G4GammaGeneralProcess.cc.

146{
147 SetParticle(&part);
148 preStepLambda = 0.0;
149 idxEnergy = 0;
150 currentCouple = nullptr;
151
152 G4LossTableManager* man = G4LossTableManager::Instance();
153
154 // initialise base material for the current run
155 G4LossTableBuilder* bld = man->GetTableBuilder();
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 return;
177 }
178
179 thePhotoElectric->PreparePhysicsTable(part);
180 theCompton->PreparePhysicsTable(part);
181 theConversionEE->PreparePhysicsTable(part);
182 if (nullptr != theRayleigh) { theRayleigh->PreparePhysicsTable(part); }
183 if (nullptr != theGammaNuclear) { theGammaNuclear->PreparePhysicsTable(part); }
184 if (nullptr != theConversionMM) { theConversionMM->PreparePhysicsTable(part); }
185
186 InitialiseProcess(&part);
187}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
void InitialiseProcess(const G4ParticleDefinition *) override
static G4bool GetBaseMaterialFlag()
void InitialiseBaseMaterials(const G4PhysicsTable *table=nullptr)

◆ ProcessDescription()

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

Reimplemented from G4VProcess.

Definition at line 737 of file G4GammaGeneralProcess.cc.

738{
739 thePhotoElectric->ProcessDescription(out);
740 theCompton->ProcessDescription(out);
741 theConversionEE->ProcessDescription(out);
742 if(theRayleigh) { theRayleigh->ProcessDescription(out); }
743 if(theGammaNuclear) { theGammaNuclear->ProcessDescription(out); }
744 if(theConversionMM) { theConversionMM->ProcessDescription(out); }
745}

◆ RetrievePhysicsTable()

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

Reimplemented from G4VProcess.

Definition at line 691 of file G4GammaGeneralProcess.cc.

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

223{
225 SelectedProcess(step, proc);
226}
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 651 of file G4GammaGeneralProcess.cc.

653{
654 SelectedProcess(step, proc);
657}
G4CrossSectionDataStore * GetCrossSectionDataStore()

Referenced by PostStepDoIt().

◆ StartTracking()

void G4GammaGeneralProcess::StartTracking ( G4Track * )
overridevirtual

Reimplemented from G4VProcess.

Definition at line 458 of file G4GammaGeneralProcess.cc.

459{
461}

◆ StorePhysicsTable()

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

Reimplemented from G4VProcess.

Definition at line 661 of file G4GammaGeneralProcess.cc.

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

◆ TotalCrossSectionPerVolume()

G4double G4GammaGeneralProcess::TotalCrossSectionPerVolume ( )
protected

Definition at line 535 of file G4GammaGeneralProcess.cc.

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