Geant4 Cross Reference |
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 // Author: Alfonso Mantero (Alfonso.Mantero@ge.infn.it) 29 // 30 // History: 31 // ----------- 32 // 33 // 29 Aug 2003 Alfonso Mantero created 34 // 35 // ------------------------------------------------------------------- 36 37 #ifndef XrayFluoPlaneDetectorConstruction_hh 38 #define XrayFluoPlaneDetectorConstruction_hh 1 39 40 #include "globals.hh" 41 #include "G4RotationMatrix.hh" 42 #include "G4VUserDetectorConstruction.hh" 43 #include "G4Cache.hh" 44 45 #include "XrayFluoSiLiDetectorType.hh" 46 #include "XrayFluoHPGeDetectorType.hh" 47 #include "XrayFluoSD.hh" 48 49 class G4Box; 50 class G4Sphere; 51 class G4LogicalVolume; 52 class G4VPhysicalVolume; 53 class G4Material; 54 class XrayFluoPlaneDetectorMessenger; 55 class XrayFluoNistMaterials; 56 57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 58 59 class XrayFluoPlaneDetectorConstruction : public G4VUserDetectorConstruction 60 { 61 public: 62 63 64 ~XrayFluoPlaneDetectorConstruction(); 65 66 public: 67 68 G4VPhysicalVolume* Construct(); 69 70 void ConstructSDandField(); 71 72 void UpdateGeometry(); 73 74 75 void SetPlaneMaterial(G4String newMaterial); 76 77 void SetDetectorType(G4String type); 78 79 static XrayFluoPlaneDetectorConstruction* GetInstance(); 80 81 inline void SetPlaneGranularity(G4bool granularity) 82 {planeGranularity = granularity;}; 83 84 inline void SetGrainDia(G4double size) 85 {grainDia = size;}; 86 87 void DeleteGrainObjects(); 88 89 public: 90 91 void PrintApparateParameters(); 92 93 XrayFluoVDetectorType* GetDetectorType() const; 94 95 96 G4double GetWorldSizeZ() const {return WorldSizeZ;}; 97 G4double GetWorldSizeXY() const {return WorldSizeXY;}; 98 99 G4double GetDeviceThickness() const {return DeviceThickness;}; 100 G4double GetDeviceSizeX() const {return DeviceSizeX;}; 101 G4double GetDeviceSizeY() const {return DeviceSizeY;}; 102 G4double GetPixelSizeXY() const {return PixelSizeXY;}; 103 G4double GetContactSizeXY() const {return ContactSizeXY;}; 104 105 G4int GetNbOfPixels() const {return NbOfPixels;}; //mandatory for XrayFluoSD 106 G4int GetNbOfPixelRows() const {return NbOfPixelRows;}; 107 G4int GetNbOfPixelColumns() const {return NbOfPixelColumns;}; 108 109 G4Material* GetOhmicPosMaterial() const {return OhmicPosMaterial;}; 110 G4double GetOhmicPosThickness()const {return OhmicPosThickness;}; 111 112 G4Material* GetOhmicNegMaterial() const {return OhmicNegMaterial;}; 113 G4double GetOhmicNegThickness() const {return OhmicNegThickness;}; 114 115 const G4VPhysicalVolume* GetphysiWorld() const {return physiWorld;}; 116 const G4VPhysicalVolume* GetHPGe() const {return physiHPGe;}; 117 const G4VPhysicalVolume* GetPlane() const {return physiPlane;}; 118 // const G4VPhysicalVolume* GetDia1() {return physiDia1;}; 119 // const G4VPhysicalVolume* GetDia3() {return physiDia3;}; 120 121 const G4VPhysicalVolume* GetphysiPixel() const {return physiPixel;}; 122 const G4VPhysicalVolume* GetOhmicPos() const {return physiOhmicPos;}; 123 const G4VPhysicalVolume* GetOhmicNeg() const {return physiOhmicNeg;}; 124 125 private: 126 127 XrayFluoPlaneDetectorConstruction(); 128 129 static XrayFluoPlaneDetectorConstruction* instance; 130 131 XrayFluoVDetectorType* detectorType; 132 133 G4bool planeGranularity; 134 135 G4double DeviceSizeX; 136 G4double DeviceSizeY; 137 G4double DeviceThickness; 138 139 G4Box* solidWorld; //pointer to the solid World 140 G4LogicalVolume* logicWorld; //pointer to the logical World 141 G4VPhysicalVolume* physiWorld; //pointer to the physical World 142 143 G4Box* solidHPGe; //pointer to the solid Sensor 144 G4LogicalVolume* logicHPGe; //pointer to the logical Sensor 145 G4VPhysicalVolume* physiHPGe; //pointer to the physical Sensor 146 147 G4Box* solidScreen; //pointer to the solid Screen 148 G4LogicalVolume* logicScreen; //pointer to the logical Screen 149 G4VPhysicalVolume* physiScreen; //pointer to the physical Screen 150 151 G4Box* solidPlane; //pointer to the solid Plane 152 G4LogicalVolume* logicPlane; //pointer to the logical Plane 153 G4VPhysicalVolume* physiPlane; //pointer to the physical Plane 154 155 // G4Tubs* solidDia1; //pointer to the solid Diaphragm 156 // G4LogicalVolume* logicDia1; //pointer to the logical Diaphragm 157 // G4VPhysicalVolume* physiDia1; //pointer to the physical Diaphragm 158 159 // G4Tubs* solidDia3; //pointer to the solid Diaphragm 160 // G4LogicalVolume* logicDia3; //pointer to the logical Diaphragm 161 // G4VPhysicalVolume* physiDia3; //pointer to the physical Diaphragm 162 163 G4Box* solidOhmicPos; 164 G4LogicalVolume* logicOhmicPos; 165 G4VPhysicalVolume* physiOhmicPos; 166 167 G4Box* solidOhmicNeg; 168 G4LogicalVolume* logicOhmicNeg; 169 G4VPhysicalVolume* physiOhmicNeg; 170 171 G4Box* solidPixel; 172 G4LogicalVolume* logicPixel; 173 G4VPhysicalVolume* physiPixel; 174 175 G4Sphere* solidGrain; 176 G4LogicalVolume* logicGrain; 177 G4VPhysicalVolume* physiGrain; 178 179 //materials management 180 XrayFluoNistMaterials* materials; 181 182 G4Material* screenMaterial; 183 G4Material* OhmicPosMaterial; 184 G4Material* OhmicNegMaterial; 185 G4Material* pixelMaterial; 186 G4Material* planeMaterial; 187 // G4Material* Dia1Material; 188 // G4Material* Dia3Material; 189 G4Material* defaultMaterial; 190 191 //apparate parameters 192 193 G4double OhmicPosThickness; 194 G4double OhmicNegThickness; 195 196 G4double screenSizeXY; 197 G4double screenThickness; 198 199 G4int PixelCopyNb; 200 G4int grainCopyNb; 201 G4int NbOfPixels; 202 G4int NbOfPixelRows; 203 G4int NbOfPixelColumns; 204 G4double PixelThickness; 205 G4double PixelSizeXY; 206 G4double ContactSizeXY; 207 208 G4double planeThickness; 209 G4double planeSizeXY; 210 G4double grainDia; 211 // G4double Dia1Thickness; 212 // G4double Dia1SizeXY; 213 // G4double Dia3Thickness; 214 // G4double Dia3SizeXY; 215 // G4double DiaInnerSize; 216 // G4double Dia3InnerSize; 217 218 219 public: 220 221 G4Material* GetPlaneMaterial() const {return planeMaterial;}; 222 G4Material* GetPixelMaterial() const {return pixelMaterial;}; 223 // G4Material* GetDia1Material() {return Dia1Material;}; 224 // G4Material* GetDia3Material() {return Dia3Material;}; 225 226 G4double GetPlaneThickness() const {return planeThickness;}; 227 G4double GetPlaneSizeXY() const {return planeSizeXY;}; 228 229 // G4double GetDia1Thickness() {return Dia1Thickness;}; 230 // G4double GetDia1SizeXY() {return Dia1SizeXY;}; 231 232 // G4double GetDia3Thickness() {return Dia3Thickness;}; 233 // G4double GetDia3SizeXY() {return Dia3SizeXY;}; 234 235 236 private: 237 238 239 G4double ThetaHPGe; 240 241 G4double DistDe; 242 G4double distScreen; 243 244 // G4double DistDia; 245 // G4double Dia3Dist; 246 G4double PhiHPGe; 247 // G4double PhiDia1; 248 // G4double PhiDia3; 249 // G4double AlphaDia1; 250 // G4double AlphaDia3; 251 252 253 G4RotationMatrix zRotPhiHPGe; 254 // G4RotationMatrix zRotPhiDia1; 255 // G4RotationMatrix zRotPhiDia3; 256 G4double WorldSizeXY; 257 G4double WorldSizeZ; 258 259 260 XrayFluoPlaneDetectorMessenger* detectorMessenger; //pointer to the Messenger 261 262 G4Cache<XrayFluoSD*> HPGeSD; //pointer to the sensitive detector 263 264 private: 265 266 void DefineDefaultMaterials(); 267 G4VPhysicalVolume* ConstructApparate(); 268 269 //calculates some quantities used to construct geometry 270 void ComputeApparateParameters(); 271 272 }; 273 274 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 275 276 inline void XrayFluoPlaneDetectorConstruction::ComputeApparateParameters() 277 { 278 // Compute derived parameters of the apparate 279 280 DeviceThickness = PixelThickness+OhmicNegThickness+OhmicPosThickness; 281 282 G4cout << "DeviceThickness(cm): "<< DeviceThickness/CLHEP::cm << G4endl; 283 284 DeviceSizeY =(NbOfPixelRows * std::max(ContactSizeXY,PixelSizeXY)); 285 DeviceSizeX =(NbOfPixelColumns * std::max(ContactSizeXY,PixelSizeXY)); 286 287 screenSizeXY = 2 * DeviceThickness + std::max(DeviceSizeY,DeviceSizeX); 288 289 G4cout << "DeviceSizeX(cm): "<< DeviceSizeX/CLHEP::cm <<G4endl; 290 G4cout << "DeviceSizeY(cm): "<< DeviceSizeY/CLHEP::cm << G4endl; 291 292 WorldSizeZ = (2 * (DistDe + DeviceThickness + screenThickness)) + 5*CLHEP::m; 293 WorldSizeXY = (2 * (planeSizeXY))+ 5*CLHEP::m; 294 295 } 296 297 #endif 298