ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DetectorMessenger.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DetectorMessenger.cc
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 //
29 //
30 // -------------------------------------------------------------
31 // GEANT4 test IBREM
32 //
33 // Authors: V.Grichine, V.Ivanchenko
34 //
35 // Modified:
36 //
37 // 18-02-03 V.Ivanchenko create
38 //
39 // -------------------------------------------------------------
40 
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43 
44 #include "DetectorMessenger.hh"
45 #include "DetectorConstruction.hh"
46 #include "G4UIdirectory.hh"
47 #include "G4UIcmdWithABool.hh"
48 #include "G4UIcmdWithAString.hh"
49 #include "G4UIcmdWithAnInteger.hh"
52 
53 //#include "g4root.hh"
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56 
58  fDetector(h)
59 {
60  fDetDir = new G4UIdirectory("/testem/");
61  fDetDir->SetGuidance("General commands");
62  fDetDir1= new G4UIdirectory("/testem/physics/");
63  fDetDir1->SetGuidance(" commands to define physics");
64  fDetDir2= new G4UIdirectory("/testem/gun/");
65  fDetDir2->SetGuidance(" commands to define gun");
66 
67  fAbsMaterCmd = new G4UIcmdWithAString("/testem/target1Material",this);
68  fAbsMaterCmd->SetGuidance("Select Material of the target1.");
69  fAbsMaterCmd->SetParameterName("Material1",false);
71 
72  fWorldMaterCmd = new G4UIcmdWithAString("/testem/target2Material",this);
73  fWorldMaterCmd->SetGuidance("Select Material of the target2.");
74  fWorldMaterCmd->SetParameterName("Material2",false);
76 
77  fAbsThickCmd = new G4UIcmdWithADoubleAndUnit("/testem/mylarZ",this);
78  fAbsThickCmd->SetGuidance("Set mylarZ");
79  fAbsThickCmd->SetParameterName("mylarZ",false);
80  fAbsThickCmd->SetUnitCategory("Length");
82 
83  fAbsGapCmd = new G4UIcmdWithADoubleAndUnit("/testem/delta",this);
84  fAbsGapCmd->SetGuidance("Set gap between absorbers");
85  fAbsGapCmd->SetParameterName("delta",false);
86  fAbsGapCmd->SetUnitCategory("Length");
88 
89  fAbsSizYZCmd = new G4UIcmdWithADoubleAndUnit("/testem/target1Z",this);
90  fAbsSizYZCmd->SetGuidance("Set targeet1Z");
91  fAbsSizYZCmd->SetParameterName("target1Z",false);
92  fAbsSizYZCmd->SetUnitCategory("Length");
94 
95  fWorldXCmd = new G4UIcmdWithADoubleAndUnit("/testem/target2Z",this);
96  fWorldXCmd->SetGuidance("Set target2Z");
97  fWorldXCmd->SetParameterName("target2Z",false);
98  fWorldXCmd->SetUnitCategory("Length");
100 
101  fXMagFieldCmd = new G4UIcmdWithADoubleAndUnit("/testem/checkShiftZ",this);
102  fXMagFieldCmd->SetGuidance("Define checkShftZ");
103  fXMagFieldCmd->SetParameterName("CheckSZ",false);
104  fXMagFieldCmd->SetUnitCategory("Length");
106 
107  fYMagFieldCmd = new G4UIcmdWithADoubleAndUnit("/testem/sdZ",this);
108  fYMagFieldCmd->SetGuidance("Define sensitive detector Z");
109  fYMagFieldCmd->SetParameterName("sdZ",false);
110  fYMagFieldCmd->SetUnitCategory("Length");
112 
113  fZMagFieldCmd = new G4UIcmdWithADoubleAndUnit("/testem/sdShiftZ",this);
114  fZMagFieldCmd->SetGuidance("Define shift of sensitive detector");
115  fZMagFieldCmd->SetParameterName("sdShiftZ",false);
116  fZMagFieldCmd->SetUnitCategory("Length");
118 
119  fNumOfAbsCmd = new G4UIcmdWithAnInteger("/testem/numberDivR",this);
120  fNumOfAbsCmd->SetGuidance("Set number divisions R");
121  fNumOfAbsCmd->SetParameterName("NR",false);
123 
124  fNumOfEvt = new G4UIcmdWithAnInteger("/testem/numberDivZ",this);
125  fNumOfEvt->SetGuidance("Set number of divisions Z");
126  fNumOfEvt->SetParameterName("NZ",false);
128 
129  fVerbCmd = new G4UIcmdWithAnInteger("/testem/verbose",this);
130  fVerbCmd->SetGuidance("Set verbose for ");
131  fVerbCmd->SetParameterName("verb",false);
133 
134  fIntCmd = new G4UIcmdWithAnInteger("/testem/numberDivE",this);
135  fIntCmd->SetGuidance("Set number of divisions E");
136  fIntCmd->SetParameterName("NZ",false);
138 
139  fDeltaECmd = new G4UIcmdWithADoubleAndUnit("/testem/maxEnergy",this);
140  fDeltaECmd->SetGuidance("Define scale of secondary energy histogram");
141  fDeltaECmd->SetParameterName("DeltaE",false);
142  fDeltaECmd->SetUnitCategory("Energy");
144 
145 }
146 
147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
148 
150 {
151  delete fDetDir;
152  delete fDetDir1;
153  delete fDetDir2;
154 
155  delete fAbsMaterCmd;
156  delete fAbsThickCmd;
157  delete fAbsGapCmd;
158  delete fAbsSizYZCmd;
159  delete fWorldMaterCmd;
160  delete fWorldXCmd;
161  delete fXMagFieldCmd;
162  delete fYMagFieldCmd;
163  delete fZMagFieldCmd;
164  delete fNumOfAbsCmd;
165  delete fNumOfEvt;
166  delete fVerbCmd;
167  delete fIntCmd;
168  delete fDeltaECmd;
169 
170 }
171 
172 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
173 
175 {
176 
177  if( command == fAbsMaterCmd )
178  { fDetector->SetTarget1Material(newValue);}
179 
180  if( command == fWorldMaterCmd )
181  { fDetector->SetTarget2Material(newValue);}
182 
183  if( command == fAbsThickCmd )
185 
186  if( command == fAbsGapCmd )
188 
189  if( command == fAbsSizYZCmd )
191 
192  if( command == fWorldXCmd )
194 
195  if( command == fXMagFieldCmd )
197 
198  if( command == fYMagFieldCmd )
199  { G4double x = fYMagFieldCmd->GetNewDoubleValue(newValue);
201  }
202 
203  if( command == fZMagFieldCmd )
205 
206  if( command == fNumOfAbsCmd )
207  {
209  }
210 
211  if( command == fNumOfEvt )
213 
214  if( command == fIntCmd )
216  if( command == fDeltaECmd )
218 
219  if( command == fVerbCmd ){
220  G4int ver = fVerbCmd->GetNewIntValue(newValue);
221  fDetector->SetVerbose(ver);
222  }
223 
224 }
225 
226 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......