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

#include <G4TransportationParameters.hh>

Public Member Functions

 ~G4TransportationParameters ()=default
 
G4bool SetNumberOfTrials (G4int val)
 
G4bool SetWarningEnergy (G4double val)
 
G4bool SetImportantEnergy (G4double val)
 
G4int GetNumberOfTrials () const
 
G4double GetWarningEnergy () const
 
G4double GetImportantEnergy () const
 
G4bool IsMagneticMomentEnabled () const
 
G4bool EnableUseOfMagneticMoment (G4bool useMoment=true)
 
G4bool SetHighLooperThresholds ()
 
G4bool SetIntermediateLooperThresholds ()
 
G4bool SetLowLooperThresholds ()
 
G4bool SetSilenceAllLooperWarnings (G4bool val=true)
 
G4bool GetSilenceAllLooperWarnings ()
 
void StreamInfo (std::ostream &os) const
 
void Dump () const
 

Static Public Member Functions

static G4TransportationParametersInstance ()
 
static G4bool Exists ()
 

Friends

std::ostream & operator<< (std::ostream &os, const G4TransportationParameters &)
 

Detailed Description

Definition at line 48 of file G4TransportationParameters.hh.

Constructor & Destructor Documentation

◆ ~G4TransportationParameters()

G4TransportationParameters::~G4TransportationParameters ( )
default

Member Function Documentation

◆ Dump()

void G4TransportationParameters::Dump ( ) const

Definition at line 133 of file G4TransportationParameters.cc.

134{
135 G4MUTEXLOCK(&transportParamsMutex);
137 G4MUTEXUNLOCK(&transportParamsMutex);
138}
#define G4MUTEXLOCK(mutex)
Definition: G4Threading.hh:251
#define G4MUTEXUNLOCK(mutex)
Definition: G4Threading.hh:254
G4GLOB_DLL std::ostream G4cout
void StreamInfo(std::ostream &os) const

◆ EnableUseOfMagneticMoment()

G4bool G4TransportationParameters::EnableUseOfMagneticMoment ( G4bool  useMoment = true)

Definition at line 189 of file G4TransportationParameters.cc.

190{
191 if(IsLocked()) { return false; }
192 fUseMagneticMoment= useMoment;
193 return true;
194}

◆ Exists()

static G4bool G4TransportationParameters::Exists ( )
inlinestatic

Definition at line 76 of file G4TransportationParameters.hh.

76{ return theInstance != nullptr; }

Referenced by G4Transportation::G4Transportation().

◆ GetImportantEnergy()

G4double G4TransportationParameters::GetImportantEnergy ( ) const
inline

Definition at line 61 of file G4TransportationParameters.hh.

61{ return fImportantEnergy; }

Referenced by StreamInfo().

◆ GetNumberOfTrials()

G4int G4TransportationParameters::GetNumberOfTrials ( ) const
inline

Definition at line 59 of file G4TransportationParameters.hh.

59{ return fNumberOfTrials; }

Referenced by StreamInfo().

◆ GetSilenceAllLooperWarnings()

G4bool G4TransportationParameters::GetSilenceAllLooperWarnings ( )
inline

Definition at line 73 of file G4TransportationParameters.hh.

73{ return fSilenceLooperWarnings; }

◆ GetWarningEnergy()

G4double G4TransportationParameters::GetWarningEnergy ( ) const
inline

Definition at line 60 of file G4TransportationParameters.hh.

60{ return fWarningEnergy; }

Referenced by StreamInfo().

◆ Instance()

G4TransportationParameters * G4TransportationParameters::Instance ( )
static

Definition at line 55 of file G4TransportationParameters.cc.

56{
57 if(theInstance == nullptr) {
58 G4MUTEXLOCK(&transportParamsMutex);
59 if(theInstance == nullptr) {
60 static G4TransportationParameters manager;
61 theInstance = &manager;
62 }
63 G4MUTEXUNLOCK(&transportParamsMutex);
64 }
65 return theInstance;
66}

Referenced by G4Transportation::G4Transportation().

◆ IsMagneticMomentEnabled()

G4bool G4TransportationParameters::IsMagneticMomentEnabled ( ) const
inline

Definition at line 62 of file G4TransportationParameters.hh.

62{ return fUseMagneticMoment; }

◆ SetHighLooperThresholds()

