Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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. More...
 
void constructINCLXXVersionName ()
 
const std::string & getINCLXXVersionName ()
 
void SetAccurateProjectile (const G4bool b)
 Setter for accurateProjectile. More...
 
void SetMaxClusterMass (const G4int aMass)
 Setter for the maximum cluster mass. More...
 
void SetCascadeMinEnergyPerNucleon (const G4double anEnergy)
 Setter for cascadeMinEnergyPerNucleon. More...
 
void SetConservationTolerance (const G4double aTolerance)
 Setter for conservationTolerance. More...
 
G4bool GetAccurateProjectile () const
 Getter for accurateProjectile. More...
 
G4double GetCascadeMinEnergyPerNucleon () const
 Getter for cascadeMinEnergyPerNucleon. More...
 
G4INCL::ConfigGetINCLConfig ()
 Getter for theConfig. More...
 
G4int GetMaxProjMassINCL () const
 Getter for theMaxProjMassINCL. More...
 
G4double GetConservationTolerance () const
 Getter for conservationTolerance. More...
 
void EmitWarning (const G4String &message)
 Emit a warning to G4cout. More...
 
void EmitBigWarning (const G4String &message) const
 Emit a BIG warning to G4cout. More...
 
G4INCLXXVInterfaceTallyGetTally () const
 Getter for the interface tally. More...
 
void SetTally (G4INCLXXVInterfaceTally *const aTally)
 Setter for the interface tally. More...
 
void SetINCLPhysics (const G4String &option)
 Set the INCL physics. More...
 
void UseAblaDeExcitation ()
 Set ABLA V3 to be the de-excitation model to be used with INCL++. More...
 

Static Public Member Functions

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

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

void G4INCLXXInterfaceStore::constructINCLXXVersionName ( )

Definition at line 101 of file G4INCLXXInterfaceStore.cc.

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

Delete the singleton instance.

Definition at line 87 of file G4INCLXXInterfaceStore.cc.

87  {
88  delete theInstance;
89  theInstance = NULL;
90 }
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 180 of file G4INCLXXInterfaceStore.cc.

