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 /// \file B1DetectorConstruction.cc 28 /// \brief Implementation of the B1DetectorCon 29 30 #include "B1DetectorConstruction.hh" 31 32 #include "G4Box.hh" 33 #include "G4Cons.hh" 34 #include "G4LogicalVolume.hh" 35 #include "G4NistManager.hh" 36 #include "G4Orb.hh" 37 #include "G4PVPlacement.hh" 38 #include "G4RunManager.hh" 39 #include "G4Sphere.hh" 40 #include "G4SystemOfUnits.hh" 41 #include "G4Trd.hh" 42 43 //....oooOO0OOooo........oooOO0OOooo........oo 44 45 B1DetectorConstruction::B1DetectorConstruction 46 {} 47 48 //....oooOO0OOooo........oooOO0OOooo........oo 49 50 B1DetectorConstruction::~B1DetectorConstructio 51 52 //....oooOO0OOooo........oooOO0OOooo........oo 53 54 G4VPhysicalVolume* B1DetectorConstruction::Con 55 { 56 // Get nist material manager 57 G4NistManager* nist = G4NistManager::Instanc 58 59 // Envelope parameters 60 // 61 G4double env_sizeXY = 20 * cm, env_sizeZ = 3 62 G4Material* env_mat = nist->FindOrBuildMater 63 64 // Option to switch on/off checking of volum 65 // 66 G4bool checkOverlaps = true; 67 68 // 69 // World 70 // 71 G4double world_sizeXY = 1.2 * env_sizeXY; 72 G4double world_sizeZ = 1.2 * env_sizeZ; 73 G4Material* world_mat = nist->FindOrBuildMat 74 75 G4Box* solidWorld = 76 new G4Box("World", // its name 77 0.5 * world_sizeXY, 0.5 * world_ 78 79 G4LogicalVolume* logicWorld = new G4LogicalV 80 81 82 83 G4VPhysicalVolume* physWorld = new G4PVPlace 84 85 86 87 88 89 90 91 92 // 93 // Envelope 94 // 95 G4Box* solidEnv = new G4Box("Envelope", // 96 0.5 * env_sizeXY 97 98 G4LogicalVolume* logicEnv = new G4LogicalVol 99 100 101 102 new G4PVPlacement(0, // no rotation 103 G4ThreeVector(), // at (0 104 logicEnv, // its logical 105 "Envelope", // its name 106 logicWorld, // its mother 107 false, // no boolean oper 108 0, // copy number 109 checkOverlaps); // overla 110 111 // 112 // Shape 1 113 // 114 G4Material* shape1_mat = nist->FindOrBuildMa 115 G4ThreeVector pos1 = G4ThreeVector(0, 2 * cm 116 117 // Conical section shape 118 G4double shape1_rmina = 0. * cm, shape1_rmax 119 G4double shape1_rminb = 0. * cm, shape1_rmax 120 G4double shape1_hz = 3. * cm; 121 G4double shape1_phimin = 0. * deg, shape1_ph 122 G4Cons* solidShape1 = new G4Cons("Shape1", s 123 shape1_hz, 124 125 G4LogicalVolume* logicShape1 = new G4Logical 126 127 128 129 new G4PVPlacement(0, // no rotation 130 pos1, // at position 131 logicShape1, // its logic 132 "Shape1", // its name 133 logicEnv, // its mother 134 false, // no boolean oper 135 0, // copy number 136 checkOverlaps); // overla 137 138 // 139 // Shape 2 140 // 141 G4Material* shape2_mat = nist->FindOrBuildMa 142 G4ThreeVector pos2 = G4ThreeVector(0, -1 * c 143 144 // Trapezoid shape 145 G4double shape2_dxa = 12 * cm, shape2_dxb = 146 G4double shape2_dya = 10 * cm, shape2_dyb = 147 G4double shape2_dz = 6 * cm; 148 G4Trd* solidShape2 = new G4Trd("Shape2", // 149 0.5 * shape2_ 150 0.5 * shape2_ 151 152 G4LogicalVolume* logicShape2 = new G4Logical 153 154 155 156 new G4PVPlacement(0, // no rotation 157 pos2, // at position 158 logicShape2, // its logic 159 "Shape2", // its name 160 logicEnv, // its mother 161 false, // no boolean oper 162 0, // copy number 163 checkOverlaps); // overla 164 165 // Set Shape2 as scoring volume 166 // 167 fScoringVolume = logicShape2; 168 169 // 170 // always return the physical World 171 // 172 return physWorld; 173 } 174 175 //....oooOO0OOooo........oooOO0OOooo........oo 176