2 #include <fdet/FDetector.h>
3 #include <fdet/Telescope.h>
4 #include <fdet/Pixel.h>
5 #include <fdet/FDetComponentSelector.h>
7 #include <det/VManager.h>
8 #include <det/Detector.h>
11 #include <fevt/Telescope.h>
12 #include <fevt/Pixel.h>
13 #include <fevt/Channel.h>
15 #include <utl/AugerException.h>
16 #include <utl/ErrorLogger.h>
30 return *std::min_element(fFullEyeList->begin(), fFullEyeList->end());
40 return *std::max_element(fFullEyeList->begin(), fFullEyeList->end());
47 it != fCommissionedEyeList.end(); ++it)
50 delete fReferenceLambda;
62 it != fCommissionedEyeList.end(); ++it)
72 if (eyeId == it->GetId())
76 err <<
"Eye with Id = " << eyeId <<
" does not exist, "
77 "or else detector description was not properly configured. "
78 "detector time = " << Detector::GetInstance().GetTime();
90 if (eyeName == it->GetName())
94 err <<
"Eye with name = " << eyeName <<
" does not exist, "
95 "or else detector description was not properly configured. "
96 "detector time = " << Detector::GetInstance().GetTime();
117 Detector::GetInstance().GetFManagerRegister();
123 manager.
GetData(*fFullEyeList,
"eyeList",
"", indexMap);
125 if (foundFlag == VManager::eNotFound) {
126 DEBUGLOG(
"Could not find a list of Eye Id's. "
127 "No eye information will be available!");
130 for (InternalEyeIdCollection::iterator it = fFullEyeList->begin();
131 it != fFullEyeList->end(); ++it) {
132 Eye*
const eye =
new Eye(*it);
133 fCommissionedEyeList.push_back(eye);
137 return *fFullEyeList;
145 return GetEye(eventEye.
GetId());
153 const unsigned int eyeid = eventTel.
GetEyeId();
154 const unsigned int telid = eventTel.
GetId();
156 return GetEye(eyeid).GetTelescope(telid);
164 const unsigned int eyeid = eventChannel.
GetEyeId();
166 const unsigned int chid = eventChannel.
GetId();
168 return GetEye(eyeid).GetTelescope(telid).GetChannel(chid);
176 const unsigned int eyeid = p.
GetEyeId();
180 return GetEye(eyeid).GetTelescope(telid).GetChannel(chid);
188 const unsigned int eyeid = p.
GetEyeId();
190 const unsigned int chid =
191 det::Detector::GetInstance().GetFDetector().GetEye(eyeid).GetTelescope(telid).GetPixel(p.
GetId()).GetChannelId();
193 return GetEye(eyeid).GetTelescope(telid).GetChannel(chid);
201 const unsigned int eyeid = eventPixel.
GetEyeId();
203 const unsigned int pixid = eventPixel.
GetId();
205 return GetEye(eyeid).GetTelescope(telid).GetPixel(pixid);
213 const unsigned int eyeid = c.
GetEyeId();
215 const unsigned int pixid =
216 det::Detector::GetInstance().GetFDetector().GetEye(eyeid).GetTelescope(telid).GetChannel(c.
GetId()).GetPixelId();
218 return GetEye(eyeid).GetTelescope(telid).GetPixel(pixid);
226 const unsigned int eyeid = c.
GetEyeId();
230 return GetEye(eyeid).GetTelescope(telid).GetPixel(pixid);
239 return fUpTimeFraction;
248 return fUpTimeFraction > 0;
274 if (fUpTimeValidityStamp.IsValid())
277 GetFDetectorData(fHasFdUpTime,
"has_fduptime",
"CDAS",
"set events up time bit");
279 GetFDetectorData(startTime,
"uptime_gpsStart",
"CDAS",
"start validity CDAS up time");
281 GetFDetectorData(endTime,
"uptime_gpsStop",
"CDAS",
"end validity CDAS up time");
282 GetFDetectorData(fUpTimeFraction,
"uptime_fraction",
"CDAS",
"CDAS up time fraction");
284 GetFDetectorData(fStatus,
"status",
"CDAS",
"CDAS DAQ status");
285 fUpTimeValidityStamp.SetValidityInterval(startTime, endTime);
294 double minWavelength = 0;
297 it != fCommissionedEyeList.end(); ++it) {
300 minWavelength = (*it)->GetModelMinWavelength();
303 minWavelength =
max(minWavelength, (*it)->GetModelMinWavelength());
306 return minWavelength;
315 double maxWavelength = 0;
318 it != fCommissionedEyeList.end(); ++it) {
321 maxWavelength = (*it)->GetModelMaxWavelength();
324 maxWavelength = min(maxWavelength, (*it)->GetModelMaxWavelength());
327 return maxWavelength;
335 if (!fReferenceLambda)
336 GetFDetectorData(fReferenceLambda,
"referenceLambda",
"telescopeList",
"reference lambda");
338 return *fReferenceLambda;
346 const string& property,
347 const string& component,
348 const string& errorMsg)
351 if (!requestedData) {
352 requestedData =
new T;
353 GetFDetectorData(*requestedData, property, component, errorMsg);
355 return *requestedData;
363 const string& property,
364 const string& component,
365 const string& errorMsg)
368 const VManager& manager = Detector::GetInstance().GetFManagerRegister();
371 manager.
GetData(requestedData, property, component, indexMap);
374 if (status == VManager::eNotFound) {
376 err <<
"Did not find requested component: '" << errorMsg <<
"' for CDAS";
unsigned int GetId() const
unsigned int GetEyeId() const
Description of the electronic channel for the 480 channels of the crate.
unsigned int GetTelescopeId() const
1..6 for normal FD, 1..3 for HEAT
Fluorescence Detector Eye Event.
bool IsCDASInAquisition() const
const Pixel & GetPixel(const fevt::Pixel &eventPixel) const
Get fdet::Pixel from fevt::Channel.
unsigned int GetId() const
unsigned int GetEyeId() const
double GetModelMinWavelength() const
unsigned int GetLastEyeId() const
Get Id of last eye.
Base class for exceptions trying to access non-existing components.
const Eye & GetEye(const unsigned int eyeId) const
Find eye by numerical Id.
Detector description interface for Eye-related data.
Interface for detector managers.
const T & GetFDetectorData(T *&requestedData, const std::string &property, const std::string &component, const std::string &errorMsg) const
void UpdateFdUpTime() const
virtual Status GetData(double &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
unsigned int GetId() const
Fluorescence Detector Pixel event.
unsigned int GetChannelId() const
double GetModelMaxWavelength() const
#define DEBUGLOG(message)
Macro for logging debugging messages.
double GetCDASUpTimeFraction() const
unsigned int GetTelescopeId() const
const Channel & GetChannel(const fevt::Channel &eventChannel) const
Get fdet::Channel from fevt::Channel.
unsigned int GetTelescopeId() const
std::list< int > InternalEyeIdCollection
Fluorescence Detector Channel Event.
unsigned int GetEyeId() const
const InternalEyeIdCollection & GetFullEyeList() const
double GetReferenceLambda() const
unsigned int GetFirstEyeId() const
Get Id of first eye.
unsigned int GetTelescopeId() const
Detector description interface for Telescope-related data.
const Telescope & GetTelescope(const fevt::Telescope &eventTel) const
Get fdet::Telescope from fevt::Telescope.
unsigned int GetId() const
InternalEyeCollection::const_iterator InternalEyeIterator
std::map< std::string, std::string > IndexMap
unsigned int GetEyeId() const
Fluorescence Detector Telescope Event.
#define ERROR(message)
Macro for logging error messages.
int GetCDASDAQStatus() const
unsigned int GetEyeId() const
1..5 (4x normal FD, 1x HEAT)
boost::indirect_iterator< InternalEyeIterator, const Eye & > AllEyeIterator
An iterator over eyes for read only.
Status
Specifies success or (eventually) various possible failure modes.
unsigned int GetPixelId() const