Geant4-11
ExN03DetectorMessenger.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//
26//
27//
28//
29
30//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
34
36#include "G4UIdirectory.hh"
37#include "G4UIcmdWithAString.hh"
41
42//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43
46:ExN03Detector(ExN03Det)
47{
48 N03Dir = new G4UIdirectory("/N03/");
49 N03Dir->SetGuidance("UI commands of this example");
50
51 detDir = new G4UIdirectory("/N03/det/");
52 detDir->SetGuidance("detector control");
53
54 AbsMaterCmd = new G4UIcmdWithAString("/N03/det/setAbsMat",this);
55 AbsMaterCmd->SetGuidance("Select Material of the Absorber.");
56 AbsMaterCmd->SetParameterName("choice",false);
58
59 GapMaterCmd = new G4UIcmdWithAString("/N03/det/setGapMat",this);
60 GapMaterCmd->SetGuidance("Select Material of the Gap.");
61 GapMaterCmd->SetParameterName("choice",false);
63
64 AbsThickCmd = new G4UIcmdWithADoubleAndUnit("/N03/det/setAbsThick",this);
65 AbsThickCmd->SetGuidance("Set Thickness of the Absorber");
66 AbsThickCmd->SetParameterName("Size",false);
67 AbsThickCmd->SetRange("Size>=0.");
70
71 GapThickCmd = new G4UIcmdWithADoubleAndUnit("/N03/det/setGapThick",this);
72 GapThickCmd->SetGuidance("Set Thickness of the Gap");
73 GapThickCmd->SetParameterName("Size",false);
74 GapThickCmd->SetRange("Size>=0.");
75 GapThickCmd->SetUnitCategory("Length");
77
78 SizeYZCmd = new G4UIcmdWithADoubleAndUnit("/N03/det/setSizeYZ",this);
79 SizeYZCmd->SetGuidance("Set tranverse size of the calorimeter");
80 SizeYZCmd->SetParameterName("Size",false);
81 SizeYZCmd->SetRange("Size>0.");
82 SizeYZCmd->SetUnitCategory("Length");
84
85 NbLayersCmd = new G4UIcmdWithAnInteger("/N03/det/setNbOfLayers",this);
86 NbLayersCmd->SetGuidance("Set number of layers.");
87 NbLayersCmd->SetParameterName("NbLayers",false);
88 NbLayersCmd->SetRange("NbLayers>0 && NbLayers<500");
90
91 UpdateCmd = new G4UIcmdWithoutParameter("/N03/det/update",this);
92 UpdateCmd->SetGuidance("Update calorimeter geometry.");
93 UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
94 UpdateCmd->SetGuidance("if you changed geometrical value(s).");
96
97 MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/N03/det/setField",this);
98 MagFieldCmd->SetGuidance("Define magnetic field.");
99 MagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
100 MagFieldCmd->SetParameterName("Bz",false);
101 MagFieldCmd->SetUnitCategory("Magnetic flux density");
103}
104
105//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
106
108{
109 delete NbLayersCmd;
110 delete AbsMaterCmd; delete GapMaterCmd;
111 delete AbsThickCmd; delete GapThickCmd;
112 delete SizeYZCmd; delete UpdateCmd;
113 delete MagFieldCmd;
114 delete detDir;
115 delete N03Dir;
116}
117
118//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119
121{
122 if( command == AbsMaterCmd )
124
125 if( command == GapMaterCmd )
126 { ExN03Detector->SetGapMaterial(newValue);}
127
128 if( command == AbsThickCmd )
130 ->GetNewDoubleValue(newValue));}
131
132 if( command == GapThickCmd )
134
135 if( command == SizeYZCmd )
137
138 if( command == NbLayersCmd )
140
141 if( command == UpdateCmd )
143
144 if( command == MagFieldCmd )
146}
147
148//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@ G4State_Idle
@ G4State_PreInit
G4UIcmdWithADoubleAndUnit * MagFieldCmd
G4UIcmdWithoutParameter * UpdateCmd
G4UIcmdWithAString * GapMaterCmd
G4UIcmdWithAString * AbsMaterCmd
ExN03DetectorConstruction * ExN03Detector
G4UIcmdWithADoubleAndUnit * SizeYZCmd
ExN03DetectorMessenger(ExN03DetectorConstruction *)
G4UIcmdWithADoubleAndUnit * GapThickCmd
G4UIcmdWithADoubleAndUnit * AbsThickCmd
void SetNewValue(G4UIcommand *, G4String)
G4UIcmdWithAnInteger * NbLayersCmd
void SetUnitCategory(const char *unitCategory)
static G4double GetNewDoubleValue(const char *paramString)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:156
void SetRange(const char *rs)
Definition: G4UIcommand.hh:120
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:288