Geant4  10.02.p03
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
 

Private Member Functions

void UpdateMaterialList ()
 

Private Attributes

RE06DetectorConstructionfDetector
 
G4UIdirectoryfDirectory
 
G4UIcmdWithAStringfAbsMaterialCmd
 
G4UIcmdWithAStringfGapMaterialCmd
 
G4UIcmdWithAnIntegerfNumLayerCmd
 
G4UIcmdWithABoolfSerialCmd
 
G4UIcmdWithAnIntegerfVerboseCmd
 
G4UIcmdWithABoolfAddMaterialCmd
 

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::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),
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);
70 
71  fGapMaterialCmd = new G4UIcmdWithAString("/RE06/setGapMat",this);
72  fGapMaterialCmd->SetGuidance("Select Material of the Gap.");
73  fGapMaterialCmd->SetParameterName("choice",false);
76 
77  fNumLayerCmd = new G4UIcmdWithAnInteger("/RE06/numberOfLayers",this);
78  fNumLayerCmd->SetGuidance("Set number of layers.");
79  fNumLayerCmd->SetParameterName("nl",false);
81  fNumLayerCmd->SetRange("nl>0");
82 
83  fSerialCmd = new G4UIcmdWithABool("/RE06/serialGeometry",this);
85  ->SetGuidance("Select calorimeters to be placed in serial or parallel.");
86  fSerialCmd->SetParameterName("serialize",false);
88 
89  fVerboseCmd = new G4UIcmdWithAnInteger("/RE06/verbose",this);
90  fVerboseCmd->SetGuidance("Set verbosity level");
91  fVerboseCmd->SetParameterName("verbose",false);
93  fVerboseCmd->SetRange("verbose>=0");
94 
95  fAddMaterialCmd = new G4UIcmdWithABool("/RE06/AddMaterial",this);
96  fAddMaterialCmd->SetGuidance("Add materials ");
97  fAddMaterialCmd->SetParameterName("dummy",true);
99 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithAString * fAbsMaterialCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:589
std::vector< G4Material * > G4MaterialTable
G4UIcmdWithAString * fGapMaterialCmd
G4UIcmdWithAnInteger * fNumLayerCmd
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:239
G4UIcmdWithABool * fSerialCmd
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:596
RE06DetectorConstruction * fDetector
void SetCandidates(const char *candidateList)
G4UIcmdWithAnInteger * fVerboseCmd
G4UIcmdWithABool * fAddMaterialCmd
Here is the call graph for this function:

◆ ~RE06DetectorMessenger()

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 }
G4UIcmdWithAString * fAbsMaterialCmd
G4UIcmdWithAString * fGapMaterialCmd
G4UIcmdWithAnInteger * fNumLayerCmd
G4UIcmdWithABool * fSerialCmd

Member Function Documentation

◆ GetCurrentValue()

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 ){
142 
143  } else if( command == fGapMaterialCmd ){
144  ans=fDetector->GetGapMaterial();
145 
146  } else if( command == fNumLayerCmd ) {
148 
149  } else if( command == fSerialCmd ){
151 
152  } else if( command == fSerialCmd ) {
154 
155  } else if( command == fVerboseCmd ) {
157 
158  }
159  return ans;
160 }
G4UIcmdWithAString * fAbsMaterialCmd
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:371
G4UIcmdWithAString * fGapMaterialCmd
G4UIcmdWithAnInteger * fNumLayerCmd
G4UIcmdWithABool * fSerialCmd
RE06DetectorConstruction * fDetector
G4UIcmdWithAnInteger * fVerboseCmd
Here is the call graph for this function:

◆ SetNewValue()

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 ) {
122 
123  } else if( command == fSerialCmd ) {
125 
126  } else if( command == fVerboseCmd ) {
128 
129  } else if( command == fAddMaterialCmd ) {
132  }
133 }
G4UIcmdWithAString * fAbsMaterialCmd
static G4int GetNewIntValue(const char *paramString)
G4UIcmdWithAString * fGapMaterialCmd
static G4bool GetNewBoolValue(const char *paramString)
G4UIcmdWithAnInteger * fNumLayerCmd
G4UIcmdWithABool * fSerialCmd
void SetAbsorberMaterial(G4String materialChoice)
RE06DetectorConstruction * fDetector
G4UIcmdWithAnInteger * fVerboseCmd
void SetGapMaterial(G4String materialChoice)
G4UIcmdWithABool * fAddMaterialCmd
Here is the call graph for this function:

◆ UpdateMaterialList()

void RE06DetectorMessenger::UpdateMaterialList ( )
private

Definition at line 164 of file RE06DetectorMessenger.cc.

165 {
166  G4String matList;
168  for(size_t i=0;i<G4Material::GetNumberOfMaterials();i++)
169  {
170  matList += (*matTbl)[i]->GetName();
171  matList += " ";
172  }
173 
174  if(fAbsMaterialCmd !=0) {
175  fAbsMaterialCmd->SetCandidates(matList);
176  }
177  if (fGapMaterialCmd !=0) {
178  fGapMaterialCmd->SetCandidates(matList);
179  }
180 }
G4UIcmdWithAString * fAbsMaterialCmd
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:589
std::vector< G4Material * > G4MaterialTable
G4UIcmdWithAString * fGapMaterialCmd
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:596
void SetCandidates(const char *candidateList)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ fAbsMaterialCmd

G4UIcmdWithAString* RE06DetectorMessenger::fAbsMaterialCmd
private

Definition at line 59 of file RE06DetectorMessenger.hh.

◆ fAddMaterialCmd

G4UIcmdWithABool* RE06DetectorMessenger::fAddMaterialCmd
private

Definition at line 64 of file RE06DetectorMessenger.hh.

◆ fDetector

RE06DetectorConstruction* RE06DetectorMessenger::fDetector
private

Definition at line 56 of file RE06DetectorMessenger.hh.

◆ fDirectory

G4UIdirectory* RE06DetectorMessenger::fDirectory
private

Definition at line 58 of file RE06DetectorMessenger.hh.

◆ fGapMaterialCmd

G4UIcmdWithAString* RE06DetectorMessenger::fGapMaterialCmd
private

Definition at line 60 of file RE06DetectorMessenger.hh.

◆ fNumLayerCmd

G4UIcmdWithAnInteger* RE06DetectorMessenger::fNumLayerCmd
private

Definition at line 61 of file RE06DetectorMessenger.hh.

◆ fSerialCmd

G4UIcmdWithABool* RE06DetectorMessenger::fSerialCmd
private

Definition at line 62 of file RE06DetectorMessenger.hh.

◆ fVerboseCmd

G4UIcmdWithAnInteger* RE06DetectorMessenger::fVerboseCmd
private

Definition at line 63 of file RE06DetectorMessenger.hh.


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