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

Singleton class for configuring the INCL++ Geant4 interface. More...

#include <G4INCLXXInterfaceStore.hh>

Public Member Functions

G4INCL::INCLGetINCLModel ()
 Get the cached INCL model engine.
 
void constructINCLXXVersionName ()
 
const std::string & getINCLXXVersionName ()
 
void SetAccurateProjectile (const G4bool b)
 Setter for accurateProjectile.
 
void SetMaxClusterMass (const G4int aMass)
 Setter for the maximum cluster mass.
 
void SetCascadeMinEnergyPerNucleon (const G4double anEnergy)
 Setter for cascadeMinEnergyPerNucleon.
 
void SetConservationTolerance (const G4double aTolerance)
 Setter for conservationTolerance.
 
G4bool GetAccurateProjectile () const
 Getter for accurateProjectile.
 
G4double GetCascadeMinEnergyPerNucleon () const
 Getter for cascadeMinEnergyPerNucleon.
 
G4INCL::ConfigGetINCLConfig ()
 Getter for theConfig.
 
G4int GetMaxProjMassINCL () const
 Getter for theMaxProjMassINCL.
 
G4double GetConservationTolerance () const
 Getter for conservationTolerance.
 
void EmitWarning (const G4String &message)
 Emit a warning to G4cout.
 
void EmitBigWarning (const G4String &message) const
 Emit a BIG warning to G4cout.
 
G4INCLXXVInterfaceTallyGetTally () const
 Getter for the interface tally.
 
void SetTally (G4INCLXXVInterfaceTally *const aTally)
 Setter for the interface tally.
 
void SetINCLPhysics (const G4String &option)
 Set the INCL physics.
 
void UseAblaDeExcitation ()
 Set ABLA V3 to be the de-excitation model to be used with INCL++.
 

Static Public Member Functions

static G4INCLXXInterfaceStoreGetInstance ()
 Get the singleton instance.
 
static void DeleteInstance ()
 Delete the singleton instance.
 

Detailed Description

Singleton class for configuring the INCL++ Geant4 interface.

This class also contains a single cached instance of the INCL model (

See also
{G4INCL::INCL}).

Definition at line 64 of file G4INCLXXInterfaceStore.hh.

Member Function Documentation

◆ constructINCLXXVersionName()

void G4INCLXXInterfaceStore::constructINCLXXVersionName ( )

Definition at line 102 of file G4INCLXXInterfaceStore.cc.

102 {
103 const std::string versionID = G4INCL_VERSION_ID;
104 const size_t lastDash = versionID.find_last_of("-");
105 versionName = "INCL++ " + versionID.substr(0,lastDash);
106}
#define G4INCL_VERSION_ID

◆ DeleteInstance()

void G4INCLXXInterfaceStore::DeleteInstance ( )
static

Delete the singleton instance.

Definition at line 88 of file G4INCLXXInterfaceStore.cc.

88 {
89 delete theInstance;
90 theInstance = NULL;
91}

◆ EmitBigWarning()

void G4INCLXXInterfaceStore::EmitBigWarning ( const G4String & message) const

Emit a BIG warning to G4cout.

There is no limit on the number of BIG warnings emitted.

Definition at line 181 of file G4INCLXXInterfaceStore.cc.

181 {
182 // Disable the printing when global hadronic verbosity is zero
183 // (which can be issued via the UI command "/process/had/verbose 0" )
184 if ( G4HadronicParameters::Instance()->GetVerboseLevel() == 0 ) return;
185 G4cout
186 << G4endl
187 << "================================================================================"
188 << G4endl
189 << " INCL++ WARNING "
190 << G4endl
191 << message
192 << G4endl
193 << "================================================================================"
194 << G4endl
195 << G4endl;
196}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
static G4HadronicParameters * Instance()

