Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 // ------------------------------------------- 28 // GEANT 4 class implementation file 29 // CERN Geneva Switzerland 30 // 31 // 32 // ------------ GammaRayTelDetectorMessen 33 // by F.Longo, R.Giannitrapani & G.S 34 // 35 // ******************************************* 36 37 #include "GammaRayTelDetectorConstruction.hh" 38 #include "GammaRayTelDetectorMessenger.hh" 39 40 #include "G4UIcmdWithADoubleAndUnit.hh" 41 #include "G4UIcmdWithAnInteger.hh" 42 #include "G4UIcmdWithAString.hh" 43 #include "G4UIcmdWithoutParameter.hh" 44 #include "G4UIdirectory.hh" 45 46 //....oooOO0OOooo........oooOO0OOooo........oo 47 48 GammaRayTelDetectorMessenger::GammaRayTelDetec 49 directory = new G4UIdirectory("/payload/"); 50 directory->SetGuidance("GammaRayTel payload 51 52 // converter material command 53 54 converterMaterialCmd = new G4UIcmdWithAStrin 55 converterMaterialCmd->SetGuidance("Select th 56 converterMaterialCmd->SetParameterName("choi 57 converterMaterialCmd->AvailableForStates(G4S 58 59 // converter thickness command 60 61 converterThicknessCmd = new G4UIcmdWithADoub 62 converterThicknessCmd->SetGuidance("Set the 63 converterThicknessCmd->SetParameterName("Siz 64 converterThicknessCmd->SetRange("Size>=0."); 65 converterThicknessCmd->SetUnitCategory("Leng 66 converterThicknessCmd->AvailableForStates(G4 67 68 // tracker silicon thickness command 69 70 siliconThicknessCmd = new G4UIcmdWithADouble 71 siliconThicknessCmd->SetGuidance("Set the th 72 siliconThicknessCmd->SetParameterName("Size" 73 siliconThicknessCmd->SetRange("Size>=0."); 74 siliconThicknessCmd->SetUnitCategory("Length 75 siliconThicknessCmd->AvailableForStates(G4St 76 77 // tracker silicon pitch command 78 79 siliconPitchCmd = new G4UIcmdWithADoubleAndU 80 siliconPitchCmd->SetGuidance("Set the pitch 81 siliconPitchCmd->SetParameterName("Size", fa 82 siliconPitchCmd->SetRange("Size>=0."); 83 siliconPitchCmd->SetUnitCategory("Length"); 84 siliconPitchCmd->AvailableForStates(G4State_ 85 86 // tracker silicon tile size command 87 88 siliconTileXYCmd = new G4UIcmdWithADoubleAnd 89 siliconTileXYCmd->SetGuidance("Set XY dimens 90 siliconTileXYCmd->SetParameterName("Size", f 91 siliconTileXYCmd->SetRange("Size>=0."); 92 siliconTileXYCmd->SetUnitCategory("Length"); 93 siliconTileXYCmd->AvailableForStates(G4State 94 95 // tracker number of silicon tiles 96 97 numberOfSiTilesCmd = new G4UIcmdWithAnIntege 98 numberOfSiTilesCmd->SetGuidance("Set the num 99 numberOfSiTilesCmd->SetParameterName("NbSiTi 100 numberOfSiTilesCmd->SetRange("NbSiTiles>0 && 101 numberOfSiTilesCmd->AvailableForStates(G4Sta 102 103 // tracker number of silicon layers 104 105 numberOfTKRLayersCmd = new G4UIcmdWithAnInte 106 numberOfTKRLayersCmd->SetGuidance("Set the n 107 numberOfTKRLayersCmd->SetParameterName("NbTK 108 numberOfTKRLayersCmd->SetRange("NbTKRLayers> 109 numberOfTKRLayersCmd->AvailableForStates(G4S 110 111 // tracker layer distance 112 113 layerDistanceCmd = new G4UIcmdWithADoubleAnd 114 layerDistanceCmd->SetGuidance("Set the dista 115 layerDistanceCmd->SetParameterName("Size", f 116 layerDistanceCmd->SetRange("Size>=0."); 117 layerDistanceCmd->SetUnitCategory("Length"); 118 layerDistanceCmd->AvailableForStates(G4State 119 120 // tracker views distance 121 122 viewsDistanceCmd = new G4UIcmdWithADoubleAnd 123 viewsDistanceCmd->SetGuidance("Set the dista 124 viewsDistanceCmd->SetParameterName("Size", f 125 viewsDistanceCmd->SetRange("Size>=0."); 126 viewsDistanceCmd->SetUnitCategory("Length"); 127 viewsDistanceCmd->AvailableForStates(G4State 128 129 // calorimeter detector thickness 130 131 calThicknessCmd = new G4UIcmdWithADoubleAndU 132 calThicknessCmd->SetGuidance("Set the thickn 133 calThicknessCmd->SetParameterName("Size", fa 134 calThicknessCmd->SetRange("Size>=0."); 135 calThicknessCmd->SetUnitCategory("Length"); 136 calThicknessCmd->AvailableForStates(G4State_ 137 138 // calorimeter, number of detectors 139 140 numberOfCALBarsCmd = new G4UIcmdWithAnIntege 141 numberOfCALBarsCmd->SetGuidance("Set the num 142 numberOfCALBarsCmd->SetParameterName("NbSiTi 143 numberOfCALBarsCmd->SetRange("NbSiTiles>0 && 144 numberOfCALBarsCmd->AvailableForStates(G4Sta 145 146 // calorimeter, number of layers 147 148 numberOfCALLayersCmd = new G4UIcmdWithAnInte 149 numberOfCALLayersCmd->SetGuidance("Set the n 150 numberOfCALLayersCmd->SetParameterName("NbCA 151 numberOfCALLayersCmd->SetRange("NbCALLayers> 152 numberOfCALLayersCmd->AvailableForStates(G4S 153 154 // anticoincidence detector thickness 155 156 acdThicknessCmd = new G4UIcmdWithADoubleAndU 157 acdThicknessCmd->SetGuidance("Set the thickn 158 acdThicknessCmd->SetParameterName("Size", fa 159 acdThicknessCmd->SetRange("Size>=0."); 160 acdThicknessCmd->SetUnitCategory("Length"); 161 acdThicknessCmd->AvailableForStates(G4State_ 162 163 // update payload geometry 164 165 updateCmd = new G4UIcmdWithoutParameter("/pa 166 updateCmd->SetGuidance("Update the geometry 167 updateCmd->SetGuidance("This command MUST be 168 updateCmd->SetGuidance("if you changed geome 169 updateCmd->AvailableForStates(G4State_Idle); 170 171 // magnetic field 172 173 magneticFieldCmd = new G4UIcmdWithADoubleAnd 174 magneticFieldCmd->SetGuidance("Define the ma 175 magneticFieldCmd->SetGuidance("Magnetic fiel 176 magneticFieldCmd->SetParameterName("Bz", fal 177 magneticFieldCmd->SetUnitCategory("Magnetic 178 magneticFieldCmd->AvailableForStates(G4State 179 } 180 181 //....oooOO0OOooo........oooOO0OOooo........oo 182 183 GammaRayTelDetectorMessenger::~GammaRayTelDete 184 delete converterMaterialCmd; 185 delete converterThicknessCmd; 186 delete numberOfSiTilesCmd; 187 delete numberOfTKRLayersCmd; 188 delete siliconTileXYCmd; 189 delete siliconPitchCmd; 190 delete siliconThicknessCmd; 191 delete layerDistanceCmd; 192 delete viewsDistanceCmd; 193 delete acdThicknessCmd; 194 delete numberOfCALLayersCmd; 195 delete numberOfCALBarsCmd; 196 delete calThicknessCmd; 197 delete updateCmd; 198 delete magneticFieldCmd; 199 delete directory; 200 } 201 202 //....oooOO0OOooo........oooOO0OOooo........oo 203 204 void GammaRayTelDetectorMessenger::SetNewValue 205 // converter 206 207 if (command == converterMaterialCmd) { 208 detector->SetConverterMaterial(newValue); 209 } else if (command == converterThicknessCmd) 210 detector->SetConverterThickness(converterT 211 } else 212 213 // tracker (TKR) 214 215 if (command == siliconTileXYCmd) { 216 detector->SetTKRTileSizeXY(siliconTileXYCm 217 } else if (command == siliconPitchCmd) { 218 detector->SetTKRSiliconPitch(siliconPitchC 219 } else if (command == siliconThicknessCmd) { 220 detector->SetTKRSiliconThickness(siliconTh 221 } else if (command == numberOfSiTilesCmd) { 222 detector->SetNbOfTKRTiles(numberOfSiTilesC 223 } else if (command == numberOfTKRLayersCmd) 224 detector->SetNbOfTKRLayers(numberOfTKRLaye 225 } else if (command == layerDistanceCmd) { 226 detector->SetTKRLayerDistance(layerDistanc 227 } else if (command == viewsDistanceCmd) { 228 detector->SetTKRViewsDistance(viewsDistanc 229 } else 230 231 // calorimeter (CAL) 232 233 if (command == numberOfCALLayersCmd) { 234 detector->SetNbOfCALLayers(numberOfCALLaye 235 } else if (command == numberOfCALBarsCmd) { 236 detector->SetNbOfCALBars(numberOfCALBarsCm 237 } else if (command == calThicknessCmd) { 238 detector->SetCALBarThickness(calThicknessC 239 } else 240 241 // anticoincidence (ACD) 242 243 if (command == acdThicknessCmd) { 244 detector->SetACDThickness(acdThicknessCmd- 245 } else if (command == updateCmd) { 246 detector->UpdateGeometry(); 247 } else if (command == magneticFieldCmd) { 248 detector->SetMagField(magneticFieldCmd->Ge 249 } 250 } 251