Public Member Functions | Private Attributes | List of all members
EDepSim::ModuleBuilderMessenger Class Reference

#include <EDepSimModuleBuilder.hh>

Inheritance diagram for EDepSim::ModuleBuilderMessenger:
EDepSim::BuilderMessenger

Public Member Functions

 ModuleBuilderMessenger (EDepSim::ModuleBuilder *c, const char *guide=NULL)
 
virtual ~ModuleBuilderMessenger ()
 
void SetNewValue (G4UIcommand *cmd, G4String val)
 
- Public Member Functions inherited from EDepSim::BuilderMessenger
 BuilderMessenger (EDepSim::Builder *c, const char *guide=NULL)
 
virtual ~BuilderMessenger ()
 
G4String GetDirectory (void)
 Return the name of the directory. More...
 
G4String CommandName (G4String cmd)
 Build a command name with the directory prefix. More...
 
void SetNewValue (G4UIcommand *cmd, G4String val)
 

Private Attributes

EDepSim::ModuleBuilderfBuilder
 
G4UIcmdWithoutParameter * fClearCMD
 
G4UIcmdWithAString * fAddCMD
 
G4UIcommand * fRepeatCMD
 
G4UIcmdWithADoubleAndUnit * fWidthCMD
 
G4UIcmdWithADoubleAndUnit * fHeightCMD
 

Detailed Description

Definition at line 144 of file EDepSimModuleBuilder.hh.

Constructor & Destructor Documentation

EDepSim::ModuleBuilderMessenger::ModuleBuilderMessenger ( EDepSim::ModuleBuilder c,
const char *  guide = NULL 
)
inline

Definition at line 154 of file EDepSimModuleBuilder.hh.

156  : EDepSim::BuilderMessenger(c,guide),
157  fBuilder(c) {
158  fClearCMD = new G4UIcmdWithoutParameter(CommandName("clear"),this);
159  fClearCMD->SetGuidance("Clear the component list for the FG tracker.");
160 
161  fAddCMD = new G4UIcmdWithAString(CommandName("add"),this);
162  fAddCMD->SetGuidance("Add the named component to the module."
163  " Components are added from upstream"
164  " to downstream.");
165  fAddCMD->SetParameterName("Component", false);
166 
167  fRepeatCMD = new G4UIcommand(CommandName("repeat"),this);
168  fRepeatCMD->SetGuidance("Times to repeat the last components.");
169  G4UIparameter* repParam = new G4UIparameter('i');
170  repParam->SetParameterName("Repetitions");
171  fRepeatCMD->SetParameter(repParam);
172  G4UIparameter* cntParam = new G4UIparameter('i');
173  cntParam->SetParameterName("Count");
174  fRepeatCMD->SetParameter(cntParam);
175 
176  fWidthCMD = new G4UIcmdWithADoubleAndUnit(CommandName("width"),this);
177  fWidthCMD->SetGuidance("Set the width of the module.");
178  fWidthCMD->SetParameterName("Width",false);
179  fWidthCMD->SetUnitCategory("Length");
180 
181  fHeightCMD = new G4UIcmdWithADoubleAndUnit(CommandName("height"),this);
182  fHeightCMD->SetGuidance("Set the height of the module.");
183  fHeightCMD->SetParameterName("Height",false);
184  fHeightCMD->SetUnitCategory("Length");
185  };
G4UIcmdWithADoubleAndUnit * fHeightCMD
G4UIcmdWithADoubleAndUnit * fWidthCMD
G4UIcmdWithoutParameter * fClearCMD
G4String CommandName(G4String cmd)
Build a command name with the directory prefix.
virtual EDepSim::ModuleBuilderMessenger::~ModuleBuilderMessenger ( )
inlinevirtual

Definition at line 187 of file EDepSimModuleBuilder.hh.

187  {
188  delete fClearCMD;
189  delete fAddCMD;
190  delete fRepeatCMD;
191  delete fWidthCMD;
192  delete fHeightCMD;
193  };
G4UIcmdWithADoubleAndUnit * fHeightCMD
G4UIcmdWithADoubleAndUnit * fWidthCMD
G4UIcmdWithoutParameter * fClearCMD

Member Function Documentation

void EDepSim::ModuleBuilderMessenger::SetNewValue ( G4UIcommand *  cmd,
G4String  val 
)
inline

Definition at line 195 of file EDepSimModuleBuilder.hh.

195  {
196  if (cmd==fClearCMD) {
198  }
199  else if (cmd==fAddCMD) {
201  }
202  else if (cmd==fRepeatCMD) {
203  int repetitions;
204  int count = 1;
205  std::istringstream inputs((char*)val.c_str());
206  inputs >> repetitions >> count;
207  fBuilder->SetRepetitions(repetitions,count);
208  }
209  else if (cmd==fWidthCMD) {
210  fBuilder->SetWidth(fWidthCMD->GetNewDoubleValue(val));
211  }
212  else if (cmd==fHeightCMD) {
213  fBuilder->SetHeight(fHeightCMD->GetNewDoubleValue(val));
214  }
215  else {
217  }
218  };
void SetNewValue(G4UIcommand *cmd, G4String val)
G4UIcmdWithADoubleAndUnit * fHeightCMD
void SetHeight(double w)
Set the height of the module. This is the Y dimension of the module.
void ClearComponentList(void)
Clear the list of components to be added to the FG tracker.
G4UIcmdWithADoubleAndUnit * fWidthCMD
G4UIcmdWithoutParameter * fClearCMD
void SetRepetitions(int r, int c)
void SetWidth(double w)
Set the width of the module. This is the X dimension of the module.
list cmd
Definition: getreco.py:22

Member Data Documentation

G4UIcmdWithAString* EDepSim::ModuleBuilderMessenger::fAddCMD
private

Definition at line 148 of file EDepSimModuleBuilder.hh.

EDepSim::ModuleBuilder* EDepSim::ModuleBuilderMessenger::fBuilder
private

Definition at line 146 of file EDepSimModuleBuilder.hh.

G4UIcmdWithoutParameter* EDepSim::ModuleBuilderMessenger::fClearCMD
private

Definition at line 147 of file EDepSimModuleBuilder.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::ModuleBuilderMessenger::fHeightCMD
private

Definition at line 151 of file EDepSimModuleBuilder.hh.

G4UIcommand* EDepSim::ModuleBuilderMessenger::fRepeatCMD
private

Definition at line 149 of file EDepSimModuleBuilder.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::ModuleBuilderMessenger::fWidthCMD
private

Definition at line 150 of file EDepSimModuleBuilder.hh.


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