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 10.0.p3)


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