TelescopeSimData.cc
Go to the documentation of this file.
1 
9 #include <fevt/TelescopeSimData.h>
10 #include <fevt/Eye.h>
11 
12 #include <utl/ErrorLogger.h>
13 #include <utl/Trace.h>
14 #include <utl/MultiTrace.h>
15 #include <utl/AugerException.h>
16 #include <utl/Md5Sum.h>
17 
18 #include <sstream>
19 
20 using namespace std;
21 using namespace utl;
22 using namespace fevt;
23 
24 
25 TelescopeSimData::TelescopeSimData() :
26  fNumberOfPhotonBins(0),
27  fNFltPixels(0),
28  fNFltPixelsFromShower(0),
29  fNFltPixelsFromBackground(0),
30  fNPixelWithShowerLight(0),
31  fNReadOutPixels(0),
32  fSltTriggerTime(0),
33  fSltTimeShift(0),
34  fConfigSignatureStr(""),
35  fConfigSignature("")
36 { }
37 
38 
41 {
42  if (!fPhotonTraces.count(source)) {
43  ostringstream err;
44  err << "Photon trace for source=" << source << " does not exist!";
45  ERROR(err);
46  throw utl::NonExistentComponentException(err.str());
47  }
48  if (!fPhotonTraces[source].HasLabel(wl)) {
49  ostringstream err;
50  err << "Photon trace for source=" << source << " at wlBin=" << wl << " does not exist!";
51  ERROR(err);
52  throw utl::NonExistentComponentException(err.str());
53  }
54  return fPhotonTraces[source].GetTrace(wl);
55 }
56 
57 
58 const utl::TraceD&
60  const
61 {
62  const ConstPhotonTraceSourceIterator it = fPhotonTraces.find(source);
63  if (it == fPhotonTraces.end()) {
64  ostringstream err;
65  err << "Photon trace for source=" << source << " does not exist!";
66  ERROR(err);
67  throw utl::NonExistentComponentException(err.str());
68  }
69  if (!it->second.HasLabel(wl)) {
70  ostringstream err;
71  err << "Photon trace for source=" << source << " at wlBin=" << wl << " does not exist!";
72  ERROR(err);
73  throw utl::NonExistentComponentException(err.str());
74  }
75  return it->second.GetTrace(wl);
76 }
77 
78 
80 bool
82  const
83 {
84  const ConstPhotonTraceSourceIterator it = fPhotonTraces.find(source);
85  return it != fPhotonTraces.end() && it->second.HasLabel(wl);
86 }
87 
88 
90 bool
92  const
93 {
94  const ConstPhotonTraceSourceIterator it = fPhotonTraces.find(source);
95  return it != fPhotonTraces.end();
96 }
97 
98 
99 void
101  const unsigned int size, const double binSize)
102 {
103  if (HasPhotonTrace(source, wl)) {
104  ERROR("Source already exists. Not Changing.");
105  return;
106  }
107  fPhotonTraces[source].AddTrace(size, binSize, wl);
108 }
109 
110 
113 {
114  const PhotonTraceSourceIterator it = fPhotonTraces.find(source);
115  if (it == fPhotonTraces.end()) {
116  ostringstream err;
117  err << "Photon trace for source=" << source << " does not exist!";
118  ERROR(err);
119  throw utl::NonExistentComponentException(err.str());
120  }
121  return it->second.Begin();
122 }
123 
124 
127  const
128 {
129  const ConstPhotonTraceSourceIterator it = fPhotonTraces.find(source);
130  if (it == fPhotonTraces.end()) {
131  ostringstream err;
132  err << "Photon trace for source=" << source << " does not exist!";
133  ERROR(err);
134  throw utl::NonExistentComponentException(err.str());
135  }
136  return it->second.Begin();
137 }
138 
139 
142 {
143  const PhotonTraceSourceIterator it = fPhotonTraces.find(source);
144  if (it == fPhotonTraces.end()) {
145  ostringstream err;
146  err << "Photon trace for source=" << source << " does not exist!";
147  ERROR(err);
148  throw utl::NonExistentComponentException(err.str());
149  }
150  return it->second.End();
151 }
152 
153 
156  const
157 {
158  const ConstPhotonTraceSourceIterator it = fPhotonTraces.find(source);
159  if (it == fPhotonTraces.end()) {
160  ostringstream err;
161  err << "Photon trace for source=" << source << " does not exist!";
162  ERROR(err);
163  throw utl::NonExistentComponentException(err.str());
164  }
165  return it->second.End();
166 }
167 
168 
169 void
170 TelescopeSimData::MakeRayTracedPhotonTrace(const unsigned int size, const double binSize)
171 {
172  if (fRayTracedPhotonTrace) {
173  ERROR("RayTracedPhotonTrace already exists");
174  return;
175  }
176  fRayTracedPhotonTrace = new TraceI(size, binSize, 0);
177 }
178 
179 
180 void
181 TelescopeSimData::MakeDistanceTrace(const unsigned int size, const double binSize)
182 {
183  if (fDistanceTrace) {
184  ERROR("Trace already exists");
185  return;
186  }
187  fDistanceTrace = new TraceD(size, binSize);
188 }
189 
190 
191 const std::string&
193  const
194 {
195  if (fConfigSignature.empty())
197  return fConfigSignature;
198 }
199 
200 
201 void
203 {
204  fConfigSignature = "";
205  fConfigSignatureStr = "";
206 }
Class to compute MD5 checksum Based on the RSA C code, wrapped in an OO fashion.
Definition: Md5Sum.h:27
PhotonTraceSourceContainer::const_iterator ConstPhotonTraceSourceIterator
bool HasPhotonTrace(const fevt::FdConstants::LightSource source, const int wl) const
Check that light trace for source /par source is present for the given wavelength bin...
Trace< int > TraceI
Definition: Trace-fwd.h:24
Base class for exceptions trying to access non-existing components.
utl::ShadowPtr< utl::TraceD > fDistanceTrace
utl::MultiTraceD::Iterator PhotonTraceIterator
An iterator over the components of the photon trace.
Trace< double > TraceD
Definition: Trace-fwd.h:26
void MakeDistanceTrace(const unsigned int size=0, const double binSize=0)
Make the trace of distance along the shower axis of light at the diaphragm.
utl::ShadowPtr< utl::TraceI > fRayTracedPhotonTrace
void MakePhotonTrace(const fevt::FdConstants::LightSource source, const int wl, const unsigned int size=0, const double binSize=0)
PhotonTraceSourceContainer::iterator PhotonTraceSourceIterator
LightSource
Possible light sources.
Definition: FdConstants.h:9
PhotonTraceSourceContainer fPhotonTraces
utl::TraceD & GetPhotonTrace(const fevt::FdConstants::LightSource source, const int wl)
Photon trace at diaphragm.
const std::string & GetConfigSignature() const
PhotonTraceIterator PhotonTracesEnd(const fevt::FdConstants::LightSource source)
PhotonTraceIterator PhotonTracesBegin(const fevt::FdConstants::LightSource source)
std::string GetHexDigest()
Definition: Md5Sum.cc:340
void MakeRayTracedPhotonTrace(const unsigned int size=0, const double binSize=0)
Add a trace for the number of photons that were ray-traced.
utl::MultiTraceD::ConstIterator ConstPhotonTraceIterator
#define ERROR(message)
Macro for logging error messages.
Definition: ErrorLogger.h:165

, generated on Tue Sep 26 2023.