Geant4 9.6.0
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 SetAccurateProjectile (const G4bool b)
 Setter for accurateProjectile.
 
void SetMaxClusterMass (const G4int aMass)
 Setter for theMaxClusterMass.
 
G4bool GetAccurateProjectile () const
 Getter for accurateProjectile.
 
G4int GetMaxClusterMass () const
 Getter for ClusterMaxMass.
 
G4int GetMaxProjMassINCL () const
 Getter for theMaxProjMassINCL.
 
G4bool GetDumpInput () const
 Getter for dumpInput.
 
void EmitWarning (const G4String &message)
 Emit a warning to G4cout.
 
void EmitBigWarning (const G4String &message) const
 Emit a BIG warning to G4cout.
 

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 63 of file G4INCLXXInterfaceStore.hh.

Member Function Documentation

◆ DeleteInstance()

static void G4INCLXXInterfaceStore::DeleteInstance ( )
inlinestatic

Delete the singleton instance.

Definition at line 74 of file G4INCLXXInterfaceStore.hh.

74 {
75 delete theInstance;
76 theInstance = NULL;
77 }

◆ 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 77 of file G4INCLXXInterfaceStore.cc.

77 {
78 G4cout
79 << G4endl
80 << "================================================================================"
81 << G4endl
82 << " INCL++ WARNING "
83 << G4endl
84 << message
85 << G4endl
86 << "================================================================================"
87 << G4endl
88 << G4endl;
89}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

Referenced by SetAccurateProjectile(), 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 68 of file G4INCLXXInterfaceStore.cc.

68 {
69 if(++nWarnings<=maxWarnings) {
70 G4cout << "[INCL++] Warning: " << message << G4endl;
71 if(nWarnings==maxWarnings) {
72 G4cout << "[INCL++] INCL++ has already emitted " << maxWarnings << " warnings and will emit no more." << G4endl;
73 }
74 }
75}

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

◆ GetAccurateProjectile()

G4bool G4INCLXXInterfaceStore::GetAccurateProjectile ( ) const
inline

Getter for accurateProjectile.

The

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

Definition at line 141 of file G4INCLXXInterfaceStore.hh.

141{ return accurateProjectile; }

◆ GetDumpInput()

G4bool G4INCLXXInterfaceStore::GetDumpInput ( ) const
inline

Getter for dumpInput.

Definition at line 157 of file G4INCLXXInterfaceStore.hh.

157{ return dumpInput; }

Referenced by G4INCLXXInterface::ApplyYourself().

◆ GetINCLModel()

G4INCL::INCL * G4INCLXXInterfaceStore::GetINCLModel ( )
inline

Get the cached INCL model engine.

Definition at line 80 of file G4INCLXXInterfaceStore.hh.

80 {
81 if(!theINCLModel) {
82 G4INCL::Config *theConfig = new G4INCL::Config;
83 theConfig->setClusterMaxMass(theMaxClusterMass);
84 theINCLModel = new G4INCL::INCL(theConfig);
85 // ownership of the Config object is taken over by the INCL model engine
86 }
87 return theINCLModel;
88 }
void setClusterMaxMass(const G4int m)
Set the maximum mass for production of clusters.

Referenced by G4INCLXXInterface::ApplyYourself().

◆ GetInstance()

static G4INCLXXInterfaceStore * G4INCLXXInterfaceStore::GetInstance ( )
inlinestatic

Get the singleton instance.

Definition at line 67 of file G4INCLXXInterfaceStore.hh.

67 {
68 if(!theInstance)
69 theInstance = new G4INCLXXInterfaceStore;
70 return theInstance;
71 }
Singleton class for configuring the INCL++ Geant4 interface.

Referenced by G4INCLXXInterface::ApplyYourself().

◆ GetMaxClusterMass()

G4int G4INCLXXInterfaceStore::GetMaxClusterMass ( ) const
inline

Getter for ClusterMaxMass.

The

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

Definition at line 148 of file G4INCLXXInterfaceStore.hh.

148{ return theMaxClusterMass; }

◆ GetMaxProjMassINCL()

G4int G4INCLXXInterfaceStore::GetMaxProjMassINCL ( ) const
inline

Getter for theMaxProjMassINCL.

Definition at line 154 of file G4INCLXXInterfaceStore.hh.

154{ return theMaxProjMassINCL; }

Referenced by G4INCLXXInterface::ApplyYourself().

◆ SetAccurateProjectile()

void G4INCLXXInterfaceStore::SetAccurateProjectile ( const G4bool  b)
inline

Setter for accurateProjectile.

Definition at line 94 of file G4INCLXXInterfaceStore.hh.

94 {
95 if(accurateProjectile!=b) {
96 // Parameter is changed, emit a big warning message
97 std::stringstream ss;
98 ss << "Switching from "
99 << (accurateProjectile ? "\"accurate projectile\" mode to \"accurate target\"" : "\"accurate target\" mode to \"accurate projectile\"")
100 << " mode."
101 << G4endl
102 << "Do this ONLY if you fully understand what it does!";
103 EmitBigWarning(ss.str());
104 }
105
106 // No need to delete the model for this parameter
107
108 accurateProjectile=b;
109 }
void EmitBigWarning(const G4String &message) const
Emit a BIG warning to G4cout.

Referenced by G4INCLXXInterfaceMessenger::SetNewValue().

◆ SetMaxClusterMass()

void G4INCLXXInterfaceStore::SetMaxClusterMass ( const G4int  aMass)
inline

Setter for theMaxClusterMass.

Definition at line 112 of file G4INCLXXInterfaceStore.hh.

112 {
113 if(theMaxClusterMass!=aMass) {
114 // Parameter is changed, emit a big warning message
115 std::stringstream ss;
116 ss << "Changing maximum cluster mass from "
117 << theMaxClusterMass
118 << " to "
119 << aMass
120 << "."
121 << G4endl
122 << "Do this ONLY if you fully understand what this setting does!";
123 EmitBigWarning(ss.str());
124 }
125
126 // We must delete the model object to make sure that we use the new
127 // parameter
128 DeleteModel();
129
130 theMaxClusterMass=aMass;
131 }

Referenced by G4INCLXXInterfaceMessenger::SetNewValue().


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