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 //
28 //
29 //
30 //
31 //
32 
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35 
36 #include "DetectorMessenger.hh"
37 
38 #include "DetectorConstruction.hh"
39 #include "G4UIdirectory.hh"
40 #include "G4UIcmdWithAString.hh"
41 #include "G4UIcmdWithAnInteger.hh"
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
48 : G4UImessenger(),
49  fDetector(Det),
50  fDetDir(0),
51  fAbsMaterCmd(0),
52  fGapMaterCmd(0),
53  fAbsThickCmd(0),
54  fGapThickCmd(0),
55  fSizeYZCmd(0),
56  fNbLayersCmd(0)
57 {
58  G4bool broadcast = false;
59  fDetDir = new G4UIdirectory("/det/",broadcast);
60  fDetDir->SetGuidance("Detector control");
61 
62  fAbsMaterCmd = new G4UIcmdWithAString("/det/setAbsMat",this);
63  fAbsMaterCmd->SetGuidance("Select Material of the Absorber.");
64  fAbsMaterCmd->SetParameterName("choice",false);
66 
67  fGapMaterCmd = new G4UIcmdWithAString("/det/setGapMat",this);
68  fGapMaterCmd->SetGuidance("Select Material of the Gap.");
69  fGapMaterCmd->SetParameterName("choice",false);
71 
72  fAbsThickCmd = new G4UIcmdWithADoubleAndUnit("/det/setAbsThick",this);
73  fAbsThickCmd->SetGuidance("Set Thickness of the Absorber");
74  fAbsThickCmd->SetParameterName("Size",false);
75  fAbsThickCmd->SetRange("Size>=0.");
76  fAbsThickCmd->SetUnitCategory("Length");
78 
79  fGapThickCmd = new G4UIcmdWithADoubleAndUnit("/det/setGapThick",this);
80  fGapThickCmd->SetGuidance("Set Thickness of the Gap");
81  fGapThickCmd->SetParameterName("Size",false);
82  fGapThickCmd->SetRange("Size>=0.");
83  fGapThickCmd->SetUnitCategory("Length");
85 
86  fSizeYZCmd = new G4UIcmdWithADoubleAndUnit("/det/setSizeYZ",this);
87  fSizeYZCmd->SetGuidance("Set tranverse size of the calorimeter");
88  fSizeYZCmd->SetParameterName("Size",false);
89  fSizeYZCmd->SetRange("Size>0.");
90  fSizeYZCmd->SetUnitCategory("Length");
92 
93  fNbLayersCmd = new G4UIcmdWithAnInteger("/det/setNbOfLayers",this);
94  fNbLayersCmd->SetGuidance("Set number of layers.");
95  fNbLayersCmd->SetParameterName("NbLayers",false);
96  fNbLayersCmd->SetRange("NbLayers>0 && NbLayers<500");
98 
99 }
100 
101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
102 
104 {
105  delete fNbLayersCmd;
106  delete fAbsMaterCmd; delete fGapMaterCmd;
107  delete fAbsThickCmd; delete fGapThickCmd;
108  delete fSizeYZCmd;
109  delete fDetDir;
110 }
111 
112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
113 
115 {
116  if( command == fAbsMaterCmd ) {
117  fDetector->SetAbsorberMaterial(newValue);
118  }
119  else if( command == fGapMaterCmd ) {
120  fDetector->SetGapMaterial(newValue);
121  }
122  else if( command == fAbsThickCmd ) {
123  fDetector
125  }
126  else if( command == fGapThickCmd ) {
128  }
129  else if( command == fSizeYZCmd ) {
131  }
132  else if( command == fNbLayersCmd ) {
134  }
135 }
136 
137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......