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 /// \file DetectorConstruction.hh 27 /// \brief Definition of the DetectorConstruct 28 // 29 // 30 31 //....oooOO0OOooo........oooOO0OOooo........oo 32 //....oooOO0OOooo........oooOO0OOooo........oo 33 34 #ifndef DetectorConstruction_H 35 #define DetectorConstruction_H 1 36 37 #include "G4VUserDetectorConstruction.hh" 38 #include "globals.hh" 39 40 class G4LogicalVolume; 41 class G4VPhysicalVolume; 42 class G4FieldManager; 43 class G4UniformMagField; 44 class G4Material; 45 class DetectorMessenger; 46 47 //....oooOO0OOooo........oooOO0OOooo........oo 48 49 class DetectorConstruction : public G4VUserDet 50 { 51 public: 52 DetectorConstruction(); 53 ~DetectorConstruction(); 54 55 G4VPhysicalVolume* Construct(); 56 void ConstructSDandField(); 57 58 void SetMagField(const G4double fieldValue 59 void SetAbsorberMaterial(const G4String na 60 void SetActiveMaterial(const G4String name 61 // Use by the messenger. 62 63 inline G4Material* GetAbsorberMaterial() c 64 inline G4Material* GetActiveMaterial() con 65 66 inline void SetIsCalHomogeneous(const G4bo 67 inline void SetIsUnitInLambda(const G4bool 68 inline void SetAbsorberTotalLength(const G 69 inline void SetCalorimeterRadius(const G4d 70 inline void SetActiveLayerNumber(const G4i 71 inline void SetActiveLayerSize(const G4dou 72 // To define the calorimeter geometry. 73 74 inline void SetIsRadiusUnitInLambda(const 75 76 void UpdateGeometry(); 77 78 inline G4double GetCaloLength() const; 79 80 private: 81 void DefineMaterials(); 82 // Define all the materials. 83 84 G4VPhysicalVolume* ConstructCalorimeter(); 85 // To be invoked each time the geometry ne 86 87 G4bool AreParametersOK(); 88 // Return true if all the parameters are s 89 90 void PrintParameters(); 91 // Print the various parameters which defi 92 93 G4Material* fVacuum; 94 G4Material* fIron; 95 G4Material* fCopper; 96 G4Material* fTungsten; 97 G4Material* fLead; 98 G4Material* fUranium; 99 G4Material* fPbWO4; 100 G4Material* fPolystyrene; 101 G4Material* fLiquidArgon; 102 G4Material* fSilicon; 103 G4Material* fQuartz; 104 G4Material* fBrass; 105 G4Material* fAluminium; 106 G4Material* fGraphite; 107 G4Material* fAbsorberMaterial; 108 G4Material* fActiveMaterial; 109 110 G4LogicalVolume* fExperimentalHall_log; 111 G4VPhysicalVolume* fExperimentalHall_phys; 112 // World envelope. 113 114 G4LogicalVolume* fLogicCalo; 115 G4VPhysicalVolume* fPhysiCalo; 116 // "Calorimeter". 117 118 G4LogicalVolume* fLogicModule; 119 G4VPhysicalVolume* fPhysiModule; 120 // Module of the "calorimeter". 121 122 G4LogicalVolume* fLogicAbsorber; 123 G4VPhysicalVolume* fPhysiAbsorber; 124 // Absorber layer of the "calorimeter". 125 126 G4LogicalVolume* fLogicActive; 127 G4VPhysicalVolume* fPhysiActive; 128 // Active layer of the "calorimeter". 129 130 G4FieldManager* fFieldMgr; 131 // Pointer to the field manager. 132 133 G4UniformMagField* fUniformMagField; 134 // Pointer to the uniform magnetic field. 135 136 DetectorMessenger* fDetectorMessenger; 137 // Pointer to the Messenger. 138 139 G4bool fIsCalHomogeneous; 140 // If false then Sampling calorimeter; 141 // If true then Homogeneous calorimeter. 142 143 G4bool fIsUnitInLambda; 144 // If false then normal unit of length to 145 // If true then lambda (interaction lengt 146 147 G4double fAbsorberTotalLength; 148 // This is the total length of the absorbe 149 // in unit of length (e.g. m, cm, mm) if t 150 // otherwise in number of lambdas (interac 151 // Notice that in the case of a sampling c 152 // theIsCalHomogeneous is false), the acti 153 // in the case of an homogenous calorimete 154 // for the overall dimension of the calori 155 156 G4double fCalorimeterRadius; 157 // This is the radius of the calorimeter w 158 // in unit of length (e.g. m, cm, mm) if t 159 // otherwise in number of lambdas (interac 160 161 G4int fActiveLayerNumber; 162 G4double fActiveLayerSize; 163 // Number of active layers and length of e 164 // of length, e.g. mm): in the case of sam 165 // (i.e. theIsCalHomogeneous is false) the 166 // in the case of an homogeneous calorimet 167 // only a fictitious way to sample the lon 168 // but they are actually made of the same 169 // thickness is taken into account in theA 170 171 G4bool fIsRadiusUnitInLambda; 172 // If false then normal unit of length to 173 // If true then lambda (interaction lengt 174 // the radius bin size. 175 176 G4double fCaloLength; // total length of 177 178 // Scoring part 179 G4LogicalVolume* fLogicScoringUpDown; 180 G4VPhysicalVolume* fPhysiScoringUpstream; 181 G4VPhysicalVolume* fPhysiScoringDownstream 182 G4LogicalVolume* fLogicScoringSide; 183 G4VPhysicalVolume* fPhysiScoringSide; 184 const G4double fScoringThickness = 10.0; 185 }; 186 187 inline G4Material* DetectorConstruction::GetAb 188 { 189 return fAbsorberMaterial; 190 } 191 192 inline G4Material* DetectorConstruction::GetAc 193 { 194 return fActiveMaterial; 195 } 196 197 inline void DetectorConstruction::SetIsCalHomo 198 { 199 fIsCalHomogeneous = choice; 200 } 201 202 inline void DetectorConstruction::SetIsUnitInL 203 { 204 fIsUnitInLambda = choice; 205 } 206 207 inline void DetectorConstruction::SetAbsorberT 208 { 209 fAbsorberTotalLength = value; 210 } 211 212 inline void DetectorConstruction::SetCalorimet 213 { 214 fCalorimeterRadius = value; 215 } 216 217 inline void DetectorConstruction::SetActiveLay 218 { 219 fActiveLayerNumber = value; 220 } 221 222 inline void DetectorConstruction::SetActiveLay 223 { 224 fActiveLayerSize = value; 225 } 226 227 inline void DetectorConstruction::SetIsRadiusU 228 { 229 fIsRadiusUnitInLambda = choice; 230 } 231 232 inline G4double DetectorConstruction::GetCaloL 233 { 234 return fCaloLength; 235 } 236 237 //....oooOO0OOooo........oooOO0OOooo........oo 238 239 #endif 240