Geant4  10.00.p02
F02DetectorMessenger.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
28 //
29 //
30 // $Id: F02DetectorMessenger.cc 77123 2013-11-21 16:13:28Z gcosmo $
31 //
32 //
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35 
36 #include "F02DetectorMessenger.hh"
37 
39 #include "G4UIcmdWithAString.hh"
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 
46  : G4UImessenger(),
47  fDetector(det),
48  fDetDir(0),
49  fAbsMaterCmd(0),
50  fAbsThickCmd(0),
51  fAbsRadCmd(0),
52  fAbsZposCmd(0),
53  fWorldMaterCmd(0),
54  fWorldZCmd(0),
55  fWorldRCmd(0)
56 {
57  fDetDir = new G4UIdirectory("/calor/");
58  fDetDir->SetGuidance("F02 detector control.");
59 
60  fAbsMaterCmd = new G4UIcmdWithAString("/calor/setAbsMat",this);
61  fAbsMaterCmd->SetGuidance("Select Material of the Absorber.");
62  fAbsMaterCmd->SetParameterName("choice",true);
66 
67  fWorldMaterCmd = new G4UIcmdWithAString("/calor/setWorldMat",this);
68  fWorldMaterCmd->SetGuidance("Select Material of the World.");
69  fWorldMaterCmd->SetParameterName("wchoice",true);
73 
74  fAbsThickCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsThick",this);
75  fAbsThickCmd->SetGuidance("Set Thickness of the Absorber");
76  fAbsThickCmd->SetParameterName("SizeZ",false,false);
78  fAbsThickCmd->SetRange("SizeZ>0.");
81 
82  fAbsRadCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsRad",this);
83  fAbsRadCmd->SetGuidance("Set radius of the Absorber");
84  fAbsRadCmd->SetParameterName("SizeR",false,false);
86  fAbsRadCmd->SetRange("SizeR>0.");
89 
90  fAbsZposCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsZpos",this);
91  fAbsZposCmd->SetGuidance("Set Z pos. of the Absorber");
92  fAbsZposCmd->SetParameterName("Zpos",false,false);
96 
97  fWorldZCmd = new G4UIcmdWithADoubleAndUnit("/calor/setWorldZ",this);
98  fWorldZCmd->SetGuidance("Set Z size of the World");
99  fWorldZCmd->SetParameterName("WSizeZ",false,false);
100  fWorldZCmd->SetDefaultUnit("mm");
101  fWorldZCmd->SetRange("WSizeZ>0.");
104 
105  fWorldRCmd = new G4UIcmdWithADoubleAndUnit("/calor/setWorldR",this);
106  fWorldRCmd->SetGuidance("Set R size of the World");
107  fWorldRCmd->SetParameterName("WSizeR",false,false);
108  fWorldRCmd->SetDefaultUnit("mm");
109  fWorldRCmd->SetRange("WSizeR>0.");
112 }
113 
114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
115 
117 {
118  delete fAbsMaterCmd;
119  delete fAbsThickCmd;
120  delete fAbsRadCmd;
121  delete fAbsZposCmd;
122  delete fWorldMaterCmd;
123  delete fWorldZCmd;
124  delete fWorldRCmd;
125  delete fDetDir;
126 }
127 
128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
129 
131 {
132  if( command == fAbsMaterCmd )
133  { fDetector->SetAbsorberMaterial(newValue);}
134 
135  if( command == fWorldMaterCmd )
136  { fDetector->SetWorldMaterial(newValue);}
137 
138  if( command == fAbsThickCmd )
140 
141  if( command == fAbsRadCmd )
143 
144  if( command == fAbsZposCmd )
146 
147  if( command == fWorldZCmd )
149 
150  if( command == fWorldRCmd )
152 }
153 
154 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithADoubleAndUnit * fWorldRCmd
G4UIcmdWithAString * fWorldMaterCmd
G4UIcmdWithAString * fAbsMaterCmd
F02DetectorConstruction * fDetector
void SetToBeBroadcasted(G4bool val)
Definition: G4UIcommand.hh:184
G4UIcmdWithADoubleAndUnit * fWorldZCmd
static G4double GetNewDoubleValue(const char *paramString)
Definition of the F02DetectorConstruction class.
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
Definition of the F02DetectorMessenger class.
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:225
G4UIcmdWithADoubleAndUnit * fAbsThickCmd
void SetDefaultValue(const char *defVal)
void SetDefaultUnit(const char *defUnit)
virtual void SetNewValue(G4UIcommand *, G4String)
G4UIcmdWithADoubleAndUnit * fAbsZposCmd
F02DetectorMessenger(F02DetectorConstruction *)
G4UIcmdWithADoubleAndUnit * fAbsRadCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)