53 fSetHistoDirNameCmd(0),
54 fSetNtupleDirNameCmd(0),
64 fSetH1ActivationCmd(0),
65 fSetH1ActivationAllCmd(0),
73 fSetH2ActivationCmd(0),
74 fSetH2ActivationAllCmd(0)
80 fSetFileNameCmd->
SetGuidance(
"Set name for the histograms & ntuple file");
85 fSetHistoDirNameCmd->
SetGuidance(
"Set name for the histograms directory");
90 fSetNtupleDirNameCmd->
SetGuidance(
"Set name for the ntuple directory");
95 G4String guidance =
"Set activation. \n";
96 guidance +=
"When this option is enabled, only the histograms marked as activated\n";
97 guidance +=
"are returned, filled or saved on file.\n";
98 guidance +=
"No warning is issued when Get or Fill is called on inactive histogram.";
105 fVerboseCmd->
SetRange(
"VerboseLevel>=0 && VerboseLevel<=4");
114 fSetH1AsciiCmd->
SetGuidance(
"Print 1D histogram of #Id on ascii file.");
122 SetH1ActivationCmd();
124 fSetH1ActivationAllCmd =
new G4UIcmdWithABool(
"/analysis/h1/setActivationToAll",
this);
125 fSetH1ActivationAllCmd->
SetGuidance(
"Set activation to all 1D histograms.");
135 fSetH2AsciiCmd->
SetGuidance(
"Print 2D histogram of #Id on ascii file.");
144 SetH2ActivationCmd();
146 fSetH2ActivationAllCmd =
new G4UIcmdWithABool(
"/analysis/h2/setActivationToAll",
this);
147 fSetH2ActivationAllCmd->
SetGuidance(
"Set activation to all 2D histograms.");
155 delete fSetFileNameCmd;
156 delete fSetHistoDirNameCmd;
157 delete fSetNtupleDirNameCmd;
158 delete fSetActivationCmd;
162 delete fSetH1AsciiCmd;
163 delete fSetH1TitleCmd;
164 delete fSetH1XAxisCmd;
165 delete fSetH1YAxisCmd;
166 delete fSetH1ActivationCmd;
167 delete fSetH1ActivationAllCmd;
171 delete fSetH2AsciiCmd;
172 delete fSetH2TitleCmd;
173 delete fSetH2XAxisCmd;
174 delete fSetH2YAxisCmd;
175 delete fSetH2ZAxisCmd;
176 delete fSetH2ActivationCmd;
177 delete fSetH2ActivationAllCmd;
187 void G4AnalysisMessenger::CreateH1Cmd()
196 h1Nbins0->
SetGuidance(
"Number of bins (default = 100)");
197 h1Nbins0->
SetGuidance(
"Can be reset with /analysis/h1/set command");
201 h1ValMin0->
SetGuidance(
"Minimum value, expressed in unit (default = 0.)");
202 h1ValMin0->
SetGuidance(
"Can be reset with /analysis/h1/set command");
206 h1ValMax0->
SetGuidance(
"Maximum value, expressed in unit (default = 1.)");
207 h1ValMax0->
SetGuidance(
"Can be reset with /analysis/h1/set command");
211 h1ValUnit0->
SetGuidance(
"The unit of valMin0 and valMax0");
215 G4String fcnGuidance =
"The function applied to filled values (log, log10, exp).\n";
216 fcnGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
217 fcnGuidance +=
"but none value should be used insted.";
222 fCreateH1Cmd =
new G4UIcommand(
"/analysis/h1/create",
this);
236 void G4AnalysisMessenger::SetH1Cmd()
246 h1ValMin->
SetGuidance(
"Minimum value, expressed in unit");
249 h1ValMax->
SetGuidance(
"Maximum value, expressed in unit");
252 h1ValUnit->
SetGuidance(
"The unit of valMin and valMax");
257 G4String fcnGuidance =
"The function applied to filled values (log, log10, exp, none).\n";
258 fcnGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
259 fcnGuidance +=
"but none value should be used insted.";
263 fSetH1Cmd =
new G4UIcommand(
"/analysis/h1/set",
this);
264 fSetH1Cmd->
SetGuidance(
"Set parameters for the 1D histogram of #Id :");
265 fSetH1Cmd->
SetGuidance(
" nbins; valMin; valMax; unit (of vmin and vmax)");
276 void G4AnalysisMessenger::SetH1TitleCmd()
286 fSetH1TitleCmd =
new G4UIcommand(
"/analysis/h1/setTitle",
this);
287 fSetH1TitleCmd->
SetGuidance(
"Set title for the 1D histogram of #Id");
294 void G4AnalysisMessenger::SetH1XAxisCmd()
304 fSetH1XAxisCmd =
new G4UIcommand(
"/analysis/h1/setXaxis",
this);
305 fSetH1XAxisCmd->
SetGuidance(
"Set x-axis title for the 1D histogram of #Id");
312 void G4AnalysisMessenger::SetH1YAxisCmd()
322 fSetH1YAxisCmd =
new G4UIcommand(
"/analysis/h1/setYaxis",
this);
323 fSetH1YAxisCmd->
SetGuidance(
"Set y-axis title for the 1D histogram of #Id");
330 void G4AnalysisMessenger::SetH1ActivationCmd()
340 fSetH1ActivationCmd =
new G4UIcommand(
"/analysis/h1/setActivation",
this);
341 fSetH1ActivationCmd->
SetGuidance(
"Set activation for the 1D histogram of #Id");
348 void G4AnalysisMessenger::CreateH2Cmd()
357 h2xNbins0->
SetGuidance(
"Number of x-bins (default = 100)");
358 h2xNbins0->
SetGuidance(
"Can be reset with /analysis/h2/set command");
362 h2xValMin0->
SetGuidance(
"Minimum x-value, expressed in unit (default = 0.)");
363 h2xValMin0->
SetGuidance(
"Can be reset with /analysis/h2/set command");
367 h2xValMax0->
SetGuidance(
"Maximum x-value, expressed in unit (default = 1.)");
368 h2xValMax0->
SetGuidance(
"Can be reset with /analysis/h2/set command");
372 h2xValUnit0->
SetGuidance(
"The unit of xvalMin0 and xvalMax0");
376 G4String fcnxGuidance =
"The function applied to filled x-values (log, log10, exp, none).\n";
377 fcnxGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
378 fcnxGuidance +=
"but none value should be used insted.";
384 h2yNbins0->
SetGuidance(
"Number of y-bins (default = 100)");
385 h2yNbins0->
SetGuidance(
"Can be reset with /analysis/h2/set command");
389 h2yValMin0->
SetGuidance(
"Minimum y-value, expressed in unit (default = 0.)");
390 h2yValMin0->
SetGuidance(
"Can be reset with /analysis/h2/set command");
394 h2yValMax0->
SetGuidance(
"Maximum y-value, expressed in unit (default = 1.)");
395 h2yValMax0->
SetGuidance(
"Can be reset with /analysis/h2/set command");
399 h2yValUnit0->
SetGuidance(
"The unit of xvalMin0 and yvalMax0");
403 G4String fcnyGuidance =
"The function applied to filled x-values (log, log10, exp, none).\n";
404 fcnyGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
405 fcnyGuidance +=
"but none value should be used insted.";
410 fCreateH2Cmd =
new G4UIcommand(
"/analysis/h2/create",
this);
429 void G4AnalysisMessenger::SetH2Cmd()
439 h2xValMin->
SetGuidance(
"Minimum x-value, expressed in unit");
442 h2xValMax->
SetGuidance(
"Maximum x-value, expressed in unit");
446 G4String fcnxGuidance =
"The function applied to filled x-values (log, log10, exp, none).\n";
447 fcnxGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
448 fcnxGuidance +=
"but none value should be used insted.";
453 h2yValUnit->
SetGuidance(
"The unit of yvalMin and yvalMax");
460 h2yValMin->
SetGuidance(
"Minimum y-value, expressed in unit");
463 h2yValMax->
SetGuidance(
"Maximum y-value, expressed in unit");
466 h2xValUnit->
SetGuidance(
"The unit of xvalMin and xvalMax");
471 G4String fcnyGuidance =
"The function applied to filled y-values (log, log10, exp, none).\n";
472 fcnyGuidance +=
"Note that the unit parameter cannot be omitted in this case,\n";
473 fcnyGuidance +=
"but none value should be used insted.";
477 fSetH2Cmd =
new G4UIcommand(
"/analysis/h2/set",
this);
478 fSetH2Cmd->
SetGuidance(
"Set parameters for the 2D histogram of #Id :");
479 fSetH2Cmd->
SetGuidance(
" nbins; valMin; valMax; unit (of vmin and vmax)");
495 void G4AnalysisMessenger::SetH2TitleCmd()
505 fSetH2TitleCmd =
new G4UIcommand(
"/analysis/h2/setTitle",
this);
506 fSetH2TitleCmd->
SetGuidance(
"Set title for the 2D histogram of #Id");
513 void G4AnalysisMessenger::SetH2XAxisCmd()
523 fSetH2XAxisCmd =
new G4UIcommand(
"/analysis/h2/setXaxis",
this);
524 fSetH2XAxisCmd->
SetGuidance(
"Set x-axis title for the 2D histogram of #Id");
531 void G4AnalysisMessenger::SetH2YAxisCmd()
541 fSetH2YAxisCmd =
new G4UIcommand(
"/analysis/h2/setYaxis",
this);
542 fSetH2YAxisCmd->
SetGuidance(
"Set y-axis title for the 2D histogram of #Id");
549 void G4AnalysisMessenger::SetH2ZAxisCmd()
559 fSetH2ZAxisCmd =
new G4UIcommand(
"/analysis/h2/setYaxis",
this);
560 fSetH2ZAxisCmd->
SetGuidance(
"Set y-axis title for the 2D histogram of #Id");
567 void G4AnalysisMessenger::SetH2ActivationCmd()
577 fSetH2ActivationCmd =
new G4UIcommand(
"/analysis/h2/setActivation",
this);
578 fSetH2ActivationCmd->
SetGuidance(
"Set activation for the 2D histogram of #Id");
587 if ( command == fSetFileNameCmd ) {
591 else if ( command == fSetHistoDirNameCmd ) {
594 else if ( command == fSetNtupleDirNameCmd ) {
597 else if ( command == fSetActivationCmd ) {
600 else if ( command == fVerboseCmd ) {
603 else if ( command == fCreateH1Cmd ) {
609 std::istringstream is(newValues.
data());
610 is >> name >> title >> nbins >> vmin >> vmax >> sunit >> sfcn;
611 fManager->
CreateH1(name, title, nbins, vmin, vmax, sunit, sfcn);
613 else if ( command == fSetH1Cmd ) {
619 std::istringstream is(newValues.
data());
620 is >>
id >> nbins >> vmin >> vmax >> sunit >> sfcn;
621 fManager->
SetH1(
id, nbins, vmin, vmax, sunit, sfcn);
623 else if ( command == fSetH1AsciiCmd ) {
627 else if ( command == fSetH1TitleCmd ) {
630 std::istringstream is(newValues.
data());
635 else if ( command == fSetH1XAxisCmd ) {
638 std::istringstream is(newValues.
data());
643 else if ( command == fSetH1YAxisCmd ) {
646 std::istringstream is(newValues.
data());
651 else if ( command == fSetH1ActivationCmd ) {
654 std::istringstream is(newValues.
data());
655 is >>
id >> sactivation;
659 else if ( command == fSetH1ActivationAllCmd ) {
663 else if ( command == fCreateH2Cmd ) {
665 G4int xnbins, ynbins;
666 G4double xvmin, xvmax, yvmin, yvmax;
667 G4String xsunit,xsfcn, ysunit, ysfcn;
668 std::istringstream is(newValues.
data());
670 >> xnbins >> xvmin >> xvmax >> xsunit >> xsfcn
671 >> ynbins >> yvmin >> yvmax >> ysunit >> ysfcn;
673 xnbins, xvmin, xvmax, ynbins, yvmin, yvmax,
674 ysunit, ysfcn, ysunit, ysfcn);
676 else if ( command == fSetH2Cmd ) {
678 G4int xnbins, ynbins;
679 G4double xvmin, xvmax, yvmin, yvmax;
680 G4String xsunit,xsfcn, ysunit, ysfcn;
681 std::istringstream is(newValues.
data());
683 >> xnbins >> xvmin >> xvmax >> xsunit >> xsfcn
684 >> ynbins >> yvmin >> yvmax >> ysunit >> ysfcn;
686 xnbins, xvmin, xvmax, ynbins, yvmin, yvmax,
687 ysunit, ysfcn, ysunit, ysfcn);
689 else if ( command == fSetH2AsciiCmd ) {
693 else if ( command == fSetH2TitleCmd ) {
696 std::istringstream is(newValues.
data());
701 else if ( command == fSetH2XAxisCmd ) {
704 std::istringstream is(newValues.
data());
709 else if ( command == fSetH2YAxisCmd ) {
712 std::istringstream is(newValues.
data());
717 else if ( command == fSetH2ZAxisCmd ) {
720 std::istringstream is(newValues.
data());
725 else if ( command == fSetH2ActivationCmd ) {
728 std::istringstream is(newValues.
data());
729 is >>
id >> sactivation;
733 else if ( command == fSetH2ActivationAllCmd ) {