// // ******************************************************************** // * 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 fpDetectorConstruction.cc /// \brief Implementation of the fpDetectorConstruction class #include "fpDetectorConstruction.hh" #include "G4RunManager.hh" #include "G4NistManager.hh" #include "G4Box.hh" #include "G4Cons.hh" #include "G4Orb.hh" #include "G4Sphere.hh" #include "G4Trd.hh" #include "G4LogicalVolume.hh" #include "G4PVPlacement.hh" #include "G4SystemOfUnits.hh" #include "G4Tubs.hh" #include "G4Element.hh" #include "G4Material.hh" //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... fpDetectorConstruction::fpDetectorConstruction() //fpDetectorConstruction��Ĺ��캯�� : G4VUserDetectorConstruction{}, //��ԱG4VUserDetectorConstruction��ʼ�� fScoringVolume{} { } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... fpDetectorConstruction::~fpDetectorConstruction() //fpDetectorConstruction����������� { } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... G4VPhysicalVolume* fpDetectorConstruction::Construct() //fpDetectorConstruction���Construct���� { // Get nist material manager G4NistManager* nist = G4NistManager::Instance(); // Envelope parameters // // Option to switch on/off checking of volumes overlaps // G4bool checkOverlaps = true; // // World // G4Material* world_mat = nist->FindOrBuildMaterial("G4_Galactic"); G4Sphere* solidWorld = new G4Sphere("World", //its name 0,50*cm,0,360*deg,0,180*deg); //its size G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld, //its solid world_mat, //its material "World"); //its name G4VPhysicalVolume* physWorld = new G4PVPlacement(0, //no rotation G4ThreeVector(), //at (0,0,0) logicWorld, //its logical volume "World", //its name 0, //its mother volume false, //no boolean operation 0, //copy number checkOverlaps); //overlaps checking // // Polyethylene Using Thermal Scattering Data by Using Name "TS_H_of_Polyethylene" // and Setting Concerning PhysicsList // G4Element* H1 = new G4Element("Hydrogen", "H", 1, 1.01 * g / mole); G4Element* C = new G4Element("Carbon", "C", 6, 12 * g / mole); G4Element* He = new G4Element("He", "He", 2, 4.01 * g / mole); // G4Material* gas = new G4Material("Gas", 1.79732e-4 * g / cm3, 3,kStateGas,1.2*atmosphere,293.15*kelvin); G4Material* gas = new G4Material("Gas", 1.79732e-4 * g / cm3, 3,kStateGas,293.15*kelvin,1.2*atmosphere); gas->AddElement(H1, 0.8); gas->AddElement(C, 0.2); gas->AddElement(He, 1); G4Box* solid_detector = new G4Box("detector", //its name 2.5 * cm, 2.5 * cm, 2.5 * cm); //its size G4LogicalVolume* logic_detector = new G4LogicalVolume(solid_detector, //its solid gas, //its material "detector"); //its name G4VPhysicalVolume* physical_detector= new G4PVPlacement(0, //no rotation G4ThreeVector(0,0,0), //at (0,0,0) logic_detector, //its logical volume "detector", //its name logicWorld, //its mother volume false, //no boolean operation 0, //copy number checkOverlaps); //overlaps checking // fScoringVolume = physical_detector; // //always return the physical World // return physWorld; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......