Referenced by G4INCLXXInterface::ApplyYourself(), G4INCLXXInterface::G4INCLXXInterface(), SetAccurateProjectile(), SetCascadeMinEnergyPerNucleon(), SetINCLPhysics(), and SetMaxClusterMass().

◆ EmitWarning()

void G4INCLXXInterfaceStore::EmitWarning ( const G4String & message)

Emit a warning to G4cout.

The InterfaceStore will not emit more than maxWarnings warnings.

Definition at line 172 of file G4INCLXXInterfaceStore.cc.

172 {
173 if(++nWarnings<=maxWarnings) {
174 G4cout << "[INCL++] Warning: " << message << G4endl;
175 if(nWarnings==maxWarnings) {
176 G4cout << "[INCL++] INCL++ has already emitted " << maxWarnings << " warnings and will emit no more." << G4endl;
177 }
178 }
179}

Referenced by G4INCLXXInterface::ApplyYourself(), and G4INCLXXInterface::G4INCLXXInterface().

◆ GetAccurateProjectile()

G4bool G4INCLXXInterfaceStore::GetAccurateProjectile ( ) const

Getter for accurateProjectile.

The

See also
{G4INCLXXInterfaceMessenger} class provides a UI command to set this parameter.

Definition at line 156 of file G4INCLXXInterfaceStore.cc.

156{ return accurateProjectile; }

◆ GetCascadeMinEnergyPerNucleon()

G4double G4INCLXXInterfaceStore::GetCascadeMinEnergyPerNucleon ( ) const

Getter for cascadeMinEnergyPerNucleon.

The

See also
{G4INCLXXInterfaceMessenger} class provides a UI command to set this parameter.

Definition at line 158 of file G4INCLXXInterfaceStore.cc.

158{ return cascadeMinEnergyPerNucleon; }

Referenced by G4INCLXXInterface::ApplyYourself().

◆ GetConservationTolerance()

G4double G4INCLXXInterfaceStore::GetConservationTolerance ( ) const

Getter for conservationTolerance.

Definition at line 165 of file G4INCLXXInterfaceStore.cc.

165{ return conservationTolerance; }

◆ GetINCLConfig()

G4INCL::Config & G4INCLXXInterfaceStore::GetINCLConfig ( )

Getter for theConfig.

Definition at line 160 of file G4INCLXXInterfaceStore.cc.

160 {
161 DeleteModel(); // in case the Config is modified
162 return theConfig;
163}

◆ GetINCLModel()

G4INCL::INCL * G4INCLXXInterfaceStore::GetINCLModel ( )

Get the cached INCL model engine.

Definition at line 93 of file G4INCLXXInterfaceStore.cc.

93 {
94 if(!theINCLModel) {
95 G4INCL::Config *aConfig = new G4INCL::Config(theConfig);
96 theINCLModel = new G4INCL::INCL(aConfig);
97 // ownership of the aConfig object is taken over by the INCL model engine
98 }
99 return theINCLModel;
100}

Referenced by G4INCLXXInterface::ApplyYourself().

◆ getINCLXXVersionName()

const std::string & G4INCLXXInterfaceStore::getINCLXXVersionName ( )

Definition at line 108 of file G4INCLXXInterfaceStore.cc.

108 {
109 return versionName;
110}

Referenced by UseAblaDeExcitation().

◆ GetInstance()

G4INCLXXInterfaceStore * G4INCLXXInterfaceStore::GetInstance ( )
static

Get the singleton instance.

Definition at line 82 of file G4INCLXXInterfaceStore.cc.

82 {
83 if(!theInstance)
84 theInstance = new G4INCLXXInterfaceStore;
85 return theInstance;
86}
Singleton class for configuring the INCL++ Geant4 interface.

Referenced by G4INCLXXInterface::ApplyYourself(), and UseAblaDeExcitation().

◆ GetMaxProjMassINCL()

G4int G4INCLXXInterfaceStore::GetMaxProjMassINCL ( ) const

