Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
HistoManagerMessenger Class Reference

#include <HistoManagerMessenger.hh>

Inheritance diagram for HistoManagerMessenger:
G4UImessenger G4UImessenger

Public Member Functions

 HistoManagerMessenger (HistoManager *)
 
virtual ~HistoManagerMessenger ()
 
virtual void SetNewValue (G4UIcommand *, G4String)
 
 HistoManagerMessenger (HistoManager *)
 
virtual ~HistoManagerMessenger ()
 
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
 

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
 

Detailed Description

Definition at line 59 of file Hadr00/include/HistoManagerMessenger.hh.

Constructor & Destructor Documentation

HistoManagerMessenger::HistoManagerMessenger ( HistoManager p)

Definition at line 58 of file Hadr00/src/HistoManagerMessenger.cc.

References G4UIcommand::AvailableForStates(), G4State_Idle, G4State_PreInit, G4UIcommand::SetGuidance(), G4UIcmdWithAString::SetParameterName(), G4UIcmdWithAnInteger::SetParameterName(), G4UIcmdWithADoubleAndUnit::SetParameterName(), and G4UIcmdWithADoubleAndUnit::SetUnitCategory().

59 :G4UImessenger(), fHisto(p)
60 {
61  fbinCmd = new G4UIcmdWithAnInteger("/testhadr/nBinsE",this);
62  fbinCmd->SetGuidance("Set number of bins for energy");
63  fbinCmd->SetParameterName("NEbins",false);
65 
66  fnOfAbsCmd = new G4UIcmdWithAnInteger("/testhadr/nBinsP",this);
67  fnOfAbsCmd->SetGuidance("Set number of bins for momentum");
68  fnOfAbsCmd->SetParameterName("NPbins",false);
70 
71  fpartCmd = new G4UIcmdWithAString("/testhadr/particle",this);
72  fpartCmd->SetGuidance("Set particle name");
73  fpartCmd->SetParameterName("Particle",false);
75 
76  fcsCmd = new G4UIcmdWithAString("/testhadr/targetElm",this);
77  fcsCmd->SetGuidance("Set element name");
78  fcsCmd->SetParameterName("Elm",false);
80 
81  fe1Cmd = new G4UIcmdWithADoubleAndUnit("/testhadr/minEnergy",this);
82  fe1Cmd->SetGuidance("Set min kinetic energy");
83  fe1Cmd->SetParameterName("eMin",false);
84  fe1Cmd->SetUnitCategory("Energy");
86 
87  fe2Cmd = new G4UIcmdWithADoubleAndUnit("/testhadr/maxEnergy",this);
88  fe2Cmd->SetGuidance("Set max kinetic energy");
89  fe2Cmd->SetParameterName("eMax",false);
90  fe2Cmd->SetUnitCategory("Energy");
92 
93  fp1Cmd = new G4UIcmdWithADoubleAndUnit("/testhadr/minMomentum",this);
94  fp1Cmd->SetGuidance("Set min momentum");
95  fp1Cmd->SetParameterName("pMin",false);
96  fp1Cmd->SetUnitCategory("Energy");
98 
99  fp2Cmd = new G4UIcmdWithADoubleAndUnit("/testhadr/maxMomentum",this);
100  fp2Cmd->SetGuidance("Set max momentum");
101  fp2Cmd->SetParameterName("pMax",false);
102  fp2Cmd->SetUnitCategory("Energy");
104 
105  fverbCmd = new G4UIcmdWithAnInteger("/testhadr/verbose",this);
106  fverbCmd->SetGuidance("Set verbose for ");
107  fverbCmd->SetParameterName("verb",false);
109 
110  fFCmd = new G4UIcmdWithAString("/testhadr/fileName",this);
111  fFCmd->SetGuidance("set name for the histograms file");
112 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetUnitCategory(const char *unitCategory)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:225
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
HistoManagerMessenger::~HistoManagerMessenger ( )
virtual

Definition at line 116 of file Hadr00/src/HistoManagerMessenger.cc.

117 {
118  delete fnOfAbsCmd;
119  delete fpartCmd;
120  delete fcsCmd;
121  delete fe1Cmd;
122  delete fe2Cmd;
123  delete fp1Cmd;
124  delete fp2Cmd;
125  delete fverbCmd;
126  delete fFCmd;
127 }
HistoManagerMessenger::HistoManagerMessenger ( HistoManager )
virtual HistoManagerMessenger::~HistoManagerMessenger ( )
virtual

Member Function Documentation

void HistoManagerMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 131 of file Hadr00/src/HistoManagerMessenger.cc.

References G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), G4UIcmdWithAnInteger::GetNewIntValue(), HistoManager::SetElementName(), HistoManager::SetHistoName(), HistoManager::SetMaxKinEnergy(), HistoManager::SetMaxMomentum(), HistoManager::SetMinKinEnergy(), HistoManager::SetMinMomentum(), HistoManager::SetNumberOfBinsE(), HistoManager::SetNumberOfBinsP(), HistoManager::SetParticleName(), and HistoManager::SetVerbose().

132 {
133  if( command == fbinCmd ) {
134  fHisto->SetNumberOfBinsE(fbinCmd->GetNewIntValue(newValue));
135  } else if( command == fnOfAbsCmd ) {
136  fHisto->SetNumberOfBinsP(fnOfAbsCmd->GetNewIntValue(newValue));
137  } else if( command == fverbCmd ) {
138  fHisto->SetVerbose(fverbCmd->GetNewIntValue(newValue));
139  } else if( command == fpartCmd ) {
140  fHisto->SetParticleName(newValue);
141  } else if( command == fcsCmd ) {
142  fHisto->SetElementName(newValue);
143  } else if( command == fe1Cmd ) {
144  fHisto->SetMinKinEnergy(fe1Cmd->GetNewDoubleValue(newValue));
145  } else if( command == fe2Cmd ) {
146  fHisto->SetMaxKinEnergy(fe2Cmd->GetNewDoubleValue(newValue));
147  } else if( command == fp1Cmd ) {
148  fHisto->SetMinMomentum(fp1Cmd->GetNewDoubleValue(newValue));
149  } else if( command == fp2Cmd ) {
150  fHisto->SetMaxMomentum(fp2Cmd->GetNewDoubleValue(newValue));
151  } else if( command == fFCmd ) {
152  fHisto->SetHistoName(newValue);
153  }
154 }
static G4int GetNewIntValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
virtual void HistoManagerMessenger::SetNewValue ( G4UIcommand ,
G4String   
)
virtual

Reimplemented from G4UImessenger.


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