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

#include <G4VRangeToEnergyConverter.hh>

+ Inheritance diagram for G4VRangeToEnergyConverter:

Public Member Functions

 G4VRangeToEnergyConverter ()
 
virtual ~G4VRangeToEnergyConverter ()
 
 G4VRangeToEnergyConverter (const G4VRangeToEnergyConverter &r)=delete
 
G4VRangeToEnergyConverteroperator= (const G4VRangeToEnergyConverter &r)=delete
 
G4bool operator== (const G4VRangeToEnergyConverter &r) const =delete
 
G4bool operator!= (const G4VRangeToEnergyConverter &r) const =delete
 
virtual G4double Convert (const G4double rangeCut, const G4Material *material)
 
const G4ParticleDefinitionGetParticleType () const
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 

Static Public Member Functions

static void SetEnergyRange (const G4double lowedge, const G4double highedge)
 
static G4double GetLowEdgeEnergy ()
 
static G4double GetHighEdgeEnergy ()
 
static G4double GetMaxEnergyCut ()
 
static void SetMaxEnergyCut (const G4double value)
 

Protected Member Functions

virtual G4double ComputeValue (const G4int Z, const G4double kinEnergy)=0
 

Protected Attributes

const G4ParticleDefinitiontheParticle = nullptr
 
G4int fPDG = 0
 

Detailed Description

Definition at line 45 of file G4VRangeToEnergyConverter.hh.

Constructor & Destructor Documentation

◆ G4VRangeToEnergyConverter() [1/2]

G4VRangeToEnergyConverter::G4VRangeToEnergyConverter ( )
explicit

Definition at line 53 of file G4VRangeToEnergyConverter.cc.

54{
55 if(nullptr == sEnergy)
56 {
57 G4AutoLock l(&theREMutex);
58 if(nullptr == sEnergy)
59 {
60 isFirstInstance = true;
61 }
62 l.unlock();
63 }
64 // this method defines lock itself
65 if(isFirstInstance)
66 {
67 FillEnergyVector(CLHEP::keV, 10.0*CLHEP::GeV);
68 }
69}

◆ ~G4VRangeToEnergyConverter()

G4VRangeToEnergyConverter::~G4VRangeToEnergyConverter ( )
virtual

Definition at line 72 of file G4VRangeToEnergyConverter.cc.

73{
74 if(isFirstInstance)
75 {
76 delete sEnergy;
77 sEnergy = nullptr;
78 sEmin = CLHEP::keV;
79 sEmax = 10.*CLHEP::GeV;
80 }
81}

◆ G4VRangeToEnergyConverter() [2/2]

G4VRangeToEnergyConverter::G4VRangeToEnergyConverter ( const G4VRangeToEnergyConverter r)
delete

Member Function Documentation

◆ ComputeValue()

virtual G4double G4VRangeToEnergyConverter::ComputeValue ( const G4int  Z,
const G4double  kinEnergy 
)
protectedpure virtual

◆ Convert()

G4double G4VRangeToEnergyConverter::Convert ( const G4double  rangeCut,
const G4Material material 
)
virtual

Reimplemented in G4RToEConvForProton.

Definition at line 84 of file G4VRangeToEnergyConverter.cc.

86{
87#ifdef G4VERBOSE
88 if (GetVerboseLevel()>3)
89 {
90 G4cout << "G4VRangeToEnergyConverter::Convert() - ";
91 G4cout << "Convert for " << material->GetName()
92 << " with Range Cut " << rangeCut/mm << "[mm]" << G4endl;
93 }
94#endif
95
96 G4double cut = 0.0;
97 if(fPDG == 22)
98 {
99 cut = ConvertForGamma(rangeCut, material);
100 }
101 else
102 {
103 cut = ConvertForElectron(rangeCut, material);
104
105 const G4double tune = 0.025*CLHEP::mm*CLHEP::g/CLHEP::cm3;
106 const G4double lowen = 30.*CLHEP::keV;
107 if(cut < lowen)
108 {
109 // corr. should be switched on smoothly
110 cut /= (1.+(1.-cut/lowen)*tune/(rangeCut*material->GetDensity()));
111 }
112 }
113
114 cut = std::max(sEmin, std::min(cut, sEmax));
115 return cut;
116}
double G4double
Definition: G4Types.hh:83
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4double GetDensity() const
Definition: G4Material.hh:175
const G4String & GetName() const
Definition: G4Material.hh:172

Referenced by G4ProductionCutsTable::ConvertRangeToEnergy(), and G4ProductionCutsTable::UpdateCoupleTable().

◆ GetHighEdgeEnergy()

G4double G4VRangeToEnergyConverter::GetHighEdgeEnergy ( )
static

Definition at line 136 of file G4VRangeToEnergyConverter.cc.

137{
138 return sEmax;
139}

Referenced by G4ProductionCutsTable::GetHighEdgeEnergy().

◆ GetLowEdgeEnergy()

G4double G4VRangeToEnergyConverter::GetLowEdgeEnergy ( )
static

Definition at line 130 of file G4VRangeToEnergyConverter.cc.

131{
132 return sEmin;
133}

Referenced by G4ProductionCutsTable::GetLowEdgeEnergy().

◆ GetMaxEnergyCut()

G4double G4VRangeToEnergyConverter::GetMaxEnergyCut ( )
static

Definition at line 143 of file G4VRangeToEnergyConverter.cc.

144{
145 return sEmax;
146}

Referenced by G4ProductionCutsTable::GetMaxEnergyCut().

◆ GetParticleType()

const G4ParticleDefinition * G4VRangeToEnergyConverter::GetParticleType ( ) const
inline

Definition at line 137 of file G4VRangeToEnergyConverter.hh.

138{
139 return theParticle;
140}
const G4ParticleDefinition * theParticle

◆ GetVerboseLevel()

◆ operator!=()

G4bool G4VRangeToEnergyConverter::operator!= ( const G4VRangeToEnergyConverter r) const
delete

◆ operator=()

G4VRangeToEnergyConverter & G4VRangeToEnergyConverter::operator= ( const G4VRangeToEnergyConverter r)
delete

◆ operator==()

G4bool G4VRangeToEnergyConverter::operator== ( const G4VRangeToEnergyConverter r) const
delete

◆ SetEnergyRange()

void G4VRangeToEnergyConverter::SetEnergyRange ( const G4double  lowedge,
const G4double  highedge 
)
static

Definition at line 119 of file G4VRangeToEnergyConverter.cc.

121{
122 G4double ehigh = std::min(10.*CLHEP::GeV, highedge);
123 if(ehigh > lowedge)
124 {
125 FillEnergyVector(lowedge, ehigh);
126 }
127}

Referenced by G4ProductionCutsTable::SetEnergyRange().

◆ SetMaxEnergyCut()

void G4VRangeToEnergyConverter::SetMaxEnergyCut ( const G4double  value)
static

Definition at line 149 of file G4VRangeToEnergyConverter.cc.

150{
151 G4double ehigh = std::min(10.*CLHEP::GeV, value);
152 if(ehigh > sEmin)
153 {
154 FillEnergyVector(sEmin, ehigh);
155 }
156}

Referenced by G4ProductionCutsTable::SetMaxEnergyCut().

◆ SetVerboseLevel()

void G4VRangeToEnergyConverter::SetVerboseLevel ( G4int  value)
inline

Definition at line 125 of file G4VRangeToEnergyConverter.hh.

126{
127 verboseLevel = value;
128}

Referenced by G4ProductionCutsTable::SetVerboseLevel(), and G4ProductionCutsTable::UpdateCoupleTable().

Member Data Documentation

◆ fPDG

◆ theParticle


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