⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mt01detectorconstruction.bakcc

📁 利用linux环境下蒙特卡罗计算工具geant4实现伽玛射线与探测器乘积能量的模拟过程
💻 BAKCC
字号:
//// ********************************************************************// * DISCLAIMER                                                       *// *                                                                  *// * The following disclaimer summarizes all the specific disclaimers *// * of contributors to this software. The specific disclaimers,which *// * govern, are listed with their locations in:                      *// *   http://cern.ch/geant4/license                                  *// *                                                                  *// * 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.                                                             *// *                                                                  *// * This  code  implementation is the  intellectual property  of the *// * GEANT4 collaboration.                                            *// * By copying,  distributing  or modifying the Program (or any work *// * based  on  the Program)  you indicate  your  acceptance of  this *// * statement, and all its terms.                                    *// ********************************************************************////// $Id: ExN01DetectorConstruction.cc,v 1.8 2003/10/06 08:59:11 maire Exp $// GEANT4 tag $Name: geant4-07-00-patch-01 $// #include "mt01DetectorConstruction.hh"//#include "mt01DetectorMessenger.hh"//#include "mt01ChamberParameterisation.hh"//#include "mt01MagneticField.hh"#include "mt01TrackerSD.hh"#include "G4Material.hh"#include "G4Box.hh"#include "G4Tubs.hh"#include "G4LogicalVolume.hh"#include "G4PVPlacement.hh"#include "G4PVParameterised.hh"#include "G4SDManager.hh"#include "globals.hh"#include "G4UserLimits.hh"#include "G4VisAttributes.hh"#include "G4Colour.hh"#include "G4ios.hh"mt01DetectorConstruction::mt01DetectorConstruction()  :  experimentalHall_log(0), tracker_log(0),windowAl_log(0),windowGlass_log(0),windowWater_log(0),    calorimeterBlock_log(0), calorimeterLayer_log(0),    experimentalHall_phys(0), calorimeterLayer_phys(0),     calorimeterBlock_phys(0), tracker_phys(0),windowAl_phys(0),windowGlass_phys(0),windowWater_phys(0){;}mt01DetectorConstruction::~mt01DetectorConstruction(){}G4VPhysicalVolume* mt01DetectorConstruction::Construct(){  //------------------------------------------------------ materials  G4double a;  // atomic mass  G4double z;  // atomic number  G4double density,temperature,pressure;  G4int nel;  // G4Material* Gas =   // new G4Material("ArgonGas", z= 18., a= 39.95*g/mole, density= 1.782*mg/cm3);  density     = universe_mean_density;  pressure    = 3.e-18*pascal;  temperature = 2.73*kelvin;  G4Material* Vacuum = new G4Material("Galactic", z=1., a=1.01*g/mole,                                    density,kStateGas,temperature,pressure);  //new G4Material("Gas", z= 1., a= 1*g/mole, density= (1e-25)*mg/cm3);  G4Element* N = new G4Element("Nitrogen", "N", z=7., a= 14.01*g/mole);  G4Element* H  =new G4Element("Hydrogen","H",z=1.,a=1*g/mole);  G4Element* C = new G4Element("Carbon", "C", z=6, a=12.01*g/mole);  G4Element* O = new G4Element("Oxygen"  , "O", z=8., a= 16.00*g/mole);  a = 126.904*g/mole;  G4Element* I  = new G4Element("Iodine"  ,"I" , z= 53., a);  G4Element* Si = new G4Element("Silicon", "Si", z=14, a=28.09*g/mole);  a = 132.905*g/mole;  G4Element* Cs  = new G4Element("Cesium"  ,"Cs" , z= 55., a);  density = 4.53*g/cm3;  G4Material* CsI = new G4Material("CesiumIodide", density, nel=2);  CsI->AddElement(Cs, 5);  CsI->AddElement(I, 5);  G4Material* Air = new G4Material("Air", density= 1.29*mg/cm3, nel=2);  Air->AddElement(N, 70*perCent);  Air->AddElement(O, 30*perCent);G4Material* Glass = new G4Material("Glass", density=2.2*mg/cm3, nel=2); Glass -> AddElement(Si, 1); Glass -> AddElement(O,  2);G4Material* Water = new G4Material("Water", density=1*g/cm3, nel=2); Water -> AddElement(H, 2); Water -> AddElement(O, 1);   G4Material *Plastic=new G4Material("Plastic",density=2*g/cm3,nel=2); Plastic->AddElement(C,4); Plastic->AddElement(H,12); G4Element* La=new G4Element("Lanthanum","La",z=51,a=138.90*g/mole); G4Element* Br=new G4Element("Bromine","Br",z=35,a=79.90*g/mole); G4Material* LaBr3=new G4Material("LaBr3",density=5.29*g/cm3,nel=2); LaBr3->AddElement(La,1); LaBr3->AddElement(Br,3);       G4Material* Al =  new G4Material("Aluminum", z= 13., a= 26.98*g/mole, density= 2.7*g/cm3);  G4Material* Pb =   new G4Material("Lead", z= 82., a= 207.19*g/mole, density= 11.35*g/cm3);  //------------------------------------------------------ volumes  //------------------------------ experimental hall (world volume)  //------------------------------ beam line along x axis  G4double expHall_x = 3.0*m;  G4double expHall_y = 3.0*m;  G4double expHall_z = 3.0*m;  G4Box* experimentalHall_box    = new G4Box("expHall_box",expHall_x,expHall_y,expHall_z);  experimentalHall_log = new G4LogicalVolume(experimentalHall_box,                                          Vacuum,"expHall_log",0,0,0);  experimentalHall_phys = new G4PVPlacement(0,G4ThreeVector(),                                      experimentalHall_log,"expHall",0,false,0);  //------------------------------ a tracker tube  G4double innerRadiusOfTheTube1 = 0.*cm;  G4double outerRadiusOfTheTube1 = 59.*mm;  G4double hightOfTheTube1 =6.*mm;  G4double startAngleOfTheTube = 0.*deg;  G4double spanningAngleOfTheTube = 360.*deg;  G4Tubs* windowAl_tube = new G4Tubs("windowAl_tube",innerRadiusOfTheTube1,                                    outerRadiusOfTheTube1,hightOfTheTube1,                                    startAngleOfTheTube,spanningAngleOfTheTube);  windowAl_log = new G4LogicalVolume(windowAl_tube,Al,"windowAl_log",0,0,0);  G4double window_x1 = 0*m;  G4double window_y1 = 0.*m;  G4double window_z1 = -1*hightOfTheTube1;     windowAl_phys = new G4PVPlacement(0,             G4ThreeVector(window_x1,window_y1,window_z1),             windowAl_log,"windowAl",experimentalHall_log,false,0);    //----------------------------------------------------------------------  G4double innerRadiusOfTheTube2 = 0.*cm;  G4double outerRadiusOfTheTube2 = 59.*mm;  G4double hightOfTheTube2 = 3.5*mm;   startAngleOfTheTube = 0.*deg;  spanningAngleOfTheTube = 360.*deg;  G4Tubs* windowGlass_tube = new G4Tubs("windowGlass_tube",innerRadiusOfTheTube2,                                    outerRadiusOfTheTube2,hightOfTheTube2,                                    startAngleOfTheTube,spanningAngleOfTheTube);  windowGlass_log = new G4LogicalVolume(windowGlass_tube,Glass,"windowGlass_log",0,0,0); G4double window_x2 = 0*mm; G4double  window_y2 = 0.*m; G4double  window_z2 =-2*hightOfTheTube1-hightOfTheTube2;      windowGlass_phys = new G4PVPlacement(0,            G4ThreeVector(window_x2,window_y2,window_z2),         windowGlass_log,"windowGlass",experimentalHall_log,false,0);  //----------------------------------------------------------  G4double innerRadiusOfTheTube3 = 0.*cm;  G4double outerRadiusOfTheTube3 = 59.*mm;  G4double hightOfTheTube3 = 6*mm;  startAngleOfTheTube = 0.*deg;  spanningAngleOfTheTube = 360.*deg;  G4Tubs* windowWater_tube = new G4Tubs("windowWater_tube",innerRadiusOfTheTube3,                                    outerRadiusOfTheTube3,hightOfTheTube3,                                    startAngleOfTheTube,spanningAngleOfTheTube);  windowWater_log = new G4LogicalVolume(windowWater_tube,Plastic,"windowWater_log",0,0,0);  G4double window_x3 = 0*mm;  G4double window_y3 = 0.*m;  G4double window_z3 = -2*(hightOfTheTube1+hightOfTheTube2)-hightOfTheTube3;    windowWater_phys = new G4PVPlacement(0,            G4ThreeVector(window_x3,window_y3,window_z3),             windowWater_log,"windowWater",experimentalHall_log,false,0);  //----------------------------------------------------------------------   G4double innerRadiusOfTheTube = 0.*cm;   G4double  outerRadiusOfTheTube = 59.*mm;   G4double hightOfTheTube = 38.*mm;   startAngleOfTheTube = 0.*deg;   spanningAngleOfTheTube = 360.*deg;   G4Tubs* tracker_tube = new G4Tubs("tracker_tube",innerRadiusOfTheTube,                                    outerRadiusOfTheTube,hightOfTheTube,                                    startAngleOfTheTube,spanningAngleOfTheTube);  tracker_log = new G4LogicalVolume(tracker_tube,CsI,"tracker_log",0,0,0);  G4double trackerPos_x = 0*mm;  G4double trackerPos_y = 0.*m;  G4double trackerPos_z =-2*(hightOfTheTube1+hightOfTheTube2+hightOfTheTube3)-hightOfTheTube;  tracker_phys = new G4PVPlacement(0,             G4ThreeVector(trackerPos_x,trackerPos_y,trackerPos_z),             tracker_log,"tracker",experimentalHall_log,false,0);	       G4SDManager* SDman = G4SDManager::GetSDMpointer();  G4String trackerChamberSDname = "mt01/mt01TrackerSD";  mt01TrackerSD* aTrackerSD = new mt01TrackerSD( trackerChamberSDname );  SDman->AddNewDetector( aTrackerSD );  tracker_log->SetSensitiveDetector( aTrackerSD );//--------- Visualization attributes -------------------------------  G4VisAttributes* BoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));  experimentalHall_log->SetVisAttributes(BoxVisAtt);    //logicTarget ->SetVisAttributes(BoxVisAtt);  //logicTracker->SetVisAttributes(BoxVisAtt);    G4VisAttributes* ChamberVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,0.0));  tracker_log->SetVisAttributes(ChamberVisAtt);	       //------------------------------------------------------------------  return experimentalHall_phys;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -