// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // /// \file B1/src/DetectorConstruction.cc /// \brief Implementation of the B1::DetectorConstruction class #include "DetectorConstruction.hh" #include "G4Box.hh" #include "G4Tubs.hh" #include "G4Polycone.hh" #include "G4Torus.hh" #include "G4Ellipsoid.hh" #include "G4UnionSolid.hh" #include "G4Transform3D.hh" #include "G4LogicalVolume.hh" #include "G4NistManager.hh" #include "G4PVPlacement.hh" #include "G4SystemOfUnits.hh" namespace B1 { //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... G4VPhysicalVolume* DetectorConstruction::Construct() { G4bool checkOverlaps = true; // Set materials G4NistManager* nist = G4NistManager::Instance(); G4Material* Vaccum = nist->FindOrBuildMaterial("G4_Galactic"); G4Material* Germanium = nist->FindOrBuildMaterial("G4_Ge"); // Geometry parameters G4double rho = 8*mm; G4double rext = 30*mm; G4double rint = 6*mm; G4double hext = 74*mm; G4double hint = 50*mm; // Construct world auto world_box = new G4Box("world_box", 50*mm, 50*mm, 50*mm); auto world_log = new G4LogicalVolume(world_box, Vaccum, "world_log"); auto world_phys = new G4PVPlacement(G4Transform3D(), world_log, "world_phys", nullptr, false, 0, checkOverlaps); // Construct detector G4double zplane[3] = { -hext/2., hext/2. - rho, hext/2. }; G4double rinner[3] = { 0., 0., 0. }; G4double router[3] = { rext, rext, rext - rho }; auto det_polycone = new G4Polycone("det_polycone", 0., CLHEP::twopi, 3, zplane, rinner, router); auto det_torus = new G4Torus("det_torus", 0., rho, rext - rho, 0., CLHEP::twopi); auto det_union = new G4UnionSolid("det_union", det_polycone, det_torus, G4TranslateZ3D(hext/2. - rho)); auto det_log = new G4LogicalVolume(det_union, Germanium, "det_log"); new G4PVPlacement(G4Transform3D(), det_log, "det_phys", world_log, false, 0, checkOverlaps); // Construct hole G4double hcyl = hint - rint; auto hole_cylinder = new G4Tubs("hole_cylinder", 0., rint, hcyl/2., 0., CLHEP::twopi); auto hole_cylinder_log = new G4LogicalVolume(hole_cylinder, Vaccum, "hole_cylinder_log"); new G4PVPlacement(G4TranslateZ3D(-hext/2. + hcyl/2.), hole_cylinder_log, "hole_cylinder_phys", det_log, false, 0, checkOverlaps); auto hole_hemisphere = new G4Ellipsoid("hole_hemisphere", rint, rint, rint, 0., rint); auto hole_hemisphere_log = new G4LogicalVolume(hole_hemisphere, Vaccum, "hole_hemisphere_log"); new G4PVPlacement(G4TranslateZ3D(-hext/2. + hcyl), hole_hemisphere_log, "hole_hemisphere_phys", det_log, false, 0, checkOverlaps); fScoringVolume = world_log; return world_phys; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... } // namespace B1