45 using namespace G4Analysis;
51 fFileMessenger(nullptr),
52 fH1Messenger(nullptr),
53 fH2Messenger(nullptr),
54 fH3Messenger(nullptr),
55 fP1Messenger(nullptr),
56 fP2Messenger(nullptr),
57 fNtupleMessenger(nullptr),
58 fH1HnMessenger(nullptr),
59 fH2HnMessenger(nullptr),
60 fH3HnMessenger(nullptr),
61 fP1HnMessenger(nullptr),
62 fP2HnMessenger(nullptr),
63 fAnalysisDir(nullptr),
64 fSetActivationCmd(nullptr),
66 fCompressionCmd(nullptr)
68 fAnalysisDir = G4Analysis::make_unique<G4UIdirectory>(
"/analysis/");
69 fAnalysisDir->SetGuidance(
"analysis control");
71 fSetActivationCmd = G4Analysis::make_unique<G4UIcmdWithABool>(
"/analysis/setActivation",
this);
72 G4String guidance =
"Set activation. \n";
73 guidance +=
"When this option is enabled, only the histograms marked as activated\n";
74 guidance +=
"are returned, filled or saved on file.\n";
75 guidance +=
"No warning is issued when Get or Fill is called on inactive histogram.";
76 fSetActivationCmd->SetGuidance(guidance);
77 fSetActivationCmd->SetParameterName(
"Activation",
false);
79 fVerboseCmd = G4Analysis::make_unique<G4UIcmdWithAnInteger>(
"/analysis/verbose",
this);
80 fVerboseCmd->SetGuidance(
"Set verbose level");
81 fVerboseCmd->SetParameterName(
"VerboseLevel",
false);
82 fVerboseCmd->SetRange(
"VerboseLevel>=0 && VerboseLevel<=4");
84 fCompressionCmd = G4Analysis::make_unique<G4UIcmdWithAnInteger>(
"/analysis/compression",
this);
85 fCompressionCmd->SetGuidance(
"Set compression level");
86 fCompressionCmd->SetParameterName(
"CompressionLevel",
false);
87 fCompressionCmd->SetRange(
"CompressionLevel>=0 && CompressionLevel<=4");
89 fFileMessenger = G4Analysis::make_unique<G4FileMessenger>(manager);
90 fH1Messenger = G4Analysis::make_unique<G4H1Messenger>(manager);
91 fH2Messenger = G4Analysis::make_unique<G4H2Messenger>(manager);
92 fH3Messenger = G4Analysis::make_unique<G4H3Messenger>(manager);
93 fP1Messenger = G4Analysis::make_unique<G4P1Messenger>(manager);
94 fP2Messenger = G4Analysis::make_unique<G4P2Messenger>(manager);
95 fNtupleMessenger = G4Analysis::make_unique<G4NtupleMessenger>(manager);
109 fH1HnMessenger = G4Analysis::make_unique<G4HnMessenger>(h1HnManager);
115 fH2HnMessenger = G4Analysis::make_unique<G4HnMessenger>(h2HnManager);
121 fH2HnMessenger = G4Analysis::make_unique<G4HnMessenger>(h2HnManager);
127 fP1HnMessenger = G4Analysis::make_unique<G4HnMessenger>(p1HnManager);
133 fP2HnMessenger = G4Analysis::make_unique<G4HnMessenger>(p2HnManager);
139 if ( command == fSetActivationCmd.get() ) {
140 fManager->
SetActivation(fSetActivationCmd->GetNewBoolValue(newValues));
142 else if ( command == fVerboseCmd.get() ) {
145 else if ( command == fCompressionCmd.get() ) {
void SetCompressionLevel(G4int level)
void SetVerboseLevel(G4int verboseLevel)
virtual ~G4AnalysisMessenger()
void SetH3HnManager(G4HnManager &h2HnManager)
void SetH1HnManager(G4HnManager &h1HnManager)
virtual void SetNewValue(G4UIcommand *command, G4String value) final
void SetActivation(G4bool activation)
void SetP2HnManager(G4HnManager &h2HnManager)
G4AnalysisMessenger(G4VAnalysisManager *manager)
void SetP1HnManager(G4HnManager &h1HnManager)
void SetH2HnManager(G4HnManager &h2HnManager)