Geant4  10.02.p03
HistoMessenger Class Reference

#include <HistoMessenger.hh>

Inheritance diagram for HistoMessenger:
Collaboration diagram for HistoMessenger:

Public Member Functions

 HistoMessenger (HistoManager *)
 
 ~HistoMessenger ()
 
virtual void SetNewValue (G4UIcommand *, G4String)
 
 HistoMessenger (Histo *)
 
virtual ~HistoMessenger ()
 
virtual void SetNewValue (G4UIcommand *, G4String)
 
 HistoMessenger (Histo *)
 
 ~HistoMessenger ()
 
virtual void SetNewValue (G4UIcommand *, G4String)
 
 HistoMessenger (Histo *)
 
virtual ~HistoMessenger ()
 
virtual void SetNewValue (G4UIcommand *, G4String)
 
 HistoMessenger (Histo *)
 
virtual ~HistoMessenger ()
 
virtual void SetNewValue (G4UIcommand *, G4String)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Private Attributes

HistoManagerfHistoManager
 
G4UIdirectoryfHistoDir
 
G4UIcmdWithAStringfFileNameCmd
 
G4UIcommandfHistoCmd
 
G4UIcmdWithAnIntegerfPrtHistoCmd
 
HistofHisto
 
G4UIcmdWithAStringfFactoryCmd
 
G4UIcmdWithAStringfFileCmd
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Constructor & Destructor Documentation

◆ HistoMessenger() [1/5]

HistoMessenger::HistoMessenger ( HistoManager manager)

Definition at line 48 of file electromagnetic/TestEm17/src/HistoMessenger.cc.

49 :G4UImessenger(),fHistoManager (manager),
50  fHistoDir(0),
51  fFileNameCmd(0),
52  fHistoCmd(0),
53  fPrtHistoCmd(0)
54 {
55  fHistoDir = new G4UIdirectory("/testem/histo/");
56  fHistoDir->SetGuidance("histograms control");
57 
58  fFileNameCmd = new G4UIcmdWithAString("/testem/histo/setFileName",this);
59  fFileNameCmd->SetGuidance("set name for the histograms file");
60 
61  fHistoCmd = new G4UIcommand("/testem/histo/setHisto",this);
62  fHistoCmd->SetGuidance("Set bining of the histo number ih :");
63  fHistoCmd->SetGuidance(" nbBins; valMin; valMax; unit (of vmin and vmax)");
64  //
65  G4UIparameter* ih = new G4UIparameter("ih",'i',false);
66  ih->SetGuidance("histo number : from 1 to MaxHisto");
67  ih->SetParameterRange("ih>0");
69  //
70  G4UIparameter* nbBins = new G4UIparameter("nbBins",'i',false);
71  nbBins->SetGuidance("number of bins");
72  nbBins->SetParameterRange("nbBins>0");
73  fHistoCmd->SetParameter(nbBins);
74  //
75  G4UIparameter* valMin = new G4UIparameter("valMin",'d',false);
76  valMin->SetGuidance("valMin, expressed in unit");
77  fHistoCmd->SetParameter(valMin);
78  //
79  G4UIparameter* valMax = new G4UIparameter("valMax",'d',false);
80  valMax->SetGuidance("valMax, expressed in unit");
81  fHistoCmd->SetParameter(valMax);
82  //
83  G4UIparameter* unit = new G4UIparameter("unit",'s',true);
84  unit->SetGuidance("if omitted, vmin and vmax are assumed dimensionless");
85  unit->SetDefaultValue("none");
86  fHistoCmd->SetParameter(unit);
87 
88  fPrtHistoCmd = new G4UIcmdWithAnInteger("/testem/histo/printHisto",this);
89  fPrtHistoCmd->SetGuidance("print histo #id on ascii file");
90  fPrtHistoCmd->SetParameterName("id",false);
91  fPrtHistoCmd->SetRange("id>0");
92 }
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterRange(const char *theRange)
void SetDefaultValue(const char *theDefaultValue)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void SetGuidance(const char *theGuidance)
Here is the call graph for this function:

◆ ~HistoMessenger() [1/5]

HistoMessenger::~HistoMessenger ( )

Definition at line 96 of file electromagnetic/TestEm17/src/HistoMessenger.cc.

Here is the caller graph for this function:

◆ HistoMessenger() [2/5]

HistoMessenger::HistoMessenger ( Histo hist)

Definition at line 46 of file electromagnetic/TestEm9/src/HistoMessenger.cc.

