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

#include <EDepSimBuilder.hh>

Inheritance diagram for EDepSim::BuilderMessenger:
CaptCryostatMessenger CaptDriftRegionMessenger CaptExposedMessenger CaptImmersedMessenger CaptPMTMessenger CaptWirePlaneMessenger CaptWorldMessenger EDepSim::ComponentBuilderMessenger EDepSim::ModuleBuilderMessenger MiniCaptExposedMessenger MiniCaptImmersedMessenger

Public Member Functions

 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::BuilderfBuilder
 
G4UIdirectory * fDirectory
 The UI directory for this messenger. More...
 
G4String fDirName
 The directory name for this messenger. More...
 
G4UIcmdWithADouble * fOpacityCMD
 
G4UIcmdWithADouble * fDaughterOpacityCMD
 
G4UIcmdWithABool * fCheckCMD
 
G4UIcommand * fSensitiveCMD
 
G4UIcmdWithADoubleAndUnit * fMaximumHitSagittaCMD
 
G4UIcmdWithADoubleAndUnit * fMaximumHitLengthCMD
 

Detailed Description

Definition at line 224 of file EDepSimBuilder.hh.

Constructor & Destructor Documentation

EDepSim::BuilderMessenger::BuilderMessenger ( EDepSim::Builder c,
const char *  guide = NULL 
)

Definition at line 75 of file EDepSimBuilder.cc.

76  {
77  fBuilder = c;
78  fDirName = c->GetName() + "/";
79  fDirectory = new G4UIdirectory(fDirName);
80  if (guide) {
81  fDirectory->SetGuidance(guide);
82  }
83  else {
84  std::string guidance = "Commands for the " + c->GetName() + " Builder";
85  fDirectory->SetGuidance(guidance.c_str());
86  }
87 
88  fOpacityCMD = new G4UIcmdWithADouble(CommandName("opacity"),this);
89  fOpacityCMD->SetGuidance("Set the log of the relative opacity."
90  " Useful values are between [-0.5, 0.5], and"
91  " +/-10 makes the object opague or transparent."
92  " A value of 0 leaves the opacity unchanged.");
93  fOpacityCMD->SetParameterName("opacity",false);
94 
95  fDaughterOpacityCMD = new G4UIcmdWithADouble(
96  CommandName("daughterOpacity"),this);
97  fDaughterOpacityCMD->SetGuidance(
98  "Set the log of the relative opacity of the daughters.");
99  fDaughterOpacityCMD->SetParameterName("opacity",false);
100 
101  fCheckCMD = new G4UIcmdWithABool(CommandName("check"),this);
102  fCheckCMD->SetGuidance("If this is true then check for overlaps");
103  fCheckCMD->SetParameterName("check",false);
104 
105  fSensitiveCMD = new G4UIcommand(CommandName("sensitive"),this);
106  fSensitiveCMD->SetGuidance("Set the name of the sensitive detector");
107  G4UIparameter* nameParam = new G4UIparameter('s');
108  nameParam->SetParameterName("Name");
109  fSensitiveCMD->SetParameter(nameParam);
110  G4UIparameter* typeParam = new G4UIparameter('s');
111  typeParam->SetParameterName("Type");
112  fSensitiveCMD->SetParameter(typeParam);
113 
115  = new G4UIcmdWithADoubleAndUnit(CommandName("maxHitSagitta"),this);
116  fMaximumHitSagittaCMD->SetGuidance("Set the maximum sagitta for a hit.");
117  fMaximumHitSagittaCMD->SetParameterName("Sagitta",false);
118  fMaximumHitSagittaCMD->SetUnitCategory("Length");
119 
121  = new G4UIcmdWithADoubleAndUnit(CommandName("maxHitLength"),this);
122  fMaximumHitLengthCMD->SetGuidance("Set the maximum length for a hit.");
123  fMaximumHitLengthCMD->SetParameterName("HitLength",false);
124  fMaximumHitLengthCMD->SetUnitCategory("Length");
125 }
G4String GetName(void)
Return the base name of the object that this builds.
EDepSim::Builder * fBuilder
std::string string
Definition: nybbler.cc:12
G4UIcmdWithADoubleAndUnit * fMaximumHitSagittaCMD
G4UIcmdWithADoubleAndUnit * fMaximumHitLengthCMD
G4UIcmdWithADouble * fDaughterOpacityCMD
G4UIcmdWithABool * fCheckCMD
G4UIdirectory * fDirectory
The UI directory for this messenger.
G4String fDirName
The directory name for this messenger.
G4String CommandName(G4String cmd)
Build a command name with the directory prefix.
G4UIcmdWithADouble * fOpacityCMD
EDepSim::BuilderMessenger::~BuilderMessenger ( )
virtual

Definition at line 157 of file EDepSimBuilder.cc.

