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.2.p1)


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