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

#include <G4EmSaturation.hh>

Public Member Functions

 G4EmSaturation (G4int verb)
 
virtual ~G4EmSaturation ()
 
virtual G4double VisibleEnergyDeposition (const G4ParticleDefinition *, const G4MaterialCutsCouple *, G4double length, G4double edepTotal, G4double edepNIEL=0.0) const
 
void InitialiseG4Saturation ()
 
G4double FindG4BirksCoefficient (const G4Material *)
 
void DumpBirksCoefficients ()
 
void DumpG4BirksCoefficients ()
 
G4double VisibleEnergyDepositionAtAStep (const G4Step *) const
 
void SetVerbose (G4int)
 
G4EmSaturationoperator= (const G4EmSaturation &right)=delete
 
 G4EmSaturation (const G4EmSaturation &)=delete
 

Detailed Description

Definition at line 69 of file G4EmSaturation.hh.

Constructor & Destructor Documentation

◆ G4EmSaturation() [1/2]

G4EmSaturation::G4EmSaturation ( G4int  verb)
explicit

Definition at line 62 of file G4EmSaturation.cc.

63{
64 verbose = verb;
65 nWarnings = nG4Birks = 0;
66
67 electron = nullptr;
68 proton = nullptr;
71}
void InitialiseG4Saturation()
static G4NistManager * Instance()

◆ ~G4EmSaturation()

G4EmSaturation::~G4EmSaturation ( )
virtualdefault

◆ G4EmSaturation() [2/2]

G4EmSaturation::G4EmSaturation ( const G4EmSaturation )
delete

Member Function Documentation

◆ DumpBirksCoefficients()

void G4EmSaturation::DumpBirksCoefficients ( )

Definition at line 237 of file G4EmSaturation.cc.

238{
239 G4cout << "### Birks coefficients used in run time" << G4endl;
241 for(std::size_t i=0; i<nMaterials; ++i) {
242 const G4Material* mat = (*mtable)[i];
244 if(br > 0.0) {
245 G4cout << " " << mat->GetName() << " "
246 << br*MeV/mm << " mm/MeV" << " "
247 << br*mat->GetDensity()*MeV*cm2/g
248 << " g/cm^2/MeV massFactor= " << massFactors[i]
249 << " effCharge= " << effCharges[i] << G4endl;
250 }
251 }
252}
std::vector< G4Material * > G4MaterialTable
double G4double
Definition: G4Types.hh:83
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4double GetBirksConstant() const
G4double GetDensity() const
Definition: G4Material.hh:175
G4IonisParamMat * GetIonisation() const
Definition: G4Material.hh:221
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:677
const G4String & GetName() const
Definition: G4Material.hh:172

Referenced by InitialiseG4Saturation().

◆ DumpG4BirksCoefficients()

void G4EmSaturation::DumpG4BirksCoefficients ( )

Definition at line 256 of file G4EmSaturation.cc.

257{
258 if(nG4Birks > 0) {
259 G4cout << "### Birks coefficients for Geant4 materials" << G4endl;
260 for(G4int i=0; i<nG4Birks; ++i) {
261 G4cout << " " << g4MatNames[i] << " "
262 << g4MatData[i]*MeV/mm << " mm/MeV" << G4endl;
263 }
264 }
265}
int G4int
Definition: G4Types.hh:85

◆ FindG4BirksCoefficient()

G4double G4EmSaturation::FindG4BirksCoefficient ( const G4Material mat)

Definition at line 160 of file G4EmSaturation.cc.

161{
162 if(0 == nG4Birks) { InitialiseG4materials(); }
163
164 G4String name = mat->GetName();
165 // is this material in the vector?
166
167 for(G4int j=0; j<nG4Birks; ++j) {
168 if(name == g4MatNames[j]) {
169 if(verbose > 0)
170 G4cout << "### G4EmSaturation::FindG4BirksCoefficient for "
171 << name << " is " << g4MatData[j]*MeV/mm << " mm/MeV "
172 << G4endl;
173 return g4MatData[j];
174 }
175 }
176 return 0.0;
177}
const char * name(G4int ptype)

◆ InitialiseG4Saturation()

void G4EmSaturation::InitialiseG4Saturation ( )

