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

#include <G4SDmessenger.hh>

+ Inheritance diagram for G4SDmessenger:

Public Member Functions

 G4SDmessenger (G4SDManager *SDManager)
 
 ~G4SDmessenger ()
 
void SetNewValue (G4UIcommand *command, G4String newValues)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool operator!= (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4long StoL (G4String s)
 
G4double StoD (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 51 of file G4SDmessenger.hh.

Constructor & Destructor Documentation

◆ G4SDmessenger()

G4SDmessenger::G4SDmessenger ( G4SDManager SDManager)

Definition at line 37 of file G4SDmessenger.cc.

37 :fSDMan(SDManager)
38{
39 hitsDir = new G4UIdirectory("/hits/");
40 hitsDir->SetGuidance("Sensitive detectors and Hits");
41
42 listCmd = new G4UIcmdWithoutParameter("/hits/list",this);
43 listCmd->SetGuidance("List sensitive detector tree.");
44
45 activeCmd = new G4UIcmdWithAString("/hits/activate",this);
46 activeCmd->SetGuidance("Activate sensitive detector(s).");
47 activeCmd->SetParameterName("detector",true);
48 activeCmd->SetDefaultValue("/");
49
50 inactiveCmd = new G4UIcmdWithAString("/hits/inactivate",this);
51 inactiveCmd->SetGuidance("Inactivate sensitive detector(s).");
52 inactiveCmd->SetParameterName("detector",true);
53 inactiveCmd->SetDefaultValue("/");
54
55 verboseCmd = new G4UIcmdWithAnInteger("/hits/verbose",this);
56 verboseCmd->SetGuidance("Set the Verbose level.");
57 verboseCmd->SetParameterName("level",false);
58}
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(const char *defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:156

◆ ~G4SDmessenger()

G4SDmessenger::~G4SDmessenger ( )

Definition at line 60 of file G4SDmessenger.cc.

61{
62 delete listCmd;
63 delete activeCmd;
64 delete inactiveCmd;
65 delete verboseCmd;
66 delete hitsDir;
67}

Member Function Documentation

◆ SetNewValue()

void G4SDmessenger::SetNewValue ( G4UIcommand command,
G4String  newValues 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 69 of file G4SDmessenger.cc.

70{
71 if( command==listCmd )
72 { fSDMan->ListTree(); }
73 if( command==activeCmd )
74 { fSDMan->Activate(newVal,1); }
75 if( command==inactiveCmd )
76 { fSDMan->Activate(newVal,0); }
77 if( command==verboseCmd )
78 { fSDMan->SetVerboseLevel(verboseCmd->GetNewIntValue(newVal)); }
79 return;
80}
void SetVerboseLevel(G4int vl)
Definition: G4SDManager.hh:92
void Activate(G4String dName, G4bool activeFlag)
Definition: G4SDManager.cc:121
void ListTree() const
Definition: G4SDManager.hh:99
static G4int GetNewIntValue(const char *paramString)

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