Geant4 11.1.1
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 ()
 
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 Initialise (const G4ParticleDefinition *, const G4DataVector &)=0
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double tmax=DBL_MAX)=0
 
virtual void InitialiseLocal (const G4ParticleDefinition *, G4VEmModel *masterModel)
 
virtual void InitialiseForMaterial (const G4ParticleDefinition *, const G4Material *)
 
virtual void InitialiseForElement (const G4ParticleDefinition *, G4int Z)
 
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 ComputeCrossSectionPerAtom (const G4ParticleDefinition *, G4double kinEnergy, G4double Z, G4double A=0., G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
 
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 LPMFlag () 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 SetLPMFlag (G4bool val)
 
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)
 
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
 
size_t currentCoupleIndex = 0
 
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 46 of file G4LivermoreRayleighModel.cc.

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

◆ ~G4LivermoreRayleighModel()

G4LivermoreRayleighModel::~G4LivermoreRayleighModel ( )

Definition at line 69 of file G4LivermoreRayleighModel.cc.

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

◆ 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 186 of file G4LivermoreRayleighModel.cc.

191{
192 if (verboseLevel > 1)
193 {
194 G4cout << "G4LivermoreRayleighModel::ComputeCrossSectionPerAtom()"
195 << G4endl;
196 }
197
198 if(GammaEnergy < lowEnergyLimit) { return 0.0; }
199
200 G4double xs = 0.0;
201 G4int intZ = G4lrint(Z);
202 if(intZ < 1 || intZ > maxZ) { return xs; }
203
204 G4PhysicsFreeVector* pv = dataCS[intZ];
205
206 // if element was not initialised
207 // do initialisation safely for MT mode
208 if(nullptr == pv) {
209 InitialiseForElement(0, intZ);
210 pv = dataCS[intZ];
211 if(nullptr == pv) { return xs; }
212 }
213
214 G4int n = G4int(pv->GetVectorLength() - 1);
215 G4double e = GammaEnergy/MeV;
216 if(e >= pv->Energy(n)) {
217 xs = (*pv)[n]/(e*e);
218 } else if(e >= pv->Energy(0)) {
219 xs = pv->Value(e)/(e*e);
220 }
221
222 if(verboseLevel > 1)
223 {
224 G4cout << "****** DEBUG: tcs value for Z=" << Z << " at energy (MeV)="
225 << e << G4endl;
226 G4cout << " cs (Geant4 internal unit)=" << xs << G4endl;
227 G4cout << " -> first E*E*cs value in CS data file (iu) =" << (*pv)[0]
228 << G4endl;
229 G4cout << " -> last E*E*cs value in CS data file (iu) =" << (*pv)[n]
230 << G4endl;
231 G4cout << "*********************************************************"
232 << G4endl;
233 }
234 return xs;
235}
double G4double
Definition: G4Types.hh:83
const G4int Z[17]
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 86 of file G4LivermoreRayleighModel.cc.

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

◆ InitialiseForElement()

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

Reimplemented from G4VEmModel.

Definition at line 267 of file G4LivermoreRayleighModel.cc.

269{
270 G4AutoLock l(&LivermoreRayleighModelMutex);
271 if(nullptr == dataCS[Z]) { ReadData(Z); }
272 l.unlock();
273}

Referenced by ComputeCrossSectionPerAtom().

◆ InitialiseLocal()

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

Reimplemented from G4VEmModel.

Definition at line 123 of file G4LivermoreRayleighModel.cc.

125{
127}
void SetElementSelectors(std::vector< G4EmElementSelector * > *)
Definition: G4VEmModel.hh:831
std::vector< G4EmElementSelector * > * GetElementSelectors()
Definition: G4VEmModel.hh:823

◆ 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 239 of file G4LivermoreRayleighModel.cc.

244{
245 if (verboseLevel > 1) {
246 G4cout << "Calling SampleSecondaries() of G4LivermoreRayleighModel"
247 << G4endl;
248 }
249 G4double photonEnergy0 = aDynamicGamma->GetKineticEnergy();
250
251 // Select randomly one element in the current material
252 const G4ParticleDefinition* particle = aDynamicGamma->GetDefinition();
253 const G4Element* elm = SelectRandomAtom(couple,particle,photonEnergy0);
254 G4int Z = G4lrint(elm->GetZ());
255
256 // Sample the angle of the scattered photon
257 G4ThreeVector photonDirection =
258 GetAngularDistribution()->SampleDirection(aDynamicGamma,
259 photonEnergy0,
260 Z, couple->GetMaterial());
261 fParticleChange->ProposeMomentumDirection(photonDirection);
262}
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4double GetZ() const
Definition: G4Element.hh:131
const G4Material * GetMaterial() const
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
G4VEmAngularDistribution * GetAngularDistribution()
Definition: G4VEmModel.hh:600
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.hh:561

◆ SetLowEnergyThreshold()

void G4LivermoreRayleighModel::SetLowEnergyThreshold ( G4double  val)
inline

Definition at line 82 of file G4LivermoreRayleighModel.hh.

83{
84 lowEnergyLimit = val;
85}

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