// // ******************************************************************** // * 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 "G4Cons.hh" #include "G4LogicalVolume.hh" #include "G4NistManager.hh" #include "G4PVPlacement.hh" #include "G4SystemOfUnits.hh" #include "G4Trd.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* Lead = nist->FindOrBuildMaterial("G4_Pb"); // Construct volumes // auto world_box = new G4Box("world_box", 17.*cm, 17.*cm, 17.*cm); auto world_log = new G4LogicalVolume(world_box, Vaccum, "world_log"); auto world_phys = new G4PVPlacement(G4Transform3D(), world_log, "world_phys", nullptr, false, 0, checkOverlaps); auto experimentalHall_box = new G4Box("experimentaHall_box", 15.01*cm, 15.01*cm, 15.01*cm); auto experimentalHall_log = new G4LogicalVolume(experimentalHall_box, Vaccum, "experimentalHall_log"); new G4PVPlacement(G4Transform3D(), experimentalHall_log, "experimentalHall_phys", world_log, false, 0, checkOverlaps); auto det_box = new G4Box("det_box", 5.*cm, 5.*cm, 0.001*mm); auto det_log = new G4LogicalVolume(det_box, Lead, "det_log"); new G4PVPlacement(G4TranslateY3D(-5.*cm)*G4RotateX3D(270.*deg), det_log, "det_phys", experimentalHall_log, false, 0, checkOverlaps); fScoringVolume = world_log; return world_phys; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... } // namespace B1