Geant4  10.02.p03
GB03DetectorMessenger Class Reference

#include <GB03DetectorMessenger.hh>

Inheritance diagram for GB03DetectorMessenger:
Collaboration diagram for GB03DetectorMessenger:

Public Member Functions

 GB03DetectorMessenger (GB03DetectorConstruction *)
 
virtual ~GB03DetectorMessenger ()
 
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 Attributes

GB03DetectorConstructionfDetector
 
G4UIdirectoryfDirectory
 
G4UIcmdWithAStringfAbsMaterialCmd
 
G4UIcmdWithAStringfGapMaterialCmd
 
G4UIcmdWithAnIntegerfNumLayerCmd
 
G4UIcmdWithAnIntegerfVerboseCmd
 

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 43 of file GB03DetectorMessenger.hh.

Constructor & Destructor Documentation

◆ GB03DetectorMessenger()

GB03DetectorMessenger::GB03DetectorMessenger ( GB03DetectorConstruction det)

Definition at line 42 of file GB03DetectorMessenger.cc.

43  : G4UImessenger(), fDetector(det)
44 {
45  fDirectory = new G4UIdirectory("/GB03/");
46  fDirectory->SetGuidance("UI commands of this example");
47 
48  G4String matList;
50  for(size_t i=0;i<G4Material::GetNumberOfMaterials();i++)
51  {
52  matList += (*matTbl)[i]->GetName();
53  matList += " ";
54  }
55 
56  fAbsMaterialCmd = new G4UIcmdWithAString("/GB03/setAbsMat",this);
57  fAbsMaterialCmd->SetGuidance("Select Material of the Absorber.");
58  fAbsMaterialCmd->SetParameterName("choice",false);
61 
62  fGapMaterialCmd = new G4UIcmdWithAString("/GB03/setGapMat",this);
63  fGapMaterialCmd->SetGuidance("Select Material of the Gap.");
64  fGapMaterialCmd->SetParameterName("choice",false);
67 
68  fNumLayerCmd = new G4UIcmdWithAnInteger("/GB03/numberOfLayers",this);
69  fNumLayerCmd->SetGuidance("Set number of layers.");
70  fNumLayerCmd->SetParameterName("nl",false);
72  fNumLayerCmd->SetRange("nl>0");
73 
74  fVerboseCmd = new G4UIcmdWithAnInteger("/GB03/verbose",this);
75  fVerboseCmd->SetGuidance("Set verbosity level");
76  fVerboseCmd->SetParameterName("verbose",false);
78  fVerboseCmd->SetRange("verbose>=0");
79 
80 }
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:589
std::vector< G4Material * > G4MaterialTable
G4UIcmdWithAnInteger * fVerboseCmd
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
GB03DetectorConstruction * fDetector
G4UIcmdWithAnInteger * fNumLayerCmd
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:596
G4UIcmdWithAString * fAbsMaterialCmd
void SetCandidates(const char *candidateList)
G4UIcmdWithAString * fGapMaterialCmd
Here is the call graph for this function:

◆ ~GB03DetectorMessenger()

GB03DetectorMessenger::~GB03DetectorMessenger ( )
virtual

Definition at line 84 of file GB03DetectorMessenger.cc.

85 {
86  delete fAbsMaterialCmd;
87  delete fGapMaterialCmd;
88  delete fNumLayerCmd;
89  delete fVerboseCmd;
90  delete fDirectory;
91 }
G4UIcmdWithAnInteger * fVerboseCmd
G4UIcmdWithAnInteger * fNumLayerCmd
G4UIcmdWithAString * fAbsMaterialCmd
G4UIcmdWithAString * fGapMaterialCmd

Member Function Documentation

◆ GetCurrentValue()

G4String GB03DetectorMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 113 of file GB03DetectorMessenger.cc.

114 {
115  G4String ans;
116  if( command == fAbsMaterialCmd ){
118 
119  } else if( command == fGapMaterialCmd ){
120  ans=fDetector->GetGapMaterial();
121 
122  } else if( command == fNumLayerCmd ) {
124 
125  } else if( command == fVerboseCmd ) {
127 
128  }
129  return ans;
130 }
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:371
G4UIcmdWithAnInteger * fVerboseCmd
GB03DetectorConstruction * fDetector
G4UIcmdWithAnInteger * fNumLayerCmd
G4UIcmdWithAString * fAbsMaterialCmd
G4UIcmdWithAString * fGapMaterialCmd
Here is the call graph for this function:

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 95 of file GB03DetectorMessenger.cc.

96 {
97  if( command == fAbsMaterialCmd ) {
98  fDetector->SetAbsorberMaterial(newValue);
99 
100  } else if( command == fGapMaterialCmd ){
101  fDetector->SetGapMaterial(newValue);
102 
103  } else if( command == fNumLayerCmd ) {
105 
106  } else if( command == fVerboseCmd ) {
108  }
109 }
static G4int GetNewIntValue(const char *paramString)
G4UIcmdWithAnInteger * fVerboseCmd
void SetGapMaterial(G4String materialChoice)
GB03DetectorConstruction * fDetector
G4UIcmdWithAnInteger * fNumLayerCmd
G4UIcmdWithAString * fAbsMaterialCmd
void SetAbsorberMaterial(G4String materialChoice)
G4UIcmdWithAString * fGapMaterialCmd
Here is the call graph for this function:

Member Data Documentation

◆ fAbsMaterialCmd

G4UIcmdWithAString* GB03DetectorMessenger::fAbsMaterialCmd
private

Definition at line 56 of file GB03DetectorMessenger.hh.

◆ fDetector

GB03DetectorConstruction* GB03DetectorMessenger::fDetector
private

Definition at line 53 of file GB03DetectorMessenger.hh.

◆ fDirectory

G4UIdirectory* GB03DetectorMessenger::fDirectory
private

Definition at line 55 of file GB03DetectorMessenger.hh.

◆ fGapMaterialCmd

G4UIcmdWithAString* GB03DetectorMessenger::fGapMaterialCmd
private

Definition at line 57 of file GB03DetectorMessenger.hh.

◆ fNumLayerCmd

G4UIcmdWithAnInteger* GB03DetectorMessenger::fNumLayerCmd
private

Definition at line 58 of file GB03DetectorMessenger.hh.

◆ fVerboseCmd

G4UIcmdWithAnInteger* GB03DetectorMessenger::fVerboseCmd
private

Definition at line 59 of file GB03DetectorMessenger.hh.


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