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

#include <G4LivermoreRayleighModel.hh>

+ Inheritance diagram for G4LivermoreRayleighModel:

Public Member Functions

 G4LivermoreRayleighModel ()
 
 ~G4LivermoreRayleighModel () override
 
void Initialise (const G4ParticleDefinition *, const G4DataVector &) override
 
void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel) override
 
void InitialiseForElement (const G4ParticleDefinition *, G4int Z) override
 
G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0, G4double cut=0, G4double emax=DBL_MAX) override
 
void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
 
void SetLowEnergyThreshold (G4double)
 
G4LivermoreRayleighModeloperator= (const G4LivermoreRayleighModel &right)=delete
 
 G4LivermoreRayleighModel (const G4LivermoreRayleighModel &)=delete
 
- Public Member Functions inherited from G4VEmModel
 G4VEmModel (const G4String &nam)
 
virtual ~G4VEmModel ()
 
virtual void InitialiseForMaterial (const G4ParticleDefinition *, const G4Material *)
 
virtual G4double ComputeDEDXPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
virtual G4double CrossSectionPerVolume (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double GetPartialCrossSection (const G4Material *, G4int level, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double ComputeCrossSectionPerShell (const G4ParticleDefinition *, G4int Z, G4int shellIdx, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
virtual G4double ChargeSquareRatio (const G4Track &)
 
virtual G4double GetChargeSquareRatio (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual G4double GetParticleCharge (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void StartTracking (G4Track *)
 
virtual void CorrectionsAlongStep (const G4MaterialCutsCouple *, const G4DynamicParticle *, const G4double &length, G4double &eloss)
 
virtual G4double Value (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy)
 
virtual G4double MinPrimaryEnergy (const G4Material *, const G4ParticleDefinition *, G4double cut=0.0)
 
virtual G4double MinEnergyCut (const G4ParticleDefinition *, const G4MaterialCutsCouple *)
 
virtual void SetupForMaterial (const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
 
virtual void DefineForRegion (const G4Region *)
 
virtual void FillNumberOfSecondaries (G4int &numberOfTriplets, G4int &numberOfRecoil)
 
virtual void ModelDescription (std::ostream &outFile) const
 
void InitialiseElementSelectors (const G4ParticleDefinition *, const G4DataVector &)
 
std::vector< G4EmElementSelector * > * GetElementSelectors ()
 
void SetElementSelectors (std::vector< G4EmElementSelector * > *)
 
G4double ComputeDEDX (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=DBL_MAX)
 
G4double CrossSection (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeMeanFreePath (const G4ParticleDefinition *, G4double kineticEnergy, const G4Material *, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
G4double ComputeCrossSectionPerAtom (const G4ParticleDefinition *, const G4Element *, G4double kinEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectRandomAtom (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectTargetAtom (const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double logKineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementSelectRandomAtom (const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
const G4ElementGetCurrentElement (const G4Material *mat=nullptr) const
 
G4int SelectRandomAtomNumber (const G4Material *) const
 
const G4IsotopeGetCurrentIsotope (const G4Element *elm=nullptr) const
 
G4int SelectIsotopeNumber (const G4Element *) const
 
void SetParticleChange (G4VParticleChange *, G4VEmFluctuationModel *f=nullptr)
 
void SetCrossSectionTable (G4PhysicsTable *, G4bool isLocal)
 
G4ElementDataGetElementData ()
 
G4PhysicsTableGetCrossSectionTable ()
 
G4VEmFluctuationModelGetModelOfFluctuations ()
 
G4VEmAngularDistributionGetAngularDistribution ()
 
G4VEmModelGetTripletModel ()
 
void SetTripletModel (G4VEmModel *)
 
void SetAngularDistribution (G4VEmAngularDistribution *)
 
G4double HighEnergyLimit () const
 
G4double LowEnergyLimit () const
 
G4double HighEnergyActivationLimit () const
 
G4double LowEnergyActivationLimit () const
 
G4double PolarAngleLimit () const
 
G4double SecondaryThreshold () const
 
G4bool DeexcitationFlag () const
 
G4bool ForceBuildTableFlag () const
 
G4bool UseAngularGeneratorFlag () const
 
void SetAngularGeneratorFlag (G4bool)
 
void SetHighEnergyLimit (G4double)
 
void SetLowEnergyLimit (G4double)
 
void SetActivationHighEnergyLimit (G4double)
 
void SetActivationLowEnergyLimit (G4double)
 
G4bool IsActive (G4double kinEnergy) const
 
void SetPolarAngleLimit (G4double)
 
void SetSecondaryThreshold (G4double)
 
void SetDeexcitationFlag (G4bool val)
 
void SetForceBuildTable (G4bool val)
 
void SetFluctuationFlag (G4bool val)
 
void SetMasterThread (G4bool val)
 
G4bool IsMaster () const
 
void SetUseBaseMaterials (G4bool val)
 
G4bool UseBaseMaterials () const
 
G4double MaxSecondaryKinEnergy (const G4DynamicParticle *dynParticle)
 
const G4StringGetName () const
 
void SetCurrentCouple (const G4MaterialCutsCouple *)
 
G4bool IsLocked () const
 
void SetLocked (G4bool)
 
void SetLPMFlag (G4bool)
 
G4VEmModeloperator= (const G4VEmModel &right)=delete
 
 G4VEmModel (const G4VEmModel &)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from G4VEmModel
G4ParticleChangeForLossGetParticleChangeForLoss ()
 
G4ParticleChangeForGammaGetParticleChangeForGamma ()
 
virtual G4double MaxSecondaryEnergy (const G4ParticleDefinition *, G4double kineticEnergy)
 
const G4MaterialCutsCoupleCurrentCouple () const
 
void SetCurrentElement (const G4Element *)
 
- Protected Attributes inherited from G4VEmModel
G4ElementDatafElementData = nullptr
 
G4VParticleChangepParticleChange = nullptr
 
G4PhysicsTablexSectionTable = nullptr
 
const G4MaterialpBaseMaterial = nullptr
 
const std::vector< G4double > * theDensityFactor = nullptr
 
const std::vector< G4int > * theDensityIdx = nullptr
 
G4double inveplus
 
G4double pFactor = 1.0
 
std::size_t currentCoupleIndex = 0
 
std::size_t basedCoupleIndex = 0
 
G4bool lossFlucFlag = true
 

Detailed Description

Definition at line 39 of file G4LivermoreRayleighModel.hh.

Constructor & Destructor Documentation

◆ G4LivermoreRayleighModel() [1/2]

G4LivermoreRayleighModel::G4LivermoreRayleighModel ( )
explicit

Definition at line 50 of file G4LivermoreRayleighModel.cc.

50 : G4VEmModel("LivermoreRayleigh")
51{
52 fParticleChange = nullptr;
53 lowEnergyLimit = 10 * CLHEP::eV;
54
56
57 verboseLevel = 0;
58 // Verbosity scale for debugging purposes:
59 // 0 = nothing
60 // 1 = calculation of cross sections, file openings...
61 // 2 = entering in methods
62
63 if (verboseLevel > 0) {
64 G4cout << "G4LivermoreRayleighModel is constructed " << G4endl;
65 }
66}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4VEmModel(const G4String &nam)
Definition G4VEmModel.cc:67
void SetAngularDistribution(G4VEmAngularDistribution *)

◆ ~G4LivermoreRayleighModel()

G4LivermoreRayleighModel::~G4LivermoreRayleighModel ( )
override

Definition at line 70 of file G4LivermoreRayleighModel.cc.

71{
72 if (IsMaster()) {
73 for (G4int i = 0; i <= maxZ; ++i) {
74 if (nullptr != dataCS[i]) {
75 delete dataCS[i];
76 dataCS[i] = nullptr;
77 }
78 }
79 }
80}
int G4int
Definition G4Types.hh:85
G4bool IsMaster() const

◆ G4LivermoreRayleighModel() [2/2]

G4LivermoreRayleighModel::G4LivermoreRayleighModel ( const G4LivermoreRayleighModel & )
delete

Member Function Documentation

◆ ComputeCrossSectionPerAtom()

G4double G4LivermoreRayleighModel::ComputeCrossSectionPerAtom ( const G4ParticleDefinition * ,
G4double kinEnergy,
G4double Z,
G4double A = 0,
G4double cut = 0,
G4double emax = DBL_MAX )
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 179 of file G4LivermoreRayleighModel.cc.

182{
183 if (verboseLevel > 1) {
184 G4cout << "G4LivermoreRayleighModel::ComputeCrossSectionPerAtom()" << G4endl;
185 }
186
187 if (GammaEnergy < lowEnergyLimit) {
188 return 0.0;
189 }
190
191 G4double xs = 0.0;
192 G4int intZ = G4lrint(Z);
193 if (intZ < 1 || intZ > maxZ) {
194 return xs;
195 }
196
197 G4PhysicsFreeVector* pv = dataCS[intZ];
198
199 // if element was not initialised
200 // do initialisation safely for MT mode
201 if (nullptr == pv) {
202 InitialiseForElement(nullptr, intZ);
203 pv = dataCS[intZ];
204 if (nullptr == pv) {
205 return xs;
206 }
207 }
208
209 auto n = G4int(pv->GetVectorLength() - 1);
210 G4double e = GammaEnergy / MeV;
211 if (e >= pv->Energy(n)) {
212 xs = (*pv)[n] / (e * e);
213 }
214 else if (e >= pv->Energy(0)) {
215 xs = pv->Value(e) / (e * e);
216 }
217
218 if (verboseLevel > 1) {
219 G4cout << "****** DEBUG: tcs value for Z=" << Z << " at energy (MeV)=" << e << G4endl;
220 G4cout << " cs (Geant4 internal unit)=" << xs << G4endl;
221 G4cout << " -> first E*E*cs value in CS data file (iu) =" << (*pv)[0] << G4endl;
222 G4cout << " -> last E*E*cs value in CS data file (iu) =" << (*pv)[n] << G4endl;
223 G4cout << "*********************************************************" << G4endl;
224 }
225 return xs;
226}
double G4double
Definition G4Types.hh:83
void InitialiseForElement(const G4ParticleDefinition *, G4int Z) override
G4double Energy(const std::size_t index) const
G4double Value(const G4double energy, std::size_t &lastidx) const
std::size_t GetVectorLength() const
int G4lrint(double ad)
Definition templates.hh:134

◆ Initialise()

void G4LivermoreRayleighModel::Initialise ( const G4ParticleDefinition * particle,
const G4DataVector & cuts )
overridevirtual

Implements G4VEmModel.

Definition at line 84 of file G4LivermoreRayleighModel.cc.

86{
87 if (verboseLevel > 1) {
88 G4cout << "Calling Initialise() of G4LivermoreRayleighModel." << G4endl
89 << "Energy range: " << LowEnergyLimit() / eV << " eV - " << HighEnergyLimit() / GeV
90 << " GeV" << G4endl;
91 }
92
93 if (IsMaster()) {
94 // Initialise element selector
95 InitialiseElementSelectors(particle, cuts);
96
97 // Access to elements
98 const G4ElementTable* elemTable = G4Element::GetElementTable();
99 std::size_t numElems = (*elemTable).size();
100 for (std::size_t ie = 0; ie < numElems; ++ie) {
101 const G4Element* elem = (*elemTable)[ie];
102 const G4int Z = std::min(maxZ, elem->GetZasInt());
103 if (dataCS[Z] == nullptr) {
104 ReadData(Z);
105 }
106 }
107 }
108 if (isInitialised) {
109 return;
110 }
111 fParticleChange = GetParticleChangeForGamma();
112 isInitialised = true;
113}
std::vector< G4Element * > G4ElementTable
#define elem(i, j)
static G4ElementTable * GetElementTable()
Definition G4Element.cc:389
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
void InitialiseElementSelectors(const G4ParticleDefinition *, const G4DataVector &)

◆ InitialiseForElement()

void G4LivermoreRayleighModel::InitialiseForElement ( const G4ParticleDefinition * ,
G4int Z )
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 253 of file G4LivermoreRayleighModel.cc.

254{
255 if (nullptr != dataCS[Z]) {
256 return;
257 }
258 G4AutoLock l(&LivermoreRayleighModelMutex);
259 if (nullptr == dataCS[Z]) {
260 ReadData(Z);
261 }
262 l.unlock();
263}

Referenced by ComputeCrossSectionPerAtom().

◆ InitialiseLocal()

void G4LivermoreRayleighModel::InitialiseLocal ( const G4ParticleDefinition * ,
G4VEmModel * masterModel )
overridevirtual

Reimplemented from G4VEmModel.

Definition at line 117 of file G4LivermoreRayleighModel.cc.

118{
120}
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
std::vector< G4EmElementSelector * > * GetElementSelectors()

◆ operator=()

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

◆ SampleSecondaries()

void G4LivermoreRayleighModel::SampleSecondaries ( std::vector< G4DynamicParticle * > * ,
const G4MaterialCutsCouple * couple,
const G4DynamicParticle * aDynamicGamma,
G4double tmin,
G4double maxEnergy )
overridevirtual

Implements G4VEmModel.

Definition at line 230 of file G4LivermoreRayleighModel.cc.

234{
235 if (verboseLevel > 1) {
236 G4cout << "Calling SampleSecondaries() of G4LivermoreRayleighModel" << G4endl;
237 }
238 G4double photonEnergy0 = aDynamicGamma->GetKineticEnergy();
239
240 // Select randomly one element in the current material
241 const G4ParticleDefinition* particle = aDynamicGamma->GetDefinition();
242 const G4Element* elm = SelectRandomAtom(couple, particle, photonEnergy0);
243 G4int Z = elm->GetZasInt();
244
245 // Sample the angle of the scattered photon
247 aDynamicGamma, photonEnergy0, Z, couple->GetMaterial());
248 fParticleChange->ProposeMomentumDirection(photonDirection);
249}
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4int GetZasInt() const
Definition G4Element.hh:120
const G4Material * GetMaterial() const
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
G4VEmAngularDistribution * GetAngularDistribution()
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)

◆ SetLowEnergyThreshold()

void G4LivermoreRayleighModel::SetLowEnergyThreshold ( G4double val)
inline

Definition at line 76 of file G4LivermoreRayleighModel.hh.

77{
78 lowEnergyLimit = val;
79}

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