// // ******************************************************************** // * 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. * // ******************************************************************** // // // $Id: gamma1DetectorConstruction.cc,v 1.9 2006/06/29 17:47:19 gunter Exp $ // GEANT4 tag $Name: geant4-09-01-patch-02 $ // #include "gamma1DetectorConstruction.hh" #include "G4Material.hh" #include "G4Box.hh" #include "G4Tubs.hh" #include "G4LogicalVolume.hh" #include "G4ThreeVector.hh" #include "G4PVPlacement.hh" #include "globals.hh" #include "G4NistManager.hh" #include "G4SDManager.hh" #include "G4GeometryTolerance.hh" #include "G4GeometryManager.hh" #include "gamma1TrackerSD.hh" gamma1DetectorConstruction::gamma1DetectorConstruction() : experimentalHall_log(0), poly_log(0), air_log(0), Al_log(0), poly_phys(0), air_phys(0), Al_phys(0) {;} gamma1DetectorConstruction::~gamma1DetectorConstruction() { } G4VPhysicalVolume* gamma1DetectorConstruction::Construct() { //------------------------------------------------------ materials G4NistManager* man = G4NistManager::Instance(); G4double a; // atomic mass G4double z; // atomic number G4double density; G4String name; G4String symbol; G4double fractionmass; G4int ncomponents; // G4Material* Air = // new G4Material("Air", z= 7.8, a= 15.6*g/mole, density= 1.205*mg/cm3); // man ->FindOrBuildMaterial("G4_Air"); G4Element* elH = new G4Element(name="Hydrogen",symbol="H" , z= 1., 1.0079*g/mole); G4Element* elN = new G4Element(name="Nitrogen",symbol="N" , z= 7., 14.01*g/mole); G4Element* elO = new G4Element(name="Oxygen" ,symbol="O" , z= 8., 16.00*g/mole); G4Element* elAr = new G4Element(name="Argon",symbol="Ar" , z= 18., 39.947*g/mole); G4Material* Air = new G4Material(name="Air",density=1.205*mg/cm3,ncomponents=4); Air->AddElement(elH, fractionmass=.0124*perCent); Air->AddElement(elN, fractionmass=75.5268*perCent); Air->AddElement(elO, fractionmass=23.1781*perCent); Air->AddElement(elAr, fractionmass=1.2827*perCent); // G4Material* Poly = // new G4Material("Polyethelene", z= 6., a= 10.5*g/mole, density= 0.93*g/cm3); // man ->FindOrBuildMaterial("G4_Polyethylene"); G4Element* elC = new G4Element(name="Carbon" ,symbol="C" , z= 6., 12.011*g/mole); G4Material* Poly = new G4Material(name="Poly",density=0.93*g/cm3,ncomponents=2); Poly->AddElement(elC, fractionmass=85.6284*perCent); Poly->AddElement(elH, fractionmass=14.3716*perCent); G4Material* Al = new G4Material("Aluminum", z= 13., a= 26.98*g/mole, density= 2.7*g/cm3); G4Material* myPb = new G4Material("myPb", z= 82., a= 207.20*g/mole, density= 11.35*g/cm3); //------------------------------------------------------ volumes //------------------------------ experimental hall (world volume) //------------------------------ beam line along x axis G4double expHall_x = 40.0*cm; G4double expHall_y = 20.0*cm; G4double expHall_z = 20.0*cm; G4Box* experimentalHall_box = new G4Box("expHall_box",expHall_x,expHall_y,expHall_z); experimentalHall_log = new G4LogicalVolume(experimentalHall_box, Air,"expHall_log",0,0,0); experimentalHall_phys = new G4PVPlacement(0,G4ThreeVector(), experimentalHall_log,"expHall",0,false,0); //------------------------------ poly //G4double poly_x = 1.5*cm; // 3cm thick //G4double poly_y = 8.0*cm; //G4double poly_z = 8.0*cm; //G4Box* poly_box = new G4Box("poly_box",poly_x,poly_y,poly_z); //poly_log = new G4LogicalVolume(poly_box,Poly,"poly_log",0,0,0); //G4double polyPos_x = 0.0*cm; // cenctered at 0 //G4double polyPos_y = 0.0*cm; //G4double polyPos_z = 0.0*cm; //poly_phys = new G4PVPlacement(0, // G4ThreeVector(polyPos_x,polyPos_y,polyPos_z), // poly_log,"poly",experimentalHall_log,false,0); //------------------------------ Aluminum G4double Al_x = 0.5*mm; // 1 mm thick G4double Al_y = 9.0*cm; G4double Al_z = 9.0*cm; G4Box* Al_box = new G4Box("Al_box",Al_x,Al_y,Al_z); Al_log = new G4LogicalVolume(Al_box,Al,"Al_log",0,0,0); G4double AlPos_x = 2.55*cm; // centered at 2.55cm so left edge at 2.5cm, 1 cm from poly right edge G4double AlPos_y = 0.0*cm; G4double AlPos_z = 0.0*cm; Al_phys = new G4PVPlacement(0, G4ThreeVector(AlPos_x,AlPos_y,AlPos_z), Al_log,"Al",experimentalHall_log,false,0); //------------------------------------------------------------------ //------------------------------ air G4double air_x = 10.0*cm; // 1 cm thick G4double air_y = 1.0*mm; G4double air_z = 1.0*mm; G4Box* air_box = new G4Box("air_box",air_x,air_y,air_z); air_log = new G4LogicalVolume(air_box,myPb,"air_log",0,0,0); G4double airPos_x = 20.65*cm; // centered 0.5mm past 3.6 cm, so left edge is 0.5mm from Al right edge, at 2.6 G4double airPos_y = 0.0*m; G4double airPos_z = 0.0*m; air_phys = new G4PVPlacement(0, G4ThreeVector(airPos_x,airPos_y,airPos_z), air_log,"air",experimentalHall_log,false,0); //------------------------------------------------ // Sensitive detectors //------------------------------------------------ G4SDManager* SDman = G4SDManager::GetSDMpointer(); G4String trackerChamberSDname = "gamma1/TrackerChamberSD"; gamma1TrackerSD* aTrackerSD = new gamma1TrackerSD( trackerChamberSDname ); SDman->AddNewDetector( aTrackerSD ); // Al_log->SetSensitiveDetector( aTrackerSD ); // poly_log->SetSensitiveDetector( aTrackerSD ); air_log->SetSensitiveDetector( aTrackerSD ); return experimentalHall_phys; }