Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/advanced/air_shower/src/UltraDetectorConstruction.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/air_shower/src/UltraDetectorConstruction.cc (Version 11.3.0) and /examples/advanced/air_shower/src/UltraDetectorConstruction.cc (Version 8.0)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                    <<   3 // * DISCLAIMER                                                       *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th <<   5 // * The following disclaimer summarizes all the specific disclaimers *
  6 // * the Geant4 Collaboration.  It is provided <<   6 // * of contributors to this software. The specific disclaimers,which *
  7 // * conditions of the Geant4 Software License <<   7 // * govern, are listed with their locations in:                      *
  8 // * LICENSE and available at  http://cern.ch/ <<   8 // *   http://cern.ch/geant4/license                                  *
  9 // * include a list of copyright holders.      << 
 10 // *                                                9 // *                                                                  *
 11 // * Neither the authors of this software syst     10 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     11 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     12 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     13 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  <<  14 // * use.                                                             *
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                               15 // *                                                                  *
 18 // * This  code  implementation is the result  <<  16 // * This  code  implementation is the  intellectual property  of the *
 19 // * technical work of the GEANT4 collaboratio <<  17 // * GEANT4 collaboration.                                            *
 20 // * By using,  copying,  modifying or  distri <<  18 // * By copying,  distributing  or modifying the Program (or any work *
 21 // * any work based  on the software)  you  ag <<  19 // * based  on  the Program)  you indicate  your  acceptance of  this *
 22 // * use  in  resulting  scientific  publicati <<  20 // * statement, and all its terms.                                    *
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // *******************************************     21 // ********************************************************************
 25 //                                                 22 //
 26 //                                                 23 //
 27 // -------------------------------------------     24 // --------------------------------------------------------------
 28 //                 GEANT 4 - ULTRA experiment      25 //                 GEANT 4 - ULTRA experiment example
 29 // -------------------------------------------     26 // --------------------------------------------------------------
 30 //                                                 27 //
 31 // Code developed by:                              28 // Code developed by:
 32 // B. Tome, M.C. Espirito-Santo, A. Trindade,  <<  29 // B. Tome, M.C. Espirito-Santo, A. Trindade, P. Rodrigues 
 33 //                                                 30 //
 34 //    ****************************************     31 //    ****************************************************
 35 //    *      UltraDetectorConstruction.cc          32 //    *      UltraDetectorConstruction.cc
 36 //    ****************************************     33 //    ****************************************************
 37 //                                                 34 //
 38 //    Class used in the definition of the Ultr     35 //    Class used in the definition of the Ultra setup consisting of:
 39 //      - the UVscope detector                     36 //      - the UVscope detector
 40 //      - an optional reflecting surface           37 //      - an optional reflecting surface
 41 //    Optical photons can reach the UVscope ei     38 //    Optical photons can reach the UVscope either directly or after reflection in the
 42 //    surface, which can be polished or diffus     39 //    surface, which can be polished or diffusing.
 43 //    The main part of the UVscope definition      40 //    The main part of the UVscope definition is the Fresnel lens construction based
 44 //    on the UltraFresnelLens class.               41 //    on the UltraFresnelLens class.
 45 //                                                 42 //
 46 #include <cmath>                                   43 #include <cmath>
 47                                                << 
 48 #include "UltraDetectorConstruction.hh"            44 #include "UltraDetectorConstruction.hh"
 49 #include "UltraDetectorMessenger.hh"           << 
 50 #include "UltraPMTSD.hh"                           45 #include "UltraPMTSD.hh"
 51 #include "UltraFresnelLens.hh"                     46 #include "UltraFresnelLens.hh"
 52                                                    47 
 53 #include "G4PhysicalConstants.hh"              <<  48 #include "G4SDManager.hh"
 54 #include "G4SystemOfUnits.hh"                  << 
 55 #include "G4RunManager.hh"                     << 
 56 #include "G4MTRunManager.hh"                   << 
 57 #include "G4GeometryManager.hh"                << 
 58 #include "G4Material.hh"                           49 #include "G4Material.hh"
 59 #include "G4MaterialTable.hh"                      50 #include "G4MaterialTable.hh"
 60 #include "G4Element.hh"                            51 #include "G4Element.hh"
 61 #include "G4ElementTable.hh"                       52 #include "G4ElementTable.hh"
 62 #include "G4LogicalBorderSurface.hh"               53 #include "G4LogicalBorderSurface.hh"
 63 #include "G4LogicalSkinSurface.hh"             << 
 64 #include "G4Box.hh"                                54 #include "G4Box.hh"
 65 #include "G4Sphere.hh"                             55 #include "G4Sphere.hh"
 66 #include "G4Tubs.hh"                               56 #include "G4Tubs.hh"
 67 #include "G4LogicalVolume.hh"                      57 #include "G4LogicalVolume.hh"
 68 #include "G4RotationMatrix.hh"                     58 #include "G4RotationMatrix.hh"
 69 #include "G4ThreeVector.hh"                        59 #include "G4ThreeVector.hh"
 70 #include "G4Transform3D.hh"                        60 #include "G4Transform3D.hh"
 71 #include "G4PVPlacement.hh"                        61 #include "G4PVPlacement.hh"
 72 #include "G4OpBoundaryProcess.hh"                  62 #include "G4OpBoundaryProcess.hh"
 73 #include "G4VisAttributes.hh"                      63 #include "G4VisAttributes.hh"
 74 #include "G4Colour.hh"                             64 #include "G4Colour.hh"
 75 #include "G4Log.hh"                            << 
 76 #include "G4SDManager.hh"                      << 
 77                                                    65 
 78 //....oooOO0OOooo........oooOO0OOooo........oo     66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 79                                                    67 
 80 UltraDetectorConstruction::UltraDetectorConstr <<  68 UltraDetectorConstruction::UltraDetectorConstruction()
 81   fReflectorOpticalSurface(0),                 << 
 82   logicalPMT(0),                               << 
 83   fReflectorLog(0),                            << 
 84   fIsReflectorConstructed(false)               << 
 85 {                                                  69 {
 86   // Define wavelength limits for materials de << 
 87   lambda_min = 200*nm ;                        << 
 88   lambda_max = 700*nm ;                        << 
 89                                                    70 
 90   fDetectorMessenger = new UltraDetectorMessen <<  71  PMTSD   = 0;
 91                                                    72 
 92   ConstructTableMaterials();                   <<  73  // Sensitive Detector Manager
                                                   >>  74  SDmanager = G4SDManager::GetSDMpointer();
 93 }                                                  75 }
 94                                                    76 
 95 //....oooOO0OOooo........oooOO0OOooo........oo     77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 96                                                    78 
 97 UltraDetectorConstruction::~UltraDetectorConst <<  79 UltraDetectorConstruction::~UltraDetectorConstruction(){;}
 98 {                                              << 
 99   delete fDetectorMessenger;                   << 
100                                                << 
101   delete fReflectorOpticalSurface;             << 
102 }                                              << 
103                                                    80 
104 //....oooOO0OOooo........oooOO0OOooo........oo     81 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
105                                                    82 
106 G4VPhysicalVolume* UltraDetectorConstruction::     83 G4VPhysicalVolume* UltraDetectorConstruction::Construct()
107 {                                                  84 {
                                                   >>  85   ConstructTableMaterials();
                                                   >>  86 
                                                   >>  87 
                                                   >>  88 
108 //  The experimental Hall                          89 //  The experimental Hall
109 //  ---------------------                          90 //  ---------------------
110                                                    91 
111   auto World_x = 1.*m;                         <<  92   G4double World_x = 1.*m;
112   auto World_y = 1.*m;                         <<  93   G4double World_y = 1.*m;
113   auto World_z = 2*m;                          <<  94   G4double World_z = 2*m;
114                                                    95 
115   auto World_box = new G4Box("World",World_x,W <<  96   G4Box * World_box = new G4Box("World",World_x,World_y,World_z);
116                                                    97 
117   // Get Air pointer from static funcion - (G4     98   // Get Air pointer from static funcion - (G4Material::GetMaterial)
118   auto Air = G4Material::GetMaterial("Air");   << 
119   auto World_log = new G4LogicalVolume(World_b << 
120                                                    99 
121   fWorld_phys   = new G4PVPlacement(0,G4ThreeV << 100 G4String name;
                                                   >> 101 G4Material *Air = G4Material::GetMaterial(name = "Air");
                                                   >> 102 G4LogicalVolume *World_log ;
                                                   >> 103 World_log  = new G4LogicalVolume(World_box,Air,"World",0,0,0);
                                                   >> 104 
                                                   >> 105 G4VPhysicalVolume *World_phys ;
                                                   >> 106 World_phys   = new G4PVPlacement(0,G4ThreeVector(),"World",World_log,0,false,0);
122                                                   107 
123    auto UniverseVisAtt = new G4VisAttributes(G << 108    G4VisAttributes* UniverseVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,1.0));
124    UniverseVisAtt->SetVisibility(true);           109    UniverseVisAtt->SetVisibility(true);
125    UniverseVisAtt->SetForceWireframe(true);       110    UniverseVisAtt->SetForceWireframe(true);
126    World_log->SetVisAttributes(UniverseVisAtt)    111    World_log->SetVisAttributes(UniverseVisAtt);
127    World_log->SetVisAttributes (G4VisAttribute << 112    World_log->SetVisAttributes (G4VisAttributes::Invisible);
128                                                   113 
129                                                   114 
130                                                   115 
131   G4cout << "\n \n \n \n \n \n \n \n \n \n \n     116   G4cout << "\n \n \n \n \n \n \n \n \n \n \n \n \n " << G4endl ;
132                                                   117 
133   G4cout << "#################################    118   G4cout << "######################################################" << G4endl ;
134   G4cout << "#                                    119   G4cout << "#                                                    #" << G4endl ;
135   G4cout << "#                                    120   G4cout << "#                                                    #" << G4endl ;
136   G4cout << "#          UltraDetectorConstruct    121   G4cout << "#          UltraDetectorConstruction:                #" << G4endl ;
137   G4cout << "#                                 << 122   G4cout << "#                                                    #" << G4endl ;  
138   G4cout << "#                                 << 123   G4cout << "#                                                    #" << G4endl ;  
139                                                   124 
140   ConstructUVscope();                          << 125   G4VPhysicalVolume* chosenVolume;
                                                   >> 126   chosenVolume = ConstructUVscope(World_phys);
141                                                   127 
142                                                   128 
143   G4cout << "#                                    129   G4cout << "#                                                    #" << G4endl ;
144   G4cout << "#                                    130   G4cout << "#                                                    #" << G4endl ;
145   G4cout << "#################################    131   G4cout << "######################################################" << G4endl ;
146                                                   132 
147   fIsReflectorConstructed = false;             << 
148                                                   133 
149   return fWorld_phys;                          << 134 #ifdef ULTRA_MIRROR_USE
150 }                                              << 
151                                                   135 
152 //....oooOO0OOooo........oooOO0OOooo........oo << 136   G4cout << "Using mirror reflecting surface " << G4endl ;
153                                                   137 
154 void UltraDetectorConstruction::ConstructSDand << 138   G4VPhysicalVolume* Mirror ;
155 {                                              << 139   Mirror = ConstructMirror(World_phys);
156   auto PMTSD = new UltraPMTSD("PMTSD");        << 140 
157   G4SDManager::GetSDMpointer()->AddNewDetector << 141 #elif ULTRA_GROUND_USE
158   SetSensitiveDetector(logicalPMT,PMTSD);      << 142 
                                                   >> 143   G4cout << "Using ground reflecting surface " << G4endl ;
                                                   >> 144 
                                                   >> 145   G4VPhysicalVolume* Ground ;
                                                   >> 146   Ground = ConstructGround(World_phys);
                                                   >> 147 
                                                   >> 148 #else
                                                   >> 149 
                                                   >> 150   G4cout << "No reflecting surface used" << G4endl ;
                                                   >> 151 
                                                   >> 152 #endif
                                                   >> 153 
                                                   >> 154   return World_phys;
159 }                                                 155 }
160                                                   156 
161 //....oooOO0OOooo........oooOO0OOooo........oo    157 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
162                                                   158 
163 void UltraDetectorConstruction::ConstructTable    159 void UltraDetectorConstruction::ConstructTableMaterials()
164 {                                                 160 {
165   G4double a, z, density;                         161   G4double a, z, density;
                                                   >> 162   G4String name, symbol;
                                                   >> 163   G4int nel;
                                                   >> 164 
166                                                   165 
167 //  ------------- Elements -------------          166 //  ------------- Elements -------------
168   a = 1.01*g/mole;                                167   a = 1.01*g/mole;
169   auto elH  = new G4Element("Hydrogen", "H", z << 168   G4Element* elH  = new G4Element(name="Hydrogen", symbol="H", z=1., a);
170                                                   169 
171   a = 12.01*g/mole;                               170   a = 12.01*g/mole;
172   auto elC  = new G4Element("Carbon", "C", z=6 << 171   G4Element* elC  = new G4Element(name="Carbon",   symbol="C", z=6., a);
173                                                   172 
174   a = 14.01*g/mole;                               173   a = 14.01*g/mole;
175   auto elN  = new G4Element("Nitrogen", "N", z << 174   G4Element* elN  = new G4Element(name="Nitrogen", symbol="N", z=7., a);
176                                                   175 
177   a = 16.00*g/mole;                               176   a = 16.00*g/mole;
178   auto elO  = new G4Element("Oxygen",  "O", z= << 177   G4Element* elO  = new G4Element(name="Oxygen",   symbol="O", z=8., a);
179                                                   178 
180   a = 28.09*g/mole;                               179   a = 28.09*g/mole;
181   auto elSi = new G4Element("Silicon", "Si", z << 180   G4Element* elSi = new G4Element(name="Silicon", symbol="Si", z=14., a);
182                                                   181 
183                                                   182 
184 //  ------------- Materials -------------         183 //  ------------- Materials -------------
185                                                   184 
186                                                   185 
187 // Air                                            186 // Air
188 // ---                                            187 // ---
189   density = 1.29e-03*g/cm3;                       188   density = 1.29e-03*g/cm3;
190   auto Air = new G4Material("Air", density, 2) << 189   G4Material* Air = new G4Material(name="Air", density, nel=2);
191   Air->AddElement(elN, .7);                       190   Air->AddElement(elN, .7);
192   Air->AddElement(elO, .3);                       191   Air->AddElement(elO, .3);
193                                                   192 
194                                                   193 
195 // Aluminum                                    << 194 // Aluminum 
196 // ---------                                      195 // ---------
197   a = 26.98*g/mole;                               196   a = 26.98*g/mole;
198   density = 2.7*g/cm3;                            197   density = 2.7*g/cm3;
199   new G4Material("Aluminum", z=13., a, density << 198   G4Material* Al ;
                                                   >> 199   Al = new G4Material(name="Aluminum", z=13., a, density); 
200                                                   200 
201                                                   201 
202 // Quartz                                         202 // Quartz
203 // -------                                        203 // -------
204 //  density = 2.200*g/cm3; // fused quartz     << 204 //  density = 2.200*g/cm3; // fused quartz 
205   density = 2.64*g/cm3;  // crystalline quartz << 205   density = 2.64*g/cm3;  // crystalline quartz (c.f. PDG) 
206   auto Quartz = new G4Material("Quartz",densit << 206   G4Material *Quartz = new G4Material(name="Quartz",density, nel=2);
207   Quartz->AddElement(elSi, 1) ;                   207   Quartz->AddElement(elSi, 1) ;
208   Quartz->AddElement(elO , 2) ;                   208   Quartz->AddElement(elO , 2) ;
209                                                   209 
210                                                   210 
211 // PMMA C5H8O2 ( Acrylic )                        211 // PMMA C5H8O2 ( Acrylic )
212 // -------------                                  212 // -------------
213    density = 1.19*g/cm3;                          213    density = 1.19*g/cm3;
214    auto Acrylic = new G4Material("Acrylic", de << 214    G4Material* Acrylic = new G4Material(name="Acrylic", density, nel=3);
215    Acrylic->AddElement(elC, 5);                   215    Acrylic->AddElement(elC, 5);
216    Acrylic->AddElement(elH, 8);                   216    Acrylic->AddElement(elH, 8);
217    Acrylic->AddElement(elO, 2);                   217    Acrylic->AddElement(elO, 2);
218                                                   218 
219                                                   219 
220 /////////////////////////////////////////////     220 /////////////////////////////////////////////
221 // Construct Material Properties Tables           221 // Construct Material Properties Tables
222 /////////////////////////////////////////////     222 /////////////////////////////////////////////
223                                                   223 
                                                   >> 224   const G4int NUMENTRIES = 32;
                                                   >> 225 
224   // Energy bins                                  226   // Energy bins
225   std::vector<G4double> X_RINDEX = {h_Planck*c << 227   G4double X_RINDEX[NUMENTRIES] =
                                                   >> 228             { 2.034E-9*GeV, 2.068E-9*GeV, 2.103E-9*GeV, 2.139E-9*GeV,
                                                   >> 229               2.177E-9*GeV, 2.216E-9*GeV, 2.256E-9*GeV, 2.298E-9*GeV,
                                                   >> 230               2.341E-9*GeV, 2.386E-9*GeV, 2.433E-9*GeV, 2.481E-9*GeV,
                                                   >> 231               2.532E-9*GeV, 2.585E-9*GeV, 2.640E-9*GeV, 2.697E-9*GeV,
                                                   >> 232               2.757E-9*GeV, 2.820E-9*GeV, 2.885E-9*GeV, 2.954E-9*GeV,
                                                   >> 233               3.026E-9*GeV, 3.102E-9*GeV, 3.181E-9*GeV, 3.265E-9*GeV,
                                                   >> 234               3.353E-9*GeV, 3.446E-9*GeV, 3.545E-9*GeV, 3.649E-9*GeV,
                                                   >> 235               3.760E-9*GeV, 3.877E-9*GeV, 4.002E-9*GeV, 4.136E-9*GeV } ;
226                                                   236 
227                                                   237 
228   // Air                                          238   // Air
229   std::vector<G4double> RINDEX_AIR{1.00, 1.00} << 239   G4double RINDEX_AIR[NUMENTRIES] =
230 // Air refractive index at 20 oC and 1 atm (fr << 240             { 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
231   for(auto&& i : RINDEX_AIR){                  << 241               1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
232     i = i  + 2.73*std::pow(10.0,-4) ;          << 242               1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
233   }                                            << 243               1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
                                                   >> 244               1.00, 1.00, 1.00, 1.00 } ;
                                                   >> 245 
                                                   >> 246 // Air refractive index at 20 oC and 1 atm (from PDG) 
                                                   >> 247   for(G4int j=0 ; j<NUMENTRIES ; j++){
                                                   >> 248     RINDEX_AIR[j] = RINDEX_AIR[j] + 2.73*std::pow(10.0,-4) ; 
                                                   >> 249     }
234                                                   250 
235   auto MPT_Air = new G4MaterialPropertiesTable << 251   G4MaterialPropertiesTable *MPT_Air = new G4MaterialPropertiesTable();
236   MPT_Air->AddProperty("RINDEX", X_RINDEX, RIN << 252   MPT_Air->AddProperty("RINDEX", X_RINDEX, RINDEX_AIR, NUMENTRIES);
237   Air->SetMaterialPropertiesTable(MPT_Air);       253   Air->SetMaterialPropertiesTable(MPT_Air);
238                                                   254 
239 //////////////////////////////////////////////    255 //////////////////////////////////////////////////////////////////////////////////////
240 //           Photomultiplier (PMT) window      << 256 //           Photomultiplier (PMT) window       
241 // The refractive index is for lime glass;     << 257 // The refractive index is for lime glass; 
242 // wavelength dependence is not included and v    258 // wavelength dependence is not included and value at 400nm is used.
243 //////////////////////////////////////////////    259 //////////////////////////////////////////////////////////////////////////////////////
244                                                   260 
245   // Refractive index                          << 261   // Refractive index 
246                                                   262 
247   std::vector<G4double> X_RINDEX_QUARTZ{h_Plan << 263   const G4int N_RINDEX_QUARTZ = 2 ;
248   std::vector<G4double> RINDEX_QUARTZ{1.54, 1. << 264   G4double X_RINDEX_QUARTZ[N_RINDEX_QUARTZ] = {0.0*eV, 10.0*eV};
                                                   >> 265   G4double RINDEX_QUARTZ[N_RINDEX_QUARTZ] = {1.54, 1.54};
249                                                   266 
250   auto MPT_PMT = new G4MaterialPropertiesTable << 267   G4MaterialPropertiesTable *MPT_PMT = new G4MaterialPropertiesTable();
251   MPT_PMT->AddProperty("RINDEX", X_RINDEX_QUAR << 268   MPT_PMT->AddProperty("RINDEX", X_RINDEX_QUARTZ, RINDEX_QUARTZ, N_RINDEX_QUARTZ);
252                                                   269 
253   Quartz->SetMaterialPropertiesTable(MPT_PMT);    270   Quartz->SetMaterialPropertiesTable(MPT_PMT);
254                                                   271 
255                                                   272 
256 //////////////////////////////////////////////    273 //////////////////////////////////////////////////////////////////
257 //               ACRYLIC Optical properties       274 //               ACRYLIC Optical properties
258 //////////////////////////////////////////////    275 //////////////////////////////////////////////////////////////////
259                                                   276 
260 // Refractive index                            << 277 // Refractive index 
261                                                   278 
262   const auto NENTRIES = 11 ;                   << 279   const G4int    N_RINDEX_ACRYLIC = 3 ;
                                                   >> 280   G4double X_RINDEX_ACRYLIC[N_RINDEX_ACRYLIC] = {320.0, 400.0, 500.0};  // Wavelength in nanometers
                                                   >> 281   G4double RINDEX_ACRYLIC[N_RINDEX_ACRYLIC] = {1.526, 1.507, 1.497};
263                                                   282 
264   std::vector<G4double> RINDEX_ACRYLIC;        << 283     // Convert from nm to GeV
265   std::vector<G4double> ENERGY_ACRYLIC;        << 
266                                                   284 
267 // Parameterization for refractive index of Hi << 285      for(G4int i=0;i<N_RINDEX_ACRYLIC; i++){
                                                   >> 286       X_RINDEX_ACRYLIC[i] = ((1239.84/X_RINDEX_ACRYLIC[i])*1E-9)*GeV;
                                                   >> 287       }
268                                                   288 
269   G4double bParam[4] = {1760.7010,-1.3687,2.43 << 289   G4MaterialPropertiesTable *MPT_Acrylic = new G4MaterialPropertiesTable();
270   auto lambda = 0.;                            << 290   MPT_Acrylic->AddProperty("RINDEX", X_RINDEX_ACRYLIC, RINDEX_ACRYLIC, N_RINDEX_ACRYLIC);
                                                   >> 291   Acrylic->SetMaterialPropertiesTable(MPT_Acrylic);
271                                                   292 
272   for(auto i=0;i<NENTRIES; ++i){               << 
273                                                   293 
274     // want energies in increasing order       << 294 //////////////////////////////////////////////////////////////////
275     lambda = lambda_min + (NENTRIES-1-i) * (la << 
276     RINDEX_ACRYLIC.push_back(0.0);             << 
277                                                   295 
278     for (auto jj=0 ; jj<4 ; jj++)              << 296   G4cout << *(G4Material::GetMaterialTable()) << G4endl ;
279     {                                          << 297 
280       RINDEX_ACRYLIC[i] +=  (bParam[jj]/1000.0 << 298 }
281     }                                          << 299 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
282                                                   300 
283     ENERGY_ACRYLIC.push_back(h_Planck*c_light/ << 301 G4VPhysicalVolume* UltraDetectorConstruction::ConstructMirror(G4VPhysicalVolume *World_phys){
284 //  G4cout << ENERGY_ACRYLIC[i]/eV << " " << l << 
285   }                                            << 
286                                                << 
287   auto MPT_Acrylic = new G4MaterialPropertiesT << 
288   MPT_Acrylic->AddProperty("RINDEX", ENERGY_AC << 
289                                                << 
290 // Absorption                                  << 
291   std::vector<G4double> LAMBDAABS              << 
292   {                                            << 
293     100.0,                                     << 
294     246.528671, 260.605103, 263.853516, 266.01 << 
295     271.433136, 273.598724, 276.305725, 279.55 << 
296     320.159241, 340.191101, 360.764343, 381.33 << 
297     421.401276, 440.891724, 460.382172, 480.41 << 
298     520.477722, 540.509583, 559.458618,        << 
299     700.0                                      << 
300   } ;                                          << 
301                                                << 
302   std::vector<G4double> T   // Transmission (i << 
303   {                                            << 
304     0.0000000,                                 << 
305     0.0000000,  5.295952,  9.657321, 19.937695 << 
306     39.252335, 48.598133, 58.255451, 65.109039 << 
307     85.669785, 89.719627, 91.277260, 91.588783 << 
308     91.588783, 91.277260, 91.277260, 91.588783 << 
309     91.900307, 91.900307, 91.588783,           << 
310     91.5                                       << 
311   } ;                                          << 
312                                                << 
313                                                << 
314   auto abslengthMPV = new G4MaterialPropertyVe << 
315   for(size_t i=0;i<T.size(); ++i){             << 
316     auto energy    = h_Planck*c_light/(LAMBDAA << 
317     auto abslength = 0.0;                      << 
318                                                   302 
319     if (T[i] <= 0.0) {                         << 303   G4double Mirror_x = 40.0*cm;
320       abslength = 1.0/kInfinity ;              << 304   G4double Mirror_y = 40.0*cm;
321     }                                          << 305   G4double Mirror_z = 1*cm;
322     else {                                     << 
323       abslength = -3.0*mm/(G4Log(T[i]/100.0))  << 
324     }                                          << 
325                                                   306 
326     abslengthMPV->InsertValues(energy,abslengt << 307   G4Box * boxMirror = new G4Box("Mirror",Mirror_x,Mirror_y,Mirror_z);
327                                                   308 
328     // MPT_Acrylic->AddEntry("ABSLENGTH", ener << 309   // Get Air pointer from static funcion - (G4Material::GetMaterial)
329   }                                            << 
330                                                   310 
331   MPT_Acrylic->AddProperty("ABSLENGTH", abslen << 311 G4String name;
332   Acrylic->SetMaterialPropertiesTable(MPT_Acry << 312 G4Material *Al = G4Material::GetMaterial(name = "Aluminum");
                                                   >> 313 G4LogicalVolume *logMirror ;
                                                   >> 314 logMirror  = new G4LogicalVolume(boxMirror,Al,"Mirror",0,0,0);
333                                                   315 
334 ////////////////////////////////////////////// << 
335                                                   316 
336   G4cout << *(G4Material::GetMaterialTable())  << 317 G4ThreeVector SurfacePosition = G4ThreeVector(0*m,0*m,1.5*m) ;
                                                   >> 318 
                                                   >> 319 // Rotate reflecting surface by 45. degrees around the OX axis.
                                                   >> 320 
                                                   >> 321 G4RotationMatrix *Surfrot = new G4RotationMatrix(G4ThreeVector(1.0,0.0,0.0),-pi/4.);
                                                   >> 322 
                                                   >> 323 G4VPhysicalVolume *physMirror ;
                                                   >> 324 physMirror = new G4PVPlacement(Surfrot,SurfacePosition,"MirrorPV",logMirror,World_phys,false,0);
                                                   >> 325 
                                                   >> 326 G4VisAttributes* SurfaceVisAtt = new G4VisAttributes(G4Colour(0.0,0.0,1.0));
                                                   >> 327 SurfaceVisAtt->SetVisibility(true);
                                                   >> 328 SurfaceVisAtt->SetForceWireframe(true);
                                                   >> 329 logMirror->SetVisAttributes(SurfaceVisAtt);
                                                   >> 330 
                                                   >> 331 
                                                   >> 332 //////////////////////////////////////////////////////////////////////////////////////////
                                                   >> 333 //   Optical properties of the interface between the Air and Reflective Surface
                                                   >> 334 //   For Mirror, reflectivity is set at 95% and specular reflection is assumed.
                                                   >> 335 
                                                   >> 336 
                                                   >> 337 G4OpticalSurface *OpticalAirMirror = new G4OpticalSurface("AirMirrorSurface");
                                                   >> 338 OpticalAirMirror->SetModel(unified);
                                                   >> 339 OpticalAirMirror->SetType(dielectric_dielectric);
                                                   >> 340 OpticalAirMirror->SetFinish(polishedfrontpainted);
                                                   >> 341 
                                                   >> 342 const G4int NUM = 2;
                                                   >> 343 G4double XX[NUM] = { 0.1E-9*GeV, 10.0E-9*GeV };
                                                   >> 344 G4double ICEREFLECTIVITY[NUM]      = { 0.95, 0.95 };
                                                   >> 345 
                                                   >> 346 G4MaterialPropertiesTable *AirMirrorMPT = new G4MaterialPropertiesTable();
                                                   >> 347 AirMirrorMPT->AddProperty("REFLECTIVITY", XX, ICEREFLECTIVITY,NUM);
                                                   >> 348 OpticalAirMirror->SetMaterialPropertiesTable(AirMirrorMPT);
                                                   >> 349 
                                                   >> 350 
                                                   >> 351 G4LogicalBorderSurface *AirMirror ;
                                                   >> 352 AirMirror = new G4LogicalBorderSurface("Air/Mirror Surface",World_phys,physMirror,OpticalAirMirror);
                                                   >> 353 
                                                   >> 354  return physMirror  ; 
337                                                   355 
338   for (const auto& mat : *(G4Material::GetMate << 
339     if (mat->GetMaterialPropertiesTable()) {   << 
340       G4cout << "Material properties  for " << << 
341       mat->GetMaterialPropertiesTable()->DumpT << 
342     }                                          << 
343   }                                            << 
344 }                                                 356 }
                                                   >> 357 
345 //....oooOO0OOooo........oooOO0OOooo........oo    358 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
346                                                   359 
347 void UltraDetectorConstruction::ConstructRefle << 360 G4VPhysicalVolume* UltraDetectorConstruction::ConstructGround(G4VPhysicalVolume *World_phys){
348 {                                              << 
349   const auto x = 40.0*cm;                      << 
350   const auto y = 40.0*cm;                      << 
351   const auto z = 1*cm;                         << 
352                                                   361 
353   auto box = new G4Box("Mirror",x,y,z);        << 362   G4double Ground_x = 40.0*cm;
                                                   >> 363   G4double Ground_y = 40.0*cm;
                                                   >> 364   G4double Ground_z = 1*cm;
                                                   >> 365 
                                                   >> 366   G4Box * boxGround = new G4Box("Ground",Ground_x,Ground_y,Ground_z);
354                                                   367 
355   // Get Air pointer from static funcion - (G4    368   // Get Air pointer from static funcion - (G4Material::GetMaterial)
356   auto Al = G4Material::GetMaterial("Aluminum" << 
357                                                   369 
358   fReflectorLog = new G4LogicalVolume(box,Al," << 370 G4String name;
                                                   >> 371 G4Material *Al = G4Material::GetMaterial(name = "Aluminum");
                                                   >> 372 G4LogicalVolume *logGround ;
                                                   >> 373 logGround  = new G4LogicalVolume(boxGround,Al,"Ground",0,0,0);
359                                                   374 
360   auto SurfacePosition = G4ThreeVector(0*m,0*m << 
361                                                   375 
362   // Rotate reflecting surface by 45. degrees  << 376 G4ThreeVector SurfacePosition = G4ThreeVector(0*m,0*m,1.5*m) ;
363                                                   377 
364   auto Surfrot = new G4RotationMatrix(G4ThreeV << 378 // Rotate reflecting surface by 45. degrees around the OX axis.
365                                                   379 
366   new G4PVPlacement(Surfrot,SurfacePosition,"M << 380 G4RotationMatrix *Surfrot = new G4RotationMatrix(G4ThreeVector(1.0,0.0,0.0),-pi/4.);
367                                                   381 
368   auto SurfaceVisAtt = new G4VisAttributes(G4C << 382 G4VPhysicalVolume *physGround ;
369   SurfaceVisAtt->SetVisibility(true);          << 383 physGround = new G4PVPlacement(Surfrot,SurfacePosition,"GroundPV",logGround,World_phys,false,0);
370   SurfaceVisAtt->SetForceWireframe(true);      << 
371   fReflectorLog->SetVisAttributes(SurfaceVisAt << 
372                                                   384 
373   fReflectorOpticalSurface = new G4OpticalSurf << 385 G4VisAttributes* SurfaceVisAtt = new G4VisAttributes(G4Colour(0.0,0.0,1.0));
374   fReflectorOpticalSurface->SetModel(unified); << 386 SurfaceVisAtt->SetVisibility(true);
375   fReflectorOpticalSurface->SetType(dielectric << 387 SurfaceVisAtt->SetForceWireframe(true);
                                                   >> 388 logGround->SetVisAttributes(SurfaceVisAtt);
376                                                   389 
377   std::vector<G4double> XX{h_Planck*c_light/la << 
378   std::vector<G4double> ICEREFLECTIVITY{ 0.95, << 
379                                                   390 
380   auto AirMirrorMPT = new G4MaterialProperties << 391 //////////////////////////////////////////////////////////////////////////////////////////
381   AirMirrorMPT->AddProperty("REFLECTIVITY", XX << 392 //   Optical properties of the interface between the Air and Reflective Surface
382   fReflectorOpticalSurface->SetMaterialPropert << 393 //   For Ground, reflectivity is set to 95% and diffusive reflection is assumed.
383                                                   394 
384   new G4LogicalSkinSurface("ReflectorSurface", << 
385                                                   395 
386 #ifdef G4MULTITHREADED                         << 396 G4OpticalSurface *OpticalAirGround = new G4OpticalSurface("AirGroundSurface");
387   auto runManager = G4MTRunManager::GetMasterR << 397 OpticalAirGround->SetModel(unified);
388   //runManager->SetNumberOfThreads(2);         << 398 OpticalAirGround->SetType(dielectric_dielectric);
389 #else                                          << 399 OpticalAirGround->SetFinish(groundfrontpainted);
390   auto runManager = G4RunManager::GetRunManage << 
391 #endif                                         << 
392                                                   400 
393   runManager->GeometryHasBeenModified();       << 401  const G4int NUM = 2;
                                                   >> 402 G4double XX[NUM] = { 0.1E-9*GeV, 10.0E-9*GeV };
                                                   >> 403 G4double ICEREFLECTIVITY[NUM]      = { 0.95, 0.95 };
394                                                   404 
395   fIsReflectorConstructed = true;              << 405 G4MaterialPropertiesTable *AirGroundMPT = new G4MaterialPropertiesTable();
396 }                                              << 406 AirGroundMPT->AddProperty("REFLECTIVITY", XX, ICEREFLECTIVITY,NUM);
                                                   >> 407 OpticalAirGround->SetMaterialPropertiesTable(AirGroundMPT);
397                                                   408 
398                                                   409 
399 void UltraDetectorConstruction::SetReflectorOp << 410 G4LogicalBorderSurface *AirGround ;
400 {                                              << 411 AirGround = new G4LogicalBorderSurface("Air/Ground Surface",World_phys,physGround,OpticalAirGround);
401   if (fReflectionType == "ground") {           << 412 
402     G4cout << "Using ground reflecting surface << 413  return physGround  ; 
403     if (fReflectorOpticalSurface)              << 414 
404       fReflectorOpticalSurface->SetFinish(grou << 
405   }                                            << 
406   else {                                       << 
407     G4cout << "Using mirror reflecting surface << 
408     if (fReflectorOpticalSurface)              << 
409       fReflectorOpticalSurface->SetFinish(poli << 
410   }                                            << 
411 }                                                 415 }
412                                                   416 
413                                                   417 
                                                   >> 418 
414 //....oooOO0OOooo........oooOO0OOooo........oo    419 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
415                                                   420 
416 void UltraDetectorConstruction::ConstructUVsco << 421 G4VPhysicalVolume* UltraDetectorConstruction::ConstructUVscope(G4VPhysicalVolume *World_phys){
417 {                                              << 
418                                                   422 
419   //  ------------- Volumes --------------     << 423 //  ------------- Volumes --------------
420                                                   424 
421   //////////////////////////////////////////// << 425 ////////////////////////////////////////////////////////////////////////////////////////////////////////
422                                                   426 
423   G4cout << "#                                 << 427 G4cout << "#                                                    #" << G4endl ;  
424   G4cout << "#           Building the Telescop << 428 G4cout << "#           Building the Telescope    ...            #" << G4endl ;  
425   G4cout << "#                                 << 429 G4cout << "#                                                    #" << G4endl ;  
426                                                   430 
427   //////////////////////////////////////////// << 431 /////////////////////////////////////////////////////////////
428   // UVscope housing is a cylinder made of 1 m << 432 // UVscope housing is a cylinder made of 1 mm thick aluminum
429   //////////////////////////////////////////// << 433 /////////////////////////////////////////////////////////////
430                                                   434 
431   auto UVscopeHeight    = 1030.0*mm ;          << 435 G4double UVscopeHeight    = 1030.0*mm ;
432   auto UVscopeDiameter  = 518.0*mm ;           << 436 G4double UVscopeDiameter  = 518.0*mm ;
433   auto UVscopeThickness = 1.0*mm   ;           << 437 G4double UVscopeThickness = 1.0*mm   ;
434   auto UVscopeBaffle    = 514.0*mm ;           << 438 G4double UVscopeBaffle    = 514.0*mm ; 
435                                                   439 
436   auto UVscopeInnerRadius = UVscopeDiameter/2. << 440 G4double UVscopeInnerRadius = UVscopeDiameter/2.0-UVscopeThickness ;
437   auto UVscopeOuterRadius = UVscopeDiameter/2. << 441 G4double UVscopeOuterRadius = UVscopeDiameter/2.0 ; 
438                                                   442 
439   auto UVscopePosition = G4ThreeVector(0.0*m,0 << 443 G4ThreeVector UVscopePosition = G4ThreeVector(0.0*m,0.0*m,-1.0*m) ;
440   auto Al = G4Material::GetMaterial("Aluminum" << 444 G4String name;
                                                   >> 445 G4Material* Al = G4Material::GetMaterial(name = "Aluminum");
441                                                   446 
442   auto solidUVscope =                          << 
443     new G4Tubs("UVscopeSolid",UVscopeInnerRadi << 
444   auto logicUVscope =                          << 
445     new G4LogicalVolume(solidUVscope,Al,"UVsco << 
446   auto physicalUVscope =                       << 
447     new G4PVPlacement(0,UVscopePosition,"UVSCo << 
448                                                   447 
                                                   >> 448 G4Tubs *solidUVscope = 
                                                   >> 449  new G4Tubs("UVscopeSolid",UVscopeInnerRadius,UVscopeOuterRadius,UVscopeHeight/2.0,0.0,twopi) ;
                                                   >> 450 G4LogicalVolume *logicUVscope =
                                                   >> 451  new G4LogicalVolume(solidUVscope,Al,"UVscopeLV",0,0,0);
                                                   >> 452 G4VPhysicalVolume *physicalUVscope =
                                                   >> 453  new G4PVPlacement(0,UVscopePosition,"UVSCopePV",logicUVscope,World_phys,false,0);
449                                                   454 
450   //////////////////////////////////////       << 
451   // Back cover of the UVscope cylinder        << 
452   //////////////////////////////////////       << 
453                                                   455 
454   auto solidUVscopeBack =                      << 456 //////////////////////////////////////
455     new G4Tubs("UVscopeBackSolid",0.0,UVscopeO << 457 // Back cover of the UVscope cylinder
                                                   >> 458 //////////////////////////////////////
456                                                   459 
457   auto logicUVscopeBack =                      << 460 G4Tubs *solidUVscopeBack = 
458     new G4LogicalVolume(solidUVscopeBack,Al,"U << 461  new G4Tubs("UVscopeBackSolid",0.0,UVscopeOuterRadius,UVscopeThickness/2.0,0.0,twopi) ;
459                                                   462 
460   auto UVscopeBackPosition  =                  << 463 G4LogicalVolume *logicUVscopeBack = 
461     UVscopePosition+G4ThreeVector(0.0*mm,0.0*m << 464  new G4LogicalVolume(solidUVscopeBack,Al,"UVscopeBackLV",0,0,0);
462   auto physicalUVscopeBack =                   << 
463     new G4PVPlacement(0,UVscopeBackPosition,"U << 
464                                                   465 
465   //////////////////////////////////////////// << 466 G4ThreeVector UVscopeBackPosition ;
                                                   >> 467 UVscopeBackPosition =  UVscopePosition+G4ThreeVector(0.0*mm,0.0*mm,-(UVscopeHeight/2.0+UVscopeThickness/2.0)) ;
                                                   >> 468 G4VPhysicalVolume *physicalUVscopeBack = 
                                                   >> 469  new G4PVPlacement(0,UVscopeBackPosition,"UVscopeBack",logicUVscopeBack,World_phys,false,0);
466                                                   470 
467   G4cout << "#                                 << 
468   G4cout << "#           Building the Fresnel  << 
469   G4cout << "#                                 << 
470                                                   471 
471   auto      LensDiameter        = 457*mm ; //  << 
472   auto      LensNumOfGrooves    = 13 ;         << 
473   //auto      LensNumOfGrooves    = 129 ;      << 
474   //auto      LensNumOfGrooves    = 1287 ;     << 
475                                                   472 
476   auto      LensBorderThickness = 2.8*mm ;     << 473 ////////////////////////////////////////////////////////////////////////////////////////////////////////
477   auto      LensFocalLength     = 441.973*mm ; << 
478   auto      LensMaterial        = G4Material:: << 
479   auto      LensPosition        = UVscopePosit << 
480                                                   474 
                                                   >> 475   G4cout << "#                                                    #" << G4endl ;  
                                                   >> 476   G4cout << "#           Building the Fresnel lens ...            #" << G4endl ;  
                                                   >> 477   G4cout << "#                                                    #" << G4endl ;  
481                                                   478 
482   FresnelLens = new UltraFresnelLens(LensDiame << 479 G4double      LensDiameter        = 457*mm ; // Size of the optical active area of the lens.
                                                   >> 480 G4int      LensNumOfGrooves    = 13 ;
                                                   >> 481 //G4int      LensNumOfGrooves    = 129 ;
                                                   >> 482 //G4int      LensNumOfGrooves    = 1287 ;
483                                                   483 
                                                   >> 484 G4double      LensBorderThickness = 2.8*mm ;     // Thickness of the border area. 
                                                   >> 485 G4double      LensFocalLength     = 441.973*mm ; // This parameter depends on the lens geometry, etc !!
                                                   >> 486 G4Material   *LensMaterial        = G4Material::GetMaterial(name = "Acrylic") ;
                                                   >> 487 G4ThreeVector LensPosition        = UVscopePosition+G4ThreeVector(0.0*mm,0.0*mm,UVscopeHeight/2.0-UVscopeBaffle) ;
484                                                   488 
485   ///////////////////////////////////          << 
486   // Lens supporting ring (aluminum)           << 
487   ///////////////////////////////////          << 
488                                                   489 
489   auto solidLensFrame = new G4Tubs("LensFrame" << 490 UltraFresnelLens *FresnelLens = new UltraFresnelLens(LensDiameter,LensNumOfGrooves,LensMaterial,World_phys,LensPosition) ;
490   auto logicLensFrame = new G4LogicalVolume(so << 
491                                                   491 
492   auto LensFramePosition = LensPosition+G4Thre << 
493                                                   492 
494   auto physicalLensFrame =                     << 493 ///////////////////////////////////
495     new G4PVPlacement(0,LensFramePosition,"Len << 494 // Lens supporting ring (aluminum)
                                                   >> 495 ///////////////////////////////////
496                                                   496 
497   //////////////////////////////////////////// << 497 G4Tubs *solidLensFrame = new G4Tubs("LensFrame",LensDiameter/2.0,UVscopeInnerRadius,LensBorderThickness/2.0,0.0,twopi) ;
                                                   >> 498 G4LogicalVolume *logicLensFrame = new G4LogicalVolume(solidLensFrame,Al,"LensFrameLV",0,0,0);
498                                                   499 
                                                   >> 500 G4ThreeVector LensFramePosition ;
                                                   >> 501 LensFramePosition = LensPosition+G4ThreeVector(0.0*mm,0.0*mm,-((FresnelLens->GetThickness())/2.0+solidLensFrame->GetDz())) ;
499                                                   502 
500   G4cout << "#                                 << 503 G4VPhysicalVolume *physicalLensFrame =
501   G4cout << "#         Building the photomulti << 504   new G4PVPlacement(0,LensFramePosition,"LensFramePV",logicLensFrame,World_phys,false,0);
502   G4cout << "#                                 << 
503                                                   505 
                                                   >> 506 ////////////////////////////////////////////////////////////////////////////////////////////////////////
504                                                   507 
505   // Photomultiplier window is a spherical sec << 
506                                                   508 
507   auto PMT_thick   =   1.0*mm ; // Thickness o << 509   G4cout << "#                                                    #" << G4endl ;  
508   auto PMT_curv    =  65.5*mm ; // Radius of c << 510   G4cout << "#         Building the photomultiplier ...           #" << G4endl ;  
509   auto StartTheta  = (180.0-31.2)*pi/180. ;    << 511   G4cout << "#                                                    #" << G4endl ;  
510   auto EndTheta    = 31.2*pi/180. ;            << 
511                                                   512 
512   auto solidPMT =                              << 
513     new G4Sphere("PMT_solid",PMT_curv-PMT_thic << 
514                                                   513 
515   auto Quartz = G4Material::GetMaterial("Quart << 514 // Photomultiplier window is a spherical section made of quartz
516   logicalPMT = new G4LogicalVolume(solidPMT,Qu << 
517                                                   515 
                                                   >> 516 G4double PMT_thick   =   1.0*mm ; // Thickness of PMT window
                                                   >> 517 G4double PMT_curv    =  65.5*mm ; // Radius of curvature of PMT window
                                                   >> 518 G4double StartTheta  = (180.0-31.2)*pi/180. ;
                                                   >> 519 G4double EndTheta    = 31.2*pi/180. ;
518                                                   520 
519   // Place PMT is at Lens Focus                << 521 G4Sphere *solidPMT ;
                                                   >> 522 solidPMT = new G4Sphere("PMT_solid",PMT_curv-PMT_thick,PMT_curv,0.0,twopi,StartTheta,EndTheta);
520                                                   523 
521   auto PMTpos = LensPosition + G4ThreeVector(0 << 524 G4Material* Quartz = G4Material::GetMaterial(name = "Quartz");
                                                   >> 525 G4LogicalVolume * logicalPMT ;
                                                   >> 526 logicalPMT = new G4LogicalVolume(solidPMT,Quartz,"PMT_log",0,0,0);
522                                                   527 
523   // Rotate PMT window through the axis OX by  << 
524                                                   528 
525   auto PMTrot = new G4RotationMatrix(G4ThreeVe << 529 // Place PMT is at Lens Focus
526   new G4PVPlacement(PMTrot,PMTpos,"PMT1",logic << 
527                                                   530 
                                                   >> 531 G4ThreeVector PMTpos = LensPosition + G4ThreeVector(0.0*cm,0.0*cm,-(LensFocalLength+PMT_curv)) ;
528                                                   532 
529   auto PMTVisAtt   = new G4VisAttributes(true, << 533 // Rotate PMT window through the axis OX by an angle = 180. degrees
530   logicalPMT->SetVisAttributes(PMTVisAtt);     << 
531                                                   534 
532   //////////////////////////////////////////// << 535 G4RotationMatrix *PMTrot = new G4RotationMatrix(G4ThreeVector(1.0,0.0,0.0),pi);
533   //   Optical properties of the interface bet << 536 G4VPhysicalVolume *physPMT ;
534   //   UVscope cylinder (5% reflectivity)      << 537 physPMT  = new G4PVPlacement(PMTrot,PMTpos,"PMT1",logicalPMT,World_phys,false,0);
535                                                   538 
                                                   >> 539   if(!PMTSD)
                                                   >> 540     {
                                                   >> 541       PMTSD = new UltraPMTSD("PMTSD");
                                                   >> 542       SDmanager->AddNewDetector( PMTSD );
                                                   >> 543     }
536                                                   544 
537   G4cout << "#    Defining interface's optical << 545   if (logicalPMT){logicalPMT->SetSensitiveDetector(PMTSD);}
538   G4cout << "#                                 << 
539                                                   546 
                                                   >> 547 G4VisAttributes* PMTVisAtt   = new G4VisAttributes(true,G4Colour(0.0,0.0,1.0)) ;   
                                                   >> 548 logicalPMT->SetVisAttributes(PMTVisAtt);
540                                                   549 
541   auto OpticalAirPaint = new G4OpticalSurface( << 550 //////////////////////////////////////////////////////////////////////////////////////////
542   OpticalAirPaint->SetModel(unified);          << 551 //   Optical properties of the interface between the Air and the walls of the 
543   OpticalAirPaint->SetType(dielectric_dielectr << 552 //   UVscope cylinder (5% reflectivity)
544   OpticalAirPaint->SetFinish(groundfrontpainte << 
545                                                   553 
546   std::vector<G4double> XX = {h_Planck*c_light << 
547   std::vector<G4double> BLACKPAINTREFLECTIVITY << 
548   //std::vector<G4double> WHITEPAINTREFLECTIVI << 
549                                                   554 
550   auto AirPaintMPT = new G4MaterialPropertiesT << 555   G4cout << "#    Defining interface's optical properties  ...    #" << G4endl ;  
551   AirPaintMPT->AddProperty("REFLECTIVITY", XX, << 556   G4cout << "#                                                    #" << G4endl ;  
552   OpticalAirPaint->SetMaterialPropertiesTable( << 
553                                                   557 
554   //OpticalAirPaint->DumpInfo();               << 
555                                                   558 
556   new G4LogicalBorderSurface("Air/UVscope Cyli << 559 G4OpticalSurface *OpticalAirPaint = new G4OpticalSurface("AirPaintSurface");
                                                   >> 560 OpticalAirPaint->SetModel(unified);
                                                   >> 561 OpticalAirPaint->SetType(dielectric_dielectric);
                                                   >> 562 OpticalAirPaint->SetFinish(groundfrontpainted);
557                                                   563 
558   new G4LogicalBorderSurface("Air/LensFrame Su << 564 const G4int NUM = 2;
                                                   >> 565 G4double XX[NUM] = { 2.030E-9*GeV, 4.144E-9*GeV };
                                                   >> 566 G4double BLACKPAINTREFLECTIVITY[NUM]      = { 0.05, 0.05 };
                                                   >> 567 //G4double WHITEPAINTREFLECTIVITY[NUM]      = { 0.99, 0.99 };
559                                                   568 
560   new G4LogicalBorderSurface("Air/UVscope Back << 569 G4MaterialPropertiesTable *AirPaintMPT = new G4MaterialPropertiesTable();
                                                   >> 570 AirPaintMPT->AddProperty("REFLECTIVITY", XX, BLACKPAINTREFLECTIVITY,NUM);
                                                   >> 571 OpticalAirPaint->SetMaterialPropertiesTable(AirPaintMPT);
561                                                   572 
                                                   >> 573 //OpticalAirPaint->DumpInfo();
562                                                   574 
563   //////////////////////////////////////////// << 575 G4LogicalBorderSurface *AirCylinder ;
                                                   >> 576 AirCylinder = new G4LogicalBorderSurface("Air/UVscope Cylinder Surface",World_phys,physicalUVscope,OpticalAirPaint);
564                                                   577 
565   auto LensVisAtt  = new G4VisAttributes(G4Col << 578 G4LogicalBorderSurface *AirLensFrame ;
566   LensVisAtt ->SetVisibility(true);            << 579 AirLensFrame = new G4LogicalBorderSurface("Air/LensFrame Surface",World_phys,physicalLensFrame,OpticalAirPaint);
567                                                   580 
                                                   >> 581 G4LogicalBorderSurface *AirBackCover ;
                                                   >> 582 AirBackCover = new G4LogicalBorderSurface("Air/UVscope Back Cover Surface",World_phys,physicalUVscopeBack,OpticalAirPaint);
568                                                   583 
569   if (FresnelLens){                            << 
570     FresnelLens->GetPhysicalVolume()->GetLogic << 
571   }                                            << 
572                                                   584 
573   auto UVscopeVisAtt  = new G4VisAttributes(G4 << 585 /////////////////////////////////////////////////////////////////////////////////////
574   UVscopeVisAtt ->SetVisibility(true);         << 
575                                                   586 
576   physicalUVscope     ->GetLogicalVolume()->Se << 
577   physicalUVscopeBack ->GetLogicalVolume()->Se << 
578   physicalLensFrame   ->GetLogicalVolume()->Se << 
579                                                   587 
580   //////////////////////////////////////////// << 588    G4VisAttributes* LensVisAtt  = new G4VisAttributes(G4Colour(1.0,0.0,0.0)) ;   // Red
                                                   >> 589    LensVisAtt ->SetVisibility(true);
581                                                   590 
582   G4cout << "#                                 << 
583   G4cout << "#               UVscope is built  << 
584   G4cout << "#                                 << 
585                                                   591 
586 }                                              << 592    if (FresnelLens){
                                                   >> 593    FresnelLens->GetPhysicalVolume()->GetLogicalVolume()->SetVisAttributes(LensVisAtt);
                                                   >> 594    }
587                                                   595 
                                                   >> 596    G4VisAttributes* UVscopeVisAtt  = new G4VisAttributes(G4Colour(0.5,0.5,0.5)) ;   // Gray
                                                   >> 597    UVscopeVisAtt ->SetVisibility(true);
588                                                   598 
589 void UltraDetectorConstruction::SetReflectionT << 599    physicalUVscope     ->GetLogicalVolume()->SetVisAttributes(UVscopeVisAtt);
590 {                                              << 600    physicalUVscopeBack ->GetLogicalVolume()->SetVisAttributes(UVscopeVisAtt);
591 #ifdef G4MULTITHREADED                         << 601    physicalLensFrame   ->GetLogicalVolume()->SetVisAttributes(UVscopeVisAtt);
592   auto runManager = G4MTRunManager::GetMasterR << 
593   //runManager->SetNumberOfThreads(2);         << 
594 #else                                          << 
595   auto runManager = G4RunManager::GetRunManage << 
596 #endif                                         << 
597                                                   602 
598   fReflectionType = rtype;                     << 603 /////////////////////////////////////////////////////////////////////////////////////
599                                                   604 
600   if (fReflectionType == "none") {             << 605   G4cout << "#                                                    #" << G4endl ;  
601     if (fIsReflectorConstructed) {             << 606   G4cout << "#               UVscope is built ! ...               #" << G4endl ;  
602       // Cleanup old geometry to delete reflec << 607   G4cout << "#                                                    #" << G4endl ;  
603       runManager->ReinitializeGeometry(true);  << 608 
604     }                                          << 609   return physicalUVscope;
605   }                                            << 
606   else {                                       << 
607     if (!fIsReflectorConstructed) {            << 
608       ConstructReflector();                    << 
609     }                                          << 
610     SetReflectorOpticalProperties();           << 
611   }                                            << 
612 }                                                 610 }
                                                   >> 611 
                                                   >> 612 
                                                   >> 613 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 614 
                                                   >> 615 
                                                   >> 616 
613                                                   617