45 fAnalysisDir = std::make_unique<G4UIdirectory>(
"/analysis/");
46 fAnalysisDir->SetGuidance(
"analysis control");
48 fOpenFileCmd = CreateCommand<G4UIcmdWithAString>(
49 "openFile",
"Open analysis file",
"FileName",
true);
50 fOpenFileCmd->SetDefaultValue(
"");
51 fOpenFileCmd->SetToBeBroadcasted(
true);
53 fWriteCmd = CreateCommandWithoutParameter(
54 "write",
"Write analysis data.");
55 fWriteCmd->SetToBeBroadcasted(
false);
57 fResetCmd = CreateCommandWithoutParameter(
58 "reset",
"Reset analysis data.");
59 fResetCmd->SetToBeBroadcasted(
false);
61 fCloseFileCmd = CreateCommand<G4UIcmdWithABool>(
62 "closeFile",
"Close analysis file and (optionally) reset data.",
"IsReset",
true);
63 fCloseFileCmd->SetDefaultValue(
true);
64 fCloseFileCmd->SetToBeBroadcasted(
false);
66 fListCmd = CreateCommand<G4UIcmdWithABool>(
67 "list",
"List all/activate analysis objects.",
"OnlyIfActive",
true);
68 fListCmd->SetDefaultValue(
true);
70 fSetDefaultFileTypeCmd = CreateCommand<G4UIcmdWithAString>(
71 "setDefaultFileType",
"Set default output file type",
"DefaultFileType",
false);
73 fSetDefaultFileTypeCmd->SetCandidates(
"csv hdf5 root xml");
75 fSetDefaultFileTypeCmd->SetCandidates(
"csv root xml");
78 fSetActivationCmd = CreateCommand<G4UIcmdWithABool>(
81 "When this option is enabled, only the histograms marked as activated\n"
82 "are returned, filled or saved on file.\n"
83 "No warning is issued when Get or Fill is called on inactive histogram.",
86 fVerboseCmd = CreateCommand<G4UIcmdWithAnInteger>(
87 "verbose",
"Set verbose level",
"VerboseLevel");
88 fVerboseCmd->SetRange(
"VerboseLevel>=0 && VerboseLevel<=4");
90 fCompressionCmd = CreateCommand<G4UIcmdWithAnInteger>(
91 "compression",
"Set compression level",
"CompressionLevel");
92 fCompressionCmd->SetRange(
"CompressionLevel>=0 && CompressionLevel<=4");
94 fSetFileNameCmd = CreateCommand<G4UIcmdWithAString>(
95 "setFileName",
"Set name for the histograms & ntuple file",
"Filename");
97 fSetHistoDirNameCmd = CreateCommand<G4UIcmdWithAString>(
98 "setHistoDirName",
"Set name for the histograms directory",
"HistoDirName");
100 fSetNtupleDirNameCmd = CreateCommand<G4UIcmdWithAString>(
101 "setNtupleDirName",
"Set name for the ntuple directory",
"NtupleDirName");
103 fNtupleMessenger = std::make_unique<G4NtupleMessenger>(manager);
135 if ( command == fOpenFileCmd.get() ) {
141 if ( command == fWriteCmd.get() ) {
142 fManager->WriteFromUI();
146 if ( command == fResetCmd.get() ) {
147 fManager->ResetFromUI();
151 if ( command == fCloseFileCmd.get() ) {
152 fManager->CloseFileFromUI(fCloseFileCmd->GetNewBoolValue(newValues));
156 if ( command == fListCmd.get() ) {
157 fManager->
List(fListCmd->GetNewBoolValue(newValues));
161 if ( command == fSetDefaultFileTypeCmd.get() ) {
166 if ( command == fSetActivationCmd.get() ) {
167 fManager->
SetActivation(fSetActivationCmd->GetNewBoolValue(newValues));
171 if ( command == fVerboseCmd.get() ) {
176 if ( command == fCompressionCmd.get() ) {
181 if ( command == fSetFileNameCmd.get() ) {
186 if ( command == fSetHistoDirNameCmd.get() ) {
191 if ( command == fSetNtupleDirNameCmd.get() ) {