Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/advanced/underground_physics/src/DMXDetectorConstruction.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/advanced/underground_physics/src/DMXDetectorConstruction.cc (Version 11.3.0) and /examples/advanced/underground_physics/src/DMXDetectorConstruction.cc (Version 9.6.p4)


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