180  {
181  G4cout
182  << G4endl
183  << "================================================================================"
184  << G4endl
185  << " INCL++ WARNING "
186  << G4endl
187  << message
188  << G4endl
189  << "================================================================================"
190  << G4endl
191  << G4endl;
192 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

void G4INCLXXInterfaceStore::EmitWarning ( const G4String message)

Emit a warning to G4cout.

The InterfaceStore will not emit more than maxWarnings warnings.

Definition at line 171 of file G4INCLXXInterfaceStore.cc.

171  {
172  if(++nWarnings<=maxWarnings) {
173  G4cout << "[INCL++] Warning: " << message << G4endl;
174  if(nWarnings==maxWarnings) {
175  G4cout << "[INCL++] INCL++ has already emitted " << maxWarnings << " warnings and will emit no more." << G4endl;
176  }
177  }
178 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

G4bool G4INCLXXInterfaceStore::GetAccurateProjectile ( ) const

Getter for accurateProjectile.

The

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

Definition at line 155 of file G4INCLXXInterfaceStore.cc.

155 { return accurateProjectile; }
G4double G4INCLXXInterfaceStore::GetCascadeMinEnergyPerNucleon ( ) const

Getter for cascadeMinEnergyPerNucleon.

The

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

Definition at line 157 of file G4INCLXXInterfaceStore.cc.

157 { return cascadeMinEnergyPerNucleon; }

Here is the caller graph for this function:

G4double G4INCLXXInterfaceStore::GetConservationTolerance ( ) const

Getter for conservationTolerance.

Definition at line 164 of file G4INCLXXInterfaceStore.cc.

164 { return conservationTolerance; }
G4INCL::Config & G4INCLXXInterfaceStore::GetINCLConfig ( )

Getter for theConfig.

Definition at line 159 of file G4INCLXXInterfaceStore.cc.

159  {
160  DeleteModel(); // in case the Config is modified
161  return theConfig;
162 }
G4INCL::INCL * G4INCLXXInterfaceStore::GetINCLModel ( )

Get the cached INCL model engine.

Definition at line 92 of file G4INCLXXInterfaceStore.cc.

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

Here is the caller graph for this function:

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

Definition at line 107 of file G4INCLXXInterfaceStore.cc.

107  {
108  return versionName;
109 }

Here is the caller graph for this function:

G4INCLXXInterfaceStore * G4INCLXXInterfaceStore::GetInstance ( )
static

Get the singleton instance.

Definition at line 81 of file G4INCLXXInterfaceStore.cc.

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

Here is the caller graph for this function:

G4int G4INCLXXInterfaceStore::GetMaxProjMassINCL ( ) const

Getter for theMaxProjMassINCL.

Definition at line 169 of file G4INCLXXInterfaceStore.cc.

169 { return theMaxProjMassINCL; }

Here is the caller graph for this function:

G4INCLXXVInterfaceTally * G4INCLXXInterfaceStore::GetTally ( ) const

Getter for the interface tally.

Definition at line 217 of file G4INCLXXInterfaceStore.cc.

217 { return theTally; }

Here is the caller graph for this function:

void G4INCLXXInterfaceStore::SetAccurateProjectile ( const G4bool  b)

Setter for accurateProjectile.

Definition at line 113 of file G4INCLXXInterfaceStore.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

void G4INCLXXInterfaceStore::SetCascadeMinEnergyPerNucleon ( const G4double  anEnergy)

Setter for cascadeMinEnergyPerNucleon.

Definition at line 194 of file G4INCLXXInterfaceStore.cc.

194  {
195  if(cascadeMinEnergyPerNucleon!=anEnergy) {
196  // Parameter is changed, emit a big warning message
197  std::stringstream ss;
198  ss << "Changing minimim cascade energy from "
199  << cascadeMinEnergyPerNucleon / MeV
200  << " to "
201  << anEnergy / MeV
202  << " MeV."
203  << G4endl
204  << "Do this ONLY if you fully understand what this setting does!";
205  EmitBigWarning(ss.str());
206  }
207 
208  // No need to delete the model object
209 
210  cascadeMinEnergyPerNucleon=anEnergy;
211 }
void EmitBigWarning(const G4String &message) const
Emit a BIG warning to G4cout.
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214

Here is the call graph for this function:

Here is the caller graph for this function:

void G4INCLXXInterfaceStore::SetConservationTolerance ( const G4double  aTolerance)

Setter for conservationTolerance.

Definition at line 213 of file G4INCLXXInterfaceStore.cc.

213  {
214  conservationTolerance = aTolerance;
215 }
void G4INCLXXInterfaceStore::SetINCLPhysics ( const G4String option)

Set the INCL physics.

Definition at line 221 of file G4INCLXXInterfaceStore.cc.

221  {
222  if(option == "default") {
223  theConfig.init();
224  } else if(option == "incl42") {
225  const G4String message = "Changing INCL++ physics to mimick INCL4.2. Do this ONLY if you fully understand the implications!";
226  EmitBigWarning(message);
227 
229  theConfig.setPionPotential(false);
232  theConfig.setBackToSpectator(false);
235  // UseRealMasses intentionally left out because it creates problems with
236  // energy conservation
237  // theConfig.setUseRealMasses(false);
239  } else {
240  G4Exception("G4INCLXXInterfaceStore::SetINCLPhysics", "INCLXX0001", FatalErrorInArgument,
241  "SetINCLPhysics argument must be one of: default, incl42"
242  );
243  }
244 }
void EmitBigWarning(const G4String &message) const
Emit a BIG warning to G4cout.
void setLocalEnergyBBType(const LocalEnergyType t)
Set the type of local energy for N-N avatars.
void setLocalEnergyPiType(const LocalEnergyType t)
Set the type of local energy for N-N avatars.
void setClusterAlgorithm(ClusterAlgorithmType const c)
Set the clustering algorithm.
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
void setCoulombType(CoulombType const c)
Set the Coulomb-distortion algorithm.
void init()
Initialise the members.
Definition: G4INCLConfig.cc:51
void setPotentialType(PotentialType type)
Set the type of the potential for nucleons.
void setPionPotential(const G4bool pionPot)
Set the type of the potential for nucleons.
void setBackToSpectator(const G4bool b)
Set back-to-spectator.
void setCrossSectionsType(CrossSectionsType const c)
Set the Cross Section type.

Here is the call graph for this function:

Here is the caller graph for this function:

void G4INCLXXInterfaceStore::SetMaxClusterMass ( const G4int  aMass)

Setter for the maximum cluster mass.

Definition at line 130 of file G4INCLXXInterfaceStore.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

void G4INCLXXInterfaceStore::SetTally ( G4INCLXXVInterfaceTally *const  aTally)

Setter for the interface tally.

Definition at line 219 of file G4INCLXXInterfaceStore.cc.

219 { theTally = aTally; }
void G4INCLXXInterfaceStore::UseAblaDeExcitation ( )

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

Definition at line 246 of file G4INCLXXInterfaceStore.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:


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