45 const G4String& commandName, std::size_t got, std::size_t expected,
49 "Got wrong number of \"" + commandName +
"\" parameters: " +
50 to_string(got) +
" instead of " + to_string(expected) +
" expected",
61 fNtupleDir = std::make_unique<G4UIdirectory>(
"/analysis/ntuple/");
81 ntupleId->SetGuidance(
"Ntuple id");
82 ntupleId->SetParameterRange(
"NtupleId>=0");
84 auto ntupleActivation =
new G4UIparameter(
"NtupleActivation",
's',
true);
85 ntupleActivation->SetGuidance(
"Ntuple activation");
86 ntupleActivation->SetDefaultValue(
"none");
88 fSetActivationCmd = std::make_unique<G4UIcommand>(
"/analysis/ntuple/setActivation",
this);
89 G4String guidance(
"Set activation for the ntuple of given id");
101 = std::make_unique<G4UIcmdWithABool>(
"/analysis/ntuple/setActivationToAll",
this);
102 G4String guidance(
"Set activation to all ntuples");
111 ntupleId->SetGuidance(
"Ntuple id");
112 ntupleId->SetParameterRange(
"NtupleId>=0");
114 auto ntupleFileName =
new G4UIparameter(
"NtupleFileName",
's',
true);
115 ntupleFileName->SetGuidance(
"Ntuple file name");
116 ntupleFileName->SetDefaultValue(
"none");
118 fSetFileNameCmd = std::make_unique<G4UIcommand>(
"/analysis/ntuple/setFileName",
this);
119 G4String guidance(
"Set file name for the ntuple of given id");
131 = std::make_unique<G4UIcmdWithAString>(
"/analysis/ntuple/setFileNameToAll",
this);
132 G4String guidance(
"Set file name to all ntuples");
146 std::vector<G4String> parameters;
167 std::vector<G4String> parameters;
173 auto fileName = parameters[counter++];
183 auto fileName = newValues;
std::unique_ptr< G4UIcommand > fSetFileNameCmd
void SetActivationToAllCmd()
virtual void SetNewValue(G4UIcommand *command, G4String value) final
std::unique_ptr< G4UIcmdWithABool > fSetActivationAllCmd
std::unique_ptr< G4UIcommand > fSetActivationCmd
void SetFileNameToAllCmd()
static constexpr std::string_view fkClass
G4VAnalysisManager * fManager
Associated class.
G4NtupleMessenger()=delete
std::unique_ptr< G4UIdirectory > fNtupleDir
virtual ~G4NtupleMessenger()
std::unique_ptr< G4UIcmdWithAString > fSetFileNameAllCmd
std::size_t GetParameterEntries() const
static G4int ConvertToInt(const char *st)
static G4bool ConvertToBool(const char *st)
const G4String & GetCommandName() const
void SetNtupleFileName(const G4String &fileName)
void SetNtupleActivation(G4bool activation)
void Tokenize(const G4String &line, std::vector< G4String > &tokens)
void Warn(const G4String &message, const std::string_view inClass, const std::string_view inFunction)
void WrongParametersWarning(const G4String &commandName, std::size_t got, std::size_t expected, std::string_view className)