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


Member Function Documentation

static void G4INCLXXInterfaceStore::DeleteInstance (  )  [inline, static]

Delete the singleton instance.

Definition at line 72 of file G4INCLXXInterfaceStore.hh.

00072                                  {
00073       delete theInstance;
00074       theInstance = NULL;
00075     }

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

References G4cout, and G4endl.

Referenced by SetAccurateProjectile(), and SetMaxClusterMass().

00075                                                                          {
00076   G4cout
00077     << G4endl
00078     << "================================================================================"
00079     << G4endl
00080     << "                                 INCL++ WARNING                                 "
00081     << G4endl
00082     << message
00083     << G4endl
00084     << "================================================================================"
00085     << G4endl
00086     << G4endl;
00087 }

void G4INCLXXInterfaceStore::EmitWarning ( const G4String message  ) 

Emit a warning to G4cout.

The InterfaceStore will not emit more than maxWarnings warnings.

Definition at line 66 of file G4INCLXXInterfaceStore.cc.

References G4cout, and G4endl.

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

00066                                                                 {
00067   if(++nWarnings<=maxWarnings) {
00068     G4cout << "[INCL++] Warning: " << message << G4endl;
00069     if(nWarnings==maxWarnings) {
00070       G4cout << "[INCL++] INCL++ has already emitted " << maxWarnings << " warnings and will emit no more." << G4endl;
00071     }
00072   }
00073 }

G4bool G4INCLXXInterfaceStore::GetAccurateProjectile (  )  const [inline]

Getter for accurateProjectile.

The

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

Definition at line 139 of file G4INCLXXInterfaceStore.hh.

00139 { return accurateProjectile; }

G4bool G4INCLXXInterfaceStore::GetDumpInput (  )  const [inline]

Getter for dumpInput.

Definition at line 155 of file G4INCLXXInterfaceStore.hh.

Referenced by G4INCLXXInterface::ApplyYourself().

00155 { return dumpInput; }

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

Get the cached INCL model engine.

Definition at line 78 of file G4INCLXXInterfaceStore.hh.

References G4INCL::Config::setClusterMaxMass().

Referenced by G4INCLXXInterface::ApplyYourself().

00078                                {
00079       if(!theINCLModel) {
00080         G4INCL::Config *theConfig = new G4INCL::Config;
00081         theConfig->setClusterMaxMass(theMaxClusterMass);
00082         theINCLModel = new G4INCL::INCL(theConfig);
00083         // ownership of the Config object is taken over by the INCL model engine
00084       }
00085       return theINCLModel;
00086     }

static G4INCLXXInterfaceStore* G4INCLXXInterfaceStore::GetInstance (  )  [inline, static]

Get the singleton instance.

Definition at line 65 of file G4INCLXXInterfaceStore.hh.

Referenced by G4INCLXXInterface::ApplyYourself().

00065                                                  {
00066       if(!theInstance)
00067         theInstance = new G4INCLXXInterfaceStore;
00068       return theInstance;
00069     }

G4int G4INCLXXInterfaceStore::GetMaxClusterMass (  )  const [inline]

Getter for ClusterMaxMass.

The

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

Definition at line 146 of file G4INCLXXInterfaceStore.hh.

00146 { return theMaxClusterMass; }

G4int G4INCLXXInterfaceStore::GetMaxProjMassINCL (  )  const [inline]

Getter for theMaxProjMassINCL.

Definition at line 152 of file G4INCLXXInterfaceStore.hh.

Referenced by G4INCLXXInterface::ApplyYourself().

00152 { return theMaxProjMassINCL; }

void G4INCLXXInterfaceStore::SetAccurateProjectile ( const G4bool  b  )  [inline]

Setter for accurateProjectile.

Definition at line 92 of file G4INCLXXInterfaceStore.hh.

References EmitBigWarning(), and G4endl.

Referenced by G4INCLXXInterfaceMessenger::SetNewValue().

00092                                                {
00093       if(accurateProjectile!=b) {
00094         // Parameter is changed, emit a big warning message
00095         std::stringstream ss;
00096         ss << "Switching from "
00097           << (accurateProjectile ? "\"accurate projectile\" mode to \"accurate target\"" : "\"accurate target\" mode to \"accurate projectile\"")
00098           << " mode."
00099           << G4endl
00100           << "Do this ONLY if you fully understand what it does!";
00101         EmitBigWarning(ss.str());
00102       }
00103 
00104       // No need to delete the model for this parameter
00105 
00106       accurateProjectile=b;
00107     }

void G4INCLXXInterfaceStore::SetMaxClusterMass ( const G4int  aMass  )  [inline]

Setter for theMaxClusterMass.

Definition at line 110 of file G4INCLXXInterfaceStore.hh.

References EmitBigWarning(), and G4endl.

Referenced by G4INCLXXInterfaceMessenger::SetNewValue().

00110                                               {
00111       if(theMaxClusterMass!=aMass) {
00112         // Parameter is changed, emit a big warning message
00113         std::stringstream ss;
00114         ss << "Changing maximum cluster mass from "
00115           << theMaxClusterMass
00116           << " to "
00117           << aMass
00118           << "."
00119           << G4endl
00120           << "Do this ONLY if you fully understand what this setting does!";
00121         EmitBigWarning(ss.str());
00122       }
00123 
00124       // We must delete the model object to make sure that we use the new
00125       // parameter
00126       DeleteModel();
00127 
00128       theMaxClusterMass=aMass;
00129     }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:15 2013 for Geant4 by  doxygen 1.4.7