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

#include <G4HadronicParametersMessenger.hh>

+ Inheritance diagram for G4HadronicParametersMessenger:

Public Member Functions

 G4HadronicParametersMessenger (G4HadronicParameters *inputHadParam)
 
 ~G4HadronicParametersMessenger ()
 
void SetNewValue (G4UIcommand *command, G4String newValues) override
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()=default
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String LtoS (G4long l)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (const G4String &s)
 
G4long StoL (const G4String &s)
 
G4double StoD (const G4String &s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir = nullptr
 
G4String baseDirName = ""
 
G4bool commandsShouldBeInMaster = false
 

Detailed Description

Definition at line 47 of file G4HadronicParametersMessenger.hh.

Constructor & Destructor Documentation

◆ G4HadronicParametersMessenger()

G4HadronicParametersMessenger::G4HadronicParametersMessenger ( G4HadronicParameters * inputHadParam)
explicit

Definition at line 41 of file G4HadronicParametersMessenger.cc.

41 :
42 theHadronicParameters( inputHadParam )
43{
44 // Main directory for the whole hadronic
45 theDirectory = new G4UIdirectory( "/process/had/" );
46 theDirectory->SetGuidance( "Control of general hadronic physics parameters and choices." );
47
48 // This command setup the overall verbose level for hadronics.
49 // It is the responsibility of all hadronic models, cross sections and processes to check
50 // this verbose level and behave consistently: in particular, if the level is "0" there
51 // should be no print out regardless of their eventual internal (local) verbosity level.
52 theVerboseCmd = new G4UIcmdWithAnInteger( "/process/had/verbose", this );
53 theVerboseCmd->SetGuidance( "Set verbose level: 0 (minimum), 1 (default), 2 (higher), ... (even higher)" );
54 theVerboseCmd->SetParameterName( "VerboseLevel", true );
55 theVerboseCmd->SetDefaultValue( 1 );
56 theVerboseCmd->SetRange( "VerboseLevel>=0" );
57 theVerboseCmd->AvailableForStates( G4State_PreInit );
58
59 // This command sets the max energy for hadronics.
60 theMaxEnergyCmd = new G4UIcmdWithADoubleAndUnit( "/process/had/maxEnergy", this );
61 theMaxEnergyCmd->SetGuidance( "Max energy for hadronics (default: 100 TeV)" );
62 theMaxEnergyCmd->SetParameterName( "MaxEnergy", false );
63 theMaxEnergyCmd->SetUnitCategory( "Energy" );
64 theMaxEnergyCmd->SetRange( "MaxEnergy>0.0" );
65 theMaxEnergyCmd->AvailableForStates( G4State_PreInit );
66
67 // This command enable the Cosmic Ray (CR) coalescence
68 theCRCoalescenceCmd = new G4UIcmdWithABool( "/process/had/enableCRCoalescence", this );
69 theCRCoalescenceCmd->SetGuidance( "Enable Cosmic Ray (CR) coalescence." );
70 theCRCoalescenceCmd->SetParameterName( "EnableCRCoalescence", false );
71 theCRCoalescenceCmd->SetDefaultValue( false );
72}
@ G4State_PreInit
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4bool defVal)
void SetUnitCategory(const char *unitCategory)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4int defVal)
void SetGuidance(const char *aGuidance)
void SetRange(const char *rs)
void AvailableForStates(G4ApplicationState s1)

◆ ~G4HadronicParametersMessenger()

G4HadronicParametersMessenger::~G4HadronicParametersMessenger ( )

Definition at line 75 of file G4HadronicParametersMessenger.cc.

75 {
76 delete theDirectory;
77 delete theVerboseCmd;
78 delete theMaxEnergyCmd;
79 delete theCRCoalescenceCmd;
80}

Member Function Documentation

◆ SetNewValue()

void G4HadronicParametersMessenger::SetNewValue ( G4UIcommand * command,
G4String newValues )
overridevirtual

Reimplemented from G4UImessenger.

Definition at line 83 of file G4HadronicParametersMessenger.cc.

83 {
84 if ( command == theVerboseCmd ) {
85 // Note that the messenger updates only the verbose level of the class G4HadronicParameters:
86 // it is the responsibility of each hadronic model, cross section and process to check
87 // this verbose level and behave accordingly.
88 theHadronicParameters->SetVerboseLevel( theVerboseCmd->GetNewIntValue( newValues ) );
89 } else if ( command == theMaxEnergyCmd ) {
90 theHadronicParameters->SetMaxEnergy( theMaxEnergyCmd->GetNewDoubleValue( newValues ) );
91 } else if ( command == theCRCoalescenceCmd ) {
92 theHadronicParameters->SetEnableCRCoalescence( theCRCoalescenceCmd->GetNewBoolValue( newValues ) );
93 }
94}
void SetVerboseLevel(const G4int val)
void SetMaxEnergy(const G4double val)
void SetEnableCRCoalescence(G4bool val)
static G4bool GetNewBoolValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
static G4int GetNewIntValue(const char *paramString)

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