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

#include <G4FTFTunings.hh>

Public Member Functions

 ~G4FTFTunings ()
 
G4String GetTuneName (const G4int index) const
 
G4int GetTuneApplicabilityState (const G4int index) const
 
void SetTuneApplicabilityState (const G4int index, const G4int state)
 
G4int GetIndexTune (const G4ParticleDefinition *particleDef, const G4double ekin) const
 

Static Public Member Functions

static G4FTFTuningsInstance ()
 

Static Public Attributes

static const G4int sNumberOfTunes = 10
 

Detailed Description

Definition at line 115 of file G4FTFTunings.hh.

Constructor & Destructor Documentation

◆ ~G4FTFTunings()

G4FTFTunings::~G4FTFTunings ( )

Definition at line 134 of file G4FTFTunings.cc.

134 {
135 delete fMessenger;
136}

Member Function Documentation

◆ GetIndexTune()

G4int G4FTFTunings::GetIndexTune ( const G4ParticleDefinition * particleDef,
const G4double ekin ) const

Definition at line 156 of file G4FTFTunings.cc.

156 {
157 // For the time being, select the first alternative (i.e. with index > 0) tune which is switched on.
158 // If nothing is found, then returns 0 (which corresponds to the default set of parameters).
159 G4int indexTune = 0;
160 for ( G4int i = 1; i < sNumberOfTunes; ++i ) {
161 if ( GetTuneApplicabilityState(i) != 0 ) { // tune i-th is switched on
162 indexTune = i;
163 break;
164 }
165 }
166
167 /* For the future
168 G4int pdgCode = std::abs( particleDef->GetPDGEncoding() );
169 if ( particleDef != nullptr && ekin >= 0.0 && pdgCode != 0 ) {
170 G4bool isLowEnergy = ( ekin < fLowEnergyThreshold );
171 G4bool isHighEnergy = ( ekin > fHighEnergyThreshold );
172 G4bool isMediumEnergy = ( ( ! isLowEnergy ) && ( ! isHighEnergy ) );
173 G4bool isMeson = ( pdgCode < 1000 );
174 G4bool isPion = ( pdgCode == 211 || pdgCode == 111 );
175 G4bool isKaon = ( pdgCode == 321 || pdgCode == 311 || pdgCode == 130 || pdgCode == 310 );
176 G4bool isBaryon = ( pdgCode > 1000 );
177 G4bool isNucleon = ( pdgCode == 2212 || pdgCode == 2112 );
178 G4bool isAntiBaryon = particleDef->GetBaryonNumber() < 0;
179 // Based on the projectile type, its kinetic energy, and the "applicability" flag
180 // of each tune, find the right tune to be applicable in this case.
181 // ...
182 }
183 */
184
185 //G4cout << "G4FTFTunings::GetIndexTune : projectile=" << particleDef->GetParticleName()
186 // << " ekin[MeV]=" << ekin << " -> indexTune=" << indexTune
187 // << " " << fNameOfTunes[indexTune] << G4endl;
188
189 return indexTune;
190}
int G4int
Definition G4Types.hh:85
static const G4int sNumberOfTunes
G4int GetTuneApplicabilityState(const G4int index) const

Referenced by G4FTFParameters::InitForInteraction().

◆ GetTuneApplicabilityState()

G4int G4FTFTunings::GetTuneApplicabilityState ( const G4int index) const
inline

Definition at line 202 of file G4FTFTunings.hh.

202 {
203 if ( index < 0 || index >= sNumberOfTunes ) return 0; // Switched off
204 return fApplicabilityOfTunes[index];
205}

Referenced by GetIndexTune().

◆ GetTuneName()

G4String G4FTFTunings::GetTuneName ( const G4int index) const
inline

Definition at line 196 of file G4FTFTunings.hh.

196 {
197 if ( index < 0 || index >= sNumberOfTunes ) return G4String();
198 return fNameOfTunes[index];
199}

◆ Instance()

G4FTFTunings * G4FTFTunings::Instance ( )
static

Definition at line 121 of file G4FTFTunings.cc.

121 {
122 if ( sInstance == nullptr ) {
123 G4AutoLock l( &paramMutex );
124 if ( sInstance == nullptr ) {
125 static G4FTFTunings theFTFTuningsObject;
126 sInstance = &theFTFTuningsObject;
127 }
128 l.unlock();
129 }
130 return sInstance;
131}

Referenced by FTFP_BERT_ATL::FTFP_BERT_ATL(), G4FTFParameters::InitForInteraction(), G4PhysListUtil::InitialiseParameters(), G4FTFTuningsMessenger::SetNewValue(), and G4FTFParamCollection::SetTune().

◆ SetTuneApplicabilityState()

void G4FTFTunings::SetTuneApplicabilityState ( const G4int index,
const G4int state )

Definition at line 150 of file G4FTFTunings.cc.

150 {
151 if ( IsLocked() || index < 0 || index >= sNumberOfTunes ) return;
152 fApplicabilityOfTunes[index] = state;
153}

Referenced by FTFP_BERT_ATL::FTFP_BERT_ATL(), and G4FTFTuningsMessenger::SetNewValue().

Member Data Documentation

◆ sNumberOfTunes


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