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

Last change on this file since 1023 was 807, checked in by garnier, 16 years ago

update

File size: 13.1 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  G4double Glass_RIND[LXe_NUMENTRIES]={1.49,1.49,1.49};
144  G4double Glass_AbsLength[LXe_NUMENTRIES]={420.*cm,420.*cm,420.*cm};
145  G4MaterialPropertiesTable *Glass_mt = new G4MaterialPropertiesTable();
146  Glass_mt->AddProperty("ABSLENGTH",LXe_Energy,Glass_AbsLength,LXe_NUMENTRIES);
147  Glass_mt->AddProperty("RINDEX",LXe_Energy,Glass_RIND,LXe_NUMENTRIES);
148  Glass->SetMaterialPropertiesTable(Glass_mt);
149
150  G4double Vacuum_Energy[LXe_NUMENTRIES]={2.0*eV,7.0*eV,7.14*eV};
151  G4double Vacuum_RIND[LXe_NUMENTRIES]={1.,1.,1.}; 
152  G4MaterialPropertiesTable *Vacuum_mt = new G4MaterialPropertiesTable();
153  Vacuum_mt->AddProperty("RINDEX", Vacuum_Energy, Vacuum_RIND,LXe_NUMENTRIES);
154  Vacuum->SetMaterialPropertiesTable(Vacuum_mt);
155  Air->SetMaterialPropertiesTable(Vacuum_mt);//Give air the same rindex
156
157  const G4int WLS_NUMENTRIES = 4;
158  G4double WLS_Energy[] = {2.00*eV,2.87*eV,2.90*eV,3.47*eV};
159   
160  G4double RIndexPstyrene[WLS_NUMENTRIES]={ 1.5, 1.5, 1.5, 1.5};
161  G4double Absorption1[WLS_NUMENTRIES]={2.*cm, 2.*cm, 2.*cm, 2.*cm};
162  G4double ScintilFast[WLS_NUMENTRIES]={0.00, 0.00, 1.00, 1.00};
163  MPTPStyrene = new G4MaterialPropertiesTable();
164  MPTPStyrene->AddProperty("RINDEX",WLS_Energy,RIndexPstyrene,WLS_NUMENTRIES);
165  MPTPStyrene->AddProperty("ABSLENGTH",WLS_Energy,Absorption1,WLS_NUMENTRIES);
166  MPTPStyrene->AddProperty("FASTCOMPONENT",WLS_Energy, ScintilFast,
167                           WLS_NUMENTRIES);
168  MPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",10./keV);
169  MPTPStyrene->AddConstProperty("RESOLUTIONSCALE",1.0);
170  MPTPStyrene->AddConstProperty("FASTTIMECONSTANT", 10.*ns);
171  Pstyrene->SetMaterialPropertiesTable(MPTPStyrene);
172
173  G4double RefractiveIndexFiber[WLS_NUMENTRIES]={ 1.60, 1.60, 1.60, 1.60};
174  G4double AbsFiber[WLS_NUMENTRIES]={9.00*m,9.00*m,0.1*mm,0.1*mm};
175  G4double EmissionFib[WLS_NUMENTRIES]={1.0, 1.0, 0.0, 0.0};
176  G4MaterialPropertiesTable* MPTFiber = new G4MaterialPropertiesTable();
177  MPTFiber->AddProperty("RINDEX",WLS_Energy,RefractiveIndexFiber,
178                        WLS_NUMENTRIES);
179  MPTFiber->AddProperty("WLSABSLENGTH",WLS_Energy,AbsFiber,WLS_NUMENTRIES);
180  MPTFiber->AddProperty("WLSCOMPONENT",WLS_Energy,EmissionFib,WLS_NUMENTRIES);
181  MPTFiber->AddConstProperty("WLSTIMECONSTANT", 0.5*ns);
182  PMMA->SetMaterialPropertiesTable(MPTFiber);
183
184  G4double RefractiveIndexClad1[WLS_NUMENTRIES]={ 1.49, 1.49, 1.49, 1.49};
185  G4MaterialPropertiesTable* MPTClad1 = new G4MaterialPropertiesTable();
186  MPTClad1->AddProperty("RINDEX",WLS_Energy,RefractiveIndexClad1,
187                        WLS_NUMENTRIES);
188  MPTClad1->AddProperty("ABSLENGTH",WLS_Energy,AbsFiber,WLS_NUMENTRIES);
189  Pethylene->SetMaterialPropertiesTable(MPTClad1);
190
191  G4double RefractiveIndexClad2[WLS_NUMENTRIES]={ 1.42, 1.42, 1.42, 1.42};
192  G4MaterialPropertiesTable* MPTClad2 = new G4MaterialPropertiesTable();
193  MPTClad2->AddProperty("RINDEX",WLS_Energy,RefractiveIndexClad2,
194                        WLS_NUMENTRIES);
195  MPTClad2->AddProperty("ABSLENGTH",WLS_Energy,AbsFiber,WLS_NUMENTRIES);
196  fPethylene->SetMaterialPropertiesTable(MPTClad2);
197}
198
199//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
200G4VPhysicalVolume* LXeDetectorConstruction::Construct(){
201  DefineMaterials();
202  return ConstructDetector();
203}
204
205//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
206G4VPhysicalVolume* LXeDetectorConstruction::ConstructDetector()
207{
208  //The experimental hall walls are all 1m away from housing walls
209  G4double expHall_x = scint_x+d_mtl+1.*m;
210  G4double expHall_y = scint_y+d_mtl+1.*m;
211  G4double expHall_z = scint_z+d_mtl+1.*m;
212
213  //Create experimental hall
214  experimentalHall_box
215    = new G4Box("expHall_box",expHall_x,expHall_y,expHall_z);
216  experimentalHall_log = new G4LogicalVolume(experimentalHall_box,
217                                             Vacuum,"expHall_log",0,0,0);
218  experimentalHall_phys = new G4PVPlacement(0,G4ThreeVector(),
219                              experimentalHall_log,"expHall",0,false,0);
220
221  experimentalHall_log->SetVisAttributes(G4VisAttributes::Invisible);
222 
223  //Place the main volume
224  if(mainVolume){
225    new LXeMainVolume(0,G4ThreeVector(),experimentalHall_log,false,0,this);
226  }
227
228  //Place the WLS slab
229  if(WLSslab){
230    G4VPhysicalVolume* slab = new LXeWLSSlab(0,G4ThreeVector(0.,0.,
231                                             -scint_z/2.-slab_z-1.*cm),
232                                             experimentalHall_log,false,0,
233                                             this);
234
235    //Surface properties for the WLS slab
236    G4OpticalSurface* ScintWrap = new G4OpticalSurface("ScintWrap");
237   
238    new G4LogicalBorderSurface("ScintWrap", slab,
239                               experimentalHall_phys,
240                               ScintWrap);
241   
242    ScintWrap->SetType(dielectric_metal);
243    ScintWrap->SetFinish(polished);
244    ScintWrap->SetModel(glisur);
245
246    const G4int NUM = 2;
247   
248    G4double pp[NUM] = {2.0*eV, 3.5*eV};
249    G4double reflectivity[NUM] = {1., 1.};
250    G4double efficiency[NUM] = {0.0, 0.0};
251   
252    G4MaterialPropertiesTable* ScintWrapProperty
253      = new G4MaterialPropertiesTable();
254
255    ScintWrapProperty->AddProperty("REFLECTIVITY",pp,reflectivity,NUM);
256    ScintWrapProperty->AddProperty("EFFICIENCY",pp,efficiency,NUM);
257    ScintWrap->SetMaterialPropertiesTable(ScintWrapProperty);
258  }
259
260  return experimentalHall_phys;
261}
262
263//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
264void LXeDetectorConstruction::SetDimensions(G4ThreeVector dims){
265  this->scint_x=dims[0];
266  this->scint_y=dims[1];
267  this->scint_z=dims[2];
268  updated=true;
269}
270 
271 //_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
272void LXeDetectorConstruction::SetHousingThickness(G4double d_mtl){
273  this->d_mtl=d_mtl;
274  updated=true;
275}
276
277//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
278void LXeDetectorConstruction::SetNX(G4int nx){
279  this->nx=nx;
280  updated=true;
281}
282
283//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
284void LXeDetectorConstruction::SetNY(G4int ny){
285  this->ny=ny;
286  updated=true;
287}
288
289//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
290void LXeDetectorConstruction::SetNZ(G4int nz){
291  this->nz=nz;
292  updated=true;
293}
294
295//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
296void LXeDetectorConstruction::SetPMTRadius(G4double outerRadius_pmt){
297  this->outerRadius_pmt=outerRadius_pmt;
298  updated=true;
299}
300
301//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
302void LXeDetectorConstruction::SetDefaults(){
303  //Resets to default values
304  d_mtl=0.0635*cm;
305 
306  scint_x = 17.8*cm;
307  scint_y = 17.8*cm;
308  scint_z = 22.6*cm;
309
310  nx = 2;
311  ny = 2;
312  nz = 3;
313
314  outerRadius_pmt = 2.3*cm;
315
316  sphereOn = true;
317  refl=1.0;
318 
319  nfibers=15;
320  WLSslab=false;
321  mainVolume=true;
322  slab_z=2.5*mm;
323
324  G4UImanager::GetUIpointer()
325    ->ApplyCommand("/LXe/detector/scintYieldFactor 1.");
326 
327  if(LXe_mt)LXe_mt->AddConstProperty("SCINTILLATIONYIELD",12000./MeV);
328  if(MPTPStyrene)MPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",10./keV);
329
330  updated=true;
331}
332
333
334//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
335void LXeDetectorConstruction::UpdateGeometry(){
336
337  // clean-up previous geometry
338  G4GeometryManager::GetInstance()->OpenGeometry();
339
340  G4PhysicalVolumeStore::GetInstance()->Clean();
341  G4LogicalVolumeStore::GetInstance()->Clean();
342  G4SolidStore::GetInstance()->Clean();
343  G4LogicalSkinSurface::CleanSurfaceTable();
344  G4LogicalBorderSurface::CleanSurfaceTable();
345
346  //define new one
347  G4RunManager::GetRunManager()->DefineWorldVolume(ConstructDetector());
348  G4RunManager::GetRunManager()->GeometryHasBeenModified();
349
350  updated=false;
351}
352
353void LXeDetectorConstruction::SetMainScintYield(G4double y){
354  LXe_mt->AddConstProperty("SCINTILLATIONYIELD",y/MeV); 
355}
356 
357void LXeDetectorConstruction::SetWLSScintYield(G4double y){
358  MPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",y/MeV); 
359}
360
361
362
363
364
Note: See TracBrowser for help on using the repository browser.