Definition at line 143 of file G4EmSaturation.cc.

144{
145 if(nMaterials == G4Material::GetNumberOfMaterials()) { return; }
147 massFactors.resize(nMaterials, 1.0);
148 effCharges.resize(nMaterials, 1.0);
149
150 if(0 == nG4Birks) { InitialiseG4materials(); }
151
152 for(std::size_t i=0; i<nMaterials; ++i) {
153 InitialiseBirksCoefficient((*G4Material::GetMaterialTable())[i]);
154 }
155 if(verbose > 0) { DumpBirksCoefficients(); }
156}
void DumpBirksCoefficients()
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:684

Referenced by G4EmSaturation().

◆ operator=()

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

◆ SetVerbose()

void G4EmSaturation::SetVerbose ( G4int  val)
inline

Definition at line 132 of file G4EmSaturation.hh.

133{
134 verbose = val;
135}

◆ VisibleEnergyDeposition()

G4double G4EmSaturation::VisibleEnergyDeposition ( const G4ParticleDefinition p,
const G4MaterialCutsCouple couple,
G4double  length,
G4double  edepTotal,
G4double  edepNIEL = 0.0 
) const
virtual

Definition at line 79 of file G4EmSaturation.cc.

85{
86 // no energy deposition
87 if(edep <= 0.0) { return 0.0; }
88
89 // zero step length may happens only if step limiter process
90 // is applied, in that case saturation should not be applied
91 if(length <= 0.0) { return edep; }
92
93 G4double evis = edep;
94 G4double bfactor = couple->GetMaterial()->GetIonisation()->GetBirksConstant();
95
96 if(bfactor > 0.0) {
97
98 // atomic relaxations for gamma incident
99 if(22 == p->GetPDGEncoding()) {
100 //G4cout << "%% gamma edep= " << edep/keV << " keV " << G4endl;
101 evis /= (1.0 + bfactor*edep/
102 G4LossTableManager::Instance()->GetRange(electron,edep,couple));
103
104 // energy loss
105 } else {
106
107 // protections
108 G4double nloss = std::max(niel, 0.0);
109 G4double eloss = edep - nloss;
110
111 // neutrons and neutral hadrons
112 if(0.0 == p->GetPDGCharge() || eloss < 0.0) {
113 nloss = edep;
114 eloss = 0.0;
115 } else {
116
117 // continues energy loss
118 eloss /= (1.0 + bfactor*eloss/length);
119 }
120 // non-ionizing energy loss
121 if(nloss > 0.0) {
122 std::size_t idx = couple->GetMaterial()->GetIndex();
123 G4double escaled = nloss*massFactors[idx];
124 /*
125 G4cout << "%% p edep= " << nloss/keV << " keV Escaled= "
126 << escaled << " MeV in " << couple->GetMaterial()->GetName()
127 << " " << p->GetParticleName()
128 << G4endl;
129 G4cout << proton->GetParticleName() << G4endl;
130 */
132 ->GetRange(proton,escaled,couple)/effCharges[idx];
133 nloss /= (1.0 + bfactor*nloss/range);
134 }
135 evis = eloss + nloss;
136 }
137 }
138 return evis;
139}
static G4LossTableManager * Instance()
G4double GetRange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
const G4Material * GetMaterial() const
size_t GetIndex() const
Definition: G4Material.hh:255
G4double GetPDGCharge() const

Referenced by VisibleEnergyDepositionAtAStep().

◆ VisibleEnergyDepositionAtAStep()

G4double G4EmSaturation::VisibleEnergyDepositionAtAStep ( const G4Step step) const
inline

Definition at line 139 of file G4EmSaturation.hh.

141{
144 step->GetStepLength(),
145 step->GetTotalEnergyDeposit(),
147}
virtual G4double VisibleEnergyDeposition(const G4ParticleDefinition *, const G4MaterialCutsCouple *, G4double length, G4double edepTotal, G4double edepNIEL=0.0) const
G4Track * GetTrack() const
G4double GetNonIonizingEnergyDeposit() const
G4double GetStepLength() const
G4double GetTotalEnergyDeposit() const
const G4ParticleDefinition * GetParticleDefinition() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const

Referenced by G4Scintillation::PostStepDoIt().


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