47  :G4UImessenger(),fHisto(hist),
48  fHistoDir(0),
49  fFactoryCmd(0),
50  fFileCmd(0),
51  fHistoCmd(0)
52 {
53  fHistoDir = new G4UIdirectory("/testem/histo/");
54  fHistoDir->SetGuidance("histograms control");
55 
56  fFactoryCmd = new G4UIcmdWithAString("/testem/histo/fileName",this);
57  fFactoryCmd->SetGuidance("set name for the histograms file");
58 
59  fFileCmd = new G4UIcmdWithAString("/testem/histo/fileType",this);
60  fFileCmd->SetGuidance("set type (hbook, XML) for the histograms file");
61 
62  fHistoCmd = new G4UIcommand("/testem/histo/setHisto",this);
63  fHistoCmd->SetGuidance("Set bining of the histo number ih :");
64  fHistoCmd->SetGuidance(" nbBins; valMin; valMax; unit (of vmin and vmax)");
65  //
66  G4UIparameter* ih = new G4UIparameter("ih",'i',false);
67  ih->SetGuidance("histo number : from 0 to MaxHisto-1");
69  //
70  G4UIparameter* nbBins = new G4UIparameter("nbBins",'i',false);
71  nbBins->SetGuidance("number of bins");
72  nbBins->SetParameterRange("nbBins>0");
73  fHistoCmd->SetParameter(nbBins);
74  //
75  G4UIparameter* valMin = new G4UIparameter("valMin",'d',false);
76  valMin->SetGuidance("valMin, expressed in unit");
77  fHistoCmd->SetParameter(valMin);
78  //
79  G4UIparameter* valMax = new G4UIparameter("valMax",'d',false);
80  valMax->SetGuidance("valMax, expressed in unit");
81  fHistoCmd->SetParameter(valMax);
82  //
83  G4UIparameter* unit = new G4UIparameter("unit",'s',true);
84  unit->SetGuidance("if omitted, vmin and vmax are assumed dimensionless");
85  unit->SetDefaultValue("none");
86  fHistoCmd->SetParameter(unit);
87 
88 }
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
void SetParameterRange(const char *theRange)
void SetDefaultValue(const char *theDefaultValue)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void SetGuidance(const char *theGuidance)
Here is the call graph for this function:

◆ ~HistoMessenger() [2/5]

virtual HistoMessenger::~HistoMessenger ( )
virtual

◆ HistoMessenger() [3/5]

HistoMessenger::HistoMessenger ( Histo )

◆ ~HistoMessenger() [3/5]

HistoMessenger::~HistoMessenger ( )

◆ HistoMessenger() [4/5]

HistoMessenger::HistoMessenger ( Histo )

◆ ~HistoMessenger() [4/5]

virtual HistoMessenger::~HistoMessenger ( )
virtual

◆ HistoMessenger() [5/5]

HistoMessenger::HistoMessenger ( Histo )

◆ ~HistoMessenger() [5/5]

virtual HistoMessenger::~HistoMessenger ( )
virtual

Member Function Documentation

◆ SetNewValue() [1/5]

virtual void HistoMessenger::SetNewValue ( G4UIcommand ,
G4String   
)
virtual

Reimplemented from G4UImessenger.

◆ SetNewValue() [2/5]

virtual void HistoMessenger::SetNewValue ( G4UIcommand ,
G4String   
)
virtual

Reimplemented from G4UImessenger.

◆ SetNewValue() [3/5]

virtual void HistoMessenger::SetNewValue ( G4UIcommand ,
G4String   
)
virtual

Reimplemented from G4UImessenger.

◆ SetNewValue() [4/5]

void HistoMessenger::SetNewValue ( G4UIcommand command,
G4String  newValues 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 106 of file electromagnetic/TestEm17/src/HistoMessenger.cc.

107 {
108  if (command == fFileNameCmd)
109  fHistoManager->SetFileName(newValues);
110 
111  if (command == fHistoCmd)
112  { G4int ih,nbBins; G4double vmin,vmax; G4String unit;
113  const char* t = newValues;
114  std::istringstream is(t);
115  is >> ih >> nbBins >> vmin >> vmax >> unit;
116  fHistoManager->SetHisto (ih,nbBins,vmin,vmax,unit);
117  }
118 
119  if (command == fPrtHistoCmd)
121 }
static G4int GetNewIntValue(const char *paramString)
int G4int
Definition: G4Types.hh:78
void SetHisto(G4int, G4int, G4double, G4double, const G4String &unit="none")
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetNewValue() [5/5]

virtual void HistoMessenger::SetNewValue ( G4UIcommand ,
G4String   
)
virtual

Reimplemented from G4UImessenger.

Member Data Documentation

◆ fFactoryCmd

G4UIcmdWithAString * HistoMessenger::fFactoryCmd
private

◆ fFileCmd

G4UIcmdWithAString * HistoMessenger::fFileCmd
private

◆ fFileNameCmd

G4UIcmdWithAString* HistoMessenger::fFileNameCmd
private

◆ fHisto

Histo * HistoMessenger::fHisto
private

◆ fHistoCmd

G4UIcommand * HistoMessenger::fHistoCmd
private

◆ fHistoDir

G4UIdirectory * HistoMessenger::fHistoDir
private

◆ fHistoManager

HistoManager* HistoMessenger::fHistoManager
private

◆ fPrtHistoCmd

G4UIcmdWithAnInteger* HistoMessenger::fPrtHistoCmd
private

The documentation for this class was generated from the following files: