Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE06DetectorMessenger Class Reference

#include <RE06DetectorMessenger.hh>

Inheritance diagram for RE06DetectorMessenger:
Collaboration diagram for RE06DetectorMessenger:

Public Member Functions

 RE06DetectorMessenger (RE06DetectorConstruction *)
 
virtual ~RE06DetectorMessenger ()
 
virtual void SetNewValue (G4UIcommand *, G4String)
 
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
 
G4bool CommandsShouldBeInMaster () 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
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Definition at line 44 of file RE06DetectorMessenger.hh.

Constructor & Destructor Documentation

RE06DetectorMessenger::RE06DetectorMessenger ( RE06DetectorConstruction det)

Definition at line 43 of file RE06DetectorMessenger.cc.

44  : G4UImessenger(),
45  fDetector(det),
46  fDirectory(0),
47  fAbsMaterialCmd(0),
48  fGapMaterialCmd(0),
49  fNumLayerCmd(0),
50  fSerialCmd(0),
51  fVerboseCmd(0),
52  fAddMaterialCmd(0)
53 {
54  fDirectory = new G4UIdirectory("/RE06/");
55  fDirectory->SetGuidance("UI commands of this example");
56 
57  G4String matList;
59  for(size_t i=0;i<G4Material::GetNumberOfMaterials();i++)
60  {
61  matList += (*matTbl)[i]->GetName();
62  matList += " ";
63  }
64 
65  fAbsMaterialCmd = new G4UIcmdWithAString("/RE06/setAbsMat",this);
66  fAbsMaterialCmd->SetGuidance("Select Material of the Absorber.");
67  fAbsMaterialCmd->SetParameterName("choice",false);
68  fAbsMaterialCmd->AvailableForStates(G4State_Idle);
69  fAbsMaterialCmd->SetCandidates(matList);
70 
71  fGapMaterialCmd = new G4UIcmdWithAString("/RE06/setGapMat",this);
72  fGapMaterialCmd->SetGuidance("Select Material of the Gap.");
73  fGapMaterialCmd->SetParameterName("choice",false);
74  fGapMaterialCmd->AvailableForStates(G4State_Idle);
75  fGapMaterialCmd->SetCandidates(matList);
76 
77  fNumLayerCmd = new G4UIcmdWithAnInteger("/RE06/numberOfLayers",this);
78  fNumLayerCmd->SetGuidance("Set number of layers.");
79  fNumLayerCmd->SetParameterName("nl",false);
80  fNumLayerCmd->AvailableForStates(G4State_Idle);
81  fNumLayerCmd->SetRange("nl>0");
82 
83  fSerialCmd = new G4UIcmdWithABool("/RE06/serialGeometry",this);
84  fSerialCmd
85  ->SetGuidance("Select calorimeters to be placed in serial or parallel.");
86  fSerialCmd->SetParameterName("serialize",false);
87  fSerialCmd->AvailableForStates(G4State_Idle);
88 
89  fVerboseCmd = new G4UIcmdWithAnInteger("/RE06/verbose",this);
90  fVerboseCmd->SetGuidance("Set verbosity level");
91  fVerboseCmd->SetParameterName("verbose",false);
92  fVerboseCmd->AvailableForStates(G4State_Idle);
93  fVerboseCmd->SetRange("verbose>=0");
94 
95  fAddMaterialCmd = new G4UIcmdWithABool("/RE06/AddMaterial",this);
96  fAddMaterialCmd->SetGuidance("Add materials ");
97  fAddMaterialCmd->SetParameterName("dummy",true);
98  fAddMaterialCmd->AvailableForStates(G4State_Idle);
99 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:587
std::vector< G4Material * > G4MaterialTable
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 AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:240
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:594
void SetCandidates(const char *candidateList)

Here is the call graph for this function:

RE06DetectorMessenger::~RE06DetectorMessenger ( )
virtual

Definition at line 103 of file RE06DetectorMessenger.cc.

104 {
105  delete fAbsMaterialCmd;
106  delete fGapMaterialCmd;
107  delete fNumLayerCmd;
108  delete fSerialCmd;
109  delete fDirectory;
110 }

Member Function Documentation

G4String RE06DetectorMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 137 of file RE06DetectorMessenger.cc.

138 {
139  G4String ans;
140  if( command == fAbsMaterialCmd ){
141  ans=fDetector->GetAbsorberMaterial();
142 
143  } else if( command == fGapMaterialCmd ){
144  ans=fDetector->GetGapMaterial();
145 
146  } else if( command == fNumLayerCmd ) {
147  ans=fNumLayerCmd->ConvertToString(fDetector->GetNumberOfLayers());
148 
149  } else if( command == fSerialCmd ){
150  ans=fSerialCmd->ConvertToString(fDetector->IsSerial());
151 
152  } else if( command == fSerialCmd ) {
153  ans=fSerialCmd->ConvertToString(fDetector->IsSerial());
154 
155  } else if( command == fVerboseCmd ) {
156  ans=fVerboseCmd->ConvertToString(fDetector->GetVerboseLevel());
157 
158  }
159  return ans;
160 }
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:372

Here is the call graph for this function:

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

Reimplemented from G4UImessenger.

Definition at line 112 of file RE06DetectorMessenger.cc.

113 {
114  if( command == fAbsMaterialCmd ) {
115  fDetector->SetAbsorberMaterial(newValue);
116 
117  } else if( command == fGapMaterialCmd ){
118  fDetector->SetGapMaterial(newValue);
119 
120  } else if( command == fNumLayerCmd ) {
121  fDetector->SetNumberOfLayers(fNumLayerCmd->GetNewIntValue(newValue));
122 
123  } else if( command == fSerialCmd ) {
124  fDetector->SetSerialGeometry(fSerialCmd->GetNewBoolValue(newValue));
125 
126  } else if( command == fVerboseCmd ) {
127  fDetector->SetVerboseLevel(fVerboseCmd->GetNewIntValue(newValue));
128 
129  } else if( command == fAddMaterialCmd ) {
130  fDetector->AddMaterial();
131  UpdateMaterialList();
132  }
133 }
static G4int GetNewIntValue(const char *paramString)
static G4bool GetNewBoolValue(const char *paramString)
void SetAbsorberMaterial(G4String materialChoice)
void SetGapMaterial(G4String materialChoice)

Here is the call graph for this function:


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