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 MoviesDetectorConstruction.cc 27 /// \brief Implementation of the MoviesDetecto 28 // 29 30 #include "MoviesDetectorConstruction.hh" 31 32 #include "G4Box.hh" 33 #include "G4LogicalVolume.hh" 34 #include "G4Material.hh" 35 #include "G4NistManager.hh" 36 #include "G4PVPlacement.hh" 37 #include "G4PVReplica.hh" 38 #include "G4PhysicalConstants.hh" 39 #include "G4SystemOfUnits.hh" 40 #include "G4VisAttributes.hh" 41 42 //....oooOO0OOooo........oooOO0OOooo........oo 43 44 G4VPhysicalVolume* MoviesDetectorConstruction: 45 { 46 // Define materials 47 DefineMaterials(); 48 49 // Define volumes 50 return DefineVolumes(); 51 } 52 53 //....oooOO0OOooo........oooOO0OOooo........oo 54 55 void MoviesDetectorConstruction::DefineMateria 56 { 57 auto nistManager = G4NistManager::Instance() 58 59 // Lead material defined using NIST Manager 60 nistManager->FindOrBuildMaterial("G4_Pb"); 61 62 // Liquid argon material 63 G4double a; // mass of a mole; 64 G4double z; // z=mean number of protons; 65 G4double density; 66 new G4Material("liquidArgon", z = 18., a = 3 67 // The argon by NIST Manager is a gas with a 68 69 // Vacuum 70 nistManager->FindOrBuildMaterial("G4_Galacti 71 72 // Print materials 73 G4cout << *(G4Material::GetMaterialTable()) 74 } 75 76 //....oooOO0OOooo........oooOO0OOooo........oo 77 78 G4VPhysicalVolume* MoviesDetectorConstruction: 79 { 80 // Geometry parameters 81 const G4bool checkOverlaps = true; 82 83 // A generous world 84 const G4double worldSizeXY = 1. * m; 85 const G4double worldSizeZ = 1. * m; 86 87 // Lead-argon calorimeter 88 G4int nofLayers = 10; 89 G4double absoThickness = 10. * mm; 90 G4double gapThickness = 5. * mm; 91 G4double calorSizeXY = 10. * cm; 92 93 auto layerThickness = absoThickness + gapThi 94 auto calorThickness = nofLayers * layerThick 95 96 // Get materials 97 auto defaultMaterial = G4Material::GetMateri 98 auto absorberMaterial = G4Material::GetMater 99 auto gapMaterial = G4Material::GetMaterial(" 100 101 // World 102 auto worldS = new G4Box("World", worldSizeXY 103 104 auto worldLV = new G4LogicalVolume(worldS, 105 defaultMa 106 "World"); 107 108 auto worldPV = new G4PVPlacement(0, // no r 109 G4ThreeVect 110 worldLV, / 111 "World", / 112 0, // its 113 false, // 114 0, // copy 115 checkOverla 116 117 // Calorimeter 118 119 auto calorimeterS = 120 new G4Box("Calorimeter", calorSizeXY / 2, 121 122 auto calorLV = new G4LogicalVolume(calorimet 123 defaultMa 124 "Calorime 125 126 new G4PVPlacement(0, // no rotation 127 G4ThreeVector(), // at (0 128 calorLV, // its logical v 129 "Calorimeter", // its nam 130 worldLV, // its mother v 131 false, // no boolean oper 132 0, // copy number 133 checkOverlaps); // checki 134 135 // Layer 136 137 auto layerS = new G4Box("Layer", // its nam 138 calorSizeXY / 2, cal 139 140 auto layerLV = new G4LogicalVolume(layerS, 141 defaultMa 142 "Layer"); 143 144 new G4PVReplica("Layer", // its name 145 layerLV, // its logical vol 146 calorLV, // its mother 147 kZAxis, // axis of replicat 148 nofLayers, // number of rep 149 layerThickness); // witdth 150 151 // Absorber 152 153 auto absorberS = new G4Box("Abso", // its n 154 calorSizeXY / 2, 155 156 auto absorberLV = new G4LogicalVolume(absorb 157 absorb 158 "Abso" 159 160 new G4PVPlacement(0, // no rotation 161 G4ThreeVector(0., 0., -gap 162 absorberLV, // its logica 163 "Abso", // its name 164 layerLV, // its mother v 165 false, // no boolean oper 166 0, // copy number 167 checkOverlaps); // checki 168 169 // Gap 170 171 auto gapS = new G4Box("Gap", // its name 172 calorSizeXY / 2, calor 173 174 auto gapLV = new G4LogicalVolume(gapS, // i 175 gapMaterial 176 "Gap"); // 177 178 new G4PVPlacement(0, // no rotation 179 G4ThreeVector(0., 0., abso 180 gapLV, // its logical vol 181 "Gap", // its name 182 layerLV, // its mother v 183 false, // no boolean oper 184 0, // copy number 185 checkOverlaps); // checki 186 187 // Visualization attributes 188 worldLV->SetVisAttributes(G4VisAttributes::G 189 190 return worldPV; 191 } 192