5 #include "G4RunManager.hh"
6 #include "G4UnitsTable.hh"
7 #include "G4SDManager.hh"
8 #include "G4Material.hh"
9 #include "G4MaterialTable.hh"
10 #include "G4Polyhedra.hh"
11 #include "G4BREPSolidPolyhedra.hh"
12 #include "G4LogicalVolume.hh"
13 #include "G4PVPlacement.hh"
14 #include "G4ThreeVector.hh"
15 #include "G4VisAttributes.hh"
16 #include "G4LogicalSkinSurface.hh"
17 #include "G4OpticalSurface.hh"
19 using namespace TelescopeSimulatorLX ;
26 fWindowSide = 21.9*
mm;
27 fPhotocathodeSide = 36.0*
mm/2.0*(2.0/
std::sqrt(3.0));
29 fWindowMaterial = G4Material::GetMaterial(
"LimeGlass");
34 SDmanager = G4SDManager::GetSDMpointer();
37 fPhotocathode_log = NULL;
50 G4Exception(
"Error in FDsimG4PMT constructor: G4Material of window of PMT not specified !!!");
53 if ( fWindowSide < fPhotocathodeSide )
54 G4Exception(
"Error in FDsimG4PMT constructor: Photocathode size > PMT size !!!");
61 G4cerr <<
" =================================================================== " << G4endl ;
62 G4cerr <<
" = PMT parameters " << G4endl ;
63 G4cerr <<
" = " << G4endl ;
64 G4cerr <<
" = PMT window side : " << fWindowSide/
mm <<
" (mm) " << G4endl ;
65 G4cerr <<
" = Photocathode side : " << fPhotocathodeSide/
mm <<
" (mm) " << G4endl ;
66 G4cerr <<
" = PMT thickness : " << fThickness/
mm <<
" (mm) " << G4endl ;
67 G4cerr <<
" = " << G4endl ;
68 G4cerr <<
" = Window Material : " << fWindowMaterial->GetName() << G4endl ;
69 G4cerr <<
" = " << G4endl ;
70 G4cerr <<
" =================================================================== " << G4endl ;
76 const G4int numSides = 6;
77 const G4int numZplanes = 2;
80 G4double rMinVec[numZplanes] = {0.0, 0.0};
81 G4double rMaxVec[numZplanes] = {fWindowSide,fWindowSide};
82 G4double zVec[numZplanes] = {-fThickness/2.0, fThickness/2.0};
84 G4Polyhedra* PMT_solid
85 =
new G4Polyhedra(
"PMT",0.,2.0*pi,numSides,numZplanes,zVec,rMinVec,rMaxVec);
89 =
new G4LogicalVolume(PMT_solid,(G4Material*)fWindowMaterial,
"PMT",0,0,0);
92 fPMT_log->SetVisAttributes(
new G4VisAttributes(
yellow));
95 G4double rPhotocathMinVec[numZplanes] = {0.0, 0.0};
96 G4double rPhotocathMaxVec[numZplanes] = {fPhotocathodeSide,fPhotocathodeSide};
97 G4double zPhotocathVec[numZplanes] = {0.9*(fThickness/2.0), 0.95*(fThickness/2.0)};
99 G4Polyhedra* Photocathode_solid
100 =
new G4Polyhedra(
"Photocathode",0.,2.0*pi,numSides,numZplanes,zPhotocathVec,rPhotocathMinVec,rPhotocathMaxVec);
103 =
new G4LogicalVolume(Photocathode_solid,(G4Material*)fWindowMaterial,
"Photocathode",0,0,0);
105 G4String name =
"Photocathode_" + fPMT_name;
106 new G4PVPlacement(0,G4ThreeVector(),fPhotocathode_log,name,fPMT_log,
false,0);
108 fPhotocathode_log->SetVisAttributes(
new G4VisAttributes(
red));
112 G4OpticalSurface* OpticalPhotocathode =
new G4OpticalSurface(
"PhotocathodeSurface");
113 OpticalPhotocathode->SetModel(unified);
114 OpticalPhotocathode->SetType(dielectric_metal);
115 OpticalPhotocathode->SetFinish(polished);
117 G4MaterialPropertiesTable* PhotocathodeMPT =
new G4MaterialPropertiesTable();
119 const G4RunManager* runManager = G4RunManager::GetRunManager();
127 if (useComplexRindex) {
133 PhotocathodeMPT->AddConstProperty(
"THICKNESS",thickness) ;
136 PhotocathodeMPT->AddProperty(
"REALRINDEX",
new G4MaterialPropertyVector()) ;
137 PhotocathodeMPT->AddProperty(
"IMAGINARYRINDEX",
new G4MaterialPropertyVector()) ;
140 unsigned nEntries = wavelength.size();
141 for (
unsigned i=0; i < nEntries; i++) {
142 energy = h_Planck*c_light/wavelength[i] ;
143 PhotocathodeMPT->AddEntry(
"REALRINDEX",energy,reRindex[i]);
144 PhotocathodeMPT->AddEntry(
"IMAGINARYRINDEX",energy,imRindex[i]);
149 PhotocathodeMPT->AddProperty(
"REFLECTIVITY",
new G4MaterialPropertyVector()) ;
152 unsigned nEntries = wavelength.size();
153 for (
unsigned i=0; i < nEntries; i++) {
154 energy = h_Planck*c_light/wavelength[i];
155 PhotocathodeMPT->AddEntry(
"REFLECTIVITY",energy,reflectivity[i]);
159 PhotocathodeMPT->AddProperty(
"EFFICIENCY",
new G4MaterialPropertyVector()) ;
160 PhotocathodeMPT->AddEntry(
"EFFICIENCY", 0.0*
eV,1.);
161 PhotocathodeMPT->AddEntry(
"EFFICIENCY",10.0*
eV,1.);
163 OpticalPhotocathode->SetMaterialPropertiesTable(PhotocathodeMPT);
165 new G4LogicalSkinSurface(
"PhotocathodeSurface",fPhotocathode_log,OpticalPhotocathode);
168 if (VerbosityLevel > 0) {
169 static G4int ifirst = 1;
171 G4cerr <<
"Material properties table for photocathode" << G4endl;
172 PhotocathodeMPT->DumpTable();
std::vector< G4double > fPhotocathodeReRindex
G4bool fPhotocathodeUseThinFilm
static const G4Colour red(1.0, 0.0, 0.0)
std::vector< G4double > fPhotocathodeReflectivity
G4bool fPhotocathodeUseComplexRindex
std::vector< G4double > fPhotocathodeWavelength
G4double fPhotocathodeThickness
std::vector< G4double > fPhotocathodeImRindex
FDsimG4PMT(G4String PMTname)
static const G4Colour yellow(1.0, 1.0, 0.5)