3 #include "G4Material.hh"
4 #include "G4MaterialTable.hh"
5 #include "G4Element.hh"
6 #include "G4ElementTable.hh"
7 #include "G4UserLimits.hh"
8 #include "G4RunManager.hh"
10 #include "geomdefs.hh"
12 #include <utl/AugerUnits.h>
13 #include <utl/Point.h>
14 #include <utl/ReferenceEllipsoid.h>
15 #include <det/Detector.h>
16 #include <fdet/FDetector.h>
18 #include <fdet/Telescope.h>
19 #include <fdet/Corrector.h>
20 #include <fdet/Filter.h>
21 #include <atm/Atmosphere.h>
22 #include <atm/ProfileResult.h>
24 using namespace TelescopeSimulatorLX ;
32 { G4Exception(
"FDsimG4Materials constructed twice."); }
36 ConstructTableOfMaterials() ;
47 const G4RunManager* runManager = G4RunManager::GetRunManager();
54 const unsigned int eyeId = fTelescope->GetEyeId();
69 G4double transmittance;
81 G4Element* elH =
new G4Element(name=
"Hydrogen", symbol=
"H", z=1., a);
84 G4Element* elC =
new G4Element(name=
"Carbon", symbol=
"C", z=6., a);
87 G4Element* elN =
new G4Element(name=
"Nitrogen", symbol=
"N", z=7., a);
90 G4Element* elO =
new G4Element(name=
"Oxygen", symbol=
"O", z=8., a);
94 density = 1.29e-03*
g/
cm3;
95 G4Material* Air =
new G4Material(name=
"Air", density, nel=2);
96 Air->AddElement(elN, .7);
97 Air->AddElement(elO, .3);
114 G4double temperature =
120 G4State state = kStateGas;
121 const G4int nElements = 2;
122 G4Material* Atmosphere =
123 new G4Material(
"Atmosphere", density,nElements,state,temperature, pressure);
124 Atmosphere->AddElement(elN,0.7);
125 Atmosphere->AddElement(elO,0.3);
129 G4MaterialPropertiesTable* atmosphereMPT =
new G4MaterialPropertiesTable();
130 atmosphereMPT->AddProperty(
"RINDEX",
new G4MaterialPropertyVector()) ;
132 const unsigned int NSTEPS = 10;
133 double deltaWl = (maxWl - minWl)/
float(NSTEPS-1);
135 for(
unsigned int j=0 ; j<NSTEPS ; ++j){
136 wvl = minWl + j * deltaWl;
139 rindex = refractionIndexVsHeight.
Y(eyeAltitude);
140 energy = (CLHEP::h_Planck*CLHEP::c_light)/(wvl/
utl::nanometer * CLHEP::nm);
141 atmosphereMPT->AddEntry(
"RINDEX", energy, rindex);
143 Atmosphere->SetMaterialPropertiesTable(atmosphereMPT);
145 if (VerbosityLevel > 0) {
146 G4cerr <<
"Material Properties Table for atmosphere: " << G4endl ;
147 atmosphereMPT->DumpTable();
155 new G4Material(name=
"Aluminum", z=13., a, density);
161 density = 1.032*
g/
cm3;
162 G4Material *Plastic =
new G4Material(name=
"MirrorPlastic",density, nel=2);
163 Plastic->AddElement(elC,9) ;
164 Plastic->AddElement(elH,10) ;
167 const G4int NENTRIES = 2 ;
168 G4double LAMBDA[NENTRIES] = {0.0*
eV,10.0*
eV};
169 G4double REFLECTIVITY[NENTRIES] = {0.91,0.91};
171 G4MaterialPropertiesTable* MPT =
new G4MaterialPropertiesTable();
172 MPT->AddProperty(
"REFLECTIVITY", LAMBDA, REFLECTIVITY, NENTRIES);
173 Plastic->SetMaterialPropertiesTable(MPT);
183 density = 1.19*
g/
cm3;
184 G4Material* BK7 =
new G4Material(name=
"BK7", density, nel=3);
185 BK7->AddElement(elC, 5);
186 BK7->AddElement(elH, 8);
187 BK7->AddElement(elO, 2);
189 G4MaterialPropertiesTable *MPT_BK7 =
new G4MaterialPropertiesTable();
190 MPT_BK7->AddProperty(
"RINDEX",
new G4MaterialPropertyVector()) ;
191 MPT_BK7->AddProperty(
"ABSLENGTH",
new G4MaterialPropertyVector()) ;
196 unsigned int nPoints;
199 for(
unsigned int j=0 ; j<nPoints ; ++j){
200 wvl = refractiveIndexBK7.
GetX(j);
201 rindex = refractiveIndexBK7.
GetY(j);
202 energy = (CLHEP::h_Planck*CLHEP::c_light)/(wvl/
utl::nanometer * CLHEP::nm);
204 MPT_BK7->AddEntry(
"RINDEX",energy,rindex);
208 for(
unsigned int j=0 ; j<nPoints ; ++j){
209 wvl = transmittanceBK7.
GetX(j);
210 transmittance = transmittanceBK7.
GetY(j);
211 energy = (CLHEP::h_Planck*CLHEP::c_light)/(wvl/
utl::nanometer * CLHEP::nm);
213 if (transmittance <= DBL_MIN)
216 abslength = -10.0*
CLHEP::mm/log(transmittance) ;
218 MPT_BK7->AddEntry(
"ABSLENGTH", energy, abslength);
221 BK7->SetMaterialPropertiesTable(MPT_BK7);
223 if (VerbosityLevel > 0) {
224 G4cerr <<
"Material properties table for lens (BK7):" << G4endl ;
225 MPT_BK7->DumpTable();
234 density = 1.19*
g/
cm3;
235 G4Material* MUG6 =
new G4Material(name=
"M-UG6", density, nel=3);
236 MUG6->AddElement(elC, 5);
237 MUG6->AddElement(elH, 8);
238 MUG6->AddElement(elO, 2);
240 G4MaterialPropertiesTable *MPT_MUG6 =
new G4MaterialPropertiesTable();
242 MPT_MUG6->AddProperty(
"RINDEX",
new G4MaterialPropertyVector()) ;
243 MPT_MUG6->AddProperty(
"ABSLENGTH",
new G4MaterialPropertyVector()) ;
245 MPT_MUG6->AddEntry(
"RINDEX",0.1*
eV, 1.526);
246 MPT_MUG6->AddEntry(
"RINDEX",10.0*
eV, 1.526);
252 G4double intTransmittance ;
253 for(
unsigned int j=0 ; j<nPoints ; ++j){
254 wvl = transmittanceMUG6.
GetX(j);
255 transmittance = transmittanceMUG6.
GetY(j);
256 energy = (CLHEP::h_Planck*CLHEP::c_light)/(wvl/
utl::nanometer * CLHEP::nm);
260 rindex = MPT_MUG6->GetProperty(
"RINDEX")->GetProperty(energy) ;
261 G4double P = 2.0*rindex/(rindex*rindex + 1.0) ;
264 intTransmittance = transmittance/P ;
266 intTransmittance = DBL_MIN;
268 if (intTransmittance <= DBL_MIN)
270 else if (intTransmittance >= 1.0)
273 abslength = -3.25*
CLHEP::mm/(std::log(intTransmittance)) ;
275 MPT_MUG6->AddEntry(
"ABSLENGTH", energy, abslength);
278 MUG6->SetMaterialPropertiesTable(MPT_MUG6);
280 if (VerbosityLevel > 0) {
281 G4cerr <<
"Material properties table for filter (MUG6):" << G4endl ;
282 MPT_MUG6->DumpTable();
291 density = 1.19*
g/
cm3;
292 G4Material* LimeGlass =
new G4Material(name=
"LimeGlass", density, nel=3);
293 LimeGlass->AddElement(elC, 5);
294 LimeGlass->AddElement(elH, 8);
295 LimeGlass->AddElement(elO, 2);
297 G4MaterialPropertiesTable *MPT_LimeGlass =
new G4MaterialPropertiesTable();
301 MPT_LimeGlass->AddProperty(
"RINDEX",
new G4MaterialPropertyVector()) ;
302 MPT_LimeGlass->AddProperty(
"ABSLENGTH",
new G4MaterialPropertyVector()) ;
308 const G4int nEntries = 10;
309 G4double lambda[nEntries] =
310 {240.0*nm,260.0*nm,280.0*nm,313.0*nm,334.0*nm,365.0*nm,405.0*nm,436.0*nm,546.0*nm,700.0*nm};
311 G4double Rindex[nEntries] =
312 {1.59,1.58,1.57,1.56,1.5525,1.545,1.54,1.535,1.525,1.52};
315 for (G4int i=0; i < nEntries; i++) {
316 energy = h_Planck*c_light/lambda[i] ;
317 MPT_LimeGlass->AddEntry(
"RINDEX", energy, Rindex[i]);
322 const G4int nEntries = 17;
323 G4double lambda[nEntries] = {
324 240.0*nm,280*nm,300*nm,310*nm,320*nm,330*nm,340*nm,350*nm,360*nm,370*nm,380*nm,
325 390*nm,400*nm,450*nm,500*nm,600*nm,700*nm};
327 G4double Transmittance[nEntries] =
328 {0.0,0.0,35.1,60.0,76.0,84.2,88.0,89.8,90.6,90.8,90.9,
329 89.2,90.0,90.3,91.2,91.3,91.1};
331 G4double Thickness[nEntries] =
332 {1.0*
mm, 1.0*
mm, 1.0*
mm, 1.0*
mm, 1.0*
mm, 1.0*
mm, 1.0*
mm, 1.0*
mm, 1.0*
mm, 1.0*
mm, 1.0*
mm,
337 for (G4int i = 0; i < nEntries; i++) {
338 energy = h_Planck*c_light/lambda[i] ;
339 Transmittance[i] = Transmittance[i]/100.0;
346 Rind = MPT_LimeGlass->GetProperty(
"RINDEX")->GetProperty(energy) ;
347 G4double P = 2.0*Rind/(Rind*Rind+1.0) ;
349 G4double InternalTransmittance ;
352 InternalTransmittance = Transmittance[i]/P;
354 InternalTransmittance = DBL_MIN;
356 if (InternalTransmittance <= DBL_MIN)
358 else if (InternalTransmittance >= 1.0)
361 abslength = -Thickness[i]/(std::log(InternalTransmittance));
363 MPT_LimeGlass->AddEntry(
"ABSLENGTH", energy, abslength);
367 LimeGlass->SetMaterialPropertiesTable(MPT_LimeGlass);
369 if (VerbosityLevel > 0) {
370 G4cerr <<
"Material properties table for PMT window (Lime Glass):" << G4endl ;
371 MPT_LimeGlass->DumpTable();
unsigned int GetNPoints() const
Top of the interface to Atmosphere information.
constexpr double atmosphere
FDsimG4Materials(const fdet::Telescope &tel)
Class to hold collection (x,y) points and provide interpolation between them.
const atm::ProfileResult & EvaluatePressureVsHeight() const
Tabulated function giving Y=air pressure as a function of X=height.
const utl::TabulatedFunction & GetTransmittance() const
Average transmittance of the filter as a function of the wavelength.
const atm::ProfileResult & EvaluateDensityVsHeight() const
Tabulated function giving Y=density as a function of X=height.
const utl::TabulatedFunction & GetTransmittance() const
Transmittance as a function of the wavelength.
double GetModelMinWavelength() const
const Eye & GetEye(const unsigned int eyeId) const
Find eye by numerical Id.
Detector description interface for Eye-related data.
static const ReferenceEllipsoid & Get(const EllipsoidID theID)
Get known ellipsoid by registered ID.
Detector description interface for FDetector-related data.
double Y(const double x) const
Get the Y value (coordinate) for given X (ordinate)
constexpr double nanometer
const atm::Atmosphere & GetAtmosphere() const
static FDsimG4Materials * fMaterials
Reference ellipsoids for UTM transformations.
double GetModelMaxWavelength() const
Class describing the Atmospheric profile.
Top of the hierarchy of the detector description interface.
Triple PointToLatitudeLongitudeHeight(const Point &thePoint) const
Convert Point to Lat/Long/Height.
const fdet::FDetector & GetFDetector() const
Description of a corrector ring.
const double & GetY(const unsigned int idx) const
const utl::TabulatedFunction & GetRefractiveIndex() const
Index of refraction as a funcction of the wavelength.
Detector description interface for Telescope-related data.
const double & GetX(const unsigned int idx) const
const atm::ProfileResult & EvaluateRefractionIndexVsHeight() const
Tabulated function giving Y=refraction index as a function of X=height.
utl::Point GetPosition() const
Eye position.
void ConstructTableOfMaterials()
const atm::ProfileResult & EvaluateTemperatureVsHeight() const
Tabulated function giving Y=temperature as a function of X=height.