[807] | 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 | // $Id: Em8DetectorConstruction.hh,v 1.9 2007/10/02 10:12:47 vnivanch Exp $ |
---|
| 28 | // GEANT4 tag $Name: $ |
---|
| 29 | // |
---|
| 30 | // |
---|
| 31 | |
---|
| 32 | #ifndef Em8DetectorConstruction_h |
---|
| 33 | #define Em8DetectorConstruction_h 1 |
---|
| 34 | |
---|
| 35 | #include "G4VUserDetectorConstruction.hh" |
---|
| 36 | #include "globals.hh" |
---|
| 37 | #include "G4ios.hh" |
---|
| 38 | |
---|
| 39 | class G4Box; |
---|
| 40 | class G4Tubs; |
---|
| 41 | class G4LogicalVolume; |
---|
| 42 | class G4VPhysicalVolume; |
---|
| 43 | class G4Material; |
---|
| 44 | class G4Region; |
---|
| 45 | class G4UniformMagField; |
---|
| 46 | class Em8DetectorMessenger; |
---|
| 47 | class Em8CalorimeterSD; |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | |
---|
| 51 | class Em8DetectorConstruction : public G4VUserDetectorConstruction |
---|
| 52 | { |
---|
| 53 | public: |
---|
| 54 | |
---|
| 55 | Em8DetectorConstruction(); |
---|
| 56 | virtual ~Em8DetectorConstruction(); |
---|
| 57 | |
---|
| 58 | void SetAbsorberMaterial (G4String); |
---|
| 59 | void SetAbsorberThickness(G4double); |
---|
| 60 | void SetAbsorberRadius(G4double); |
---|
| 61 | |
---|
| 62 | void SetAbsorberZpos(G4double); |
---|
| 63 | |
---|
| 64 | void SetWorldMaterial(G4String); |
---|
| 65 | void SetWorldSizeZ(G4double); |
---|
| 66 | void SetWorldSizeR(G4double); |
---|
| 67 | |
---|
| 68 | void SetGammaCut(G4double cut){fGammaCut = cut;}; |
---|
| 69 | void SetElectronCut(G4double cut){fElectronCut = cut;}; |
---|
| 70 | void SetPositronCut(G4double cut){fPositronCut = cut;}; |
---|
| 71 | |
---|
| 72 | G4VPhysicalVolume* Construct(); |
---|
| 73 | |
---|
| 74 | void UpdateGeometry(); |
---|
| 75 | |
---|
| 76 | void PrintCalorParameters(); |
---|
| 77 | |
---|
| 78 | G4Material* GetWorldMaterial() {return fWorldMaterial;}; |
---|
| 79 | G4double GetWorldSizeZ() {return fWorldSizeZ;}; |
---|
| 80 | G4double GetWorldSizeR() {return fWorldSizeR;}; |
---|
| 81 | |
---|
| 82 | G4double GetAbsorberZ() {return fAbsorberZ;}; |
---|
| 83 | G4double GetStartAbsZ() {return fStartAbsZ;}; |
---|
| 84 | G4double GetEndAbsZ() {return fEndAbsZ;}; |
---|
| 85 | |
---|
| 86 | G4Material* GetAbsorberMaterial() {return fAbsorberMaterial;}; |
---|
| 87 | G4double GetAbsorberThickness() {return fAbsorberThickness;}; |
---|
| 88 | G4double GetAbsorberRadius() {return fAbsorberRadius;}; |
---|
| 89 | |
---|
| 90 | const G4VPhysicalVolume* GetphysiWorld() {return fPhysicsWorld;}; |
---|
| 91 | const G4VPhysicalVolume* GetAbsorber() {return fPhysicsAbsorber;}; |
---|
| 92 | G4LogicalVolume* GetLogicalAbsorber() {return fLogicAbsorber;}; |
---|
| 93 | |
---|
| 94 | private: |
---|
| 95 | |
---|
| 96 | G4double fDelta; |
---|
| 97 | |
---|
| 98 | G4bool fWorldChanged; |
---|
| 99 | G4double fAbsorberThickness; |
---|
| 100 | G4double fAbsorberRadius; |
---|
| 101 | |
---|
| 102 | G4Material* fWindowMat ; |
---|
| 103 | G4double fWindowThick ; |
---|
| 104 | |
---|
| 105 | G4double fAbsorberZ ; |
---|
| 106 | G4double fStartAbsZ , fEndAbsZ ; |
---|
| 107 | |
---|
| 108 | G4Material* fWorldMaterial; |
---|
| 109 | G4double fWorldSizeR; |
---|
| 110 | G4double fWorldSizeZ; |
---|
| 111 | |
---|
| 112 | G4Tubs* fSolidWorld; //pointer to the solid World |
---|
| 113 | G4LogicalVolume* fLogicWorld; //pointer to the logical World |
---|
| 114 | G4VPhysicalVolume* fPhysicsWorld; //pointer to the physical World |
---|
| 115 | |
---|
| 116 | |
---|
| 117 | G4Material* fAbsorberMaterial; |
---|
| 118 | G4Tubs* fSolidAbsorber; //pointer to the solid Absorber |
---|
| 119 | G4LogicalVolume* fLogicAbsorber; //pointer to the logical Absorber |
---|
| 120 | G4VPhysicalVolume* fPhysicsAbsorber; //pointer to the physical Absorber |
---|
| 121 | |
---|
| 122 | G4double fElectronCut, fGammaCut, fPositronCut; |
---|
| 123 | |
---|
| 124 | Em8DetectorMessenger* fDetectorMessenger; //pointer to the Messenger |
---|
| 125 | Em8CalorimeterSD* fCalorimeterSD; //pointer to the sensitive detector |
---|
| 126 | G4Region* fRegGasDet; |
---|
| 127 | |
---|
| 128 | private: |
---|
| 129 | |
---|
| 130 | void DefineMaterials(); |
---|
| 131 | void ComputeCalorParameters(); |
---|
| 132 | G4VPhysicalVolume* ConstructCalorimeter(); |
---|
| 133 | |
---|
| 134 | }; |
---|
| 135 | |
---|
| 136 | ////////////////////////////////////////////////////////////////////// |
---|
| 137 | |
---|
| 138 | inline void Em8DetectorConstruction::ComputeCalorParameters() |
---|
| 139 | { |
---|
| 140 | // Compute derived parameters of the calorimeter |
---|
| 141 | |
---|
| 142 | if( !fWorldChanged ) |
---|
| 143 | { |
---|
| 144 | // WorldSizeR=2.*AbsorberRadius ; |
---|
| 145 | // WorldSizeZ=2.*AbsorberThickness ; |
---|
| 146 | } |
---|
| 147 | fWorldSizeZ = fAbsorberThickness + 2*fWindowThick + 2*fDelta; |
---|
| 148 | fWorldSizeR = fAbsorberRadius + fDelta; |
---|
| 149 | |
---|
| 150 | fStartAbsZ = fAbsorberZ - 0.5*fAbsorberThickness; |
---|
| 151 | fEndAbsZ = fAbsorberZ + 0.5*fAbsorberThickness; |
---|
| 152 | |
---|
| 153 | } |
---|
| 154 | |
---|
| 155 | #endif |
---|
| 156 | |
---|