source: trunk/examples/advanced/underground_physics/src/DMXDetectorConstruction.cc

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

update

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