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

#include <ExN03DetectorMessenger.hh>

Inheritance diagram for ExN03DetectorMessenger:
G4UImessenger

Public Member Functions

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

Constructor & Destructor Documentation

ExN03DetectorMessenger::ExN03DetectorMessenger ( ExN03DetectorConstruction ExN03Det)

Definition at line 45 of file ExN03DetectorMessenger.cc.

References G4UIcommand::AvailableForStates(), G4State_Idle, G4State_PreInit, G4UIcommand::SetGuidance(), G4UIcmdWithAString::SetParameterName(), G4UIcmdWithAnInteger::SetParameterName(), G4UIcmdWithADoubleAndUnit::SetParameterName(), G4UIcommand::SetRange(), and G4UIcmdWithADoubleAndUnit::SetUnitCategory().

47 :ExN03Detector(ExN03Det)
48 {
49  N03Dir = new G4UIdirectory("/N03/");
50  N03Dir->SetGuidance("UI commands of this example");
51 
52  detDir = new G4UIdirectory("/N03/det/");
53  detDir->SetGuidance("detector control");
54 
55  AbsMaterCmd = new G4UIcmdWithAString("/N03/det/setAbsMat",this);
56  AbsMaterCmd->SetGuidance("Select Material of the Absorber.");
57  AbsMaterCmd->SetParameterName("choice",false);
59 
60  GapMaterCmd = new G4UIcmdWithAString("/N03/det/setGapMat",this);
61  GapMaterCmd->SetGuidance("Select Material of the Gap.");
62  GapMaterCmd->SetParameterName("choice",false);
64 
65  AbsThickCmd = new G4UIcmdWithADoubleAndUnit("/N03/det/setAbsThick",this);
66  AbsThickCmd->SetGuidance("Set Thickness of the Absorber");
67  AbsThickCmd->SetParameterName("Size",false);
68  AbsThickCmd->SetRange("Size>=0.");
69  AbsThickCmd->SetUnitCategory("Length");
71 
72  GapThickCmd = new G4UIcmdWithADoubleAndUnit("/N03/det/setGapThick",this);
73  GapThickCmd->SetGuidance("Set Thickness of the Gap");
74  GapThickCmd->SetParameterName("Size",false);
75  GapThickCmd->SetRange("Size>=0.");
76  GapThickCmd->SetUnitCategory("Length");
78 
79  SizeYZCmd = new G4UIcmdWithADoubleAndUnit("/N03/det/setSizeYZ",this);
80  SizeYZCmd->SetGuidance("Set tranverse size of the calorimeter");
81  SizeYZCmd->SetParameterName("Size",false);
82  SizeYZCmd->SetRange("Size>0.");
83  SizeYZCmd->SetUnitCategory("Length");
85 
86  NbLayersCmd = new G4UIcmdWithAnInteger("/N03/det/setNbOfLayers",this);
87  NbLayersCmd->SetGuidance("Set number of layers.");
88  NbLayersCmd->SetParameterName("NbLayers",false);
89  NbLayersCmd->SetRange("NbLayers>0 && NbLayers<500");
91 
92  UpdateCmd = new G4UIcmdWithoutParameter("/N03/det/update",this);
93  UpdateCmd->SetGuidance("Update calorimeter geometry.");
94  UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
95  UpdateCmd->SetGuidance("if you changed geometrical value(s).");
96  UpdateCmd->AvailableForStates(G4State_Idle);
97 
98  MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/N03/det/setField",this);
99  MagFieldCmd->SetGuidance("Define magnetic field.");
100  MagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
101  MagFieldCmd->SetParameterName("Bz",false);
102  MagFieldCmd->SetUnitCategory("Magnetic flux density");
104 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetUnitCategory(const char *unitCategory)
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:225
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
ExN03DetectorMessenger::~ExN03DetectorMessenger ( )

Definition at line 108 of file ExN03DetectorMessenger.cc.

109 {
110  delete NbLayersCmd;
111  delete AbsMaterCmd; delete GapMaterCmd;
112  delete AbsThickCmd; delete GapThickCmd;
113  delete SizeYZCmd; delete UpdateCmd;
114  delete MagFieldCmd;
115  delete detDir;
116  delete N03Dir;
117 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 121 of file ExN03DetectorMessenger.cc.

References G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), G4UIcmdWithAnInteger::GetNewIntValue(), ExN03DetectorConstruction::SetAbsorberMaterial(), ExN03DetectorConstruction::SetAbsorberThickness(), ExN03DetectorConstruction::SetCalorSizeYZ(), ExN03DetectorConstruction::SetGapMaterial(), ExN03DetectorConstruction::SetGapThickness(), ExN03DetectorConstruction::SetMagField(), ExN03DetectorConstruction::SetNbOfLayers(), and ExN03DetectorConstruction::UpdateGeometry().

122 {
123  if( command == AbsMaterCmd )
124  { ExN03Detector->SetAbsorberMaterial(newValue);}
125 
126  if( command == GapMaterCmd )
127  { ExN03Detector->SetGapMaterial(newValue);}
128 
129  if( command == AbsThickCmd )
130  { ExN03Detector->SetAbsorberThickness(AbsThickCmd
131  ->GetNewDoubleValue(newValue));}
132 
133  if( command == GapThickCmd )
134  { ExN03Detector->SetGapThickness(GapThickCmd->GetNewDoubleValue(newValue));}
135 
136  if( command == SizeYZCmd )
137  { ExN03Detector->SetCalorSizeYZ(SizeYZCmd->GetNewDoubleValue(newValue));}
138 
139  if( command == NbLayersCmd )
140  { ExN03Detector->SetNbOfLayers(NbLayersCmd->GetNewIntValue(newValue));}
141 
142  if( command == UpdateCmd )
143  { ExN03Detector->UpdateGeometry(); }
144 
145  if( command == MagFieldCmd )
146  { ExN03Detector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));}
147 }
static G4int GetNewIntValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)

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