source: trunk/examples/extended/optical/LXe/src/LXeDetectorConstruction.cc @ 1337

Last change on this file since 1337 was 1230, checked in by garnier, 15 years ago

update to geant4.9.3

File size: 13.4 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer                                           *
4// *                                                                  *
5// * The  Geant4 software  is  copyright of the Copyright Holders  of *
6// * the Geant4 Collaboration.  It is provided  under  the terms  and *
7// * conditions of the Geant4 Software License,  included in the file *
8// * LICENSE and available at  http://cern.ch/geant4/license .  These *
9// * include a list of copyright holders.                             *
10// *                                                                  *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work  make  any representation or  warranty, express or implied, *
14// * regarding  this  software system or assume any liability for its *
15// * use.  Please see the license in the file  LICENSE  and URL above *
16// * for the full disclaimer and the limitation of liability.         *
17// *                                                                  *
18// * This  code  implementation is the result of  the  scientific and *
19// * technical work of the GEANT4 collaboration.                      *
20// * By using,  copying,  modifying or  distributing the software (or *
21// * any work based  on the software)  you  agree  to acknowledge its *
22// * use  in  resulting  scientific  publications,  and indicate your *
23// * acceptance of all terms of the Geant4 Software license.          *
24// ********************************************************************
25//
26#include "LXeDetectorConstruction.hh"
27#include "LXePMTSD.hh"
28#include "LXeScintSD.hh"
29#include "LXeDetectorMessenger.hh"
30#include "LXeMainVolume.hh"
31#include "LXeWLSSlab.hh"
32
33#include "G4SDManager.hh"
34#include "G4RunManager.hh"
35#include "G4LogicalBorderSurface.hh"
36#include "G4LogicalSkinSurface.hh"
37#include "G4OpticalSurface.hh"
38#include "G4MaterialTable.hh"
39#include "G4VisAttributes.hh"
40#include "G4Material.hh"
41#include "G4Box.hh"
42#include "G4Tubs.hh"
43#include "G4Sphere.hh"
44#include "G4LogicalVolume.hh"
45#include "G4ThreeVector.hh"
46#include "G4PVPlacement.hh"
47#include "globals.hh"
48#include "G4SolidStore.hh"
49#include "G4LogicalVolumeStore.hh"
50#include "G4PhysicalVolumeStore.hh"
51#include "G4GeometryManager.hh"
52#include "G4UImanager.hh"
53
54G4bool LXeDetectorConstruction::sphereOn = true;
55
56//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
57LXeDetectorConstruction::LXeDetectorConstruction()
58: LXe_mt(NULL), MPTPStyrene(NULL)
59{
60  SetDefaults();
61  detectorMessenger = new LXeDetectorMessenger(this);
62}
63
64//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
65LXeDetectorConstruction::~LXeDetectorConstruction(){
66}
67
68//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
69void LXeDetectorConstruction::DefineMaterials(){
70  G4double a;  // atomic mass
71  G4double z;  // atomic number
72  G4double density;
73
74  G4int polyPMMA = 1;
75  G4int nC_PMMA = 3+2*polyPMMA;
76  G4int nH_PMMA = 6+2*polyPMMA;
77
78  G4int polyeth = 1;
79  G4int nC_eth = 2*polyeth;
80  G4int nH_eth = 4*polyeth;
81
82  //***Elements
83  H = new G4Element("H", "H", z=1., a=1.01*g/mole);
84  C = new G4Element("C", "C", z=6., a=12.01*g/mole);
85  N = new G4Element("N", "N", z=7., a= 14.01*g/mole);
86  O = new G4Element("O"  , "O", z=8., a= 16.00*g/mole);
87 
88  //***Materials
89  //Liquid Xenon
90  LXe = new G4Material("LXe",z=54.,a=131.29*g/mole,density=3.020*g/cm3);
91  //Aluminum
92  Al = new G4Material("Al",z=13.,a=26.98*g/mole,density=2.7*g/cm3);
93  //Vacuum
94  Vacuum = new G4Material("Vacuum",z=1.,a=1.01*g/mole,
95                          density=universe_mean_density,kStateGas,0.1*kelvin,
96                          1.e-19*pascal); 
97  //Air
98  Air = new G4Material("Air", density= 1.29*mg/cm3, 2);
99  Air->AddElement(N, 70*perCent);
100  Air->AddElement(O, 30*perCent);
101  //Glass
102  Glass = new G4Material("Glass", density=1.032*g/cm3,2);
103  Glass->AddElement(C,91.533*perCent);
104  Glass->AddElement(H,8.467*perCent);
105  //Polystyrene
106  Pstyrene = new G4Material("Polystyrene", density= 1.03*g/cm3, 2);
107  Pstyrene->AddElement(C, 8);
108  Pstyrene->AddElement(H, 8);
109  //Fiber(PMMA)
110  PMMA = new G4Material("PMMA", density=1190*kg/m3,3);
111  PMMA->AddElement(H,nH_PMMA);
112  PMMA->AddElement(C,nC_PMMA);
113  PMMA->AddElement(O,2);
114  //Cladding(polyethylene)
115  Pethylene = new G4Material("Pethylene", density=1200*kg/m3,2);
116  Pethylene->AddElement(H,nH_eth);
117  Pethylene->AddElement(C,nC_eth);
118  //Double cladding(flourinated polyethylene)
119  fPethylene = new G4Material("fPethylene", density=1400*kg/m3,2);
120  fPethylene->AddElement(H,nH_eth);
121  fPethylene->AddElement(C,nC_eth);
122 
123  //***Material properties tables
124
125  const G4int LXe_NUMENTRIES = 3;
126  G4double LXe_Energy[LXe_NUMENTRIES]    = { 7.0*eV , 7.07*eV, 7.14*eV };
127
128  G4double LXe_SCINT[LXe_NUMENTRIES] = { 0.1, 1.0, 0.1 };
129  G4double LXe_RIND[LXe_NUMENTRIES]  = { 1.59 , 1.57, 1.54 };
130  G4double LXe_ABSL[LXe_NUMENTRIES]  = { 35.*cm, 35.*cm, 35.*cm}; 
131  LXe_mt = new G4MaterialPropertiesTable();
132  LXe_mt->AddProperty("FASTCOMPONENT", LXe_Energy, LXe_SCINT, LXe_NUMENTRIES);
133  LXe_mt->AddProperty("SLOWCOMPONENT", LXe_Energy, LXe_SCINT, LXe_NUMENTRIES);
134  LXe_mt->AddProperty("RINDEX",        LXe_Energy, LXe_RIND,  LXe_NUMENTRIES);
135  LXe_mt->AddProperty("ABSLENGTH",     LXe_Energy, LXe_ABSL,  LXe_NUMENTRIES);
136  LXe_mt->AddConstProperty("SCINTILLATIONYIELD",12000./MeV); 
137  LXe_mt->AddConstProperty("RESOLUTIONSCALE",1.0);
138  LXe_mt->AddConstProperty("FASTTIMECONSTANT",20.*ns);
139  LXe_mt->AddConstProperty("SLOWTIMECONSTANT",45.*ns);
140  LXe_mt->AddConstProperty("YIELDRATIO",1.0);
141  LXe->SetMaterialPropertiesTable(LXe_mt);
142
143  // Set the Birks Constant for the LXe scintillator
144
145  LXe->GetIonisation()->SetBirksConstant(0.126*mm/MeV);
146 
147  G4double Glass_RIND[LXe_NUMENTRIES]={1.49,1.49,1.49};
148  G4double Glass_AbsLength[LXe_NUMENTRIES]={420.*cm,420.*cm,420.*cm};
149  G4MaterialPropertiesTable *Glass_mt = new G4MaterialPropertiesTable();
150  Glass_mt->AddProperty("ABSLENGTH",LXe_Energy,Glass_AbsLength,LXe_NUMENTRIES);
151  Glass_mt->AddProperty("RINDEX",LXe_Energy,Glass_RIND,LXe_NUMENTRIES);
152  Glass->SetMaterialPropertiesTable(Glass_mt);
153
154  G4double Vacuum_Energy[LXe_NUMENTRIES]={2.0*eV,7.0*eV,7.14*eV};
155  G4double Vacuum_RIND[LXe_NUMENTRIES]={1.,1.,1.}; 
156  G4MaterialPropertiesTable *Vacuum_mt = new G4MaterialPropertiesTable();
157  Vacuum_mt->AddProperty("RINDEX", Vacuum_Energy, Vacuum_RIND,LXe_NUMENTRIES);
158  Vacuum->SetMaterialPropertiesTable(Vacuum_mt);
159  Air->SetMaterialPropertiesTable(Vacuum_mt);//Give air the same rindex
160
161  const G4int WLS_NUMENTRIES = 4;
162  G4double WLS_Energy[] = {2.00*eV,2.87*eV,2.90*eV,3.47*eV};
163   
164  G4double RIndexPstyrene[WLS_NUMENTRIES]={ 1.5, 1.5, 1.5, 1.5};
165  G4double Absorption1[WLS_NUMENTRIES]={2.*cm, 2.*cm, 2.*cm, 2.*cm};
166  G4double ScintilFast[WLS_NUMENTRIES]={0.00, 0.00, 1.00, 1.00};
167  MPTPStyrene = new G4MaterialPropertiesTable();
168  MPTPStyrene->AddProperty("RINDEX",WLS_Energy,RIndexPstyrene,WLS_NUMENTRIES);
169  MPTPStyrene->AddProperty("ABSLENGTH",WLS_Energy,Absorption1,WLS_NUMENTRIES);
170  MPTPStyrene->AddProperty("FASTCOMPONENT",WLS_Energy, ScintilFast,
171                           WLS_NUMENTRIES);
172  MPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",10./keV);
173  MPTPStyrene->AddConstProperty("RESOLUTIONSCALE",1.0);
174  MPTPStyrene->AddConstProperty("FASTTIMECONSTANT", 10.*ns);
175  Pstyrene->SetMaterialPropertiesTable(MPTPStyrene);
176
177  // Set the Birks Constant for the Polystyrene scintillator
178
179  Pstyrene->GetIonisation()->SetBirksConstant(0.126*mm/MeV);
180
181  G4double RefractiveIndexFiber[WLS_NUMENTRIES]={ 1.60, 1.60, 1.60, 1.60};
182  G4double AbsFiber[WLS_NUMENTRIES]={9.00*m,9.00*m,0.1*mm,0.1*mm};
183  G4double EmissionFib[WLS_NUMENTRIES]={1.0, 1.0, 0.0, 0.0};
184  G4MaterialPropertiesTable* MPTFiber = new G4MaterialPropertiesTable();
185  MPTFiber->AddProperty("RINDEX",WLS_Energy,RefractiveIndexFiber,
186                        WLS_NUMENTRIES);
187  MPTFiber->AddProperty("WLSABSLENGTH",WLS_Energy,AbsFiber,WLS_NUMENTRIES);
188  MPTFiber->AddProperty("WLSCOMPONENT",WLS_Energy,EmissionFib,WLS_NUMENTRIES);
189  MPTFiber->AddConstProperty("WLSTIMECONSTANT", 0.5*ns);
190  PMMA->SetMaterialPropertiesTable(MPTFiber);
191
192  G4double RefractiveIndexClad1[WLS_NUMENTRIES]={ 1.49, 1.49, 1.49, 1.49};
193  G4MaterialPropertiesTable* MPTClad1 = new G4MaterialPropertiesTable();
194  MPTClad1->AddProperty("RINDEX",WLS_Energy,RefractiveIndexClad1,
195                        WLS_NUMENTRIES);
196  MPTClad1->AddProperty("ABSLENGTH",WLS_Energy,AbsFiber,WLS_NUMENTRIES);
197  Pethylene->SetMaterialPropertiesTable(MPTClad1);
198
199  G4double RefractiveIndexClad2[WLS_NUMENTRIES]={ 1.42, 1.42, 1.42, 1.42};
200  G4MaterialPropertiesTable* MPTClad2 = new G4MaterialPropertiesTable();
201  MPTClad2->AddProperty("RINDEX",WLS_Energy,RefractiveIndexClad2,
202                        WLS_NUMENTRIES);
203  MPTClad2->AddProperty("ABSLENGTH",WLS_Energy,AbsFiber,WLS_NUMENTRIES);
204  fPethylene->SetMaterialPropertiesTable(MPTClad2);
205}
206
207//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
208G4VPhysicalVolume* LXeDetectorConstruction::Construct(){
209  DefineMaterials();
210  return ConstructDetector();
211}
212
213//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
214G4VPhysicalVolume* LXeDetectorConstruction::ConstructDetector()
215{
216  //The experimental hall walls are all 1m away from housing walls
217  G4double expHall_x = scint_x+d_mtl+1.*m;
218  G4double expHall_y = scint_y+d_mtl+1.*m;
219  G4double expHall_z = scint_z+d_mtl+1.*m;
220
221  //Create experimental hall
222  experimentalHall_box
223    = new G4Box("expHall_box",expHall_x,expHall_y,expHall_z);
224  experimentalHall_log = new G4LogicalVolume(experimentalHall_box,
225                                             Vacuum,"expHall_log",0,0,0);
226  experimentalHall_phys = new G4PVPlacement(0,G4ThreeVector(),
227                              experimentalHall_log,"expHall",0,false,0);
228
229  experimentalHall_log->SetVisAttributes(G4VisAttributes::Invisible);
230 
231  //Place the main volume
232  if(mainVolume){
233    new LXeMainVolume(0,G4ThreeVector(),experimentalHall_log,false,0,this);
234  }
235
236  //Place the WLS slab
237  if(WLSslab){
238    G4VPhysicalVolume* slab = new LXeWLSSlab(0,G4ThreeVector(0.,0.,
239                                             -scint_z/2.-slab_z-1.*cm),
240                                             experimentalHall_log,false,0,
241                                             this);
242
243    //Surface properties for the WLS slab
244    G4OpticalSurface* ScintWrap = new G4OpticalSurface("ScintWrap");
245   
246    new G4LogicalBorderSurface("ScintWrap", slab,
247                               experimentalHall_phys,
248                               ScintWrap);
249   
250    ScintWrap->SetType(dielectric_metal);
251    ScintWrap->SetFinish(polished);
252    ScintWrap->SetModel(glisur);
253
254    const G4int NUM = 2;
255   
256    G4double pp[NUM] = {2.0*eV, 3.5*eV};
257    G4double reflectivity[NUM] = {1., 1.};
258    G4double efficiency[NUM] = {0.0, 0.0};
259   
260    G4MaterialPropertiesTable* ScintWrapProperty
261      = new G4MaterialPropertiesTable();
262
263    ScintWrapProperty->AddProperty("REFLECTIVITY",pp,reflectivity,NUM);
264    ScintWrapProperty->AddProperty("EFFICIENCY",pp,efficiency,NUM);
265    ScintWrap->SetMaterialPropertiesTable(ScintWrapProperty);
266  }
267
268  return experimentalHall_phys;
269}
270
271//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
272void LXeDetectorConstruction::SetDimensions(G4ThreeVector dims){
273  this->scint_x=dims[0];
274  this->scint_y=dims[1];
275  this->scint_z=dims[2];
276  updated=true;
277}
278 
279 //_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
280void LXeDetectorConstruction::SetHousingThickness(G4double d_mtl){
281  this->d_mtl=d_mtl;
282  updated=true;
283}
284
285//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
286void LXeDetectorConstruction::SetNX(G4int nx){
287  this->nx=nx;
288  updated=true;
289}
290
291//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
292void LXeDetectorConstruction::SetNY(G4int ny){
293  this->ny=ny;
294  updated=true;
295}
296
297//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
298void LXeDetectorConstruction::SetNZ(G4int nz){
299  this->nz=nz;
300  updated=true;
301}
302
303//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
304void LXeDetectorConstruction::SetPMTRadius(G4double outerRadius_pmt){
305  this->outerRadius_pmt=outerRadius_pmt;
306  updated=true;
307}
308
309//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
310void LXeDetectorConstruction::SetDefaults(){
311  //Resets to default values
312  d_mtl=0.0635*cm;
313 
314  scint_x = 17.8*cm;
315  scint_y = 17.8*cm;
316  scint_z = 22.6*cm;
317
318  nx = 2;
319  ny = 2;
320  nz = 3;
321
322  outerRadius_pmt = 2.3*cm;
323
324  sphereOn = true;
325  refl=1.0;
326 
327  nfibers=15;
328  WLSslab=false;
329  mainVolume=true;
330  slab_z=2.5*mm;
331
332  G4UImanager::GetUIpointer()
333    ->ApplyCommand("/LXe/detector/scintYieldFactor 1.");
334 
335  if(LXe_mt)LXe_mt->AddConstProperty("SCINTILLATIONYIELD",12000./MeV);
336  if(MPTPStyrene)MPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",10./keV);
337
338  updated=true;
339}
340
341
342//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
343void LXeDetectorConstruction::UpdateGeometry(){
344
345  // clean-up previous geometry
346  G4GeometryManager::GetInstance()->OpenGeometry();
347
348  G4PhysicalVolumeStore::GetInstance()->Clean();
349  G4LogicalVolumeStore::GetInstance()->Clean();
350  G4SolidStore::GetInstance()->Clean();
351  G4LogicalSkinSurface::CleanSurfaceTable();
352  G4LogicalBorderSurface::CleanSurfaceTable();
353  G4SurfaceProperty::CleanSurfacePropertyTable();
354
355  //define new one
356  G4RunManager::GetRunManager()->DefineWorldVolume(ConstructDetector());
357  G4RunManager::GetRunManager()->GeometryHasBeenModified();
358
359  updated=false;
360}
361
362void LXeDetectorConstruction::SetMainScintYield(G4double y){
363  LXe_mt->AddConstProperty("SCINTILLATIONYIELD",y/MeV); 
364}
365 
366void LXeDetectorConstruction::SetWLSScintYield(G4double y){
367  MPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",y/MeV); 
368}
369
370
371
372
373
Note: See TracBrowser for help on using the repository browser.