Getter for theMaxProjMassINCL.

Definition at line 170 of file G4INCLXXInterfaceStore.cc.

170{ return theMaxProjMassINCL; }

Referenced by G4INCLXXInterface::ApplyYourself().

◆ GetTally()

G4INCLXXVInterfaceTally * G4INCLXXInterfaceStore::GetTally ( ) const

Getter for the interface tally.

Definition at line 221 of file G4INCLXXInterfaceStore.cc.

221{ return theTally; }

Referenced by G4INCLXXInterface::ApplyYourself().

◆ SetAccurateProjectile()

void G4INCLXXInterfaceStore::SetAccurateProjectile ( const G4bool b)

Setter for accurateProjectile.

Definition at line 114 of file G4INCLXXInterfaceStore.cc.

114 {
115 if(accurateProjectile!=b) {
116 // Parameter is changed, emit a big warning message
117 std::stringstream ss;
118 ss << "Switching from "
119 << (accurateProjectile ? "\"accurate projectile\" mode to \"accurate target\"" : "\"accurate target\" mode to \"accurate projectile\"")
120 << " mode."
121 << G4endl
122 << "Do this ONLY if you fully understand what it does!";
123 EmitBigWarning(ss.str());
124 }
125
126 // No need to delete the model for this parameter
127
128 accurateProjectile=b;
129}
void EmitBigWarning(const G4String &message) const
Emit a BIG warning to G4cout.

Referenced by G4INCLXXInterfaceMessenger::SetNewValue().

◆ SetCascadeMinEnergyPerNucleon()

void G4INCLXXInterfaceStore::SetCascadeMinEnergyPerNucleon ( const G4double anEnergy)

Setter for cascadeMinEnergyPerNucleon.

Definition at line 198 of file G4INCLXXInterfaceStore.cc.

198 {
199 if(cascadeMinEnergyPerNucleon!=anEnergy) {
200 // Parameter is changed, emit a big warning message
201 std::stringstream ss;
202 ss << "Changing minimim cascade energy from "
203 << cascadeMinEnergyPerNucleon / MeV
204 << " to "
205 << anEnergy / MeV
206 << " MeV."
207 << G4endl
208 << "Do this ONLY if you fully understand what this setting does!";
209 EmitBigWarning(ss.str());
210 }
211
212 // No need to delete the model object
213
214 cascadeMinEnergyPerNucleon=anEnergy;
215}

Referenced by G4INCLXXInterfaceMessenger::SetNewValue().

◆ SetConservationTolerance()

void G4INCLXXInterfaceStore::SetConservationTolerance ( const G4double aTolerance)

Setter for conservationTolerance.

Definition at line 217 of file G4INCLXXInterfaceStore.cc.

217 {
218 conservationTolerance = aTolerance;
219}

◆ SetINCLPhysics()

void G4INCLXXInterfaceStore::SetINCLPhysics ( const G4String & option)

Set the INCL physics.

Definition at line 225 of file G4INCLXXInterfaceStore.cc.

225 {
226 if(option == "default") {
227 theConfig.init();
228 } else if(option == "incl42") {
229 const G4String message = "Changing INCL++ physics to mimic INCL4.2. Do this ONLY if you fully understand the implications!";
230 EmitBigWarning(message);
231
233 theConfig.setPionPotential(false);
236 theConfig.setBackToSpectator(false);
239 // UseRealMasses intentionally left out because it creates problems with
240 // energy conservation
241 // theConfig.setUseRealMasses(false);
243 } else {
244 G4Exception("G4INCLXXInterfaceStore::SetINCLPhysics", "INCLXX0001", FatalErrorInArgument,
245 "SetINCLPhysics argument must be one of: default, incl42"
246 );
247 }
248}
@ FatalErrorInArgument
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
void setClusterAlgorithm(ClusterAlgorithmType const c)
Set the clustering algorithm.
void setLocalEnergyPiType(const LocalEnergyType t)
Set the type of local energy for N-N avatars.
void setBackToSpectator(const G4bool b)
Set back-to-spectator.
void setCoulombType(CoulombType const c)
Set the Coulomb-distortion algorithm.
void setPionPotential(const G4bool pionPot)
Set the type of the potential for nucleons.
void setPotentialType(PotentialType type)
Set the type of the potential for nucleons.
void setCrossSectionsType(CrossSectionsType const c)
Set the Cross Section type.
void init()
Initialise the members.
void setLocalEnergyBBType(const LocalEnergyType t)
Set the type of local energy for N-N avatars.

