ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LXeDetectorConstruction.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file LXeDetectorConstruction.cc
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 //
29 //
30 //
32 #include "LXePMTSD.hh"
33 #include "LXeScintSD.hh"
34 #include "LXeDetectorMessenger.hh"
35 #include "LXeMainVolume.hh"
36 #include "LXeWLSSlab.hh"
37 
38 #include "G4SDManager.hh"
39 #include "G4RunManager.hh"
40 
41 #include "G4GeometryManager.hh"
42 #include "G4SolidStore.hh"
43 #include "G4LogicalVolumeStore.hh"
44 #include "G4PhysicalVolumeStore.hh"
46 #include "G4LogicalSkinSurface.hh"
47 
48 #include "G4OpticalSurface.hh"
49 #include "G4MaterialTable.hh"
50 #include "G4VisAttributes.hh"
51 #include "G4Material.hh"
52 #include "G4Box.hh"
53 #include "G4Tubs.hh"
54 #include "G4Sphere.hh"
55 #include "G4LogicalVolume.hh"
56 #include "G4ThreeVector.hh"
57 #include "G4PVPlacement.hh"
58 #include "globals.hh"
59 #include "G4UImanager.hh"
60 #include "G4PhysicalConstants.hh"
61 #include "G4SystemOfUnits.hh"
62 
64 
65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
66 
68 : fLXe_mt(nullptr), fMPTPStyrene(nullptr)
69 {
70  fExperimentalHall_box = nullptr;
71  fExperimentalHall_log = nullptr;
72  fExperimentalHall_phys = nullptr;
73 
74  fLXe = fAl = fAir = fVacuum = fGlass = nullptr;
75  fPstyrene = fPMMA = fPethylene1 = fPethylene2 = nullptr;
76 
77  fN = fO = fC = fH = nullptr;
78 
79  fSaveThreshold = 0;
80  SetDefaults();
81 
84 }
85 
86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
87 
89 
90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91 
93  G4double a; // atomic mass
94  G4double z; // atomic number
95  G4double density;
96 
97  G4int polyPMMA = 1;
98  G4int nC_PMMA = 3+2*polyPMMA;
99  G4int nH_PMMA = 6+2*polyPMMA;
100 
101  G4int polyeth = 1;
102  G4int nC_eth = 2*polyeth;
103  G4int nH_eth = 4*polyeth;
104 
105  //***Elements
106  fH = new G4Element("H", "H", z=1., a=1.01*g/mole);
107  fC = new G4Element("C", "C", z=6., a=12.01*g/mole);
108  fN = new G4Element("N", "N", z=7., a= 14.01*g/mole);
109  fO = new G4Element("O" , "O", z=8., a= 16.00*g/mole);
110 
111  //***Materials
112  //Liquid Xenon
113  fLXe = new G4Material("LXe",z=54.,a=131.29*g/mole,density=3.020*g/cm3);
114  //Aluminum
115  fAl = new G4Material("Al",z=13.,a=26.98*g/mole,density=2.7*g/cm3);
116  //Vacuum
117  fVacuum = new G4Material("Vacuum",z=1.,a=1.01*g/mole,
119  1.e-19*pascal);
120  //Air
121  fAir = new G4Material("Air", density= 1.29*mg/cm3, 2);
122  fAir->AddElement(fN, 70*perCent);
123  fAir->AddElement(fO, 30*perCent);
124  //Glass
125  fGlass = new G4Material("Glass", density=1.032*g/cm3,2);
126  fGlass->AddElement(fC,91.533*perCent);
127  fGlass->AddElement(fH,8.467*perCent);
128  //Polystyrene
129  fPstyrene = new G4Material("Polystyrene", density= 1.03*g/cm3, 2);
130  fPstyrene->AddElement(fC, 8);
131  fPstyrene->AddElement(fH, 8);
132  //Fiber(PMMA)
133  fPMMA = new G4Material("PMMA", density=1190*kg/m3,3);
134  fPMMA->AddElement(fH,nH_PMMA);
135  fPMMA->AddElement(fC,nC_PMMA);
136  fPMMA->AddElement(fO,2);
137  //Cladding(polyethylene)
138  fPethylene1 = new G4Material("Pethylene1", density=1200*kg/m3,2);
139  fPethylene1->AddElement(fH,nH_eth);
140  fPethylene1->AddElement(fC,nC_eth);
141  //Double cladding(flourinated polyethylene)
142  fPethylene2 = new G4Material("Pethylene2", density=1400*kg/m3,2);
143  fPethylene2->AddElement(fH,nH_eth);
144  fPethylene2->AddElement(fC,nC_eth);
145 
146  //***Material properties tables
147 
148  G4double lxe_Energy[] = { 7.0*eV , 7.07*eV, 7.14*eV };
149  const G4int lxenum = sizeof(lxe_Energy)/sizeof(G4double);
150 
151  G4double lxe_SCINT[] = { 0.1, 1.0, 0.1 };
152  assert(sizeof(lxe_SCINT) == sizeof(lxe_Energy));
153  G4double lxe_RIND[] = { 1.59 , 1.57, 1.54 };
154  assert(sizeof(lxe_RIND) == sizeof(lxe_Energy));
155  G4double lxe_ABSL[] = { 35.*cm, 35.*cm, 35.*cm};
156  assert(sizeof(lxe_ABSL) == sizeof(lxe_Energy));
158  fLXe_mt->AddProperty("FASTCOMPONENT", lxe_Energy, lxe_SCINT, lxenum);
159  fLXe_mt->AddProperty("SLOWCOMPONENT", lxe_Energy, lxe_SCINT, lxenum);
160  fLXe_mt->AddProperty("RINDEX", lxe_Energy, lxe_RIND, lxenum);
161  fLXe_mt->AddProperty("ABSLENGTH", lxe_Energy, lxe_ABSL, lxenum);
162  fLXe_mt->AddConstProperty("SCINTILLATIONYIELD",12000./MeV);
163  fLXe_mt->AddConstProperty("RESOLUTIONSCALE",1.0);
164  fLXe_mt->AddConstProperty("FASTTIMECONSTANT",20.*ns);
165  fLXe_mt->AddConstProperty("SLOWTIMECONSTANT",45.*ns);
166  fLXe_mt->AddConstProperty("YIELDRATIO",1.0);
168 
169  // Set the Birks Constant for the LXe scintillator
170 
172 
173  G4double glass_RIND[]={1.49,1.49,1.49};
174  assert(sizeof(glass_RIND) == sizeof(lxe_Energy));
175  G4double glass_AbsLength[]={420.*cm,420.*cm,420.*cm};
176  assert(sizeof(glass_AbsLength) == sizeof(lxe_Energy));
178  glass_mt->AddProperty("ABSLENGTH",lxe_Energy,glass_AbsLength,lxenum);
179  glass_mt->AddProperty("RINDEX",lxe_Energy,glass_RIND,lxenum);
181 
182  G4double vacuum_Energy[]={2.0*eV,7.0*eV,7.14*eV};
183  const G4int vacnum = sizeof(vacuum_Energy)/sizeof(G4double);
184  G4double vacuum_RIND[]={1.,1.,1.};
185  assert(sizeof(vacuum_RIND) == sizeof(vacuum_Energy));
187  vacuum_mt->AddProperty("RINDEX", vacuum_Energy, vacuum_RIND,vacnum);
189  fAir->SetMaterialPropertiesTable(vacuum_mt);//Give air the same rindex
190 
191  G4double wls_Energy[] = {2.00*eV,2.87*eV,2.90*eV,3.47*eV};
192  const G4int wlsnum = sizeof(wls_Energy)/sizeof(G4double);
193 
194  G4double rIndexPstyrene[]={ 1.5, 1.5, 1.5, 1.5};
195  assert(sizeof(rIndexPstyrene) == sizeof(wls_Energy));
196  G4double absorption1[]={2.*cm, 2.*cm, 2.*cm, 2.*cm};
197  assert(sizeof(absorption1) == sizeof(wls_Energy));
198  G4double scintilFast[]={0.00, 0.00, 1.00, 1.00};
199  assert(sizeof(scintilFast) == sizeof(wls_Energy));
201  fMPTPStyrene->AddProperty("RINDEX",wls_Energy,rIndexPstyrene,wlsnum);
202  fMPTPStyrene->AddProperty("ABSLENGTH",wls_Energy,absorption1,wlsnum);
203  fMPTPStyrene->AddProperty("FASTCOMPONENT",wls_Energy, scintilFast,wlsnum);
204  fMPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",10./keV);
205  fMPTPStyrene->AddConstProperty("RESOLUTIONSCALE",1.0);
206  fMPTPStyrene->AddConstProperty("FASTTIMECONSTANT", 10.*ns);
208 
209  // Set the Birks Constant for the Polystyrene scintillator
210 
212 
213  G4double RefractiveIndexFiber[]={ 1.60, 1.60, 1.60, 1.60};
214  assert(sizeof(RefractiveIndexFiber) == sizeof(wls_Energy));
215  G4double AbsFiber[]={9.00*m,9.00*m,0.1*mm,0.1*mm};
216  assert(sizeof(AbsFiber) == sizeof(wls_Energy));
217  G4double EmissionFib[]={1.0, 1.0, 0.0, 0.0};
218  assert(sizeof(EmissionFib) == sizeof(wls_Energy));
220  fiberProperty->AddProperty("RINDEX",wls_Energy,RefractiveIndexFiber,wlsnum);
221  fiberProperty->AddProperty("WLSABSLENGTH",wls_Energy,AbsFiber,wlsnum);
222  fiberProperty->AddProperty("WLSCOMPONENT",wls_Energy,EmissionFib,wlsnum);
223  fiberProperty->AddConstProperty("WLSTIMECONSTANT", 0.5*ns);
224  fPMMA->SetMaterialPropertiesTable(fiberProperty);
225 
226  G4double RefractiveIndexClad1[]={ 1.49, 1.49, 1.49, 1.49};
227  assert(sizeof(RefractiveIndexClad1) == sizeof(wls_Energy));
229  clad1Property->AddProperty("RINDEX",wls_Energy,RefractiveIndexClad1,wlsnum);
230  clad1Property->AddProperty("ABSLENGTH",wls_Energy,AbsFiber,wlsnum);
231  fPethylene1->SetMaterialPropertiesTable(clad1Property);
232 
233  G4double RefractiveIndexClad2[]={ 1.42, 1.42, 1.42, 1.42};
234  assert(sizeof(RefractiveIndexClad2) == sizeof(wls_Energy));
236  clad2Property->AddProperty("RINDEX",wls_Energy,RefractiveIndexClad2,wlsnum);
237  clad2Property->AddProperty("ABSLENGTH",wls_Energy,AbsFiber,wlsnum);
238  fPethylene2->SetMaterialPropertiesTable(clad2Property);
239 }
240 
241 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
242 
244 
245  //The experimental hall walls are all 1m away from housing walls
249 
250  //Create experimental hall
252  = new G4Box("expHall_box",expHall_x,expHall_y,expHall_z);
254  fVacuum,"expHall_log",0,0,0);
256  fExperimentalHall_log,"expHall",0,false,0);
257 
259 
260  //Place the main volume
261  if(fMainVolumeOn){
263  = new LXeMainVolume(0,G4ThreeVector(),fExperimentalHall_log,false,0,this);
264  }
265 
266  //Place the WLS slab
267  if(fWLSslab){
268  G4VPhysicalVolume* slab = new LXeWLSSlab(0,G4ThreeVector(0.,0.,
269  -fScint_z/2.-fSlab_z-1.*cm),
270  fExperimentalHall_log,false,0,
271  this);
272 
273  //Surface properties for the WLS slab
274  G4OpticalSurface* scintWrap = new G4OpticalSurface("ScintWrap");
275 
276  new G4LogicalBorderSurface("ScintWrap", slab,
278  scintWrap);
279 
280  scintWrap->SetType(dielectric_metal);
281  scintWrap->SetFinish(polished);
282  scintWrap->SetModel(glisur);
283 
284  G4double pp[] = {2.0*eV, 3.5*eV};
285  const G4int num = sizeof(pp)/sizeof(G4double);
286  G4double reflectivity[] = {1., 1.};
287  assert(sizeof(reflectivity) == sizeof(pp));
288  G4double efficiency[] = {0.0, 0.0};
289  assert(sizeof(efficiency) == sizeof(pp));
290 
291  G4MaterialPropertiesTable* scintWrapProperty
293 
294  scintWrapProperty->AddProperty("REFLECTIVITY",pp,reflectivity,num);
295  scintWrapProperty->AddProperty("EFFICIENCY",pp,efficiency,num);
296  scintWrap->SetMaterialPropertiesTable(scintWrapProperty);
297  }
298 
299  return fExperimentalHall_phys;
300 }
301 
302 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
303 
305 
306  if (!fMainVolume) return;
307 
308  // PMT SD
309 
310  LXePMTSD* pmt = fPmt_SD.Get();
311  if (!pmt) {
312  //Created here so it exists as pmts are being placed
313  G4cout << "Construction /LXeDet/pmtSD" << G4endl;
314  LXePMTSD* pmt_SD = new LXePMTSD("/LXeDet/pmtSD");
315  fPmt_SD.Put(pmt_SD);
316 
317  pmt_SD->InitPMTs();
319  }
320  else {
321  pmt->InitPMTs();
323  }
325  //sensitive detector is not actually on the photocathode.
326  //processHits gets done manually by the stepping action.
327  //It is used to detect when photons hit and get absorbed&detected at the
328  //boundary to the photocathode (which doesnt get done by attaching it to a
329  //logical volume.
330  //It does however need to be attached to something or else it doesnt get
331  //reset at the begining of events
332 
334 
335  // Scint SD
336 
337  if (!fScint_SD.Get()) {
338  G4cout << "Construction /LXeDet/scintSD" << G4endl;
339  LXeScintSD* scint_SD = new LXeScintSD("/LXeDet/scintSD");
340  fScint_SD.Put(scint_SD);
341  }
344 }
345 
346 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
347 
349  fScint_x=dims[0];
350  fScint_y=dims[1];
351  fScint_z=dims[2];
353 }
354 
355 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
356 
358  fD_mtl=d_mtl;
360 }
361 
362 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
363 
365  fNx=nx;
367 }
368 
369 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
370 
372  fNy=ny;
374 }
375 
376 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
377 
379  fNz=nz;
381 }
382 
383 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
384 
386  fOuterRadius_pmt=outerRadius_pmt;
388 }
389 
390 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
391 
393 
394  //Resets to default values
395  fD_mtl=0.0635*cm;
396 
397  fScint_x = 17.8*cm;
398  fScint_y = 17.8*cm;
399  fScint_z = 22.6*cm;
400 
401  fNx = 2;
402  fNy = 2;
403  fNz = 3;
404 
405  fOuterRadius_pmt = 2.3*cm;
406 
407  fSphereOn = true;
408  fRefl = 1.0;
409 
410  fNfibers = 15;
411  fWLSslab = false;
412  fMainVolumeOn = true;
413  fMainVolume = nullptr;
414  fSlab_z = 2.5*mm;
415 
417  ->ApplyCommand("/LXe/detector/scintYieldFactor 1.");
418 
419  if(fLXe_mt)fLXe_mt->AddConstProperty("SCINTILLATIONYIELD",12000./MeV);
420  if(fMPTPStyrene)fMPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",10./keV);
421 
422 }
423 
424 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
425 
427  fSphereOn=b;
429 }
430 
431 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
432 
434  fRefl=r;
436 }
437 
438 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
439 
441  fWLSslab=b;
443 }
444 
445 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
446 
450 }
451 
452 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
453 
455  fNfibers=n;
457 }
458 
459 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
460 
462  fLXe_mt->AddConstProperty("SCINTILLATIONYIELD",y/MeV);
463 }
464 
465 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
466 
468  fMPTPStyrene->AddConstProperty("SCINTILLATIONYIELD",y/MeV);
469 }
470 
471 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
472 
474 /*Sets the save threshold for the random number seed. If the number of photons
475 generated in an event is lower than this, then save the seed for this event
476 in a file called run###evt###.rndm
477 */
478  fSaveThreshold=save;
480 }
481 
482 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......