TelescopeData.cc
Go to the documentation of this file.
1 #include "TelescopeData.h"
2 #include <utl/TabulatedFunction.h>
3 #include <utl/AugerUnits.h>
4 #include <cmath>
5 #include <algorithm>
6 
7 using namespace utl;
8 using namespace FdEnergyDepositFinderKG;
9 
10 
11 typedef std::map<fevt::FdConstants::LightSource, double> EfficiencyMap;
12 
13 TelescopeDataBin::TelescopeDataBin(const double minDepth,
14  const double maxDepth,
15  const double hXmean,
16  const utl::Point& pFirst,
17  const utl::Point& pLast,
18  const utl::Point& pXMean,
19  const double t, const double dt,
20  const double sig, const double sigErr,
21  const double vbg,
22  const EfficiencyMap& lightEfficiencies, const int parentBin):
23  fMinDepth(minDepth),
24  fMaxDepth(maxDepth),
25  fHeight(hXmean),
26  fFirstPoint(pFirst),
27  fLastPoint(pLast),
28  fMeanDepthPoint(pXMean),
29  fTime(t),
30  fTimeBinHalfWidth(dt),
31  fSignal(sig),
32  fSignalErr(sigErr),
33  fBackgroundVariance(vbg),
34  fParentBin(parentBin),
35  fLightEfficiencies(lightEfficiencies),
36  fArcLengthFunction(),
37  fMaxZeta(0.)
38 {
39 }
40 
42 }
43 
44 
45 void
47 {
48  for (unsigned int i=0; i<pixel.GetXCoordinates().size(); ++i) {
49  const double x = pixel.GetXCoordinates()[i];
50  const double y = pixel.GetYCoordinates()[i];
51  const double r = std::sqrt(x*x+y*y);
52  if (r > fMaxZeta)
53  fMaxZeta = r;
54  }
55  fZetaPixels.push_back(pixel);
56 }
57 
58 double
60  const
61 {
62  return fMaxZeta;
63 }
64 
65 double
67  const
68 {
69  EfficiencyMap::const_iterator iter = fLightEfficiencies.find(source);
70  if (iter != fLightEfficiencies.end())
71  return iter->second;
72  else
73  return 1.;
74 }
75 
76 double
78  const
79 {
80  return (fMinDepth+fMaxDepth)/2.;
81 }
82 
83 bool
85  const
86 {
87  return (fLightEfficiencies.find(source) != fLightEfficiencies.end());
88 }
89 
90 
91 const std::vector<ZetaPixel>&
93  const
94 {
95  return fZetaPixels;
96 }
97 
98 const TabulatedFunction&
100  const {
101 
103  double zeta = 0;
104  const double dZeta = 0.001 * degree;
105  while (zeta < fMaxZeta + dZeta) {
106 
107  double arcLength = 0;
108  for (unsigned int i=0;i<fZetaPixels.size(); ++i) {
109  double arcLengthPixel = fZetaPixels[i].CalculateInsideArcLength(0.,0.,zeta);
110  fZetaPixels[i].fArcLengthFunction.PushBack(zeta, arcLengthPixel);
111  arcLength += arcLengthPixel;
112  }
113  fArcLengthFunction.PushBack(zeta, arcLength);
114  zeta+=dZeta;
115  }
116  }
117 
118  return fArcLengthFunction;
119 
120 }
121 
122 
123 //------------------------------------
124 
125 
128  fTelescopeId(telId), fTelDataType(type),
129  fPhotonToPhotoElectron(0.), fGainVariance(0.),
130  fDiaphragmArea(0.), fZeta(0.)
131 {
132 }
133 
134 void
136  std::sort(fTelescopeDataBins.begin(), fTelescopeDataBins.end());
137 }
138 
139 
140 void
142 {
143  fTelescopeDataBins.push_back(telDataBin);
144 }
145 
146 double
148 {
149  return fTelescopeDataBins.empty()?-1.:fTelescopeDataBins.front().fMinDepth;
150 }
151 
152 double
154  const
155 {
156  return fTelescopeDataBins.empty()?-1.:fTelescopeDataBins.back().fMaxDepth;
157 }
158 
159 bool
160 TelescopeData::DepthInRange(const double depth) const
161 {
162  return (GetMinDepth() <= depth &&
163  GetMaxDepth() >= depth);
164 }
165 
166 unsigned int
168 {
169  return fTelescopeId;
170 }
171 
174  const
175 {
176  return fTelDataType;
177 }
178 
179 const std::vector<TelescopeDataBin>&
181  const
182 {
183  return fTelescopeDataBins;
184 }
185 
186 std::vector<TelescopeDataBin>::const_iterator
188  const
189 {
190  return fTelescopeDataBins.begin();
191 }
192 
193 std::vector<TelescopeDataBin>::const_iterator
195  const
196 {
197  return fTelescopeDataBins.end();
198 }
199 
200 void
201 TelescopeData::SetTelescopeParameters(double peFactor, double gainVariance,
202  double diaArea)
203 {
204  fPhotonToPhotoElectron=peFactor;
205  fGainVariance=gainVariance;
206  fDiaphragmArea = diaArea;
207 }
208 
unsigned int GetNPoints() const
const double degree
Point object.
Definition: Point.h:32
bool DepthInRange(const double depth) const
Class to hold collection (x,y) points and provide interpolation between them.
utl::TabulatedFunction fArcLengthFunction
Definition: TelescopeData.h:54
std::vector< TelescopeDataBin >::const_iterator TelDataBinsBegin() const
const std::vector< double > & GetXCoordinates() const
get x coordinates of corner points (0-6, see sketch below)
Definition: ZetaPixel.h:39
void PushBack(const double x, const double y)
std::vector< TelescopeDataBin >::const_iterator TelDataBinsEnd() const
LightSource
Possible light sources.
Definition: FdConstants.h:9
const std::vector< ZetaPixel > & GetZetaPixels() const
std::map< fevt::FdConstants::LightSource, double > EfficiencyMap
fZeta(t.GetZeta())
fTelescopeId(t.GetTelescopeId())
std::vector< ZetaPixel > fZetaPixels
Definition: TelescopeData.h:53
void SetTelescopeParameters(double peFactor, double gainVariance, double diaArea)
bool HasEfficiency(fevt::FdConstants::LightSource source) const
std::vector< TelescopeDataBin > fTelescopeDataBins
const std::vector< TelescopeDataBin > & GetTelescopeDataBins() const
void AddZetaPixel(const ZetaPixel &pixel)
double GetEfficiency(fevt::FdConstants::LightSource source) const
std::map< fevt::FdConstants::LightSource, double > fLightEfficiencies
Definition: TelescopeData.h:52
void AddTelescopeDataBin(const TelescopeDataBin &telDataBin)
const utl::TabulatedFunction & GetArcLengthFunction() const
const std::vector< double > & GetYCoordinates() const
get y coordinates of corner points (0-6, see sketch below)
Definition: ZetaPixel.h:42

, generated on Tue Sep 26 2023.