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

#include <G4AnalysisMessenger.hh>

+ Inheritance diagram for G4AnalysisMessenger:

Public Member Functions

 G4AnalysisMessenger (G4VAnalysisManager *manager)
 
virtual ~G4AnalysisMessenger ()
 
void SetH1HnManager (G4HnManager &h1HnManager)
 
void SetH2HnManager (G4HnManager &h2HnManager)
 
void SetH3HnManager (G4HnManager &h3HnManager)
 
void SetP1HnManager (G4HnManager &p1HnManager)
 
void SetP2HnManager (G4HnManager &p2HnManager)
 
virtual void SetNewValue (G4UIcommand *command, G4String value) final
 
- 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 57 of file G4AnalysisMessenger.hh.

Constructor & Destructor Documentation

◆ G4AnalysisMessenger()

G4AnalysisMessenger::G4AnalysisMessenger ( G4VAnalysisManager manager)
explicit

Definition at line 47 of file G4AnalysisMessenger.cc.

48 : G4UImessenger(),
49 fManager(manager),
50 fFileMessenger(nullptr),
51 fH1Messenger(nullptr),
52 fH2Messenger(nullptr),
53 fH3Messenger(nullptr),
54 fP1Messenger(nullptr),
55 fP2Messenger(nullptr),
56 fNtupleMessenger(nullptr),
57 fH1HnMessenger(nullptr),
58 fH2HnMessenger(nullptr),
59 fH3HnMessenger(nullptr),
60 fP1HnMessenger(nullptr),
61 fP2HnMessenger(nullptr),
62 fAnalysisDir(nullptr),
63 fSetActivationCmd(nullptr),
64 fVerboseCmd(nullptr),
65 fCompressionCmd(nullptr)
66{
67 fAnalysisDir = G4Analysis::make_unique<G4UIdirectory>("/analysis/");
68 fAnalysisDir->SetGuidance("analysis control");
69
70 fSetActivationCmd = G4Analysis::make_unique<G4UIcmdWithABool>("/analysis/setActivation",this);
71 G4String guidance = "Set activation. \n";
72 guidance += "When this option is enabled, only the histograms marked as activated\n";
73 guidance += "are returned, filled or saved on file.\n";
74 guidance += "No warning is issued when Get or Fill is called on inactive histogram.";
75 fSetActivationCmd->SetGuidance(guidance);
76 fSetActivationCmd->SetParameterName("Activation",false);
77
78 fVerboseCmd = G4Analysis::make_unique<G4UIcmdWithAnInteger>("/analysis/verbose",this);
79 fVerboseCmd->SetGuidance("Set verbose level");
80 fVerboseCmd->SetParameterName("VerboseLevel",false);
81 fVerboseCmd->SetRange("VerboseLevel>=0 && VerboseLevel<=4");
82
83 fCompressionCmd = G4Analysis::make_unique<G4UIcmdWithAnInteger>("/analysis/compression",this);
84 fCompressionCmd->SetGuidance("Set compression level");
85 fCompressionCmd->SetParameterName("CompressionLevel",false);
86 fCompressionCmd->SetRange("CompressionLevel>=0 && CompressionLevel<=4");
87
88 fFileMessenger = G4Analysis::make_unique<G4FileMessenger>(manager);
89 fH1Messenger = G4Analysis::make_unique<G4H1Messenger>(manager);
90 fH2Messenger = G4Analysis::make_unique<G4H2Messenger>(manager);
91 fH3Messenger = G4Analysis::make_unique<G4H3Messenger>(manager);
92 fP1Messenger = G4Analysis::make_unique<G4P1Messenger>(manager);
93 fP2Messenger = G4Analysis::make_unique<G4P2Messenger>(manager);
94 fNtupleMessenger = G4Analysis::make_unique<G4NtupleMessenger>(manager);
95}

◆ ~G4AnalysisMessenger()

G4AnalysisMessenger::~G4AnalysisMessenger ( )
virtual

Definition at line 98 of file G4AnalysisMessenger.cc.

99{}

Member Function Documentation

◆ SetH1HnManager()

void G4AnalysisMessenger::SetH1HnManager ( G4HnManager h1HnManager)

Definition at line 106 of file G4AnalysisMessenger.cc.

107{
108 fH1HnMessenger = G4Analysis::make_unique<G4HnMessenger>(h1HnManager);
109}

◆ SetH2HnManager()

void G4AnalysisMessenger::SetH2HnManager ( G4HnManager h2HnManager)

Definition at line 112 of file G4AnalysisMessenger.cc.

113{
114 fH2HnMessenger = G4Analysis::make_unique<G4HnMessenger>(h2HnManager);
115}

◆ SetH3HnManager()

void G4AnalysisMessenger::SetH3HnManager ( G4HnManager h3HnManager)

Definition at line 118 of file G4AnalysisMessenger.cc.

119{
120 fH3HnMessenger = G4Analysis::make_unique<G4HnMessenger>(h3HnManager);
121}

◆ SetNewValue()

void G4AnalysisMessenger::SetNewValue ( G4UIcommand command,
G4String  value 
)
finalvirtual

Reimplemented from G4UImessenger.

Definition at line 136 of file G4AnalysisMessenger.cc.

137{
138 if ( command == fSetActivationCmd.get() ) {
139 fManager->SetActivation(fSetActivationCmd->GetNewBoolValue(newValues));
140 }
141 else if ( command == fVerboseCmd.get() ) {
142 fManager->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValues));
143 }
144 else if ( command == fCompressionCmd.get() ) {
145 fManager->SetCompressionLevel(fCompressionCmd->GetNewIntValue(newValues));
146 }
147}
void SetActivation(G4bool activation)
void SetVerboseLevel(G4int verboseLevel)
void SetCompressionLevel(G4int level)

◆ SetP1HnManager()

void G4AnalysisMessenger::SetP1HnManager ( G4HnManager p1HnManager)

Definition at line 124 of file G4AnalysisMessenger.cc.

125{
126 fP1HnMessenger = G4Analysis::make_unique<G4HnMessenger>(p1HnManager);
127}

◆ SetP2HnManager()

void G4AnalysisMessenger::SetP2HnManager ( G4HnManager p2HnManager)

Definition at line 130 of file G4AnalysisMessenger.cc.

131{
132 fP2HnMessenger = G4Analysis::make_unique<G4HnMessenger>(p2HnManager);
133}

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