40 #include "G4UIdirectory.hh"
41 #include "G4UIcommand.hh"
42 #include "G4UIparameter.hh"
43 #include "G4UIcmdWithAString.hh"
50 fHistoDir =
new G4UIdirectory(
"/testhadr/histo/");
51 fHistoDir->SetGuidance(
"histograms control");
53 fFactoryCmd =
new G4UIcmdWithAString(
"/testhadr/histo/fileName",
this);
54 fFactoryCmd->SetGuidance(
"set name for the histograms file");
56 fFileCmd =
new G4UIcmdWithAString(
"/testhadr/histo/fileType",
this);
57 fFileCmd->SetGuidance(
"set type (hbook, XML) for the histograms file");
59 fHistoCmd =
new G4UIcommand(
"/testhadr/histo/setHisto",
this);
60 fHistoCmd->SetGuidance(
"Set bining of the histo number ih :");
61 fHistoCmd->SetGuidance(
" nbBins; valMin; valMax; unit (of vmin and vmax)");
63 G4UIparameter* ih =
new G4UIparameter(
"ih",
'i',
false);
64 ih->SetGuidance(
"histo number : from 0 to MaxHisto-1");
67 G4UIparameter* nbBins =
new G4UIparameter(
"nbBins",
'i',
false);
68 nbBins->SetGuidance(
"number of bins");
69 nbBins->SetParameterRange(
"nbBins>0");
72 G4UIparameter* valMin =
new G4UIparameter(
"valMin",
'd',
false);
73 valMin->SetGuidance(
"valMin, expressed in unit");
76 G4UIparameter* valMax =
new G4UIparameter(
"valMax",
'd',
false);
77 valMax->SetGuidance(
"valMax, expressed in unit");
80 G4UIparameter* unit =
new G4UIparameter(
"unit",
's',
true);
81 unit->SetGuidance(
"if omitted, vmin and vmax are assumed dimensionless");
82 unit->SetDefaultValue(
"none");
108 std::istringstream is(newValues);
110 is >> ih >> nbBins >> vmin >> vmax >> unts;
111 G4String unit = unts;
112 G4double vUnit = 1. ;
113 if(unit !=
"none") { vUnit = G4UIcommand::ValueOf(unit); }
114 if(vUnit <= 0.0) { vUnit = 1.; }
G4UIdirectory * fHistoDir
G4UIcmdWithAString * fFileCmd
void SetFileType(const G4String &)
G4UIcmdWithAString * fFactoryCmd
virtual ~HistoMessenger()
void SetHisto1D(G4int, G4int, G4double, G4double, G4double)
void SetFileName(const G4String &)
virtual void SetNewValue(G4UIcommand *, G4String)