157  {
158  delete fDirectory;
159  delete fOpacityCMD;
160  delete fDaughterOpacityCMD;
161  delete fCheckCMD;
162  delete fSensitiveCMD;
163  delete fMaximumHitSagittaCMD;
164  delete fMaximumHitLengthCMD;
165 }
G4UIcmdWithADoubleAndUnit * fMaximumHitSagittaCMD
G4UIcmdWithADoubleAndUnit * fMaximumHitLengthCMD
G4UIcmdWithADouble * fDaughterOpacityCMD
G4UIcmdWithABool * fCheckCMD
G4UIdirectory * fDirectory
The UI directory for this messenger.
G4UIcmdWithADouble * fOpacityCMD

Member Function Documentation

G4String EDepSim::BuilderMessenger::CommandName ( G4String  cmd)
inline

Build a command name with the directory prefix.

Definition at line 249 of file EDepSimBuilder.hh.

249  {
250  G4String name = GetDirectory() + cmd;
251  return name;
252  };
static QCString name
Definition: declinfo.cpp:673
G4String GetDirectory(void)
Return the name of the directory.
list cmd
Definition: getreco.py:22
G4String EDepSim::BuilderMessenger::GetDirectory ( void  )
inline

Return the name of the directory.

Definition at line 246 of file EDepSimBuilder.hh.

246 {return fDirName;};
G4String fDirName
The directory name for this messenger.
void EDepSim::BuilderMessenger::SetNewValue ( G4UIcommand *  cmd,
G4String  val 
)

Definition at line 127 of file EDepSimBuilder.cc.

127  {
128  if (cmd == fOpacityCMD) {
129  fBuilder->SetOpacity(fOpacityCMD->GetNewDoubleValue(val));
130  }
131  else if (cmd == fDaughterOpacityCMD) {
133  fDaughterOpacityCMD->GetNewDoubleValue(val));
134  }
135  else if (cmd == fCheckCMD) {
136  fBuilder->SetCheck(fCheckCMD->GetNewBoolValue(val));
137  }
138  else if (cmd==fSensitiveCMD) {
139  std::istringstream buf(val.c_str());
141  buf >> name;
142  buf >> type;
143  fBuilder->SetSensitiveDetector(name,type);
144  }
145  else if (cmd==fMaximumHitSagittaCMD) {
146  fBuilder->
147  SetMaximumHitSagitta(
148  fMaximumHitSagittaCMD->GetNewDoubleValue(val));
149  }
150  else if (cmd==fMaximumHitLengthCMD) {
151  fBuilder->
152  SetMaximumHitLength(
153  fMaximumHitLengthCMD->GetNewDoubleValue(val));
154  }
155 }
static QCString name
Definition: declinfo.cpp:673
EDepSim::Builder * fBuilder
std::string string
Definition: nybbler.cc:12
void SetCheck(bool v)
Set the check value.
G4UIcmdWithADoubleAndUnit * fMaximumHitSagittaCMD
G4UIcmdWithADoubleAndUnit * fMaximumHitLengthCMD
G4UIcmdWithADouble * fDaughterOpacityCMD
void SetOpacity(double v)
Set the relative opacity of the constructed object.
G4UIcmdWithABool * fCheckCMD
virtual void SetSensitiveDetector(G4VSensitiveDetector *s)
Set the sensitive detector for this component.
static QCString type
Definition: declinfo.cpp:672
list cmd
Definition: getreco.py:22
void SetDaughterOpacity(double v)
Set the relative opacity of the object daughters.
G4UIcmdWithADouble * fOpacityCMD

Member Data Documentation

EDepSim::Builder* EDepSim::BuilderMessenger::fBuilder
private

Definition at line 226 of file EDepSimBuilder.hh.

G4UIcmdWithABool* EDepSim::BuilderMessenger::fCheckCMD
private

Definition at line 236 of file EDepSimBuilder.hh.

G4UIcmdWithADouble* EDepSim::BuilderMessenger::fDaughterOpacityCMD
private

Definition at line 235 of file EDepSimBuilder.hh.

G4UIdirectory* EDepSim::BuilderMessenger::fDirectory
private

The UI directory for this messenger.

Definition at line 229 of file EDepSimBuilder.hh.

G4String EDepSim::BuilderMessenger::fDirName
private

The directory name for this messenger.

Definition at line 232 of file EDepSimBuilder.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::BuilderMessenger::fMaximumHitLengthCMD
private

Definition at line 239 of file EDepSimBuilder.hh.

G4UIcmdWithADoubleAndUnit* EDepSim::BuilderMessenger::fMaximumHitSagittaCMD
private

Definition at line 238 of file EDepSimBuilder.hh.

G4UIcmdWithADouble* EDepSim::BuilderMessenger::fOpacityCMD
private

Definition at line 234 of file EDepSimBuilder.hh.

G4UIcommand* EDepSim::BuilderMessenger::fSensitiveCMD
private

Definition at line 237 of file EDepSimBuilder.hh.


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