Referenced by G4INCLXXInterfaceMessenger::SetNewValue().

◆ SetMaxClusterMass()

void G4INCLXXInterfaceStore::SetMaxClusterMass ( const G4int aMass)

Setter for the maximum cluster mass.

Definition at line 131 of file G4INCLXXInterfaceStore.cc.

131 {
132 const G4int theMaxClusterMass = theConfig.getClusterMaxMass();
133 if(theMaxClusterMass!=aMass) {
134 // Parameter is changed, emit a big warning message
135 std::stringstream ss;
136 ss << "Changing maximum cluster mass from "
137 << theMaxClusterMass
138 << " to "
139 << aMass
140 << "."
141 << G4endl
142 << "Do this ONLY if you fully understand what this setting does!";
143 EmitBigWarning(ss.str());
144
145 // We must delete the model object to make sure that we use the new
146 // parameter
147 DeleteModel();
148
149 theConfig.setClusterMaxMass(aMass);
150 }
151}
int G4int
Definition G4Types.hh:85
void setClusterMaxMass(const G4int clm)
Set the maximum mass for production of clusters.
G4int getClusterMaxMass() const
Get the maximum mass for production of clusters.

Referenced by G4INCLXXInterfaceMessenger::SetNewValue().

◆ SetTally()

void G4INCLXXInterfaceStore::SetTally ( G4INCLXXVInterfaceTally *const aTally)

Setter for the interface tally.

Definition at line 223 of file G4INCLXXInterfaceStore.cc.

223{ theTally = aTally; }

◆ UseAblaDeExcitation()

void G4INCLXXInterfaceStore::UseAblaDeExcitation ( )

Set ABLA V3 to be the de-excitation model to be used with INCL++.

Definition at line 250 of file G4INCLXXInterfaceStore.cc.

250 {
251 // Get hold of pointers to the INCL++ model interfaces
252 std::vector<G4HadronicInteraction *> const &interactions = G4HadronicInteractionRegistry::Instance()
254 for(std::vector<G4HadronicInteraction *>::const_iterator iInter=interactions.begin(), e=interactions.end();
255 iInter!=e; ++iInter) {
256 G4INCLXXInterface *theINCLInterface = dynamic_cast<G4INCLXXInterface*>(*iInter);
257 if(theINCLInterface) {
258 // Instantiate the ABLA model
260 G4AblaInterface *theAblaInterface = dynamic_cast<G4AblaInterface*>(interaction);
261 if(!theAblaInterface)
262 theAblaInterface = new G4AblaInterface;
263 // Couple INCL++ to ABLA
264 G4cout << "Coupling INCLXX to ABLA" << G4endl;
265 theINCLInterface->SetDeExcitation(theAblaInterface);
266 }
267 }
268}
std::vector< G4HadronicInteraction * > FindAllModels(const G4String &name)
G4HadronicInteraction * FindModel(const G4String &name)
static G4HadronicInteractionRegistry * Instance()
static G4INCLXXInterfaceStore * GetInstance()
Get the singleton instance.
const std::string & getINCLXXVersionName()
INCL++ intra-nuclear cascade.
void SetDeExcitation(G4VPreCompoundModel *ptr)

Referenced by G4INCLXXInterfaceMessenger::SetNewValue().


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