Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UltraDetectorConstruction.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // --------------------------------------------------------------
28 // GEANT 4 - ULTRA experiment example
29 // --------------------------------------------------------------
30 //
31 // Code developed by:
32 // B. Tome, M.C. Espirito-Santo, A. Trindade, P. Rodrigues
33 //
34 // ****************************************************
35 // * UltraDetectorConstruction.cc
36 // ****************************************************
37 //
38 // Class used in the definition of the Ultra setup consisting of:
39 // - the UVscope detector
40 // - an optional reflecting surface
41 // Optical photons can reach the UVscope either directly or after reflection in the
42 // surface, which can be polished or diffusing.
43 // The main part of the UVscope definition is the Fresnel lens construction based
44 // on the UltraFresnelLens class.
45 //
46 #include <cmath>
47 
49 #include "UltraPMTSD.hh"
50 #include "UltraFresnelLens.hh"
51 
52 #include "G4PhysicalConstants.hh"
53 #include "G4SystemOfUnits.hh"
54 #include "G4SDManager.hh"
55 #include "G4Material.hh"
56 #include "G4MaterialTable.hh"
57 #include "G4Element.hh"
58 #include "G4ElementTable.hh"
60 #include "G4Box.hh"
61 #include "G4Sphere.hh"
62 #include "G4Tubs.hh"
63 #include "G4LogicalVolume.hh"
64 #include "G4RotationMatrix.hh"
65 #include "G4ThreeVector.hh"
66 #include "G4Transform3D.hh"
67 #include "G4PVPlacement.hh"
68 #include "G4OpBoundaryProcess.hh"
69 #include "G4VisAttributes.hh"
70 #include "G4Colour.hh"
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
73 
75 {
76 
77  PMTSD = 0;
78 
79  // Sensitive Detector Manager
80  SDmanager = G4SDManager::GetSDMpointer();
81 
82 // Define wavelength limits for materials definition
83  lambda_min = 200*nm ;
84  lambda_max = 700*nm ;
85 
86 }
87 
88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
89 
91 
92 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
93 
95 {
96  ConstructTableMaterials();
97 
98 
99 
100 // The experimental Hall
101 // ---------------------
102 
103  G4double World_x = 1.*m;
104  G4double World_y = 1.*m;
105  G4double World_z = 2*m;
106 
107  G4Box * World_box = new G4Box("World",World_x,World_y,World_z);
108 
109  // Get Air pointer from static funcion - (G4Material::GetMaterial)
110 
111 G4String name;
112 G4Material *Air = G4Material::GetMaterial(name = "Air");
113 G4LogicalVolume *World_log ;
114 World_log = new G4LogicalVolume(World_box,Air,"World",0,0,0);
115 
116 G4VPhysicalVolume *World_phys ;
117 World_phys = new G4PVPlacement(0,G4ThreeVector(),"World",World_log,0,false,0);
118 
119  G4VisAttributes* UniverseVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,1.0));
120  UniverseVisAtt->SetVisibility(true);
121  UniverseVisAtt->SetForceWireframe(true);
122  World_log->SetVisAttributes(UniverseVisAtt);
124 
125 
126 
127  G4cout << "\n \n \n \n \n \n \n \n \n \n \n \n \n " << G4endl ;
128 
129  G4cout << "######################################################" << G4endl ;
130  G4cout << "# #" << G4endl ;
131  G4cout << "# #" << G4endl ;
132  G4cout << "# UltraDetectorConstruction: #" << G4endl ;
133  G4cout << "# #" << G4endl ;
134  G4cout << "# #" << G4endl ;
135 
136  ConstructUVscope(World_phys);
137 
138 
139  G4cout << "# #" << G4endl ;
140  G4cout << "# #" << G4endl ;
141  G4cout << "######################################################" << G4endl ;
142 
143 
144 #ifdef ULTRA_MIRROR_USE
145 
146  G4cout << "Using mirror reflecting surface " << G4endl ;
147 
148  G4VPhysicalVolume* Mirror ;
149  Mirror = ConstructMirror(World_phys);
150 
151 #elif ULTRA_GROUND_USE
152 
153  G4cout << "Using ground reflecting surface " << G4endl ;
154 
155  G4VPhysicalVolume* Ground ;
156  Ground = ConstructGround(World_phys);
157 
158 #else
159 
160  G4cout << "No reflecting surface used" << G4endl ;
161 
162 #endif
163 
164  return World_phys;
165 }
166 
167 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
168 
169 void UltraDetectorConstruction::ConstructTableMaterials()
170 {
171  G4double a, z, density;
173  G4int nel;
174 
175 
176 // ------------- Elements -------------
177  a = 1.01*g/mole;
178  G4Element* elH = new G4Element(name="Hydrogen", symbol="H", z=1., a);
179 
180  a = 12.01*g/mole;
181  G4Element* elC = new G4Element(name="Carbon", symbol="C", z=6., a);
182 
183  a = 14.01*g/mole;
184  G4Element* elN = new G4Element(name="Nitrogen", symbol="N", z=7., a);
185 
186  a = 16.00*g/mole;
187  G4Element* elO = new G4Element(name="Oxygen", symbol="O", z=8., a);
188 
189  a = 28.09*g/mole;
190  G4Element* elSi = new G4Element(name="Silicon", symbol="Si", z=14., a);
191 
192 
193 // ------------- Materials -------------
194 
195 
196 // Air
197 // ---
198  density = 1.29e-03*g/cm3;
199  G4Material* Air = new G4Material(name="Air", density, nel=2);
200  Air->AddElement(elN, .7);
201  Air->AddElement(elO, .3);
202 
203 
204 // Aluminum
205 // ---------
206  a = 26.98*g/mole;
207  density = 2.7*g/cm3;
208  new G4Material(name="Aluminum", z=13., a, density);
209 
210 
211 // Quartz
212 // -------
213 // density = 2.200*g/cm3; // fused quartz
214  density = 2.64*g/cm3; // crystalline quartz (c.f. PDG)
215  G4Material *Quartz = new G4Material(name="Quartz",density, nel=2);
216  Quartz->AddElement(elSi, 1) ;
217  Quartz->AddElement(elO , 2) ;
218 
219 
220 // PMMA C5H8O2 ( Acrylic )
221 // -------------
222  density = 1.19*g/cm3;
223  G4Material* Acrylic = new G4Material(name="Acrylic", density, nel=3);
224  Acrylic->AddElement(elC, 5);
225  Acrylic->AddElement(elH, 8);
226  Acrylic->AddElement(elO, 2);
227 
228 
230 // Construct Material Properties Tables
232 
233  const G4int NUMENTRIES = 2;
234 
235  // Energy bins
236  G4double X_RINDEX[NUMENTRIES] = {h_Planck*c_light/lambda_max, h_Planck*c_light/lambda_min} ;
237 
238 
239  // Air
240  G4double RINDEX_AIR[NUMENTRIES] = {1.00, 1.00} ;
241 
242 // Air refractive index at 20 oC and 1 atm (from PDG)
243  for(G4int j=0 ; j<NUMENTRIES ; j++){
244  RINDEX_AIR[j] = RINDEX_AIR[j] + 2.73*std::pow(10.0,-4) ;
245  }
246 
248  MPT_Air->AddProperty("RINDEX", X_RINDEX, RINDEX_AIR, NUMENTRIES);
249  Air->SetMaterialPropertiesTable(MPT_Air);
250 
252 // Photomultiplier (PMT) window
253 // The refractive index is for lime glass;
254 // wavelength dependence is not included and value at 400nm is used.
256 
257  // Refractive index
258 
259  const G4int N_RINDEX_QUARTZ = 2 ;
260  G4double X_RINDEX_QUARTZ[N_RINDEX_QUARTZ] = {h_Planck*c_light/lambda_max, h_Planck*c_light/lambda_min} ;
261  G4double RINDEX_QUARTZ[N_RINDEX_QUARTZ] = {1.54, 1.54};
262 
264  MPT_PMT->AddProperty("RINDEX", X_RINDEX_QUARTZ, RINDEX_QUARTZ, N_RINDEX_QUARTZ);
265 
266  Quartz->SetMaterialPropertiesTable(MPT_PMT);
267 
268 
270 // ACRYLIC Optical properties
272 
273 // Refractive index
274 
275  const G4int NENTRIES = 11 ;
276  G4double LAMBDA_ACRYLIC[NENTRIES] ;
277 
278 
279  G4double RINDEX_ACRYLIC[NENTRIES] ;
280  G4double ENERGY_ACRYLIC[NENTRIES] ;
281 
282 // Parameterization for refractive index of High Grade PMMA
283 
284  G4double bParam[4] = {1760.7010,-1.3687,2.4388e-3,-1.5178e-6} ;
285 
286  for(G4int i=0;i<NENTRIES; i++){
287 
288  LAMBDA_ACRYLIC[i] = lambda_min + i*(lambda_max-lambda_min)/float(NENTRIES-1) ;
289  RINDEX_ACRYLIC[i] = 0.0 ;
290 
291  for (G4int jj=0 ; jj<4 ; jj++)
292  {
293  RINDEX_ACRYLIC[i] += (bParam[jj]/1000.0)*std::pow(LAMBDA_ACRYLIC[i]/nm,jj) ;
294  }
295 
296  ENERGY_ACRYLIC[i] = h_Planck*c_light/LAMBDA_ACRYLIC[i] ; // Convert from wavelength to energy ;
297 // G4cout << ENERGY_ACRYLIC[i]/eV << " " << LAMBDA_ACRYLIC[i]/nm << " " << RINDEX_ACRYLIC[i] << G4endl ;
298 
299  }
300 
302  MPT_Acrylic->AddProperty("RINDEX", ENERGY_ACRYLIC, RINDEX_ACRYLIC, NENTRIES);
303 
304 
305 // Absorption
306  const G4int NENT = 25 ;
307  G4double LAMBDAABS[NENT] =
308  {
309  100.0,
310  246.528671, 260.605103, 263.853516, 266.019104, 268.726105,
311  271.433136, 273.598724, 276.305725, 279.554138, 300.127380,
312  320.159241, 340.191101, 360.764343, 381.337585, 399.745239,
313  421.401276, 440.891724, 460.382172, 480.414001, 500.987274,
314  520.477722, 540.509583, 559.458618,
315  700.0
316  } ;
317 
318  G4double ABS[NENT] = // Transmission (in %) of 3mm thick PMMA
319  {
320  0.0000000,
321  0.0000000, 5.295952, 9.657321, 19.937695, 29.283491,
322  39.252335, 48.598133, 58.255451, 65.109039, 79.439247,
323  85.669785, 89.719627, 91.277260, 91.588783, 91.900307,
324  91.588783, 91.277260, 91.277260, 91.588783, 91.588783,
325  91.900307, 91.900307, 91.588783,
326  91.5
327  } ;
328 
329 
330  MPT_Acrylic->AddProperty("ABSLENGTH", new G4MaterialPropertyVector()) ;
331  for(G4int i=0;i<NENT; i++){
332  G4double energy = h_Planck*c_light/(LAMBDAABS[i]*nm) ;
333  G4double abslength ;
334 
335  if (ABS[i] <= 0.0) {
336  abslength = 1.0/kInfinity ;
337  }
338  else {
339  abslength = -3.0*mm/(std::log(ABS[i]/100.0)) ;
340  }
341 
342  MPT_Acrylic->AddEntry("ABSLENGTH", energy, abslength);
343 
344  }
345 
346  Acrylic->SetMaterialPropertiesTable(MPT_Acrylic);
347 
348 
350 
352 
353 }
354 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
355 
356 G4VPhysicalVolume* UltraDetectorConstruction::ConstructMirror(G4VPhysicalVolume *World_phys){
357 
358  G4double Mirror_x = 40.0*cm;
359  G4double Mirror_y = 40.0*cm;
360  G4double Mirror_z = 1*cm;
361 
362  G4Box * boxMirror = new G4Box("Mirror",Mirror_x,Mirror_y,Mirror_z);
363 
364  // Get Air pointer from static funcion - (G4Material::GetMaterial)
365 
366 G4String name;
367 G4Material *Al = G4Material::GetMaterial(name = "Aluminum");
368 G4LogicalVolume *logMirror ;
369 logMirror = new G4LogicalVolume(boxMirror,Al,"Mirror",0,0,0);
370 
371 
372 G4ThreeVector SurfacePosition = G4ThreeVector(0*m,0*m,1.5*m) ;
373 
374 // Rotate reflecting surface by 45. degrees around the OX axis.
375 
376 G4RotationMatrix *Surfrot = new G4RotationMatrix(G4ThreeVector(1.0,0.0,0.0),-pi/4.);
377 
378 G4VPhysicalVolume *physMirror ;
379 physMirror = new G4PVPlacement(Surfrot,SurfacePosition,"MirrorPV",logMirror,World_phys,false,0);
380 
381 G4VisAttributes* SurfaceVisAtt = new G4VisAttributes(G4Colour(0.0,0.0,1.0));
382 SurfaceVisAtt->SetVisibility(true);
383 SurfaceVisAtt->SetForceWireframe(true);
384 logMirror->SetVisAttributes(SurfaceVisAtt);
385 
386 
388 // Optical properties of the interface between the Air and Reflective Surface
389 // For Mirror, reflectivity is set at 95% and specular reflection is assumed.
390 
391 
392 G4OpticalSurface *OpticalAirMirror = new G4OpticalSurface("AirMirrorSurface");
393 OpticalAirMirror->SetModel(unified);
394 OpticalAirMirror->SetType(dielectric_dielectric);
395 OpticalAirMirror->SetFinish(polishedfrontpainted);
396 
397 const G4int NUM = 2;
398 G4double XX[NUM] = {h_Planck*c_light/lambda_max, h_Planck*c_light/lambda_min} ;
399 G4double ICEREFLECTIVITY[NUM] = { 0.95, 0.95 };
400 
402 AirMirrorMPT->AddProperty("REFLECTIVITY", XX, ICEREFLECTIVITY,NUM);
403 OpticalAirMirror->SetMaterialPropertiesTable(AirMirrorMPT);
404 
405 
406 
407 new G4LogicalBorderSurface("Air/Mirror Surface",World_phys,physMirror,OpticalAirMirror);
408 
409  return physMirror ;
410 
411 }
412 
413 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
414 
415 G4VPhysicalVolume* UltraDetectorConstruction::ConstructGround(G4VPhysicalVolume *World_phys){
416 
417  G4double Ground_x = 40.0*cm;
418  G4double Ground_y = 40.0*cm;
419  G4double Ground_z = 1*cm;
420 
421  G4Box * boxGround = new G4Box("Ground",Ground_x,Ground_y,Ground_z);
422 
423  // Get Air pointer from static funcion - (G4Material::GetMaterial)
424 
425 G4String name;
426 G4Material *Al = G4Material::GetMaterial(name = "Aluminum");
427 G4LogicalVolume *logGround ;
428 logGround = new G4LogicalVolume(boxGround,Al,"Ground",0,0,0);
429 
430 
431 G4ThreeVector SurfacePosition = G4ThreeVector(0*m,0*m,1.5*m) ;
432 
433 // Rotate reflecting surface by 45. degrees around the OX axis.
434 
435 G4RotationMatrix *Surfrot = new G4RotationMatrix(G4ThreeVector(1.0,0.0,0.0),-pi/4.);
436 
437 G4VPhysicalVolume *physGround ;
438 physGround = new G4PVPlacement(Surfrot,SurfacePosition,"GroundPV",logGround,World_phys,false,0);
439 
440 G4VisAttributes* SurfaceVisAtt = new G4VisAttributes(G4Colour(0.0,0.0,1.0));
441 SurfaceVisAtt->SetVisibility(true);
442 SurfaceVisAtt->SetForceWireframe(true);
443 logGround->SetVisAttributes(SurfaceVisAtt);
444 
445 
447 // Optical properties of the interface between the Air and Reflective Surface
448 // For Ground, reflectivity is set to 95% and diffusive reflection is assumed.
449 
450 
451 G4OpticalSurface *OpticalAirGround = new G4OpticalSurface("AirGroundSurface");
452 OpticalAirGround->SetModel(unified);
453 OpticalAirGround->SetType(dielectric_dielectric);
454 OpticalAirGround->SetFinish(groundfrontpainted);
455 
456  const G4int NUM = 2;
457 G4double XX[NUM] = {h_Planck*c_light/lambda_max, h_Planck*c_light/lambda_min} ;
458 G4double ICEREFLECTIVITY[NUM] = { 0.95, 0.95 };
459 
461 AirGroundMPT->AddProperty("REFLECTIVITY", XX, ICEREFLECTIVITY,NUM);
462 OpticalAirGround->SetMaterialPropertiesTable(AirGroundMPT);
463 
464 
465 new G4LogicalBorderSurface("Air/Ground Surface",World_phys,physGround,OpticalAirGround);
466 
467  return physGround ;
468 
469 }
470 
471 
472 
473 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
474 
475 G4VPhysicalVolume* UltraDetectorConstruction::ConstructUVscope(G4VPhysicalVolume *World_phys){
476 
477 // ------------- Volumes --------------
478 
480 
481 G4cout << "# #" << G4endl ;
482 G4cout << "# Building the Telescope ... #" << G4endl ;
483 G4cout << "# #" << G4endl ;
484 
486 // UVscope housing is a cylinder made of 1 mm thick aluminum
488 
489 G4double UVscopeHeight = 1030.0*mm ;
490 G4double UVscopeDiameter = 518.0*mm ;
491 G4double UVscopeThickness = 1.0*mm ;
492 G4double UVscopeBaffle = 514.0*mm ;
493 
494 G4double UVscopeInnerRadius = UVscopeDiameter/2.0-UVscopeThickness ;
495 G4double UVscopeOuterRadius = UVscopeDiameter/2.0 ;
496 
497 G4ThreeVector UVscopePosition = G4ThreeVector(0.0*m,0.0*m,-1.0*m) ;
498 G4String name;
499 G4Material* Al = G4Material::GetMaterial(name = "Aluminum");
500 
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);
508 
509 
511 // Back cover of the UVscope cylinder
513 
514 G4Tubs *solidUVscopeBack =
515  new G4Tubs("UVscopeBackSolid",0.0,UVscopeOuterRadius,UVscopeThickness/2.0,0.0,twopi) ;
516 
517 G4LogicalVolume *logicUVscopeBack =
518  new G4LogicalVolume(solidUVscopeBack,Al,"UVscopeBackLV",0,0,0);
519 
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);
524 
525 
526 
528 
529  G4cout << "# #" << G4endl ;
530  G4cout << "# Building the Fresnel lens ... #" << G4endl ;
531  G4cout << "# #" << G4endl ;
532 
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 ;
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) ;
542 
543 
544 FresnelLens = new UltraFresnelLens(LensDiameter,LensNumOfGrooves,LensMaterial,World_phys,LensPosition) ;
545 
546 
548 // Lens supporting ring (aluminum)
550 
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);
553 
554 G4ThreeVector LensFramePosition ;
555 LensFramePosition = LensPosition+G4ThreeVector(0.0*mm,0.0*mm,-((FresnelLens->GetThickness())/2.0+solidLensFrame->GetDz())) ;
556 
557 G4VPhysicalVolume *physicalLensFrame =
558  new G4PVPlacement(0,LensFramePosition,"LensFramePV",logicLensFrame,World_phys,false,0);
559 
561 
562 
563  G4cout << "# #" << G4endl ;
564  G4cout << "# Building the photomultiplier ... #" << G4endl ;
565  G4cout << "# #" << G4endl ;
566 
567 
568 // Photomultiplier window is a spherical section made of quartz
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. ;
574 
575 G4Sphere *solidPMT ;
576 solidPMT = new G4Sphere("PMT_solid",PMT_curv-PMT_thick,PMT_curv,0.0,twopi,StartTheta,EndTheta);
577 
578 G4Material* Quartz = G4Material::GetMaterial(name = "Quartz");
579 G4LogicalVolume * logicalPMT ;
580 logicalPMT = new G4LogicalVolume(solidPMT,Quartz,"PMT_log",0,0,0);
581 
582 
583 // Place PMT is at Lens Focus
584 
585 G4ThreeVector PMTpos = LensPosition + G4ThreeVector(0.0*cm,0.0*cm,-(LensFocalLength+PMT_curv)) ;
586 
587 // Rotate PMT window through the axis OX by an angle = 180. degrees
588 
589 G4RotationMatrix *PMTrot = new G4RotationMatrix(G4ThreeVector(1.0,0.0,0.0),pi);
590 new G4PVPlacement(PMTrot,PMTpos,"PMT1",logicalPMT,World_phys,false,0);
591 
592  if(!PMTSD)
593  {
594  PMTSD = new UltraPMTSD("PMTSD");
595  SDmanager->AddNewDetector( PMTSD );
596  }
597 
598  if (logicalPMT){logicalPMT->SetSensitiveDetector(PMTSD);}
599 
600 G4VisAttributes* PMTVisAtt = new G4VisAttributes(true,G4Colour(0.0,0.0,1.0)) ;
601 logicalPMT->SetVisAttributes(PMTVisAtt);
602 
604 // Optical properties of the interface between the Air and the walls of the
605 // UVscope cylinder (5% reflectivity)
606 
607 
608  G4cout << "# Defining interface's optical properties ... #" << G4endl ;
609  G4cout << "# #" << G4endl ;
610 
611 
612 G4OpticalSurface *OpticalAirPaint = new G4OpticalSurface("AirPaintSurface");
613 OpticalAirPaint->SetModel(unified);
614 OpticalAirPaint->SetType(dielectric_dielectric);
615 OpticalAirPaint->SetFinish(groundfrontpainted);
616 
617 const G4int NUM = 2;
618 G4double XX[NUM] = {h_Planck*c_light/lambda_max, h_Planck*c_light/lambda_min} ;
619 G4double BLACKPAINTREFLECTIVITY[NUM] = { 0.05, 0.05 };
620 //G4double WHITEPAINTREFLECTIVITY[NUM] = { 0.99, 0.99 };
621 
623 AirPaintMPT->AddProperty("REFLECTIVITY", XX, BLACKPAINTREFLECTIVITY,NUM);
624 OpticalAirPaint->SetMaterialPropertiesTable(AirPaintMPT);
625 
626 //OpticalAirPaint->DumpInfo();
627 
628 new G4LogicalBorderSurface("Air/UVscope Cylinder Surface",World_phys,physicalUVscope,OpticalAirPaint);
629 
630 new G4LogicalBorderSurface("Air/LensFrame Surface",World_phys,physicalLensFrame,OpticalAirPaint);
631 
632 new G4LogicalBorderSurface("Air/UVscope Back Cover Surface",World_phys,physicalUVscopeBack,OpticalAirPaint);
633 
634 
636 
637 
638  G4VisAttributes* LensVisAtt = new G4VisAttributes(G4Colour(1.0,0.0,0.0)) ; // Red
639  LensVisAtt ->SetVisibility(true);
640 
641 
642  if (FresnelLens){
643  FresnelLens->GetPhysicalVolume()->GetLogicalVolume()->SetVisAttributes(LensVisAtt);
644  }
645 
646  G4VisAttributes* UVscopeVisAtt = new G4VisAttributes(G4Colour(0.5,0.5,0.5)) ; // Gray
647  UVscopeVisAtt ->SetVisibility(true);
648 
649  physicalUVscope ->GetLogicalVolume()->SetVisAttributes(UVscopeVisAtt);
650  physicalUVscopeBack ->GetLogicalVolume()->SetVisAttributes(UVscopeVisAtt);
651  physicalLensFrame ->GetLogicalVolume()->SetVisAttributes(UVscopeVisAtt);
652 
654 
655  G4cout << "# #" << G4endl ;
656  G4cout << "# UVscope is built ! ... #" << G4endl ;
657  G4cout << "# #" << G4endl ;
658 
659  return physicalUVscope;
660 }
661 
662 
663 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
664 
665 
666