78G4bool G4GammaGeneralProcess::theT[nTables] =
79 {
true,
false,
true,
true,
false,
false,
true,
true,
true,
80 false,
true,
true,
true,
false,
false};
81G4String G4GammaGeneralProcess::nameT[nTables] =
82 {
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
83 "9",
"10",
"11",
"12",
"13",
"14"};
87 minPEEnergy(50*
CLHEP::keV),
88 minEEEnergy(2*
CLHEP::electron_mass_c2),
89 minMMEnergy(100*
CLHEP::MeV),
95 thePhotoElectric = theCompton = theConversionEE = theRayleigh =
nullptr;
97 theConversionMM =
nullptr;
101 preStepLogE = factor = 1.0;
116 theHandler =
nullptr;
133 if(stype ==
fRayleigh) { theRayleigh = ptr; }
143 theConversionMM = ptr;
168 G4cout <<
"G4GammaGeneralProcess::PreparePhysicsTable() for "
193 if(theRayleigh) { theT[1] = theT[4] =
true; }
195 if(theConversionMM) { theT[14] =
true; }
211 size_t nbin1 = std::max(5, nd*
G4lrint(std::log10(minPEEnergy/mine)));
212 size_t nbin2 = std::max(5, nd*
G4lrint(std::log10(maxe/minMMEnergy)));
226 for(
size_t i=0; i<nTables; ++i) {
231 for(
size_t j=0; j<numOfCouples; ++j) {
233 if (bld->GetFlag(j) && !vec) {
257 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() for "
262 if(thePhotoElectric !=
nullptr) {
268 if(theCompton !=
nullptr) {
274 if(theConversionEE !=
nullptr) {
280 if(theRayleigh !=
nullptr) {
295 const std::vector<G4PhysicsTable*>& tables = theHandler->
GetTables();
302 G4double sigComp(0.), sigPE(0.), sigConv(0.), sigR(0.),
303 sigN(0.), sigM(0.), val(0.);
305 for(
size_t i=0; i<numOfCouples; ++i) {
309 G4int idx = (*theDensityIdx)[i];
315 size_t nn = (*(tables[0]))[idx]->GetVectorLength();
317 G4cout <<
"======= Zone 0 ======= N= " << nn
320 for(
size_t j=0; j<nn; ++j) {
321 G4double e = (*(tables[0]))[idx]->Energy(j);
323 sigComp = (theCompton) ? theCompton->
GetLambda(e, couple, loge) : 0.0;
324 sigR = (theRayleigh) ? theRayleigh->
GetLambda(e, couple, loge) : 0.0;
327 G4cout << j <<
". E= " << e <<
" xs= " << sum
328 <<
" compt= " << sigComp <<
" Rayl= " << sigR <<
G4endl;
330 (*(tables[0]))[idx]->PutValue(j, sum);
332 val = (sum > 0.0) ? sigComp/sum : 0.0;
333 (*(tables[1]))[idx]->PutValue(j, val);
338 nn = (*(tables[2]))[idx]->GetVectorLength();
342 for(
size_t j=0; j<nn; ++j) {
343 G4double e = (*(tables[2]))[idx]->Energy(j);
345 sigComp = (theCompton) ? theCompton->
GetLambda(e, couple, loge) : 0.0;
346 sigR = (theRayleigh) ? theRayleigh->
GetLambda(e, couple, loge) : 0.0;
347 sigPE = (thePhotoElectric)
348 ? thePhotoElectric->
GetLambda(e, couple, loge) : 0.0;
354 G4double sum = sigComp + sigR + sigPE + sigN;
356 G4cout << j <<
". E= " << e <<
" xs= " << sum
357 <<
" compt= " << sigComp <<
" conv= " << sigConv
358 <<
" PE= " << sigPE <<
" Rayl= " << sigR
359 <<
" GN= " << sigN <<
G4endl;
361 (*(tables[2]))[idx]->PutValue(j, sum);
362 val = (sum > 0.0) ? sigPE/sum : 0.0;
363 (*(tables[3]))[idx]->PutValue(j, val);
365 val = (sum > 0.0) ? (sigComp + sigPE)/sum : 0.0;
366 (*(tables[4]))[idx]->PutValue(j, val);
369 val = (sum > 0.0) ? (sigComp + sigPE + sigR)/sum : 0.0;
370 (*(tables[5]))[idx]->PutValue(j, val);
375 nn = (*(tables[6]))[idx]->GetVectorLength();
379 for(
size_t j=0; j<nn; ++j) {
380 G4double e = (*(tables[6]))[idx]->Energy(j);
382 sigComp = (theCompton) ? theCompton->
GetLambda(e, couple, loge) : 0.0;
383 sigConv = (theConversionEE)
384 ? theConversionEE->
GetLambda(e, couple, loge) : 0.0;
385 sigPE = (thePhotoElectric)
386 ? thePhotoElectric->
GetLambda(e, couple, loge) : 0.0;
392 G4double sum = sigComp + sigConv + sigPE + sigN;
394 G4cout << j <<
". E= " << e <<
" xs= " << sum
395 <<
" compt= " << sigComp <<
" conv= " << sigConv
397 <<
" GN= " << sigN <<
G4endl;
399 (*(tables[6]))[idx]->PutValue(j, sum);
400 val = (sum > 0.0) ? sigConv/sum : 0.0;
401 (*(tables[7]))[idx]->PutValue(j, val);
402 val = (sum > 0.0) ? (sigConv + sigComp)/sum : 0.0;
403 (*(tables[8]))[idx]->PutValue(j, val);
405 val = (sum > 0.0) ? (sigConv + sigComp + sigPE)/sum : 0.0;
406 (*(tables[9]))[idx]->PutValue(j, val);
411 nn = (*(tables[10]))[idx]->GetVectorLength();
413 G4cout <<
"======= Zone 3 ======= N= " << nn
416 for(
size_t j=0; j<nn; ++j) {
417 G4double e = (*(tables[10]))[idx]->Energy(j);
419 sigComp = (theCompton) ? theCompton->
GetLambda(e, couple, loge) : 0.0;
420 sigConv = (theConversionEE)
421 ? theConversionEE->
GetLambda(e, couple, loge) : 0.0;
422 sigPE = (thePhotoElectric)
423 ? thePhotoElectric->
GetLambda(e, couple, loge) : 0.0;
430 if(theConversionMM) {
432 sigM = (val <
DBL_MAX) ? 1./val : 0.0;
434 G4double sum = sigComp + sigConv + sigPE + sigN + sigM;
436 G4cout << j <<
". E= " << e <<
" xs= " << sum
437 <<
" compt= " << sigComp <<
" conv= " << sigConv
439 <<
" GN= " << sigN <<
G4endl;
441 (*(tables[10]))[idx]->PutValue(j, sum);
442 val = (sum > 0.0) ? 1.0 - sigConv/sum : 1.0;
443 (*(tables[11]))[idx]->PutValue(j, val);
444 val = (sum > 0.0) ? 1.0 - (sigConv + sigComp)/sum : 1.0;
445 (*(tables[12]))[idx]->PutValue(j, val);
447 val = (sum > 0.0) ? 1.0 - (sigConv + sigComp + sigPE)/sum : 1.0;
448 (*(tables[13]))[idx]->PutValue(j, val);
452 ? 1.0 - (sigConv + sigComp + sigPE + sigN)/sum : 1.0;
453 (*(tables[14]))[idx]->PutValue(j, val);
456 for(
size_t k=0; k<nTables; ++k) {
457 if(theT[k] && splineFlag) {
458 (*(tables[k]))[idx]->FillSecondDerivatives();
467 G4cout <<
"### G4VEmProcess::BuildPhysicsTable() done for "
544G4double G4GammaGeneralProcess::TotalCrossSectionPerVolume()
556 peLambda = (thePhotoElectric) ? thePhotoElectric
604 }
else if(theRayleigh !=
nullptr) {
621 if(theRayleigh !=
nullptr) {
664 }
else if(theConversionMM !=
nullptr) {
694 if(thePhotoElectric !=
nullptr &&
697 if(theCompton !=
nullptr &&
700 if(theConversionEE !=
nullptr &&
703 if(theRayleigh !=
nullptr &&
707 for(
size_t i=0; i<nTables; ++i) {
709 G4String nam = (0==i || 2==i || 6==i || 10==i)
710 ?
"LambdaGeneral" + nameT[i] :
"ProbGeneral" + nameT[i];
726 G4cout <<
"G4GammaGeneralProcess::RetrievePhysicsTable() for "
731 if(thePhotoElectric !=
nullptr &&
734 if(theCompton !=
nullptr &&
737 if(theConversionEE !=
nullptr &&
740 if(theRayleigh !=
nullptr &&
744 for(
size_t i=0; i<nTables; ++i) {
746 G4String nam = (0==i || 2==i || 6==i || 10==i)
747 ?
"LambdaGeneral" + nameT[i] :
"ProbGeneral" + nameT[i];
800 if(thePhotoElectric !=
nullptr && name == thePhotoElectric->
GetProcessName()) {
801 proc = thePhotoElectric;
802 }
else if(theCompton !=
nullptr && name == theCompton->
GetProcessName()) {
804 }
else if(theConversionEE !=
nullptr && name == theConversionEE->
GetProcessName()) {
805 proc = theConversionEE;
806 }
else if(theRayleigh !=
nullptr && name == theRayleigh->
GetProcessName()) {
G4double condition(const G4ErrorSymMatrix &m)
G4double G4Log(G4double x)
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
G4double ComputeCrossSection(const G4DynamicParticle *, const G4Material *)
G4double GetLogKineticEnergy() const
void SetKineticEnergy(G4double aEnergy)
void SetMasterProcess(const G4VEmProcess *)
G4PhysicsTable * MakeTable(size_t idx)
G4bool RetrievePhysicsTable(size_t idx, const G4ParticleDefinition *part, const G4String &fname, G4bool ascii)
const G4VEmProcess * GetMasterProcess(size_t idx) const
const std::vector< G4PhysicsTable * > & GetTables() const
G4bool StorePhysicsTable(size_t idx, const G4ParticleDefinition *part, const G4String &fname, G4bool ascii)
G4double MinKinEnergy() const
G4int NumberOfBinsPerDecade() const
G4int WorkerVerbose() const
G4double MaxKinEnergy() const
G4double ComputeMeanFreePath(G4double GammaEnergy, const G4Material *aMaterial)
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep) override
void AddHadProcess(G4HadronicProcess *)
G4int GetProcessSubType() const
G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &) override
G4bool StorePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false) override
G4double GetProbability(size_t idxt)
G4bool IsApplicable(const G4ParticleDefinition &) override
G4VParticleChange * SampleHadSecondaries(const G4Track &, const G4Step &, G4HadronicProcess *)
void AddEmProcess(G4VEmProcess *)
virtual ~G4GammaGeneralProcess()
void StartTracking(G4Track *) override
void BuildPhysicsTable(const G4ParticleDefinition &) override
void AddMMProcess(G4GammaConversionToMuons *)
G4double ComputeGeneralLambda(size_t idxe, size_t idxt)
const G4String & GetProcessName() const
void ProcessDescription(std::ostream &outFile) const override
G4VEmProcess * GetEmProcess(const G4String &name) override
void PreparePhysicsTable(const G4ParticleDefinition &) override
void SelectedProcess(const G4Step &track, const G4VProcess *ptr)
void InitialiseProcess(const G4ParticleDefinition *) override
const G4VProcess * selectedProc
G4HadronicProcess * theGammaNuclear
G4VParticleChange * SampleEmSecondaries(const G4Track &, const G4Step &, G4VEmProcess *)
G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
G4bool RetrievePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii) override
G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep) override
void ProcessDescription(std::ostream &outFile) const override
void PreparePhysicsTable(const G4ParticleDefinition &) override
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4CrossSectionDataStore * GetCrossSectionDataStore()
G4bool GetFlag(size_t idx)
G4LossTableBuilder * GetTableBuilder()
const G4Material * GetMaterial() const
const G4String & GetName() const
void InitializeForPostStep(const G4Track &)
const G4String & GetParticleName() const
static void SetPhysicsVector(G4PhysicsTable *physTable, std::size_t idx, G4PhysicsVector *vec)
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
G4Material * GetMaterial() const
const G4DynamicParticle * GetDynamicParticle() const
G4double GetKineticEnergy() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4double MeanFreePath(const G4Track &track)
G4LossTableManager * lManager
virtual void BuildPhysicsTable(const G4ParticleDefinition &) override
void SetEmMasterProcess(const G4VEmProcess *)
virtual G4bool RetrievePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii) override
virtual void ProcessDescription(std::ostream &outFile) const override
G4EmParameters * theParameters
const G4MaterialCutsCouple * currentCouple
const G4ParticleDefinition * theGamma
virtual G4bool StorePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false) override
G4double preStepKinEnergy
size_t currentCoupleIndex
G4double GetLambda(G4double kinEnergy, const G4MaterialCutsCouple *couple)
G4ParticleChangeForGamma fParticleChange
void SetParticle(const G4ParticleDefinition *p)
virtual void PreparePhysicsTable(const G4ParticleDefinition &) override
const G4Material * currentMaterial
G4double currentInteractionLength
G4double theInitialNumberOfInteractionLength
void SetVerboseLevel(G4int value)
virtual void ProcessDescription(std::ostream &outfile) const
G4double theNumberOfInteractionLengthLeft
void SetProcessSubType(G4int)
virtual void PreparePhysicsTable(const G4ParticleDefinition &)
G4int GetProcessSubType() const
const G4String & GetPhysicsTableFileName(const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
const G4String & GetProcessName() const