Geant4 11.4.0
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 (const 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
73 // This command dumps the hadronic parameters to G4cout
74 theDumpCmd = new G4UIcommand( "/process/had/printParameters", this );
75 theDumpCmd->SetGuidance( "Print all Hadronic parameters." );
76 theDumpCmd->AvailableForStates( G4State_PreInit, G4State_Idle );
77 theDumpCmd->SetToBeBroadcasted( false );
78}
@ G4State_Idle
@ G4State_PreInit

◆ ~G4HadronicParametersMessenger()

G4HadronicParametersMessenger::~G4HadronicParametersMessenger ( )

Definition at line 81 of file G4HadronicParametersMessenger.cc.

81 {
82 delete theDirectory;
83 delete theVerboseCmd;
84 delete theMaxEnergyCmd;
85 delete theCRCoalescenceCmd;
86 delete theDumpCmd;
87}

Member Function Documentation

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 90 of file G4HadronicParametersMessenger.cc.

90 {
91 if ( command == theVerboseCmd ) {
92 // Note that the messenger updates only the verbose level of the class G4HadronicParameters:
93 // it is the responsibility of each hadronic model, cross section and process to check
94 // this verbose level and behave accordingly.
95 theHadronicParameters->SetVerboseLevel( theVerboseCmd->GetNewIntValue( newValues ) );
96 } else if ( command == theMaxEnergyCmd ) {
97 theHadronicParameters->SetMaxEnergy( theMaxEnergyCmd->GetNewDoubleValue( newValues ) );
98 } else if ( command == theCRCoalescenceCmd ) {
99 theHadronicParameters->SetEnableCRCoalescence( theCRCoalescenceCmd->GetNewBoolValue( newValues ) );
100 }
101 else if ( command == theDumpCmd ) {
102 theHadronicParameters->Dump();
103 }
104}

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