// // ******************************************************************** // * 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 B1DetectorConstruction.cc /// \brief Implementation of the B1DetectorConstruction class #include "B1DetectorConstruction.hh" #include "G4RunManager.hh" #include "G4NistManager.hh" #include "G4Box.hh" #include "G4Cons.hh" #include "G4Orb.hh" #include "G4Sphere.hh" #include "G4Trd.hh" #include "G4Ellipsoid.hh" #include "G4LogicalVolume.hh" #include "G4PVPlacement.hh" #include "G4SystemOfUnits.hh" #include "G4RotationMatrix.hh" #include "G4Tubs.hh" #include "G4BooleanSolid.hh" #include "G4VSolid.hh" #include "G4IntersectionSolid.hh" #include "G4SubtractionSolid.hh" #include "G4UnionSolid.hh" //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... B1DetectorConstruction::B1DetectorConstruction(G4bool CircularTargetFlag, G4bool SecondTargetFlag, G4int TargMat, G4double pRMin, G4double pRMax, G4double pDz, G4double pSPhi, G4double pDPhi) : G4VUserDetectorConstruction(), fScoringVolume(0), //target 1 fScoringVolume2(0), //target 2 fCircularTargetFlag(CircularTargetFlag), fSecondTargetFlag(SecondTargetFlag), fTargMat(TargMat), fWorldMat(WorldMat), fpRMin(pRMin), fpRMax(pRMax), fpDz(pDz), fpSPhi(pSPhi), fpDPhi(pDPhi) { } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... B1DetectorConstruction::~B1DetectorConstruction() { } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... G4VPhysicalVolume* B1DetectorConstruction::Construct() { // World size // G4double world_sizeXY = 30*cm; //total x,y lenght G4double world_sizeZ = 30*cm; //total z lenght // Get nist material manager G4NistManager* nist = G4NistManager::Instance(); // ================ // define materials // ================ G4Material* berillio = nist->FindOrBuildMaterial("G4_Be"); G4Material* carbon = nist->FindOrBuildMaterial("G4_C"); G4Material* Graphite = new G4Material("Graphite", 6., 12.0107*g/mole, 2.5*g/cm3); G4Material* air = nist->FindOrBuildMaterial("G4_AIR"); G4Material* Molibdeno = nist->FindOrBuildMaterial("G4_Mo"); //has density 10.22 G4Material* MoGr= new G4Material("MoGr", 2.5*g/cm3, 2); MoGr->AddMaterial(Graphite, 0.95); MoGr->AddMaterial(Molibdeno, 0.05); //intergalactic G4double atomicNumber = 1.; G4double massOfMole = 1.008*g/mole; G4double density = 1.e-25*g/cm3; G4double temperature = 2.73*kelvin; G4double pressure = 3.e-18*pascal; G4Material* vacuum = new G4Material("vacuum", atomicNumber, massOfMole, density, kStateGas, temperature, pressure); //idrogenum pellet G4double Hdensity = 0.086*g/cm3; G4double Htemperature = 14.0*kelvin; G4double Hpressure = 500.e9*pascal; G4Material* Hpellet = new G4Material("HPellet", atomicNumber, massOfMole, Hdensity, kStateSolid, Htemperature, Hpressure); //assign material to target G4Material* TargMat = berillio; if (fTargMat==1) TargMat = carbon; //assign material to world G4Material* world_mat = vacuum; if (fWorldMat==1) world_mat = air; // Option to switch on/off checking of volumes overlaps // G4bool checkOverlaps = true; //World G4Box* solidWorld = new G4Box("World", //its name 0.5*world_sizeXY, 0.5*world_sizeXY, 0.5*world_sizeZ); //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 // Circular target if (fCircularTargetFlag){ G4Tubs* solidEnv = new G4Tubs("Circular", //its name fpRMin, fpRMax, 0.5*fpDz, fpSPhi, fpDPhi); //its size } G4LogicalVolume* logicEnv = new G4LogicalVolume(solidEnv, //its solid TargMat, //its material "Target1"); //its name G4LogicalVolume* logicEnv2 = new G4LogicalVolume(solidEnv, //its solid TargMat, //its material "Target2"); //its name*/ new G4PVPlacement(0, //no rotation G4ThreeVector(), //at (0,0,0) logicEnv, //its logical volume "Target1", //its name logicWorld, //its mother volume false, //no boolean operation 0, //copy number checkOverlaps); //overlaps checking new G4PVPlacement(0, //0 no rotation G4ThreeVector(0,0,2.3*cm), //at (0,0,2.3) 2.3= 0.3*cm+2*cm logicEnv2, //its logical volume "Target2", //its name logicWorld, //its mother volume false, //no boolean operation 0, //copy number checkOverlaps); //overlaps checking fScoringVolume = logicEnv; fScoringVolume2 = logicEnv2; return physWorld; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......