G4bool G4TransportationParameters::SetHighLooperThresholds ( )

Definition at line 142 of file G4TransportationParameters.cc.

143{
144 if(IsLocked()) { return false; }
145
146 // Restores the old high values -- potentially appropriate for energy-frontier
147 // HEP experiments.
148 // Caution: All tracks with E < 100 MeV that are found to loop are
149 SetWarningEnergy( 100.0 * CLHEP::MeV ); // Warn above this energy
150 SetImportantEnergy( 250.0 * CLHEP::MeV ); // Extra trial above this En
151
152 G4int maxTrials = 10;
153 SetNumberOfTrials( maxTrials );
154
155 return true;
156}
int G4int
Definition: G4Types.hh:85

◆ SetImportantEnergy()

G4bool G4TransportationParameters::SetImportantEnergy ( G4double  val)

Definition at line 106 of file G4TransportationParameters.cc.

107{
108 if(IsLocked()) { return false; }
109 fImportantEnergy = val;
110
111 // Consistency check -- and trial fix
112 if( fImportantEnergy < fWarningEnergy )
113 fWarningEnergy = fImportantEnergy;
114
115 return true;
116}

Referenced by SetHighLooperThresholds(), and SetLowLooperThresholds().

◆ SetIntermediateLooperThresholds()

G4bool G4TransportationParameters::SetIntermediateLooperThresholds ( )

Definition at line 160 of file G4TransportationParameters.cc.

161{
162 if(IsLocked()) { return false; } // Currently must not change during loop - may relax
163
164 // Medium values -- reasonable default for an unknown application
165 fWarningEnergy= 1.0 * CLHEP::MeV; // Warn above this energy
166 fImportantEnergy= 10.0 * CLHEP::MeV; // Extra trial above this En
167 fNumberOfTrials= 10;
168 return true;
169}

◆ SetLowLooperThresholds()

G4bool G4TransportationParameters::SetLowLooperThresholds ( )

Definition at line 173 of file G4TransportationParameters.cc.

174{
175 if(IsLocked()) { return false; }
176
177 // These values were the default in Geant4 10.5 - beta
178 SetWarningEnergy( 1.0 * CLHEP::keV ); // Warn above this En
179 SetImportantEnergy( 1.0 * CLHEP::MeV ); // Extra trials above it
180
181 G4int maxTrials = 30;
182 SetNumberOfTrials( maxTrials );
183
184 return true;
185}

◆ SetNumberOfTrials()

G4bool G4TransportationParameters::SetNumberOfTrials ( G4int  val)

Definition at line 83 of file G4TransportationParameters.cc.

84{
85 if(IsLocked()) { return false; }
86 fNumberOfTrials = val;
87 return true;
88}

Referenced by SetHighLooperThresholds(), and SetLowLooperThresholds().

◆ SetSilenceAllLooperWarnings()

G4bool G4TransportationParameters::SetSilenceAllLooperWarnings ( G4bool  val = true)

Definition at line 199 of file G4TransportationParameters.cc.

200{
201 if(IsLocked()) { return false; }
202 fSilenceLooperWarnings= val;
203 return true;
204}

◆ SetWarningEnergy()

G4bool G4TransportationParameters::SetWarningEnergy ( G4double  val)

Definition at line 92 of file G4TransportationParameters.cc.

93{
94 if(IsLocked()) { return false; }
95 fWarningEnergy = val;
96
97 // Consistency check -- and trial fix
98 if( fWarningEnergy > fImportantEnergy )
99 fImportantEnergy = fWarningEnergy;
100
101 return true;
102}

Referenced by SetHighLooperThresholds(), and SetLowLooperThresholds().

◆ StreamInfo()

void G4TransportationParameters::StreamInfo ( std::ostream &  os) const

Definition at line 120 of file G4TransportationParameters.cc.

121{
122 auto prec = os.precision(5);
123
124 os << "Transport Parameters: " << G4endl;
125 os << " Warning energy = " << GetWarningEnergy() / CLHEP::MeV << " MeV " << G4endl;
126 os << " Important energy = " << GetImportantEnergy() / CLHEP::MeV << " MeV " << G4endl;
127 os << " Number of trials = " << GetNumberOfTrials() << G4endl;
128 os.precision(prec);
129}
#define G4endl
Definition: G4ios.hh:57

Referenced by Dump().

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const G4TransportationParameters  
)
friend

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