1 #include "TFlukaCerenkov.h"
3 ClassImp(TFlukaCerenkov);
6 TFlukaCerenkov::TFlukaCerenkov()
12 fAbsorptionCoefficient(0),
13 fQuantumEfficiency(0),
16 // Default constructor
20 TFlukaCerenkov::TFlukaCerenkov(Int_t npckov, Float_t *ppckov, Float_t *absco, Float_t *effic, Float_t *rindex)
24 fEnergy = new Float_t[fSamples];
25 fWaveLength = new Float_t[fSamples];
26 fAbsorptionCoefficient = new Float_t[fSamples];
27 fRefractionIndex = new Float_t[fSamples];
28 fQuantumEfficiency = new Float_t[fSamples];
29 for (Int_t i = 0; i < fSamples; i++) {
30 fEnergy[i] = ppckov[i];
31 fWaveLength[i] = khc / ppckov[i];
33 fAbsorptionCoefficient[i] = 1./ absco[i];
35 fAbsorptionCoefficient[i] = 1.e15;
37 fRefractionIndex[i] = rindex[i];
38 fQuantumEfficiency[i] = effic[i];
40 // Flag is sensitive if quantum efficiency 0 < eff < 1 for at least one value.
41 if (effic[i] < 1. && effic[i] > 0.) fIsSensitive = 1;
45 Float_t TFlukaCerenkov::GetAbsorptionCoefficient(Float_t energy)
48 // Get AbsorptionCoefficient for given energy
50 return Interpolate(energy, fEnergy, fAbsorptionCoefficient);
54 Float_t TFlukaCerenkov::GetRefractionIndex(Float_t energy)
57 // Get RefractionIndex for given energy
59 return Interpolate(energy, fEnergy, fRefractionIndex);
63 Float_t TFlukaCerenkov::GetQuantumEfficiency(Float_t energy)
66 // Get QuantumEfficiency for given energy
68 return Interpolate(energy, fEnergy, fQuantumEfficiency);
73 Float_t TFlukaCerenkov::GetAbsorptionCoefficientByWaveLength(Float_t wavelength)
76 // Get AbsorptionCoefficient for given wavelength
78 Float_t energy = khc / wavelength;
79 return Interpolate(energy, fEnergy, fAbsorptionCoefficient);
83 Float_t TFlukaCerenkov::GetRefractionIndexByWaveLength(Float_t wavelength)
86 // Get RefractionIndex for given wavelenth
88 Float_t energy = khc / wavelength;
89 return Interpolate(energy, fEnergy, fRefractionIndex);
92 Float_t TFlukaCerenkov::GetQuantumEfficiencyByWaveLength(Float_t wavelength)
95 // Get QuantumEfficiency for given wavelength
97 Float_t energy = khc / wavelength;
98 return Interpolate(energy, fEnergy, fQuantumEfficiency);
101 Float_t TFlukaCerenkov::Interpolate(Float_t value, Float_t* array1, Float_t* array2)
104 // Interpolate array values
106 if (value < array1[0] && value >= array1[fSamples - 1]) {
107 Warning("Interpolate()", "Photon energy out of range. Returning 0.");
111 Int_t i = TMath::BinarySearch(fSamples, array1, value);
112 if (i == (fSamples-1)) {
115 return (array2[i] + (array2[i+1] - array2[i]) / (array1[i+1] - array1[i]) * (value - array1[i]));