Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DetectorMessenger.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$
31 //
32 //
34 //
35 // TestEm9: Crystal calorimeter
36 //
37 // Created: 31.01.03 V.Ivanchenko
38 //
39 // Modified:
40 //
42 //
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
47 #include "DetectorMessenger.hh"
48 
49 #include "DetectorConstruction.hh"
50 #include "G4UIdirectory.hh"
51 #include "G4UIcmdWithAString.hh"
52 #include "G4UIcmdWith3Vector.hh"
55 #include "HistoManager.hh"
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58 
60  :fDetector(det)
61 {
62  fAtestemDir = new G4UIdirectory("/testem/");
63  fAtestemDir->SetGuidance(" detector control.");
64 
65  fAMaterCmd = new G4UIcmdWithAString("/testem/det/CalMat",this);
66  fAMaterCmd->SetGuidance("Select Material for calorimeter");
67  fAMaterCmd->SetParameterName("calMaterial",false);
69 
70  fALBinCmd = new G4UIcmdWithAString("/testem/det/AbsMat",this);
71  fALBinCmd->SetGuidance("Select Material for absorber");
72  fALBinCmd->SetParameterName("absMarerial",false);
74 
75  fAl1Cmd = new G4UIcmdWithADoubleAndUnit("/testem/det/EcalLength",this);
76  fAl1Cmd->SetGuidance("Set length of Ecal");
77  fAl1Cmd->SetParameterName("lEcal",false);
78  fAl1Cmd->SetUnitCategory("Length");
79  fAl1Cmd->SetRange("lEcal>0");
81 
82  fAl2Cmd = new G4UIcmdWithADoubleAndUnit("/testem/det/EcalWidth",this);
83  fAl2Cmd->SetGuidance("Set width of Ecal crystal");
84  fAl2Cmd->SetParameterName("wEcal",false);
85  fAl2Cmd->SetUnitCategory("Length");
87 
88  fAl3Cmd = new G4UIcmdWithADoubleAndUnit("/testem/det/AbsLength",this);
89  fAl3Cmd->SetGuidance("Set length of the absorber");
90  fAl3Cmd->SetParameterName("lAbs",false);
91  fAl3Cmd->SetUnitCategory("Length");
93 
94  fAl4Cmd = new G4UIcmdWithADoubleAndUnit("/testem/det/VertexLength",this);
95  fAl4Cmd->SetGuidance("Set length of the vertex region");
96  fAl4Cmd->SetParameterName("lVert",false);
97  fAl4Cmd->SetUnitCategory("Length");
99 
100  fAl5Cmd = new G4UIcmdWithADoubleAndUnit("/testem/det/PadLength",this);
101  fAl5Cmd->SetGuidance("Set length of vertex detector");
102  fAl5Cmd->SetParameterName("lPad",false);
103  fAl5Cmd->SetUnitCategory("Length");
105 
106  fAl6Cmd = new G4UIcmdWithADoubleAndUnit("/testem/det/PadWidth",this);
107  fAl6Cmd->SetGuidance("Set width of a vertex pad");
108  fAl6Cmd->SetParameterName("wPad",false);
109  fAl6Cmd->SetUnitCategory("Length");
111 
112  fAUpdateCmd = new G4UIcmdWithoutParameter("/testem/det/update",this);
113  fAUpdateCmd->SetGuidance("Update geometry.");
114  fAUpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
115  fAUpdateCmd->SetGuidance("if you changed geometrical value(s)");
117 
118  fAaccCmd1 = new G4UIcmdWith3Vector("/testem/det/acceptance1",this);
119  fAaccCmd1->SetGuidance("set Edep and RMS");
120  fAaccCmd1->SetGuidance("acceptance values for central cell");
121  fAaccCmd1->SetParameterName("edep","rms","limit",true);
122  fAaccCmd1->SetRange("edep>0 && edep<1 && rms>0");
124 
125  fAaccCmd2 = new G4UIcmdWith3Vector("/testem/det/acceptance9",this);
126  fAaccCmd2->SetGuidance("set Edep and RMS");
127  fAaccCmd2->SetGuidance("acceptance values for 3x3 matrix");
128  fAaccCmd2->SetParameterName("edep","rms","limit",true);
129  fAaccCmd2->SetRange("edep>0 && edep<1 && rms>0");
131 
132  fAaccCmd3 = new G4UIcmdWith3Vector("/testem/det/acceptance25",this);
133  fAaccCmd3->SetGuidance("set Edep and RMS");
134  fAaccCmd3->SetGuidance("acceptance values for 5x5 matrix");
135  fAaccCmd3->SetParameterName("edep","rms","limit",true);
136  fAaccCmd3->SetRange("edep>0 && edep<1 && rms>0");
138 
139 }
140 
141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
142 
144 {
145  delete fAMaterCmd;
146  delete fALBinCmd;
147  delete fAl1Cmd;
148  delete fAl2Cmd;
149  delete fAl3Cmd;
150  delete fAl4Cmd;
151  delete fAl5Cmd;
152  delete fAl6Cmd;
153  delete fAUpdateCmd;
154  delete fAtestemDir;
155  delete fAaccCmd1;
156  delete fAaccCmd2;
157  delete fAaccCmd3;
158 }
159 
160 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
161 
163 {
164  if( command == fAMaterCmd )
165  { fDetector->SetEcalMaterial(newValue);}
166 
167  if( command == fALBinCmd )
168  { fDetector->SetAbsMaterial(newValue);}
169 
170  if( command == fAl1Cmd )
171  { fDetector->SetEcalLength(fAl1Cmd->GetNewDoubleValue(newValue));}
172 
173  if( command == fAl2Cmd )
174  { fDetector->SetEcalWidth(fAl2Cmd->GetNewDoubleValue(newValue));}
175 
176  if( command == fAl3Cmd )
177  { fDetector->SetAbsLength(fAl3Cmd->GetNewDoubleValue(newValue));}
178 
179  if( command == fAl4Cmd )
180  { fDetector->SetVertexLength(fAl4Cmd->GetNewDoubleValue(newValue));}
181 
182  if( command == fAl5Cmd )
183  { fDetector->SetPadLength(fAl5Cmd->GetNewDoubleValue(newValue));}
184 
185  if( command == fAl6Cmd )
186  { fDetector->SetPadWidth(fAl6Cmd->GetNewDoubleValue(newValue));}
187 
188  if( command == fAUpdateCmd )
189  { fDetector->UpdateGeometry();}
190 
192  if( command == fAaccCmd1 )
193  { histo->SetEdepAndRMS(0,fAaccCmd1->GetNew3VectorValue(newValue));}
194 
195  if( command == fAaccCmd2 )
196  { histo->SetEdepAndRMS(1,fAaccCmd2->GetNew3VectorValue(newValue));}
197 
198  if( command == fAaccCmd3 )
199  { histo->SetEdepAndRMS(2,fAaccCmd3->GetNew3VectorValue(newValue));}
200 
201 
202 }
203 
204 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
205