Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // 26 // 27 /// \file eventgenerator/pythia/pythia8decayer 27 /// \file eventgenerator/pythia/pythia8decayer/src/DetConstruction.cc 28 /// \brief Implementation of the DetConstructi 28 /// \brief Implementation of the DetConstruction class 29 /// 29 /// 30 /// \author J. Yarba; FNAL 30 /// \author J. Yarba; FNAL 31 31 32 #include "DetConstruction.hh" 32 #include "DetConstruction.hh" 33 33 34 #include "G4Box.hh" << 35 #include "G4LogicalVolume.hh" << 36 #include "G4Material.hh" 34 #include "G4Material.hh" 37 #include "G4NistManager.hh" 35 #include "G4NistManager.hh" 38 #include "G4PVPlacement.hh" << 36 #include "G4Box.hh" 39 #include "G4Tubs.hh" 37 #include "G4Tubs.hh" >> 38 #include "G4LogicalVolume.hh" >> 39 #include "G4PVPlacement.hh" 40 40 41 //....oooOO0OOooo........oooOO0OOooo........oo 41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 42 42 43 G4VPhysicalVolume* DetConstruction::Construct( 43 G4VPhysicalVolume* DetConstruction::Construct() 44 { 44 { 45 // Define materials via NIST manager << 46 << 47 auto worldMaterial = G4NistManager::Instance << 48 auto detMaterial = G4NistManager::Instance() << 49 << 50 // World volume << 51 45 52 G4ThreeVector worldSize(200. * CLHEP::cm, 20 << 46 // Define materials via NIST manager 53 << 47 54 fWorld = << 48 auto worldMaterial = 55 new G4PVPlacement(0, G4ThreeVector(), "wor << 49 G4NistManager::Instance()->FindOrBuildMaterial("G4_AIR"); 56 new G4LogicalVolume(new << 50 auto detMaterial = 57 << 51 G4NistManager::Instance()->FindOrBuildMaterial("G4_C"); 58 worl << 52 59 0, false, 0); << 53 // World volume >> 54 >> 55 G4ThreeVector worldSize( 200.*CLHEP::cm, 200.*CLHEP::cm, 200.*CLHEP::cm ); >> 56 >> 57 >> 58 fWorld = new G4PVPlacement( >> 59 0, G4ThreeVector(), >> 60 "world_phys", >> 61 new G4LogicalVolume( new G4Box( "world_solid", >> 62 0.5*worldSize.x(), >> 63 0.5*worldSize.y(), >> 64 0.5*worldSize.z() ), >> 65 worldMaterial, "world_log", 0, 0, 0 ), >> 66 0, >> 67 false, 0 ); 60 68 61 // "Detector" 69 // "Detector" 62 70 63 double rmin = 10. * CLHEP::cm; << 71 double rmin = 10.*CLHEP::cm; 64 double rmax = 80. * CLHEP::cm; << 72 double rmax = 80.*CLHEP::cm; 65 double zlength = 98. * CLHEP::cm; << 73 double zlength = 98.*CLHEP::cm; 66 << 74 67 G4VSolid* sDet = new G4Tubs("det_solid", rmi << 75 G4VSolid* sDet = new G4Tubs( "det_solid", 68 << 76 rmin, rmax, 0.5*zlength, 69 G4LogicalVolume* lDet = new G4LogicalVolume( << 77 0., 2.*CLHEP::pi ); 70 << 78 71 fDet = new G4PVPlacement(0, G4ThreeVector(), << 79 G4LogicalVolume* lDet = new G4LogicalVolume( sDet, detMaterial, "det_log", 72 fWorld, // it's mo << 80 0, 0, 0 ); 73 false, 0); << 81 74 << 82 fDet = new G4PVPlacement( 0, G4ThreeVector(), "det_phys", 75 // always return the root volume << 83 lDet, >> 84 fWorld, // it's mother (physical) volume >> 85 false, 0 ); >> 86 >> 87 >> 88 //always return the root volume 76 // 89 // 77 return fWorld; 90 return fWorld; >> 91 78 } 92 } 79 93 80 //....oooOO0OOooo........oooOO0OOooo........oo 94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 95 81 96