Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/extended/optical/LXe/src/LXeMainVolume.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/extended/optical/LXe/src/LXeMainVolume.cc (Version 11.3.0) and /examples/extended/optical/LXe/src/LXeMainVolume.cc (Version 10.4.p2)


  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 // $Id: LXeMainVolume.cc 82853 2014-07-14 09:07:11Z gcosmo $
 26 //                                                 27 //
 27 /// \file optical/LXe/src/LXeMainVolume.cc         28 /// \file optical/LXe/src/LXeMainVolume.cc
 28 /// \brief Implementation of the LXeMainVolume     29 /// \brief Implementation of the LXeMainVolume class
 29 //                                                 30 //
 30 //                                                 31 //
                                                   >>  32 #include "globals.hh"
                                                   >>  33 
 31 #include "LXeMainVolume.hh"                        34 #include "LXeMainVolume.hh"
 32                                                    35 
 33 #include "G4Box.hh"                            << 
 34 #include "G4Colour.hh"                         << 
 35 #include "G4LogicalBorderSurface.hh"           << 
 36 #include "G4LogicalSkinSurface.hh"                 36 #include "G4LogicalSkinSurface.hh"
 37 #include "G4LogicalVolume.hh"                  <<  37 #include "G4LogicalBorderSurface.hh"
 38 #include "G4Material.hh"                       <<  38 
 39 #include "G4MaterialPropertiesTable.hh"        << 
 40 #include "G4OpticalSurface.hh"                 << 
 41 #include "G4Sphere.hh"                         << 
 42 #include "G4SystemOfUnits.hh"                      39 #include "G4SystemOfUnits.hh"
 43 #include "G4Tubs.hh"                           << 
 44 #include "G4VisAttributes.hh"                  << 
 45 #include "globals.hh"                          << 
 46                                                    40 
 47 //....oooOO0OOooo........oooOO0OOooo........oo     41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 48                                                    42 
 49 LXeMainVolume::LXeMainVolume(G4RotationMatrix* <<  43 LXeMainVolume::LXeMainVolume(G4RotationMatrix *pRot,
 50                              G4LogicalVolume*  <<  44                              const G4ThreeVector &tlate,
                                                   >>  45                              G4LogicalVolume *pMotherLogical,
                                                   >>  46                              G4bool pMany,
                                                   >>  47                              G4int pCopyNo,
 51                              LXeDetectorConstr     48                              LXeDetectorConstruction* c)
 52   // Pass info to the G4PVPlacement constructo <<  49   //Pass info to the G4PVPlacement constructor
 53   : G4PVPlacement(                             <<  50   :G4PVPlacement(pRot,tlate,
 54       pRot, tlate,                             <<  51                  //Temp logical volume must be created here
 55       // Temp logical volume must be created h <<  52                  new G4LogicalVolume(new G4Box("temp",1,1,1),
 56       new G4LogicalVolume(new G4Box("temp", 1, <<  53                                      G4Material::GetMaterial("Vacuum"),
 57       "housing", pMotherLogical, pMany, pCopyN <<  54                                      "temp",0,0,0),
 58     fConstructor(c)                            <<  55                  "housing",pMotherLogical,pMany,pCopyNo),fConstructor(c)
 59 {                                                  56 {
 60   CopyValues();                                    57   CopyValues();
 61                                                    58 
 62   G4double housing_x = fScint_x + 2. * fD_mtl; <<  59   G4double housing_x=fScint_x+2.*fD_mtl;
 63   G4double housing_y = fScint_y + 2. * fD_mtl; <<  60   G4double housing_y=fScint_y+2.*fD_mtl;
 64   G4double housing_z = fScint_z + 2. * fD_mtl; <<  61   G4double housing_z=fScint_z+2.*fD_mtl;
 65                                                <<  62  
 66   //*************************** housing and sc     63   //*************************** housing and scintillator
 67   fScint_box = new G4Box("scint_box", fScint_x <<  64   fScint_box = new G4Box("scint_box",fScint_x/2.,fScint_y/2.,fScint_z/2.);
 68   fHousing_box = new G4Box("housing_box", hous <<  65   fHousing_box = new G4Box("housing_box",housing_x/2.,housing_y/2.,
 69                                                <<  66                            housing_z/2.);
 70   fScint_log = new G4LogicalVolume(fScint_box, <<  67  
 71   fHousing_log = new G4LogicalVolume(fHousing_ <<  68   fScint_log = new G4LogicalVolume(fScint_box,G4Material::GetMaterial("LXe"),
 72                                                <<  69                                    "scint_log",0,0,0);
 73   new G4PVPlacement(nullptr, G4ThreeVector(),  <<  70   fHousing_log = new G4LogicalVolume(fHousing_box,
 74                                                <<  71                                      G4Material::GetMaterial("Al"),
                                                   >>  72                                      "housing_log",0,0,0);
                                                   >>  73  
                                                   >>  74   new G4PVPlacement(0,G4ThreeVector(),fScint_log,"scintillator",
                                                   >>  75                                  fHousing_log,false,0);
                                                   >>  76  
 75   //*************** Miscellaneous sphere to de     77   //*************** Miscellaneous sphere to demonstrate skin surfaces
 76   fSphere = new G4Sphere("sphere", 0., 2. * cm <<  78   fSphere = new G4Sphere("sphere",0.*mm,2.*cm,0.*deg,360.*deg,0.*deg,360.*deg);
 77   fSphere_log = new G4LogicalVolume(fSphere, G <<  79   fSphere_log = new G4LogicalVolume(fSphere,G4Material::GetMaterial("Al"),
 78   if (fSphereOn)                               <<  80                                     "sphere_log");
 79     new G4PVPlacement(nullptr, G4ThreeVector(5 <<  81   if(fSphereOn)
 80                       fScint_log, false, 0);   <<  82     new G4PVPlacement(0,G4ThreeVector(5.*cm,5.*cm,5.*cm),
 81                                                <<  83                                       fSphere_log,"sphere",fScint_log,false,0);
                                                   >>  84  
 82   //****************** Build PMTs                  85   //****************** Build PMTs
 83   G4double innerRadius_pmt = 0.;               <<  86   G4double innerRadius_pmt = 0.*cm;
 84   G4double height_pmt = fD_mtl / 2.;           <<  87   G4double height_pmt = fD_mtl/2.;
 85   G4double startAngle_pmt = 0.;                <<  88   G4double startAngle_pmt = 0.*deg;
 86   G4double spanningAngle_pmt = 360. * deg;     <<  89   G4double spanningAngle_pmt = 360.*deg;
 87                                                <<  90  
 88   fPmt = new G4Tubs("pmt_tube", innerRadius_pm <<  91   fPmt = new G4Tubs("pmt_tube",innerRadius_pmt,fOuterRadius_pmt,
 89                     spanningAngle_pmt);        <<  92                     height_pmt,startAngle_pmt,spanningAngle_pmt);
 90                                                <<  93  
 91   // the "photocathode" is a metal slab at the <<  94   //the "photocathode" is a metal slab at the back of the glass that
 92   // is only a very rough approximation of the <<  95   //is only a very rough approximation of the real thing since it only
 93   // absorbs or detects the photons based on t <<  96   //absorbs or detects the photons based on the efficiency set below
 94   fPhotocath = new G4Tubs("photocath_tube", in <<  97   fPhotocath = new G4Tubs("photocath_tube",innerRadius_pmt,fOuterRadius_pmt,
 95                           startAngle_pmt, span <<  98                           height_pmt/2,startAngle_pmt,spanningAngle_pmt);
 96                                                <<  99  
 97   fPmt_log = new G4LogicalVolume(fPmt, G4Mater << 100   fPmt_log = new G4LogicalVolume(fPmt,G4Material::GetMaterial("Glass"),
 98   fPhotocath_log = new G4LogicalVolume(fPhotoc << 101                                  "pmt_log");
 99                                                << 102   fPhotocath_log = new G4LogicalVolume(fPhotocath,
100   new G4PVPlacement(nullptr, G4ThreeVector(0., << 103                                        G4Material::GetMaterial("Al"),
101                     fPmt_log, false, 0);       << 104                                        "photocath_log");
102                                                << 105  
                                                   >> 106   new G4PVPlacement(0,G4ThreeVector(0,0,-height_pmt/2),
                                                   >> 107                                     fPhotocath_log,"photocath",
                                                   >> 108                                     fPmt_log,false,0);
                                                   >> 109  
103   //***********Arrange pmts around the outside    110   //***********Arrange pmts around the outside of housing**********
104                                                   111 
105   G4double dx = fScint_x / fNx;                << 112   G4double dx = fScint_x/fNx;
106   G4double dy = fScint_y / fNy;                << 113   G4double dy = fScint_y/fNy;
107   G4double dz = fScint_z / fNz;                << 114   G4double dz = fScint_z/fNz;
108                                                << 115  
109   G4double x, y, z;                            << 116   G4double x,y,z;
110   G4double xmin = -fScint_x / 2. - dx / 2.;    << 117   G4double xmin = -fScint_x/2. - dx/2.;
111   G4double ymin = -fScint_y / 2. - dy / 2.;    << 118   G4double ymin = -fScint_y/2. - dy/2.;
112   G4double zmin = -fScint_z / 2. - dz / 2.;    << 119   G4double zmin = -fScint_z/2. - dz/2.;
113   G4int k = 0;                                 << 120   G4int k=0;
114                                                << 121  
115   z = -fScint_z / 2. - height_pmt;  // front   << 122   z = -fScint_z/2. - height_pmt;      //front
116   PlacePMTs(fPmt_log, nullptr, x, y, dx, dy, x << 123   PlacePMTs(fPmt_log,0,x,y,dx,dy,xmin,ymin,fNx,fNy,x,y,z,k);
117                                                << 124 
118   auto rm_z = new G4RotationMatrix();          << 125   G4RotationMatrix* rm_z = new G4RotationMatrix();
119   rm_z->rotateY(180. * deg);                   << 126   rm_z->rotateY(180*deg);
120   z = fScint_z / 2. + height_pmt;  // back     << 127   z = fScint_z/2. + height_pmt;       //back
121   PlacePMTs(fPmt_log, rm_z, x, y, dx, dy, xmin << 128   PlacePMTs(fPmt_log,rm_z,x,y,dx,dy,xmin,ymin,fNx,fNy,x,y,z,k);
122                                                << 129  
123   auto rm_y1 = new G4RotationMatrix();         << 130   G4RotationMatrix* rm_y1 = new G4RotationMatrix();
124   rm_y1->rotateY(-90. * deg);                  << 131   rm_y1->rotateY(-90*deg);
125   x = -fScint_x / 2. - height_pmt;  // left    << 132   x = -fScint_x/2. - height_pmt;      //left
126   PlacePMTs(fPmt_log, rm_y1, y, z, dy, dz, ymi << 133   PlacePMTs(fPmt_log,rm_y1,y,z,dy,dz,ymin,zmin,fNy,fNz,x,y,z,k);
127                                                << 134 
128   auto rm_y2 = new G4RotationMatrix();         << 135   G4RotationMatrix* rm_y2 = new G4RotationMatrix();
129   rm_y2->rotateY(90. * deg);                   << 136   rm_y2->rotateY(90*deg);
130   x = fScint_x / 2. + height_pmt;  // right    << 137   x = fScint_x/2. + height_pmt;      //right
131   PlacePMTs(fPmt_log, rm_y2, y, z, dy, dz, ymi << 138   PlacePMTs(fPmt_log,rm_y2,y,z,dy,dz,ymin,zmin,fNy,fNz,x,y,z,k);
132                                                << 139  
133   auto rm_x1 = new G4RotationMatrix();         << 140   G4RotationMatrix* rm_x1 = new G4RotationMatrix();
134   rm_x1->rotateX(90. * deg);                   << 141   rm_x1->rotateX(90*deg);
135   y = -fScint_y / 2. - height_pmt;  // bottom  << 142   y = -fScint_y/2. - height_pmt;     //bottom
136   PlacePMTs(fPmt_log, rm_x1, x, z, dx, dz, xmi << 143   PlacePMTs(fPmt_log,rm_x1,x,z,dx,dz,xmin,zmin,fNx,fNz,x,y,z,k);
137                                                << 144 
138   auto rm_x2 = new G4RotationMatrix();         << 145   G4RotationMatrix* rm_x2 = new G4RotationMatrix();
139   rm_x2->rotateX(-90. * deg);                  << 146   rm_x2->rotateX(-90*deg);
140   y = fScint_y / 2. + height_pmt;  // top      << 147   y = fScint_y/2. + height_pmt;      //top
141   PlacePMTs(fPmt_log, rm_x2, x, z, dx, dz, xmi << 148   PlacePMTs(fPmt_log,rm_x2,x,z,dx,dz,xmin,zmin,fNx,fNz,x,y,z,k);
142                                                << 149  
143   VisAttributes();                                150   VisAttributes();
144   SurfaceProperties();                            151   SurfaceProperties();
145                                                   152 
146   SetLogicalVolume(fHousing_log);                 153   SetLogicalVolume(fHousing_log);
147 }                                                 154 }
148                                                   155 
149 //....oooOO0OOooo........oooOO0OOooo........oo    156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
150                                                   157 
151 void LXeMainVolume::CopyValues()               << 158 void LXeMainVolume::CopyValues(){
152 {                                              << 159   fScint_x=fConstructor->GetScintX();
153   fScint_x = fConstructor->GetScintX();        << 160   fScint_y=fConstructor->GetScintY();
154   fScint_y = fConstructor->GetScintY();        << 161   fScint_z=fConstructor->GetScintZ();
155   fScint_z = fConstructor->GetScintZ();        << 162   fD_mtl=fConstructor->GetHousingThickness();
156   fD_mtl = fConstructor->GetHousingThickness() << 163   fNx=fConstructor->GetNX();
157   fNx = fConstructor->GetNX();                 << 164   fNy=fConstructor->GetNY();
158   fNy = fConstructor->GetNY();                 << 165   fNz=fConstructor->GetNZ();
159   fNz = fConstructor->GetNZ();                 << 166   fOuterRadius_pmt=fConstructor->GetPMTRadius();
160   fOuterRadius_pmt = fConstructor->GetPMTRadiu << 167   fSphereOn=fConstructor->GetSphereOn();
161   fSphereOn = fConstructor->GetSphereOn();     << 168   fRefl=fConstructor->GetHousingReflectivity();
162   fRefl = fConstructor->GetHousingReflectivity << 
163 }                                                 169 }
164                                                   170 
165 //....oooOO0OOooo........oooOO0OOooo........oo    171 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
166                                                   172 
167 void LXeMainVolume::PlacePMTs(G4LogicalVolume* << 173 void LXeMainVolume::PlacePMTs(G4LogicalVolume* pmt_log,
168                               G4double& b, G4d << 174                               G4RotationMatrix *rot,
169                               G4int na, G4int  << 175                               G4double &a, G4double &b, G4double da,
170 {                                              << 176                               G4double db, G4double amin,
171   /*  PlacePMTs : a different way to parameter << 177                               G4double bmin, G4int na, G4int nb,
172    * on calculating the position from the copy << 178                               G4double &x, G4double &y, G4double &z,
173    *                                           << 179                               G4int &k){
174    *  pmt_log = logical volume for pmts to be  << 180 /*PlacePMTs : a different way to parameterize placement that does not depend on
175    *  rot = rotation matrix to apply           << 181   calculating the position from the copy number
176    *  a,b = coordinates to vary(ie. if varying << 182 
177    *  da,db = value to increment a,b by        << 183   pmt_log = logical volume for pmts to be placed
178    *  amin,bmin = start values for a,b         << 184   rot = rotation matrix to apply
179    *  na,nb = number of repitions in a and b   << 185   a,b = coordinates to vary(ie. if varying in the xy plane then pass x,y)
180    *  x,y,z = just pass x,y, and z by referenc << 186   da,db = value to increment a,b by
181    *  k = copy number to start with            << 187   amin,bmin = start values for a,b
182    *  sd = sensitive detector for pmts         << 188   na,nb = number of repitions in a and b
183    */                                          << 189   x,y,z = just pass x,y, and z by reference (the same ones passed for a,b)
184   a = amin;                                    << 190   k = copy number to start with
185   for (G4int j = 1; j <= na; ++j) {            << 191   sd = sensitive detector for pmts
186     a += da;                                   << 192 */
187     b = bmin;                                  << 193   a=amin;
188     for (G4int i = 1; i <= nb; ++i) {          << 194   for(G4int j=1;j<=na;j++){
189       b += db;                                 << 195     a+=da;
190       new G4PVPlacement(rot, G4ThreeVector(x,  << 196     b=bmin;
191       fPmtPositions.push_back(G4ThreeVector(x, << 197     for(G4int i=1;i<=nb;i++){
192       ++k;                                     << 198       b+=db;
                                                   >> 199       new G4PVPlacement(rot,G4ThreeVector(x,y,z),pmt_log,"pmt",
                                                   >> 200                         fHousing_log,false,k);
                                                   >> 201       fPmtPositions.push_back(G4ThreeVector(x,y,z));
                                                   >> 202       k++;
193     }                                             203     }
194   }                                               204   }
195 }                                                 205 }
196                                                   206 
197 //....oooOO0OOooo........oooOO0OOooo........oo    207 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
198                                                   208 
199 void LXeMainVolume::VisAttributes()            << 209 void LXeMainVolume::VisAttributes(){
200 {                                              << 210   G4VisAttributes* housing_va = new G4VisAttributes(G4Colour(0.8,0.8,0.8));
201   auto housing_va = new G4VisAttributes(G4Colo << 
202   fHousing_log->SetVisAttributes(housing_va);     211   fHousing_log->SetVisAttributes(housing_va);
203                                                   212 
204   auto sphere_va = new G4VisAttributes();      << 213   G4VisAttributes* sphere_va = new G4VisAttributes();
205   sphere_va->SetForceSolid(true);                 214   sphere_va->SetForceSolid(true);
206   fSphere_log->SetVisAttributes(sphere_va);       215   fSphere_log->SetVisAttributes(sphere_va);
207 }                                                 216 }
208                                                   217 
209 //....oooOO0OOooo........oooOO0OOooo........oo    218 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
210                                                   219 
211 void LXeMainVolume::SurfaceProperties()        << 220 void LXeMainVolume::SurfaceProperties(){
212 {                                              << 221   G4double ephoton[] = {7.0*eV, 7.14*eV};
213   std::vector<G4double> ephoton = {7.0 * eV, 7 << 222   const G4int num = sizeof(ephoton)/sizeof(G4double);
214                                                   223 
215   //**Scintillator housing properties             224   //**Scintillator housing properties
216   std::vector<G4double> reflectivity = {fRefl, << 225   G4double reflectivity[] = {fRefl, fRefl};
217   std::vector<G4double> efficiency = {0.0, 0.0 << 226   assert(sizeof(reflectivity) == sizeof(ephoton));
218   auto scintHsngPT = new G4MaterialPropertiesT << 227   G4double efficiency[] = {0.0, 0.0};
219   scintHsngPT->AddProperty("REFLECTIVITY", eph << 228   assert(sizeof(efficiency) == sizeof(ephoton));
220   scintHsngPT->AddProperty("EFFICIENCY", ephot << 229   G4MaterialPropertiesTable* scintHsngPT = new G4MaterialPropertiesTable();
221   auto OpScintHousingSurface =                 << 230   scintHsngPT->AddProperty("REFLECTIVITY", ephoton, reflectivity, num);
222     new G4OpticalSurface("HousingSurface", uni << 231   scintHsngPT->AddProperty("EFFICIENCY", ephoton, efficiency, num);
                                                   >> 232   G4OpticalSurface* OpScintHousingSurface =
                                                   >> 233     new G4OpticalSurface("HousingSurface",unified,polished,dielectric_metal);
223   OpScintHousingSurface->SetMaterialProperties    234   OpScintHousingSurface->SetMaterialPropertiesTable(scintHsngPT);
224                                                << 235  
225   //**Sphere surface properties                   236   //**Sphere surface properties
226   std::vector<G4double> sphereReflectivity = { << 237   G4double sphereReflectivity[] = {1.0, 1.0};
227   std::vector<G4double> sphereEfficiency = {0. << 238   assert(sizeof(sphereReflectivity) == sizeof(ephoton));
228   auto spherePT = new G4MaterialPropertiesTabl << 239   G4double sphereEfficiency[] = {0.0, 0.0};
229   spherePT->AddProperty("REFLECTIVITY", ephoto << 240   assert(sizeof(sphereEfficiency) == sizeof(ephoton));
230   spherePT->AddProperty("EFFICIENCY", ephoton, << 241   G4MaterialPropertiesTable* spherePT = new G4MaterialPropertiesTable();
231   auto OpSphereSurface = new G4OpticalSurface( << 242   spherePT->AddProperty("REFLECTIVITY", ephoton, sphereReflectivity, num);
                                                   >> 243   spherePT->AddProperty("EFFICIENCY", ephoton, sphereEfficiency, num);
                                                   >> 244   G4OpticalSurface* OpSphereSurface =
                                                   >> 245     new G4OpticalSurface("SphereSurface",unified,polished,dielectric_metal);
232   OpSphereSurface->SetMaterialPropertiesTable(    246   OpSphereSurface->SetMaterialPropertiesTable(spherePT);
233                                                << 247  
234   //**Photocathode surface properties             248   //**Photocathode surface properties
235   std::vector<G4double> photocath_EFF = {1., 1 << 249   G4double photocath_EFF[]={1.,1.}; //Enables 'detection' of photons
236   std::vector<G4double> photocath_ReR = {1.92, << 250   assert(sizeof(photocath_EFF) == sizeof(ephoton));
237   std::vector<G4double> photocath_ImR = {1.69, << 251   G4double photocath_ReR[]={1.92,1.92};
238   auto photocath_mt = new G4MaterialProperties << 252   assert(sizeof(photocath_ReR) == sizeof(ephoton));
239   photocath_mt->AddProperty("EFFICIENCY", epho << 253   G4double photocath_ImR[]={1.69,1.69};
240   photocath_mt->AddProperty("REALRINDEX", epho << 254   assert(sizeof(photocath_ImR) == sizeof(ephoton));
241   photocath_mt->AddProperty("IMAGINARYRINDEX", << 255   G4MaterialPropertiesTable* photocath_mt = new G4MaterialPropertiesTable();
242   auto photocath_opsurf =                      << 256   photocath_mt->AddProperty("EFFICIENCY",ephoton,photocath_EFF,num);
243     new G4OpticalSurface("photocath_opsurf", g << 257   photocath_mt->AddProperty("REALRINDEX",ephoton,photocath_ReR,num);
                                                   >> 258   photocath_mt->AddProperty("IMAGINARYRINDEX",ephoton,photocath_ImR,num);
                                                   >> 259   G4OpticalSurface* photocath_opsurf=
                                                   >> 260     new G4OpticalSurface("photocath_opsurf",glisur,polished,
                                                   >> 261                          dielectric_metal);
244   photocath_opsurf->SetMaterialPropertiesTable    262   photocath_opsurf->SetMaterialPropertiesTable(photocath_mt);
245                                                   263 
246   //**Create logical skin surfaces                264   //**Create logical skin surfaces
247   new G4LogicalSkinSurface("photocath_surf", f << 265   new G4LogicalSkinSurface("photocath_surf",fHousing_log,
248   new G4LogicalSkinSurface("sphere_surface", f << 266                            OpScintHousingSurface);
249   new G4LogicalSkinSurface("photocath_surf", f << 267   new G4LogicalSkinSurface("sphere_surface",fSphere_log,OpSphereSurface);
                                                   >> 268   new G4LogicalSkinSurface("photocath_surf",fPhotocath_log,photocath_opsurf);
250 }                                                 269 }
251                                                   270