Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DMXDetectorConstruction.cc
Go to the documentation of this file.
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 //
27 // --------------------------------------------------------------
28 // GEANT 4 - Underground Dark Matter Detector Advanced Example
29 //
30 // For information related to this code contact: Alex Howard
31 // e-mail: alexander.howard@cern.ch
32 // --------------------------------------------------------------
33 // Comments
34 //
35 // Underground Advanced
36 // by A. Howard and H. Araujo
37 // (27th November 2001)
38 //
39 // DetectorConstruction program
40 // --------------------------------------------------------------
41 
43 #include "DMXDetectorMessenger.hh"
44 
45 #include "DMXScintSD.hh"
46 #include "DMXPmtSD.hh"
47 
48 
49 #include "G4Material.hh"
50 #include "G4MaterialTable.hh"
51 #include "G4Element.hh"
52 #include "G4Isotope.hh"
53 #include "G4UnitsTable.hh"
54 #include "G4Box.hh"
55 #include "G4Tubs.hh"
56 #include "G4Sphere.hh"
57 #include "G4UnionSolid.hh"
58 #include "G4SubtractionSolid.hh"
59 
60 #include "G4LogicalVolume.hh"
61 #include "G4PVPlacement.hh"
62 #include "G4ThreeVector.hh"
63 #include "G4RotationMatrix.hh"
64 #include "G4Transform3D.hh"
66 #include "G4LogicalSkinSurface.hh"
67 #include "G4OpBoundaryProcess.hh"
68 
69 #include "G4FieldManager.hh"
73 #include "G4EqMagElectricField.hh"
74 #include "G4ClassicalRK4.hh"
75 #include "G4ChordFinder.hh"
76 
77 #include "G4SDManager.hh"
78 
79 #include "G4VisAttributes.hh"
80 #include "G4Colour.hh"
81 
82 #include "G4UserLimits.hh"
83 
84 #include "G4RunManager.hh"
85 #include "G4SystemOfUnits.hh"
86 
87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
89 {
90  // create commands for interactive definition of time cuts:
91  detectorMessenger = new DMXDetectorMessenger(this);
92 
93  theUserLimitsForRoom = 0;
94  theUserLimitsForDetector = 0;
95  // default time cut = infinite
96  // - note also number of steps cut in stepping action = MaxNoSteps
97  theMaxTimeCuts = DBL_MAX;
98  theMaxStepSize = DBL_MAX;
99  theDetectorStepSize = DBL_MAX;
100  theRoomTimeCut = 1000. * nanosecond;
101  theMinEkine = 250.0*eV; // minimum kinetic energy required in volume
102  theRoomMinEkine = 250.0*eV; // minimum kinetic energy required in volume
103 
104  //Zero the G4Cache objects to contain logical volumes
105  LXeSD.Put(0);
106  pmtSD.Put(0);
107 }
108 
109 
110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
112 {
113  delete theUserLimitsForRoom;
114  delete theUserLimitsForDetector;
115  delete detectorMessenger;
116 }
117 
118 
119 
120 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
121 void DMXDetectorConstruction::DefineMaterials()
122 {
123 
124 #include "DMXDetectorMaterial.icc"
125 
126 }
127 
128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
130 
131  DefineMaterials();
132 
133  // DefineField();
134 
135  // make colours
136  G4Colour white (1.0, 1.0, 1.0) ;
137  G4Colour grey (0.5, 0.5, 0.5) ;
138  G4Colour lgrey (.85, .85, .85) ;
139  G4Colour red (1.0, 0.0, 0.0) ;
140  G4Colour blue (0.0, 0.0, 1.0) ;
141  G4Colour cyan (0.0, 1.0, 1.0) ;
142  G4Colour magenta (1.0, 0.0, 1.0) ;
143  G4Colour yellow (1.0, 1.0, 0.0) ;
144  G4Colour orange (.75, .55, 0.0) ;
145  G4Colour lblue (0.0, 0.0, .75) ;
146  G4Colour lgreen (0.0, .75, 0.0) ;
147  G4Colour green (0.0, 1.0, 0.0) ;
148  G4Colour brown (0.7, 0.4, 0.1) ;
149 
150 
151  // un-used colours:
152  // G4Colour black (0.0, 0.0, 0.0) ;
153 
154 
155 
156  // Universe - room wall - CONCRETE ****************************************
157 
158  //NB: measured INSIDE of lab, therefore have to add twice wall thickness
159  G4double wallThick = 24.*cm;
160  G4double worldWidth = 470.0*cm + 2.*wallThick; // "x"
161  G4double worldLength = 690.0*cm + 2.*wallThick; // "y"
162  G4double worldHeight = 280.0*cm + 2.*wallThick; // "z"
163 
164  G4Box* world_box = new G4Box
165  ("world_box", 0.5*worldWidth, 0.5*worldLength, 0.5*worldHeight );
166  world_log = new G4LogicalVolume(world_box, world_mat, "world_log");
167  world_phys = new G4PVPlacement(0, G4ThreeVector(0.,0.,0.),
168  "world_phys", world_log, NULL, false,0);
169 
170  // G4VisAttributes* world_vat= new G4VisAttributes(white);
172  //world_vat->SetVisibility(true);
173  //world_vat->SetVisibility(false);
174  //world_log->SetVisAttributes(world_vat);
175 
176 
177  // Lab Space - AIR ********************************************************
178 
179  G4double labWidth = worldWidth - 2.*wallThick; //X
180  G4double labLength = worldLength - 2.*wallThick; //Y
181  G4double labHeight = worldHeight - 2.*wallThick; //Z
182 
183  G4Box* lab_box = new G4Box
184  ("lab_box", 0.5*labWidth, 0.5*labLength, 0.5*labHeight );
185  lab_log = new G4LogicalVolume(lab_box, lab_mat, "lab_log");
186  lab_phys = new G4PVPlacement(0, G4ThreeVector(0.,0.,0.), "lab_phys",
187  lab_log, world_phys, false,0);
188 
189  G4VisAttributes* lab_vat= new G4VisAttributes(white);
190  // lab_log->SetVisAttributes(G4VisAttributes::GetInvisible());
191  // lab_vat->SetVisibility(true);
192  lab_vat->SetVisibility(false);
193  lab_log->SetVisAttributes(lab_vat);
194 
195 // include room furniture: **************************************************
196 
197 #include "DMXDetectorRoom.icc"
198 
199  // Now start with detector assembly:
200 
201  // first LN2 cooling container: *******************************************
202 
203  G4double PosZ = -25.3*cm; // extra z-pos to correspond with height in lab
204 
205  G4double LN2jacketRadius = 107.5*mm;
206  G4double LN2jacketHeight = 590.0*mm;
207  G4double jacketHeight = 680.0*mm;
208  G4double jacketflangeHeight = 53.0*mm;
209  G4double LN2PosZ = 0.5*jacketHeight + 0.5*LN2jacketHeight
210  + jacketflangeHeight + PosZ;
211 
212  G4Tubs* LN2jacket_tube = new G4Tubs("LN2jacket_tube",
213  0.*cm, LN2jacketRadius, 0.5*LN2jacketHeight, 0.*deg, 360.*deg);
214  LN2jacket_log = new G4LogicalVolume
215  (LN2jacket_tube, LN2jacket_mat, "LN2jacket_log");
216  LN2jacket_phys = new G4PVPlacement(0, G4ThreeVector(0.,0.,LN2PosZ),
217  "LN2jacket_phys", LN2jacket_log, lab_phys, false,0);
218 
219  G4VisAttributes* LN2jacket_vat = new G4VisAttributes(lgrey);
220  // LN2jacket_log->SetVisAttributes(G4VisAttributes::GetInvisible());
221  // LN2jacket_vat->SetVisibility(true);
222  LN2jacket_log->SetVisAttributes(LN2jacket_vat);
223 
224  // LN2jacket vacuum: **********************
225 
226  G4double LN2jacketMetalThick = 2.0*mm;
227  G4double LN2vacuumRadius = LN2jacketRadius - LN2jacketMetalThick;
228  G4double LN2vacuumHeight = LN2jacketHeight - LN2jacketMetalThick;
229 
230  G4Tubs* LN2vacuum_tube = new G4Tubs("LN2vacuum_tube",
231  0.*cm, LN2vacuumRadius, 0.5*LN2vacuumHeight, 0.*deg, 360.*deg);
232  LN2vacuum_log = new G4LogicalVolume
233  (LN2vacuum_tube, vacuum_mat, "LN2vacuum_log");
234  LN2vacuum_phys = new G4PVPlacement(0, G4ThreeVector(0.,0.,0.),
235  "LN2vacuum_phys", LN2vacuum_log, LN2jacket_phys, false,0);
236 
238 
239  // LN2 vessel: ************************************************************
240 
241  G4double LN2Radius = 76.0*mm;
242  G4double LN2Height = 590.0*mm - 2.*LN2jacketMetalThick;
243  G4double LN2vesselRadius = LN2Radius + LN2jacketMetalThick;
244  G4double LN2vesselHeight = LN2Height;
245  G4double LN2vesselPosZ = 0.5*LN2vacuumHeight - 0.5*LN2vesselHeight;
246 
247  G4Tubs* LN2vessel_tube = new G4Tubs("LN2vessel_tube",
248  0.*cm, LN2vesselRadius, 0.5*LN2vesselHeight, 0.*deg, 360.*deg);
249  LN2vessel_log = new G4LogicalVolume
250  (LN2vessel_tube, LN2jacket_mat, "LN2vessel_log");
251  LN2vessel_phys = new G4PVPlacement(0, G4ThreeVector(0.,0.,LN2vesselPosZ),
252  "LN2vessel_phys", LN2vessel_log, LN2vacuum_phys, false,0);
253 
254  G4VisAttributes* LN2vessel_vat = new G4VisAttributes(lgrey);
255  // LN2vessel_log->SetVisAttributes(G4VisAttributes::GetInvisible());
256  // LN2vessel_vat->SetVisibility(true);
257  LN2vessel_log->SetVisAttributes(LN2vessel_vat);
258 
259 
260  // and finally LN2: *******************************************************
261 
262  G4Tubs* LN2_tube = new G4Tubs("LN2_tube",
263  0.*cm, LN2Radius, 0.5*LN2Height, 0.*deg, 360.*deg);
264  LN2_log = new G4LogicalVolume(LN2_tube, LN2_mat, "LN2_log");
265  LN2_phys = new G4PVPlacement(0, G4ThreeVector(0.,0.,0.),
266  "LN2_phys", LN2_log, LN2vessel_phys, false,0);
267 
268  G4VisAttributes* LN2_vat = new G4VisAttributes(green);
269  LN2_vat->SetVisibility(true);
270  LN2_log->SetVisAttributes(LN2_vat);
271 
272 
273  // outer vacuum jacket volume: stainless steel ****************************
274 
275  G4double jacketRadius = 127.5*mm;
276  // G4double jacketHeight = 680.0*mm; // defined above to get full-height
277  G4double jacketMetalThick = LN2jacketMetalThick;
278 
279  G4Tubs* jacket_tube = new G4Tubs("jacket_tube",
280  0.*cm, jacketRadius, 0.5*jacketHeight, 0.*deg, 360.*deg);
281  jacket_log = new G4LogicalVolume(jacket_tube, jacket_mat, "jacket_log");
282  jacket_phys = new G4PVPlacement(0, G4ThreeVector(0.,0.,PosZ),
283  "jacket_phys", jacket_log, lab_phys, false,0);
284 
285  G4VisAttributes* jacket_vat = new G4VisAttributes(grey);
286  // jacket_log->SetVisAttributes(G4VisAttributes::GetInvisible());
287  jacket_log->SetVisAttributes(jacket_vat);
288 
289 
290  // outer vacuum jacket flanges: stainless steel *************************
291 
292  G4double jacketflangeRadius = 127.5*mm;
293  // G4double jacketflangeHeight = 53.0*mm; // defined above to get full-height
294  G4double topjacketflangePosZ = 0.5*(jacketHeight+jacketflangeHeight);
295 
296  G4Tubs* jacketflange_tube = new G4Tubs("jacketflange_tube",
297  0.*cm, jacketflangeRadius, 0.5*jacketflangeHeight, 0.*deg, 360.*deg);
298  jacketflange_log = new G4LogicalVolume
299  (jacketflange_tube, jacketflange_mat, "jacketflange_log");
300  topjacketflange_phys = new G4PVPlacement
301  (0, G4ThreeVector(0.,0.,topjacketflangePosZ + PosZ),
302  "topjacketflange_phys", jacketflange_log, lab_phys, false,0);
303  bottomjacketflange_phys = new G4PVPlacement
304  (0, G4ThreeVector(0.,0.,-topjacketflangePosZ + PosZ),
305  "bottomjacketflange_phys", jacketflange_log, lab_phys, false,0);
306 
307  // jacketflange_log->SetVisAttributes(G4VisAttributes::GetInvisible());
308  jacketflange_log->SetVisAttributes(jacket_vat);
309 
310  // vacuum **************************************************************
311 
312  G4double vacuumRadius = jacketRadius - jacketMetalThick;
313  G4double vacuumHeight = jacketHeight - jacketMetalThick;
314 
315  G4Tubs* vacuum_tube = new G4Tubs("vacuum_tube",
316  0.*cm, vacuumRadius, 0.5*vacuumHeight, 0.*deg, 360.*deg);
317  vacuum_log = new G4LogicalVolume(vacuum_tube, vacuum_mat, "vacuum_log");
318  vacuum_phys = new G4PVPlacement(0, G4ThreeVector(0.,0.,0.),
319  "vacuum_phys", vacuum_log, jacket_phys, false,0);
320 
321  // G4VisAttributes* vacuum_vat= new G4VisAttributes(lgrey);
323 
324 
325  // copper cooling jacket volume: **************************************
326 
327  G4double copperMetalThick = 3.0*mm;
328  G4double copperRadius = 103.5*mm + copperMetalThick;
329  G4double copperHeight = 420.0*mm;
330  G4double copperInner = copperRadius - copperMetalThick;
331  G4double vesselHeight = 320.0*mm;
332  G4double copperVPos = 0.5*(vesselHeight-copperHeight) + 13.0*cm;
333  G4double coppertopThick = 1.0*cm;
334  G4double coppertopVPos = copperVPos + 0.5*(coppertopThick+copperHeight);
335 
336  G4Tubs* copper_tube = new G4Tubs("copper_tube",
337  copperInner, copperRadius, 0.5*copperHeight, 0.*deg, 360.*deg);
338  copper_log = new G4LogicalVolume(copper_tube, copper_mat, "copper_log");
339  copper_phys = new G4PVPlacement(0, G4ThreeVector(0.,0.,copperVPos),
340  "copper_phys", copper_log, vacuum_phys, false,0);
341 
342  G4Tubs* coppertop_tube = new G4Tubs("coppertop_tube",
343  0.*cm, copperRadius, 0.5*coppertopThick, 0.*deg, 360.*deg);
344  coppertop_log = new G4LogicalVolume
345  (coppertop_tube, copper_mat, "coppertop_log");
346  coppertop_phys = new G4PVPlacement(0,G4ThreeVector(0.,0.,coppertopVPos),
347  "coppertop_phys", coppertop_log, vacuum_phys, false,0);
348 
349  G4VisAttributes* copper_vat = new G4VisAttributes(orange);
350  // copper_log->SetVisAttributes(G4VisAttributes::GetInvisible());
351  copper_log->SetVisAttributes(copper_vat);
352  coppertop_log->SetVisAttributes(copper_vat);
353 
354  // inner vessel jacket volume: stainless steel ************************
355 
356  // G4double vesselHeight = 320.0*mm; // - moved earlier
357  G4double vesselMetalThick = jacketMetalThick;
358  G4double vesselRadius = 75.0*mm + vesselMetalThick;
359  G4double vesselflangeRadius = 101.5*mm;
360  G4double vesselflangeThick = 40.0*mm;
361  G4double PMTvesselRadius = 31.0*mm + vesselMetalThick;
362  G4double PMTvesselHeight = 152.0*mm;
363  G4double pmtvesselflangeRadius = 52.0*mm;
364  G4double pmtvesselflangeThick = 32.0*mm;
365  G4double vesselVPos = 7.0*cm;
366  G4double TotalvesselHeight = PMTvesselHeight + vesselHeight;
367 
368  G4Tubs* vessel_tube = new G4Tubs("vessel_tube",
369  0.*cm, vesselRadius, 0.5*vesselHeight, 0.*deg, 360.*deg);
370  G4Tubs* PMTvessel_tube = new G4Tubs("PMTvessel_tube",
371  0.*cm, PMTvesselRadius, 0.5*PMTvesselHeight, 0.*deg, 360.*deg);
372 
373  G4UnionSolid* vessel_sol = new G4UnionSolid
374  ("vessel_sol", vessel_tube, PMTvessel_tube,
376  G4ThreeVector(0,0,-0.5*(vesselHeight+PMTvesselHeight))));
377 
378  vessel_log = new G4LogicalVolume(vessel_sol, vessel_mat, "vessel_log");
379  vessel_phys = new G4PVPlacement(0, G4ThreeVector(0.,0.,vesselVPos),
380  "vessel_phys", vessel_log, vacuum_phys, false,0);
381 
382 
383  // flanges: 1=upper half (diff. inner diam.) 2=lower half
384  G4Tubs* vesseltop_flange1 = new G4Tubs("vesseltop_flange1",
385  0.*cm, vesselflangeRadius, 0.25*vesselflangeThick, 0.*deg, 360.*deg);
386  vesseltop_log1 = new G4LogicalVolume
387  (vesseltop_flange1, vessel_mat, "vesseltop_log1");
388  vesseltop_phys1 = new G4PVPlacement
389  (0,
390  G4ThreeVector(0.,0.,0.5*(vesselHeight+0.5*vesselflangeThick)+vesselVPos),
391  "vesseltop_phys1", vesseltop_log1, vacuum_phys, false,0);
392 
393  G4Tubs* vesseltop_flange2 = new G4Tubs("vesseltop_flange2",vesselRadius,
394  vesselflangeRadius, 0.25*vesselflangeThick, 0.*deg, 360.*deg);
395  vesseltop_log2 = new G4LogicalVolume
396  (vesseltop_flange2, vessel_mat, "vesseltop_log2");
397  vesseltop_phys2 = new G4PVPlacement
398  (0,
399  G4ThreeVector(0.,0.,0.5*(vesselHeight-0.5*vesselflangeThick)+vesselVPos),
400  "vesseltop_phys2", vesseltop_log2, vacuum_phys, false,0);
401 
402 
403  G4Tubs* vesselbottom_flange1 = new G4Tubs
404  ("vesselbottom_flange1",vesselRadius, vesselflangeRadius,
405  0.25*vesselflangeThick, 0.*deg, 360.*deg);
406  vesselbottom_log1 = new G4LogicalVolume
407  (vesselbottom_flange1, vessel_mat, "vesselbottom_log1");
408  vesselbottom_phys1 = new G4PVPlacement(0,
409  G4ThreeVector(0.,0.,-0.5*(vesselHeight-0.5*vesselflangeThick)+vesselVPos),
410  "vesselbottom_phys1", vesselbottom_log1, vacuum_phys, false,0);
411 
412  G4Tubs* vesselbottom_flange2 = new G4Tubs
413  ("vesselbottom_flange2",PMTvesselRadius, vesselflangeRadius,
414  0.25*vesselflangeThick, 0.*deg, 360.*deg);
415  vesselbottom_log2 = new G4LogicalVolume
416  (vesselbottom_flange2, vessel_mat, "vesselbottom_log2");
417  vesselbottom_phys2 = new G4PVPlacement(0,
418  G4ThreeVector(0.,0.,-0.5*(vesselHeight+0.5*vesselflangeThick)+vesselVPos),
419  "vesselbottom_phys2", vesselbottom_log2, vacuum_phys, false,0);
420 
421 
422  G4Tubs* pmtvesselbottom_flange1 = new G4Tubs
423  ("pmtvesselbottom_flange1", PMTvesselRadius, pmtvesselflangeRadius,
424  0.25*pmtvesselflangeThick, 0.*deg, 360.*deg);
425  pmtvesselbottom_log1 = new G4LogicalVolume
426  (pmtvesselbottom_flange1, vessel_mat, "pmtvesselbottom_log1");
427  pmtvesselbottom_phys1 = new G4PVPlacement(0, G4ThreeVector(0.,0.,
428  (-0.5*vesselHeight-PMTvesselHeight+vesselVPos+0.25*pmtvesselflangeThick)),
429  "pmtvesselbottom_phys1", pmtvesselbottom_log1, vacuum_phys, false,0);
430 
431  G4Tubs* pmtvesselbottom_flange2 = new G4Tubs
432  ("pmtvesselbottom_flange2", 0.*cm, pmtvesselflangeRadius,
433  0.25*pmtvesselflangeThick, 0.*deg, 360.*deg);
434  pmtvesselbottom_log2 = new G4LogicalVolume
435  (pmtvesselbottom_flange2, vessel_mat, "pmtvesselbottom_log2");
436  pmtvesselbottom_phys2 = new G4PVPlacement(0, G4ThreeVector(0.,0.,
437  -0.5*vesselHeight-PMTvesselHeight+vesselVPos-0.25*pmtvesselflangeThick),
438  "pmtvesselbottom_phys2", pmtvesselbottom_log2, vacuum_phys, false,0);
439 
440 
441  G4VisAttributes* vessel_vat = new G4VisAttributes(grey);
442  G4VisAttributes* pmtvessel_vat = new G4VisAttributes(yellow);
443  G4VisAttributes* pmtvessel_vat2 = new G4VisAttributes(green);
444  // vessel_log->SetVisAttributes(G4VisAttributes::GetInvisible());
445  // vessel_vat->SetForceSolid(true);
446  // pmtvessel_vat->SetForceSolid(true);
447  // pmtvessel_vat2->SetForceSolid(true);
448  vessel_log->SetVisAttributes(vessel_vat);
449  vesseltop_log1->SetVisAttributes(vessel_vat);
450  vesselbottom_log1->SetVisAttributes(vessel_vat);
451  vesseltop_log2->SetVisAttributes(pmtvessel_vat);
452  vesselbottom_log2->SetVisAttributes(pmtvessel_vat);
453  // pmtvesselbottom_log->SetVisAttributes(vessel_vat);
454  pmtvesselbottom_log1->SetVisAttributes(vessel_vat);
455  pmtvesselbottom_log2->SetVisAttributes(pmtvessel_vat2);
456 
457 
458 
459  // *********************************************************************
460  // grid#1 to mirror surface: 21.75 mm
461  // LXe height = 15.75 mm, gXe height = 6.00 mm
462  // NB: Increased liquid height by 1mm - to take away problem with
463  // over-lapping volumes/ring pronounced from liquid phase..........
464  // *********************************************************************
465 
466  // detector volume: gas phase ******************************************
467 
468  G4double mirrorVPos = 21.3*cm;
469  G4double gasGap = 6.0*mm;
470  G4double DetectorRadius = vesselRadius - vesselMetalThick;
471  G4double GXeHeight = TotalvesselHeight - mirrorVPos + gasGap;
472  G4double GXeVPos = 0.5*vesselHeight - 0.5*GXeHeight;
473 
474  G4Tubs* GXe_tube = new G4Tubs("GXe_tube",
475  0.*cm, DetectorRadius, 0.5*GXeHeight, 0.*deg, 360.*deg);
476  GXe_log = new G4LogicalVolume(GXe_tube, GXe_mat, "GXe_log");
477  GXe_phys = new G4PVPlacement(0, G4ThreeVector(0.,0.,GXeVPos),
478  "GXe_phys", GXe_log, vessel_phys, false,0);
479 
480  G4VisAttributes* GXe_vat = new G4VisAttributes(cyan);
481  // GXe_vat->SetForceSolid(true);
482  GXe_vat->SetVisibility(true);
483  GXe_log->SetVisAttributes(GXe_vat);
484 
485 
486  // liquid phase *******************************************************
487 
488  G4double LXeHeight = mirrorVPos - gasGap;
489  G4double PMTDetectorRadius = PMTvesselRadius - vesselMetalThick;
490  G4double PMTDetectorHeight = PMTvesselHeight;
491  G4double LXeTubeHeight = LXeHeight - PMTDetectorHeight;
492  G4double LXe_solVPos = -0.5*(LXeTubeHeight+PMTDetectorHeight);
493  G4double LXeVPos = -0.5*TotalvesselHeight + 0.5*LXeHeight;
494 
495  G4Tubs* LXe_tube = new G4Tubs("GXe_tube",
496  0.*cm, DetectorRadius, 0.5*LXeTubeHeight, 0.*deg, 360.*deg);
497  G4Tubs* PMTdetector_tube = new G4Tubs("PMTdetector_tube",
498  0.*cm, PMTDetectorRadius, 0.5*PMTDetectorHeight, 0.*deg, 360.*deg);
499 
500  G4UnionSolid* LXe_sol = new G4UnionSolid
501  ("LXe_sol", LXe_tube, PMTdetector_tube,
502  G4Transform3D(G4RotationMatrix(), G4ThreeVector(0,0,LXe_solVPos)));
503 
504  LXe_log = new G4LogicalVolume(LXe_sol, LXe_mat, "LXe_log");
505  LXe_phys = new G4PVPlacement(0, G4ThreeVector(0.*cm, 0.*cm, LXeVPos),
506  "LXe_phys", LXe_log, vessel_phys, false, 0);
507 
508  // attributes
509  G4VisAttributes* LXe_vat = new G4VisAttributes(lblue);
510  // LXe_vat->SetForceSolid(true);
511  LXe_vat->SetVisibility(true);
512  LXe_log->SetVisAttributes(LXe_vat);
513 
514 
515  // Gas phase vessel lagging - for optical properties:
516 
517  G4double laggingThickness = 10.*micrometer;
518  G4double laggingRadius = DetectorRadius - laggingThickness;
519 
520  G4Tubs* gaslag_tube = new G4Tubs("gaslag_tube", laggingRadius,
521  DetectorRadius, 0.5*GXeHeight, 0.*deg, 360.*deg);
522  gaslag_log = new G4LogicalVolume(gaslag_tube, vessel_mat, "gaslag_log");
523  gaslag_phys = new G4PVPlacement(0, G4ThreeVector(0.*cm, 0.*cm, 0.*cm),
524  "gaslag_phys", gaslag_log, GXe_phys, false, 0);
525 
526  // attributes
527  G4VisAttributes* gaslag_vat = new G4VisAttributes(lgreen);
528  // gaslag_vat->SetForceSolid(true);
529  gaslag_vat->SetVisibility(true);
530  gaslag_log->SetVisAttributes(gaslag_vat);
531 
532 
533  // liquid phase vessel lagging - for optical properties:
534 
535  G4double lagTubeRadius = DetectorRadius - laggingThickness;
536  G4double lagTubeHeight = LXeHeight - PMTDetectorHeight;
537  G4double lagPMTRadius = PMTDetectorRadius - laggingThickness;
538  G4double lagPMTHeight = PMTDetectorHeight;
539 
540  G4Tubs* liqLag_tube = new G4Tubs("liqlag_tube", lagTubeRadius,
541  DetectorRadius, 0.5*lagTubeHeight, 0.*deg, 360.*deg);
542  G4Tubs* lagPMT_tube = new G4Tubs("lagPMT_tube", lagPMTRadius,
543  PMTDetectorRadius, 0.5*lagPMTHeight, 0.*deg, 360.*deg);
544 
545  G4UnionSolid* liqLag_sol = new G4UnionSolid
546  ("liqLag_sol", liqLag_tube, lagPMT_tube,
547  G4Transform3D(G4RotationMatrix(),G4ThreeVector(0,0,LXe_solVPos)));
548 
549  liqLag_log = new G4LogicalVolume(liqLag_sol, vessel_mat, "liqLag_log");
550  liqLag_phys = new G4PVPlacement(0, G4ThreeVector(0.*cm, 0.*cm, 0.*cm),
551  "liqLag_phys", liqLag_log, LXe_phys, false, 0);
552 
553  // attributes
554  G4VisAttributes* liqLag_vat = new G4VisAttributes(magenta);
555  // liqLag_vat->SetForceSolid(true);
556  liqLag_vat->SetVisibility(true);
557  liqLag_log->SetVisAttributes(liqLag_vat);
558 
559 
560  // Vessel Wall Optical Surface definition:
561  G4OpticalSurface* OpVesselSurface = new G4OpticalSurface
562  ("VesselSurface", unified, polished, dielectric_metal);
563 
564  // created optical lagging onto vessel - to avoid clash between over-lapping
565  // liquid and gas phase - so removed below:
566  /*
567  G4LogicalBorderSurface* VesselSurface;
568  VesselSurface = new G4LogicalBorderSurface
569  ("Vessel", liqPhase_phys, vessel_phys, OpVesselSurface);
570  */
571 
572  const G4int NUM = 2;
573  G4double vessel_PP[NUM] = { 6.5*eV, 7.50*eV };
574  G4double vessel_REFL[NUM] = { 0.2, 0.2 };
576  vessel_mt->AddProperty("REFLECTIVITY", vessel_PP, vessel_REFL, NUM);
577  OpVesselSurface->SetMaterialPropertiesTable(vessel_mt);
578 
579  // G4LogicalBorderSurface* VesselTopSurface =
581  ("VesselTop", GXe_phys, vesseltop_phys1, OpVesselSurface);
582 
583  //G4LogicalBorderSurface* VesselBottomSurface =
585  ("VesselBottom", LXe_phys, vesselbottom_phys2, OpVesselSurface);
586 
587  //G4LogicalBorderSurface* GasVesselSurface =
589  ("GasVessel", GXe_phys, gaslag_phys, OpVesselSurface);
590 
591  //G4LogicalBorderSurface* LiquidVesselSurface =
593  ("LiquidVessel", LXe_phys, liqLag_phys, OpVesselSurface);
594 
595 
596 
597  // Cu Shield **********************************************************
598 
599  G4double CuShieldHeight = 17.7*cm;
600  G4double CuShieldThickness = 2.4*mm;
601  G4double CuShieldOuterRadius = 3.0*cm;
602  G4double CuShieldInnerRadius = CuShieldOuterRadius-CuShieldThickness;
603  G4double CuShieldVPosition = -0.5*LXeTubeHeight - PMTDetectorHeight
604  + 0.5*CuShieldHeight;
605 
606  // Zero co-ordinate of the union is the zero of the first volume,
607  // i.e. the offset is still present
608 
609  G4Tubs* CuShield_tube = new G4Tubs("CuShield_tube", CuShieldInnerRadius,
610  CuShieldOuterRadius, 0.5*CuShieldHeight, 0.*deg, 360.*deg);
611  CuShield_log = new G4LogicalVolume(CuShield_tube, CuShield_mat,
612  "CuShield_log");
613  CuShield_phys = new G4PVPlacement(0,
614  G4ThreeVector(0.*cm, 0.*cm, CuShieldVPosition),
615  "CuShield_phys", CuShield_log, LXe_phys, false, 0);
616 
617  // G4VisAttributes* CuShield_vat= new G4VisAttributes(magenta);
618  G4VisAttributes* CuShield_vat = new G4VisAttributes(brown);
619  // CuShield_vat->SetForceSolid(true);
620  CuShield_vat->SetVisibility(true);
621  CuShield_log->SetVisAttributes(CuShield_vat);
622 
623  // Cu shield surface
624  G4double sigalpha;
625  G4OpticalSurface* OpCuShieldSurface = new G4OpticalSurface
626  ("ShieldSurface", unified, ground, dielectric_metal, sigalpha=30.0*deg);
627  //G4LogicalBorderSurface* ShieldSurface =
629  ("Shield", LXe_phys, CuShield_phys, OpCuShieldSurface);
630 
631  G4double CuShield_PP[NUM] = { 7.0*eV, 7.50*eV };
632  G4double CuShield_REFL[NUM] = { 0.3, 0.2 };
634  CuShield_mt->AddProperty("REFLECTIVITY", CuShield_PP, CuShield_REFL, NUM);
635  OpCuShieldSurface->SetMaterialPropertiesTable(CuShield_mt);
636 
637 
638  // rings ***************************************************************
639 
640  G4double ringHeight = 4.*mm;
641  G4double ringOuterRadius = 4.0*cm;
642  G4double ringInnerRadius = CuShieldOuterRadius;
643  G4double ringVOffset = 0.5*ringHeight;
644  G4double ringVPosition = -0.5*GXeHeight + gasGap +ringVOffset;
645 
646  G4Tubs* ring_tube=new G4Tubs("ring_tube", ringInnerRadius,
647  ringOuterRadius, 0.5*ringHeight, 0.*deg, 360.*deg);
648  ring_log = new G4LogicalVolume(ring_tube, ring_mat, "ring_log");
649 
650  // optical surface: ring materials table
651  G4double ring_PP[NUM] = { 6.00*eV, 7.50*eV };
652  G4double ring_REFL[NUM] = { 0.7, 0.65 };
654  ring_mt->AddProperty("REFLECTIVITY", ring_PP, ring_REFL, NUM);
655 
656  G4OpticalSurface* OpRingSurface = new G4OpticalSurface
657  ("RingSurface", unified, ground, dielectric_metal, sigalpha=10.*deg);
658  // last argument is surface roughness if it's non-polished - i.e. ground
659  OpRingSurface->SetMaterialPropertiesTable(ring_mt);
660 
661  // rings inside gas phase
662  ring_phys_gas[0] = new G4PVPlacement(0, G4ThreeVector
663  (0.*cm, 0.*cm, ringVPosition),"ring_phys0",ring_log,GXe_phys,false, 0);
664  //G4LogicalBorderSurface* RingSurface_gas0 =
666  ("Ring", GXe_phys, ring_phys_gas[0], OpRingSurface);
667 
668  ring_phys_gas[1] = new G4PVPlacement(0,
669  G4ThreeVector(0.*cm, 0.*cm, ringVPosition-=ringHeight+1.0*mm),
670  "ring_phys1",ring_log, GXe_phys, false, 0);
671  //G4LogicalBorderSurface* RingSurface_gas1 =
673  ("Ring", GXe_phys, ring_phys_gas[1], OpRingSurface);
674 
675 
676  // rings inside liquid phase:
677  ringVPosition = 0.5*LXeTubeHeight;
678 
679  ring_phys_liq[0] = new G4PVPlacement(0,
680  G4ThreeVector(0.*cm, 0.*cm, ringVPosition-=0.5*ringHeight),
681  "ring_phys2",ring_log,LXe_phys, false, 0);
682  //G4LogicalBorderSurface* RingSurface_liq0 =
684  ("Ring", LXe_phys, ring_phys_liq[0], OpRingSurface);
685 
686  ring_phys_liq[1] = new G4PVPlacement(0,
687  G4ThreeVector(0.*cm, 0.*cm, ringVPosition-=ringHeight+1.75*mm),
688  "ring_phys3",ring_log, LXe_phys, false, 0);
689  //G4LogicalBorderSurface* RingSurface_liq1 =
691  ("Ring", LXe_phys, ring_phys_liq[1], OpRingSurface);
692 
693  ring_phys_liq[2]=new G4PVPlacement(0,
694  G4ThreeVector(0.*cm, 0.*cm, ringVPosition-=ringHeight),
695  "ring_phys4",ring_log, LXe_phys, false, 0);
696  //G4LogicalBorderSurface* RingSurface_liq2 =
698  ("Ring", LXe_phys, ring_phys_liq[2], OpRingSurface);
699 
700  ring_phys_liq[3]=new G4PVPlacement(0,
701  G4ThreeVector(0.*cm, 0.*cm, ringVPosition-=ringHeight),
702  "ring_phys5",ring_log, LXe_phys, false, 0);
703  //G4LogicalBorderSurface* RingSurface_liq3 =
705  ("Ring", LXe_phys, ring_phys_liq[3], OpRingSurface);
706 
707  ring_phys_liq[4]=new G4PVPlacement(0,
708  G4ThreeVector(0.*cm, 0.*cm, ringVPosition-=ringHeight+1.75*mm),
709  "ring_phys6",ring_log, LXe_phys,false, 0);
710  //G4LogicalBorderSurface* RingSurface_liq4 =
712  ("Ring", LXe_phys, ring_phys_liq[4], OpRingSurface);
713 
714  ring_phys_liq[5]=new G4PVPlacement(0,
715  G4ThreeVector(0.*cm, 0.*cm, ringVPosition-=ringHeight+1.75*mm),
716  "ring_phys7",ring_log, LXe_phys,false, 0);
717  //G4LogicalBorderSurface* RingSurface_liq5 =
719  ("Ring", LXe_phys, ring_phys_liq[5], OpRingSurface);
720 
721 
722  G4VisAttributes* ring_vat= new G4VisAttributes(lgrey);
723  ring_vat->SetVisibility(true);
724  ring_log->SetVisAttributes(ring_vat);
725 
726 
727  // Mirror *************************************************************
728 
729  G4double mirrorHeight = 2.0*mm;
730  G4double mirrorRadius = ringInnerRadius;
731  G4double mirrorVOffset = 0.5*ringHeight;
732  G4double mirrorVPosition = -0.5*GXeHeight + gasGap +mirrorVOffset;
733 
734  G4Tubs* mirror_tube = new G4Tubs("mirror_tube", 0.*cm, mirrorRadius,
735  0.5*mirrorHeight, 0.*deg, 360.*deg);
736  mirror_log = new G4LogicalVolume(mirror_tube, mirror_mat, "mirror_log");
737  mirror_phys = new G4PVPlacement(0,
738  G4ThreeVector(0.*cm, 0.*cm, mirrorVPosition),
739  "mirror_phys", mirror_log, GXe_phys, false, 0);
740 
741  G4VisAttributes* mirror_vat = new G4VisAttributes(cyan);
742  mirror_vat->SetVisibility(true);
743  // mirror_vat->SetForceSolid(true);
744  mirror_log->SetVisAttributes(mirror_vat);
745 
746 
747  // mirror surface
748  G4OpticalSurface * OpMirrorSurface = new G4OpticalSurface
749  ("MirrorSurface", unified, ground, dielectric_metal, sigalpha=5.0*deg);
750  //G4LogicalBorderSurface* MirrorSurface =
752  ("Mirror", GXe_phys, mirror_phys, OpMirrorSurface);
753 
754  G4double mirror_PP[NUM] = { 6.00*eV, 7.50*eV };
755  G4double mirror_REFL[NUM] = { 0.83, 0.78 };
757  mirror_mt->AddProperty("REFLECTIVITY", mirror_PP, mirror_REFL, NUM);
758  OpMirrorSurface->SetMaterialPropertiesTable(mirror_mt);
759 
760 
761  // Grids *************************************************************
762 
763  G4double gridHeight = 0.100*mm;
764  G4double gridRadius = ringInnerRadius;
765  G4double grid1VOffset = 3.5*ringHeight+1.75*mm;
766  G4double grid1VPosition = 0.5*LXeTubeHeight - grid1VOffset;
767  G4double grid2VOffset = 4.5*ringHeight+3.50*mm;
768  G4double grid2VPosition = 0.5*LXeTubeHeight - grid2VOffset;
769 
770  G4Tubs* grid_tube = new G4Tubs("grid_tube", 0.*cm, gridRadius,
771  0.5*gridHeight, 0.*deg, 360.*deg);
772 
773  grid1_log = new G4LogicalVolume(grid_tube, grid_mat, "grid1_log");
774  grid1_phys = new G4PVPlacement(0,G4ThreeVector(0.*cm, 0.*cm, grid1VPosition),
775  "grid1_phys", grid1_log, LXe_phys, false, 0);
776  grid2_log = new G4LogicalVolume(grid_tube, grid_mat, "grid2_log");
777  grid2_phys = new G4PVPlacement(0,G4ThreeVector(0.*cm, 0.*cm, grid2VPosition),
778  "grid2_phys", grid2_log, LXe_phys, false, 0);
779 
780  G4VisAttributes* grid_vat = new G4VisAttributes(red);
781  grid_vat->SetVisibility(true);
782  grid1_log->SetVisAttributes(grid_vat);
783  grid2_log->SetVisAttributes(grid_vat);
784 
785 
786  // alpha source holder ************************************************
787 
788  G4double alphaHeight = 0.7*mm; // total lead thickness = 1.23 mm
789  G4double recessHeight = 0.3*mm; // totals lead thickness = 1.23 mm
790  G4double alphaRadius = 1.2*mm; // was 0.8
791  G4double recessRadius = 0.35*mm; // was 0.5 was 0.2
792  G4double recessVPosition = 0.5*(alphaHeight - recessHeight);
793 
794  G4double alphaVOffset = grid1VOffset-0.5*alphaHeight - gridHeight;
795  G4double americiumHeight = 3000.*nanometer; // assumes ~1% Am
796  G4double extra_offset = (recessHeight +0.3*mm + 0.5*americiumHeight);
797  G4double alphaVPosition = 0.5*LXeTubeHeight - alphaVOffset + extra_offset;
798 
799  G4Tubs* alpha_tube = new G4Tubs("alpha_tube", 0.*cm, alphaRadius,
800  0.5*alphaHeight, 0.*deg, 360.*deg);
801  G4Tubs* recess_tube = new G4Tubs("recess_tube", 0.*cm, recessRadius,
802  0.5*recessHeight, 0.*deg, 360.*deg);
803 
804  G4SubtractionSolid* alpha_sol = new G4SubtractionSolid
805  ("alpha_sol", alpha_tube, recess_tube, G4Transform3D
806  (G4RotationMatrix(), G4ThreeVector(0. ,0. , recessVPosition)));
807  alpha_log = new G4LogicalVolume(alpha_sol, alpha_mat, "alpha_log");
808 
809  alpha_phys = new G4PVPlacement(0, G4ThreeVector(0., 0., alphaVPosition),
810  "alpha_phys", alpha_log, LXe_phys, false, 0);
811 
812  G4VisAttributes* alpha_vat = new G4VisAttributes(white);
813  alpha_vat->SetVisibility(true);
814  alpha_log ->SetVisAttributes(alpha_vat);
815 
816  // alpha source HOLDER surface
817  G4OpticalSurface* OpAlphaSurface = new G4OpticalSurface("AlphaSurface",
818  unified, ground, dielectric_metal, sigalpha=20.0*deg);
819  //G4LogicalBorderSurface* AlphaSurface =
821  ("Alpha", LXe_phys, alpha_phys, OpAlphaSurface);
822 
823  G4double alpha_PP[NUM] = { 6.00*eV, 7.50*eV };
824  G4double alpha_REFL[NUM] = { 0.05, 0.05 };
826  alpha_mt->AddProperty("REFLECTIVITY", alpha_PP, alpha_REFL, NUM);
827  OpAlphaSurface->SetMaterialPropertiesTable(alpha_mt);
828 
829  // americium ***********************************************************
830 
831  // moved above for the "extra_offset":
832  // G4double americiumHeight = 600.*nanometer; // assumes ~1% Am
833  G4double americiumRadius = recessRadius - 50.0*micrometer;
834  G4double americiumVOffset = 0.5*(alphaHeight-americiumHeight)-recessHeight;
835  G4double americiumVPosition = americiumVOffset;
836 
837  sourceZ = vesselVPos + LXeVPos + alphaVPosition + americiumVPosition + PosZ;
838  G4cout << G4endl << "Calibration source centre (X,Y,Z): 0, 0, "
839  << sourceZ/mm << " mm" << G4endl;
840 
841  G4Tubs* americium_tube = new G4Tubs("americium_tube", 0.*cm,
842  americiumRadius, 0.5*americiumHeight, 0.*deg, 360.*deg);
843  americium_log = new G4LogicalVolume(americium_tube, americium_mat,
844  "americium_log");
845  americium_phys = new G4PVPlacement(0, G4ThreeVector(0., 0.,
846  americiumVPosition),"americium_phys", americium_log, alpha_phys,false,0);
847 
848  // americium optical properties:
849  G4OpticalSurface* OpAmericiumSurface = new G4OpticalSurface
850  ("AmericiumSurface", unified, ground, dielectric_metal, sigalpha=5.0*deg);
851  //G4LogicalBorderSurface* AmericiumSurface =
853  ("Americium", LXe_phys, americium_phys, OpAmericiumSurface);
854 
855  G4double americium_PP[NUM] = { 6.00*eV, 7.50*eV };
856  G4double americium_REFL[NUM] = { 0.7, 0.65 };
858  americium_mt->AddProperty("REFLECTIVITY", americium_PP, americium_REFL, NUM);
859  OpAlphaSurface->SetMaterialPropertiesTable(americium_mt);
860 
861  G4VisAttributes* americium_vat= new G4VisAttributes(cyan);
862  americium_vat->SetVisibility(true);
863  americium_vat->SetForceSolid(true);
864  americium_log->SetVisAttributes(americium_vat);
865 
866 
867  // Photomultiplier: ETL 9829 QA ****************************************
868 
869  G4double pmtHeight = 12.0*cm;
870  G4double pmtRadius = 2.6*cm;
871  G4double pmtVOffset = 1.0*cm;
872  G4double pmtVPosition = -0.5*(LXeTubeHeight+pmtHeight)+pmtVOffset;
873 
874  G4Sphere* pmt_window = new G4Sphere("pmt_sphere", 0.*cm, 2.*pmtRadius,
875  0.*deg, 360.*deg, 0.*deg, 30.0*deg);
876  G4Tubs* pmt_tube = new G4Tubs("pmt_tube", 0.*cm, pmtRadius, 0.5*pmtHeight,
877  0.*deg, 360.*deg);
878 
879  G4UnionSolid* pmt_sol = new G4UnionSolid("pmt_sol", pmt_tube, pmt_window,
880  G4Transform3D(G4RotationMatrix(), G4ThreeVector(0,0,0.5*pmtHeight
881  -2.*pmtRadius*std::cos(30.0*deg))));
882 
883  pmt_log = new G4LogicalVolume(pmt_sol, pmt_mat, "pmt_log");
884  pmt_phys = new G4PVPlacement(0,G4ThreeVector(0.*cm, 0.*cm, pmtVPosition),
885  "pmt_phys", pmt_log, LXe_phys, false, 0);
886 
887  G4OpticalSurface* pmt_opsurf = new G4OpticalSurface
888  ("pmt_opsurf",unified, polished, dielectric_dielectric);
889  //G4LogicalBorderSurface* pmt_surf =
891  ("pmt_surf", LXe_phys, pmt_phys, pmt_opsurf);
892 
893  G4VisAttributes* pmt_vat= new G4VisAttributes(blue);
894  pmt_vat->SetForceSolid(true);
895  pmt_vat->SetVisibility(true);
896  pmt_log->SetVisAttributes(pmt_vat);
897 
898 
899  // photocathode *******************************************************
900 
901  G4double phcathVOffset = 0.5*pmtHeight-2.*pmtRadius*std::cos(30.0*deg);
902  G4double phcathVPosition = phcathVOffset;
903 
904  G4Sphere* phcath_sol = new G4Sphere("phcath_sphere",
905  2.*pmtRadius-1.6*mm, 2.*pmtRadius-1.59*mm, 0.*deg, 360.*deg, 0.*deg,
906  27.0*deg);
907 
908  phcath_log = new G4LogicalVolume(phcath_sol, phcath_mat, "phcath_log");
909  phcath_phys = new G4PVPlacement(0, G4ThreeVector(0., 0., phcathVPosition),
910  "phcath_phys", phcath_log, pmt_phys, false, 0);
911 
912  G4OpticalSurface* phcath_opsurf = new G4OpticalSurface("phcath_opsurf",
914  //G4LogicalBorderSurface* phcath_surf =
916  ("phcath_surf", pmt_phys, phcath_phys, phcath_opsurf);
917 
918  G4double phcath_PP[NUM] = { 6.00*eV, 7.50*eV };
919  // G4double phcath_REFL[NUM] = { 0.0, 0.0};
920  // G4MaterialPropertiesTable* phcath_mt = new G4MaterialPropertiesTable();
921  // phcath_mt->AddProperty("REFLECTIVITY", phcath_PP, phcath_REFL, NUM);
922  // phcath_opsurf->SetMaterialPropertiesTable(phcath_mt);
923 
924 
925  //**Photocathode surface properties
926  G4double photocath_EFF[NUM]={1.,1.}; //Enables 'detection' of photons
927  G4double photocath_ReR[NUM]={1.92,1.92};
928  G4double photocath_ImR[NUM]={1.69,1.69};
930  photocath_mt->AddProperty("EFFICIENCY",phcath_PP,photocath_EFF,NUM);
931  photocath_mt->AddProperty("REALRINDEX",phcath_PP,photocath_ReR,NUM);
932  photocath_mt->AddProperty("IMAGINARYRINDEX",phcath_PP,photocath_ImR,NUM);
933  G4OpticalSurface* photocath_opsurf=
934  new G4OpticalSurface("photocath_opsurf",glisur,polished,
936  photocath_opsurf->SetMaterialPropertiesTable(photocath_mt);
937 
938 
939  G4VisAttributes* phcath_vat= new G4VisAttributes(lblue);
940  phcath_vat->SetForceSolid(true);
941  phcath_vat->SetVisibility(true);
942  phcath_log->SetVisAttributes(phcath_vat);
943 
944  new G4LogicalSkinSurface("photocath_surf",phcath_log,photocath_opsurf);
945 
946  // ......................................................................
947  // attach user limits ...................................................
948 
949 
950  G4cout << G4endl << "User Limits: " << G4endl
951  << "\t theMaxTimeCuts: " << G4BestUnit(theMaxTimeCuts,"Time")
952  << G4endl
953  << "\t theRoomTimeCut: " << G4BestUnit(theRoomTimeCut,"Time")
954  << G4endl
955  << "\t theMaxStepSize: " << G4BestUnit(theMaxStepSize,"Length")
956  << G4endl
957  << "\t theMinEKine: " << G4BestUnit(theMinEkine,"Energy")
958  << G4endl
959  << "\t minRoomMinEKine: " << G4BestUnit(theRoomMinEkine,"Energy")
960  << G4endl << G4endl;
961 
962  if (theUserLimitsForRoom != 0) delete theUserLimitsForRoom;
963  if (theUserLimitsForDetector != 0) delete theUserLimitsForDetector;
964 
965  theUserLimitsForRoom = new G4UserLimits(theMaxStepSize, // step length max
966  DBL_MAX, // track length max
967  theRoomTimeCut, // Time cut
968  theRoomMinEkine); // min energy
969 
970 #include "DMXDetectorRoomLimits.icc"
971 
972  theUserLimitsForDetector = new G4UserLimits(theDetectorStepSize,
973  DBL_MAX, // Track Max
974  theMaxTimeCuts,
975  theMinEkine);
976 
977  world_log->SetUserLimits(theUserLimitsForRoom);
978  lab_log->SetUserLimits(theUserLimitsForRoom);
979  jacket_log->SetUserLimits(theUserLimitsForRoom);
980  vacuum_log->SetUserLimits(theUserLimitsForRoom);
981  vessel_log->SetUserLimits(theUserLimitsForRoom);
982  GXe_log->SetUserLimits(theUserLimitsForDetector);
983  // LXe_log->SetUserLimits(theUserLimitsForXenon);
984  LXe_log->SetUserLimits(theUserLimitsForDetector);
985  CuShield_log->SetUserLimits(theUserLimitsForDetector);
986  ring_log->SetUserLimits(theUserLimitsForDetector);
987  mirror_log->SetUserLimits(theUserLimitsForDetector);
988  grid1_log->SetUserLimits(theUserLimitsForDetector);
989  grid2_log->SetUserLimits(theUserLimitsForDetector);
990  alpha_log->SetUserLimits(theUserLimitsForDetector);
991  americium_log->SetUserLimits(theUserLimitsForDetector);
992  pmt_log->SetUserLimits(theUserLimitsForDetector);
993  phcath_log->SetUserLimits(theUserLimitsForDetector);
994 
995  return world_phys;
996 
997 }
998 
999 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
1000 
1002 {
1003  // ......................................................................
1004  // sensitive detectors ..................................................
1005  // ......................................................................
1006 
1007  if (LXeSD.Get() == 0)
1008  {
1009  G4String name="/DMXDet/LXeSD";
1010  DMXScintSD* aSD = new DMXScintSD(name);
1011  LXeSD.Put(aSD);
1012  }
1014  if (LXe_log)
1015  SetSensitiveDetector(LXe_log,LXeSD.Get());
1016 
1017  if (pmtSD.Get() == 0)
1018  {
1019  G4String name="/DMXDet/pmtSD";
1020  DMXPmtSD* aSD = new DMXPmtSD(name);
1021  pmtSD.Put(aSD);
1022  }
1024  if (phcath_log)
1025  SetSensitiveDetector(phcath_log,pmtSD.Get());
1026 
1027  return;
1028 }
1029 
1030 
1031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
1032 
1033 // specific method to G4UserLimits:= SetUserMinEkine
1035 {
1036  // set minimum charged particle energy cut - NB: for ROOM
1037  theRoomMinEkine = val;
1038  if (theUserLimitsForRoom != 0)
1039  {
1040  theUserLimitsForRoom->SetUserMinEkine(val);
1041  G4cout << " Changing Room energy cut to: " << G4BestUnit(val,"Energy")
1042  << G4endl;
1043  }
1044 }
1045 
1046 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
1047 
1048 // specific method to G4UserLimits:= SetUserMinEkine
1050 {
1051  // set minimum charged particle energy cut - NB: for Xenon Detector
1052  theMinEkine = val;
1053  if (theUserLimitsForDetector != 0)
1054  {
1055  theUserLimitsForDetector->SetUserMinEkine(val);
1056  G4cout << "Changing Detector energy cut to: " << G4BestUnit(val,"Energy")
1057  << G4endl;
1058  }
1059 }
1060 
1061 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
1062 
1063 // specific method to G4UserLimits:= SetUserMaxTime
1065 {
1066  // set room time cut:
1067  theRoomTimeCut = val;
1068  if (theUserLimitsForRoom != 0)
1069  {
1070  theUserLimitsForRoom->SetUserMaxTime(val);
1071  G4cout << " Changing Room Time cut to: " << G4BestUnit(val,"Time")
1072  << G4endl;
1073  }
1074 }
1075 
1076 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
1077 
1078 // specific method to G4UserLimits:= SetUserMaxTime
1080 {
1081  // set detector time cut:
1082  theMaxTimeCuts = val;
1083  if (theUserLimitsForDetector != 0)
1084  {
1085  theUserLimitsForDetector->SetUserMaxTime(val);
1086  G4cout << " Changing Detector Time cut to: " << G4BestUnit(val,"Time")
1087  << G4endl;
1088  }
1089 }
1090 
1091 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
1092 
1093 
1094 
const XML_Char * name
Definition: expat.h:151
static constexpr double mm
Definition: G4SIunits.hh:115
Definition: test07.cc:36
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepRotation G4RotationMatrix
Definition: G4Box.hh:64
void SetUserLimits(G4UserLimits *pULimits)
value_type & Get() const
Definition: G4Cache.hh:282
Definition: G4Tubs.hh:85
virtual void SetUserMinEkine(G4double uekinMin)
static constexpr double nanometer
Definition: G4SIunits.hh:101
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
Definition: test07.cc:36
Definition: test07.cc:36
int G4int
Definition: G4Types.hh:78
static constexpr double nanosecond
Definition: G4SIunits.hh:158
G4MaterialPropertyVector * AddProperty(const char *key, G4double *PhotonEnergies, G4double *PropertyValues, G4int NumEntries)
void SetForceSolid(G4bool=true)
G4VPhysicalVolume * Construct()
G4GLOB_DLL std::ostream G4cout
void SetVisibility(G4bool=true)
static constexpr double cm
Definition: G4SIunits.hh:119
static constexpr double eV
Definition: G4SIunits.hh:215
HepGeom::Transform3D G4Transform3D
void SetSensitiveDetector(const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:71
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
static constexpr double deg
Definition: G4SIunits.hh:152
void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT)
#define DBL_MAX
Definition: templates.hh:83
void Put(const value_type &val) const
Definition: G4Cache.hh:286
static constexpr double micrometer
Definition: G4SIunits.hh:100
static const G4VisAttributes & GetInvisible()
virtual void SetUserMaxTime(G4double utimeMax)
void SetVisAttributes(const G4VisAttributes *pVA)