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

#include <RE05StackingActionMessenger.hh>

Inheritance diagram for RE05StackingActionMessenger:
G4UImessenger

Public Member Functions

 RE05StackingActionMessenger (RE05StackingAction *msa)
 
virtual ~RE05StackingActionMessenger ()
 
virtual void SetNewValue (G4UIcommand *command, G4String newValues)
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
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 42 of file RE05StackingActionMessenger.hh.

Constructor & Destructor Documentation

RE05StackingActionMessenger::RE05StackingActionMessenger ( RE05StackingAction msa)

Definition at line 38 of file RE05StackingActionMessenger.cc.

References G4UIcmdWithADoubleAndUnit::SetDefaultUnit(), G4UIcmdWithAnInteger::SetDefaultValue(), G4UIcommand::SetGuidance(), G4UIcmdWithAnInteger::SetParameterName(), G4UIcmdWithADoubleAndUnit::SetParameterName(), and G4UIcommand::SetRange().

39 :myAction(msa)
40 {
41  muonCmd = new G4UIcmdWithAnInteger("/mydet/reqmuon",this);
42  muonCmd->SetGuidance("Number of muon for the trigger.");
43  muonCmd->SetParameterName("N",true);
44  muonCmd->SetDefaultValue(2);
45  muonCmd->SetRange("N>=0");
46 
47  isomuonCmd = new G4UIcmdWithAnInteger("/mydet/isomuon",this);
48  isomuonCmd->SetGuidance("Number of isolated muon for the trigger.");
49  isomuonCmd->SetParameterName("N",true);
50  isomuonCmd->SetDefaultValue(2);
51  isomuonCmd->SetRange("N>=0");
52 
53  isoCmd = new G4UIcmdWithAnInteger("/mydet/isolation",this);
54  isoCmd->SetGuidance("Maximum allowed number of hits in tracker");
55  isoCmd->SetGuidance(" for an isolated muon track (includes hits by muon)");
56  isoCmd->SetParameterName("N",true);
57  isoCmd->SetDefaultValue(10);
58  isoCmd->SetRange("N>=0");
59 
60  roiCmd = new G4UIcmdWithADoubleAndUnit("/mydet/RoIangle",this);
61  roiCmd->SetGuidance("Define RoI angle");
62  roiCmd->SetParameterName("theta",true,true);
63  roiCmd->SetDefaultUnit("deg");
64 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void SetDefaultUnit(const char *defUnit)
void SetDefaultValue(G4int defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
RE05StackingActionMessenger::~RE05StackingActionMessenger ( )
virtual

Definition at line 66 of file RE05StackingActionMessenger.cc.

67 {
68  delete muonCmd;
69  delete isomuonCmd;
70  delete isoCmd;
71  delete roiCmd;
72 }

Member Function Documentation

G4String RE05StackingActionMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 86 of file RE05StackingActionMessenger.cc.

References G4UIcommand::ConvertToString(), RE05StackingAction::GetNIsolation(), RE05StackingAction::GetNRequestIsoMuon(), RE05StackingAction::GetNRequestMuon(), and RE05StackingAction::GetRoIAngle().

87 {
88  G4String cv;
89 
90  if( command==muonCmd )
91  { cv = muonCmd->ConvertToString(myAction->GetNRequestMuon()); }
92  else if( command==isomuonCmd )
93  { cv = isomuonCmd->ConvertToString(myAction->GetNRequestIsoMuon()); }
94  else if( command==isoCmd )
95  { cv = isoCmd->ConvertToString(myAction->GetNIsolation()); }
96  else if( command==roiCmd )
97  { cv = roiCmd->ConvertToString(myAction->GetRoIAngle(),"deg"); }
98 
99  return cv;
100 }
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:357
G4int GetNRequestIsoMuon() const
G4int GetNRequestMuon() const
G4double GetRoIAngle() const
G4int GetNIsolation() const
void RE05StackingActionMessenger::SetNewValue ( G4UIcommand command,
G4String  newValues 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 74 of file RE05StackingActionMessenger.cc.

References G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), G4UIcmdWithAnInteger::GetNewIntValue(), RE05StackingAction::SetNIsolation(), RE05StackingAction::SetNRequestIsoMuon(), RE05StackingAction::SetNRequestMuon(), and RE05StackingAction::SetRoIAngle().

75 {
76  if( command==muonCmd )
77  { myAction->SetNRequestMuon(muonCmd->GetNewIntValue(newValue)); }
78  else if( command==isomuonCmd )
79  { myAction->SetNRequestIsoMuon(isomuonCmd->GetNewIntValue(newValue)); }
80  else if( command==isoCmd )
81  { myAction->SetNIsolation(isoCmd->GetNewIntValue(newValue)); }
82  else if( command==roiCmd )
83  { myAction->SetRoIAngle(roiCmd->GetNewDoubleValue(newValue)); }
84 }
void SetNRequestMuon(G4int val)
static G4int GetNewIntValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
void SetRoIAngle(G4double val)
void SetNIsolation(G4int val)
void SetNRequestIsoMuon(G4int val)

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