// // ******************************************************************** // * 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 DetectorConstruction.cc /// \brief Implementation of the B1::DetectorConstruction class #include "DetectorConstruction.hh" #include "G4RunManager.hh" #include "G4NistManager.hh" #include "G4Box.hh" #include "G4Cons.hh" #include "G4Tubs.hh" #include "G4Orb.hh" #include "G4Sphere.hh" #include "G4Trd.hh" #include "G4LogicalVolume.hh" #include "G4PVPlacement.hh" #include "G4SystemOfUnits.hh" #include "G4Element.hh" #include "G4Material.hh" #include "G4SubtractionSolid.hh" #include "G4VSolid.hh" #include "G4RotationMatrix.hh" #include "G4RotationMatrix.hh" #include "G4VisAttributes.hh" #include "G4Colour.hh" namespace B1 { //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... DetectorConstruction::DetectorConstruction() {} //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... DetectorConstruction::~DetectorConstruction() {} //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... G4VPhysicalVolume* DetectorConstruction::Construct() { // Get nist material manager G4NistManager* nist = G4NistManager::Instance(); // Envelope parameters // G4double env_sizeXY = 50*cm, env_sizeZ = 50*cm; G4Material* env_mat = nist->FindOrBuildMaterial("G4_Galactic"); // Option to switch on/off checking of volumes overlaps // G4bool checkOverlaps = true; // // World // G4double world_sizeXY = 1.2*env_sizeXY; G4double world_sizeZ = 1.2*env_sizeZ; G4Material* world_mat = nist->FindOrBuildMaterial("G4_Galactic"); 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 // // Envelope // G4Box* solidEnv = new G4Box("Envelope", //its name 0.5*env_sizeXY, 0.5*env_sizeXY, 0.5*env_sizeZ); //its size G4LogicalVolume* logicEnv = new G4LogicalVolume(solidEnv, //its solid env_mat, //its material "Envelope"); //its name new G4PVPlacement(0, //no rotation G4ThreeVector(), //at (0,0,0) logicEnv, //its logical volume "Envelope", //its name logicWorld, //its mother volume false, //no boolean operation 0, //copy number checkOverlaps); //overlaps checking // ALL DISCS //(1) CaSO4:Dy material G4double a=40.078*g/mole; G4int z=20; G4Element* elCa = new G4Element("Calcium","Ca", z, a); a=32.065*g/mole; G4Element* elS = new G4Element("Sulfur", "S", z= 16, a); a=15.999*g/mole; G4Element* elO = new G4Element("Oxygen", "O", z= 8, a); a=162.5*g/mole; G4Element* elDy = new G4Element("Dysprosium", "Dy", z= 66, a); G4double density = 2.96*g/cm3; G4int ncomp=4; G4Material* TLD= new G4Material("TLD", density, ncomp); TLD->AddElement(elCa, 29.4211*perCent); TLD->AddElement(elS, 23.539*perCent); TLD->AddElement(elO, 46.98*perCent); TLD->AddElement(elDy, 0.059*perCent); /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // (3) D1 disc G4Material* shape3_mat = TLD; G4ThreeVector pos3 = G4ThreeVector(0, 1.75*cm, 0.141*cm); G4Tubs* solidShape3 = new G4Tubs("Shape3", 0, 0.665*cm, 0.04*cm, 0, 2*M_PI*rad); G4LogicalVolume* logicShape3 = new G4LogicalVolume(solidShape3, //its solid shape3_mat, //its material "Shape3"); //its name new G4PVPlacement(0, //no rotation pos3, //at position logicShape3, //its logical volume "Shape3", //its name logicEnv, //its mother volume false, //no boolean operation 0, //copy number checkOverlaps); //overlaps checking G4VisAttributes* D1VisAtt= new G4VisAttributes(G4Colour(0.0,1.0,0.0)); logicShape3->SetVisAttributes(D1VisAtt); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////// Cassette Material ///////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////// Cassette body ////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////// Front Filters ////////////////////////////////////////////////////////////////// // Cu Filter 1 G4Material* Cu_mat = nist->FindOrBuildMaterial("G4_Cu"); G4ThreeVector posCuF1 = G4ThreeVector(0,1.85*cm,-0.25*cm); G4Box* solidCuF1= new G4Box("FilCuF1", 1.5*cm,0.80*cm,0.050*cm); G4LogicalVolume* logicCuF1 = new G4LogicalVolume(solidCuF1, //its solid Cu_mat, //its material "FilCuF1"); //its name new G4PVPlacement(0, //no rotation posCuF1, //at position logicCuF1, //its logical volume "FilCuF1", //its name logicEnv, //its mother volume false, //no boolean operation 0, //copy number checkOverlaps); //overlaps checking G4VisAttributes* CuF1VisAtt= new G4VisAttributes(G4Colour(0.0,0.0,1.0)); logicCuF1->SetVisAttributes(CuF1VisAtt); // Al Filter 1 G4Material* Al_mat = nist->FindOrBuildMaterial("G4_Al"); G4ThreeVector posAlF1 = G4ThreeVector(0,1.75*cm,-0.33*cm); G4Tubs* solidAlF1= new G4Tubs("FilAlF1",0*cm,0.68*cm,0.03*cm,0, 2*M_PI*rad); G4LogicalVolume* logicAlF1 = new G4LogicalVolume(solidAlF1, //its solid Al_mat, //its material "FilAlF1"); //its name new G4PVPlacement(0, //no rotation posAlF1, //at position logicAlF1, //its logical volume "FilAlF1", //its name logicEnv, //its mother volume false, //no boolean operation 0, //copy number checkOverlaps); //overlaps checking G4VisAttributes* AlF1VisAtt= new G4VisAttributes(G4Colour(0.0,1.0,1.0)); logicAlF1->SetVisAttributes(AlF1VisAtt); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////// Back Filters /////////////////////////////////////////////////////////////////////// ///Cu Filter 2 G4ThreeVector posCuF2 = G4ThreeVector(0,1.75*cm,0.25*cm); G4Tubs* solidCuF2= new G4Tubs("FilCuF2",0*cm,0.78*cm,0.050*cm,0, 2*M_PI*rad); G4LogicalVolume* logicCuF2 = new G4LogicalVolume(solidCuF2, //its solid Cu_mat, //its material "FilCuF2"); //its name new G4PVPlacement(0, //no rotation posCuF2, //at position logicCuF2, //its logical volume "FilCuF2", //its name logicEnv, //its mother volume false, //no boolean operation 0, //copy number checkOverlaps); //overlaps checking G4VisAttributes* CuF2VisAtt= new G4VisAttributes(G4Colour(0.0,0.0,1.0)); logicCuF2->SetVisAttributes(CuF2VisAtt); /// Al Filter 2 G4ThreeVector posAlF2 = G4ThreeVector(0,1.75*cm,0.33*cm); G4Tubs* solidAlF2= new G4Tubs("FilAlF2",0*cm,0.63*cm,0.03*cm,0, 2*M_PI*rad); G4LogicalVolume* logicAlF2 = new G4LogicalVolume(solidAlF2, //its solid Al_mat, //its material "FilAlF2"); //its name new G4PVPlacement(0, //no rotation posAlF2, //at position logicAlF2, //its logical volume "FilAlF2", //its name logicEnv, //its mother volume false, //no boolean operation 0, //copy number checkOverlaps); //overlaps checking G4VisAttributes* AlF2VisAtt= new G4VisAttributes(G4Colour(0.0,1.0,1.0)); logicAlF2->SetVisAttributes(AlF2VisAtt); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////// ISO SLAB PHANTOM ////////////////////////////////////////////////////////////////////////// G4Material* pmma_mat = nist->FindOrBuildMaterial("G4_PLEXIGLASS"); G4VSolid* slabIN= new G4Box("slabIN",14*cm,14*cm,6.875*cm); G4VSolid* slabOUT = new G4Box("slabOUT",15*cm,15*cm,7.5*cm); G4LogicalVolume* logicslabph = new G4LogicalVolume(slabOUT, //its solid pmma_mat, //its material "slabOUT"); //its name new G4PVPlacement(0, //no rotation G4ThreeVector(0,0,7.865*cm), //at (0,0,0) logicslabph, //its logical volume "slabOUT", //its name logicEnv, //its mother volume false, //no boolean operation 0, //copy number checkOverlaps); //overlaps checking G4VisAttributes* slabphVisAtt= new G4VisAttributes(G4Colour(1.0,0.0,0.0)); logicslabph->SetVisAttributes(slabphVisAtt); G4Material* water = nist->FindOrBuildMaterial("G4_WATER"); G4LogicalVolume* logicwater = new G4LogicalVolume(slabIN, //its solid water, //its material "water"); //its name new G4PVPlacement(0, //no rotation G4ThreeVector(0,0,-0.375*cm), //at (0,0,0) logicwater, //its logical volume "water", //its name logicslabph, //its mother volume false, //no boolean operation 0, //copy number checkOverlaps); //overlaps checking ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// fScoringVolume = logicShape3; // //always return the physical World // return physWorld; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... }