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