source: trunk/examples/advanced/air_shower/src/UltraDetectorConstruction.cc @ 1303

Last change on this file since 1303 was 1230, checked in by garnier, 14 years ago

update to geant4.9.3

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