3 #include <boost/lexical_cast.hpp>
5 #include <fdet/Telescope.h>
8 #include <det/VManager.h>
9 #include <det/Detector.h>
11 #include <utl/UTMPoint.h>
12 #include <utl/Point.h>
13 #include <utl/ReferenceEllipsoid.h>
14 #include <utl/Transformation.h>
15 #include <utl/Vector.h>
16 #include <utl/ErrorLogger.h>
17 #include <utl/Deprecator.h>
19 #include <fwk/CoordinateSystemRegistry.h>
20 #include <fwk/LocalCoordinateSystem.h>
33 const TimeStamp& dTime = det::Detector::GetInstance().GetTime();
41 Eye::Eye(
unsigned int eyeId) :
44 fIdOfParentPhysicalEye(-1),
45 fFullTelescopeIdList(0),
51 fTimeCorrectionFactors(0),
146 GetEyeData(startTime,
"uptime_gpsStart",
"eye",
"start validity eye up time");
148 GetEyeData(endTime,
"uptime_gpsStop",
"eye",
"end validity eye up time");
167 "parent eye id of virtual eye");
185 if (telescopeId == it->GetId())
189 err <<
"Telescope with Id = " << telescopeId <<
" "
191 "is not commissioned at detector time = "
192 << Detector::GetInstance().GetTime();
205 GetEyeData(northing,
"northing",
"eye",
"eye position northing");
207 GetEyeData(easting,
"easting",
"eye",
"eye position easting");
209 GetEyeData(altitude,
"altitude",
"eye",
"eye position altitude");
211 GetEyeData(zone,
"zone",
"eye",
"eye position zone");
213 GetEyeData(band,
"band",
"eye",
"eye position band");
217 const UTMPoint utmp(northing, easting, altitude, zone, band.c_str()[0], e);
293 return LocalCoordinateSystem::Create(pos);
311 double timeoffset = 0;
312 GetEyeData(timeoffset,
"sdTimeOffset",
"eye",
"eye sd time offset");
321 double minWavelength = 0;
326 minWavelength = it->GetModelMinWavelength();
329 minWavelength =
max(minWavelength, it->GetModelMinWavelength());
332 return minWavelength;
336 double maxWavelength = 0;
341 maxWavelength = it->GetModelMaxWavelength();
344 maxWavelength = min(maxWavelength, it->GetModelMaxWavelength());
347 return maxWavelength;
351 std::set<unsigned int>
355 set<unsigned int> ids;
364 ids.insert(it->GetParentPhysicalEyeId());
373 const string& property,
374 const string& component,
375 const string& errorMsg)
378 if (!requestedData) {
379 requestedData =
new T;
380 GetEyeData(*requestedData, property, component, errorMsg);
382 return *requestedData;
390 const string& property,
391 const string& component,
392 const string& errorMsg)
395 const VManager& manager = Detector::GetInstance().GetFManagerRegister();
402 && component !=
"virtualEye"
403 && property !=
"telescopeList"
404 && property !=
"name")
410 manager.
GetData(requestedData, property, component, indexMap);
413 if (status == VManager::eNotFound) {
415 err <<
"Did not find requested component for " << errorMsg <<
"; "
416 << VManager::QueryInfoMessage(property, component, indexMap);
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
The Auger coordinate system (x to east, z local verical) for this eye.
utl::CoordinateSystemPtr fCoordinateSystem
void UpdateFdUpTime() const
const T & GetEyeData(T *&requestedData, const std::string &property, const std::string &component, const std::string &errorMsg) const
double GetCDASVetoFraction() const
const utl::TabulatedFunction & GetTimeCorrectionFactors() const
int fIdOfParentPhysicalEye
void GetFullTelescopeList() const
Class to hold and convert a point in geodetic coordinates.
FullTelescopeIdList * fFullTelescopeIdList
Class to hold collection (x,y) points and provide interpolation between them.
FullTelescopeList::iterator FullTelescopeIterator
Base class for exceptions trying to access non-existing components.
Interface for detector managers.
unsigned int GetFirstTelescopeId() const
First telescope id in the eye.
InternalTelescopeIterator FullTelescopesBegin()
det::ValidityStamp fUpTimeValidityStamp
A TimeStamp holds GPS second and nanosecond for some event.
double GetUpTimeFraction() const
boost::indirect_iterator< FullTelescopeIterator, Telescope & > InternalTelescopeIterator
virtual Status GetData(double &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const =0
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
boost::indirect_iterator< FullTelescopeConstIterator, const Telescope & > InternalConstTelescopeIterator
Reference ellipsoids for UTM transformations.
void SetValidityInterval(const utl::TimeStamp &start, const utl::TimeStamp &stop)
Set the start and end validity times.
std::string fIdOfParentPhysicalEyeString
utl::CoordinateSystemPtr GetEyeCoordinateSystem() const
Returns the Eye Coordinate system.
double GetFDASVetoFraction() const
TelescopeIterator TelescopesBegin() const
Beginning of the collection of telescopes.
const utl::TimeStamp & GetDecommissionTime() const
Telescope decommission time.
const Telescope & GetTelescope(const unsigned int telescopeId) const
Find Telescope by numerical Id.
bool IsValid() const
True if detector time is between start and end validity times.
const std::string & GetNameAbbr() const
double GetModelMinWavelength() const
boost::filter_iterator< TelIsCommissioned, InternalConstTelescopeIterator > TelescopeIterator
An iterator over telescopes.
const utl::TimeInterval & GetSDTimeOffset() const
Time Offset of this eye with respect to SD.
Detector description interface for Telescope-related data.
A TimeInterval is used to represent time elapsed between two events.
double GetBackwallAngle() const
std::map< std::string, std::string > IndexMap
int GetDAQStatus() const
0 == not in DAQ
unsigned int GetLastTelescopeId() const
Last telescope id in the eye.
TelescopeIterator TelescopesEnd() const
End of the collection of telescopes.
FullTelescopeList fFullTelescopeList
std::set< unsigned int > GetParticipatingEyeIds() const
Returns a list of eye id's that participate in this (virtual) eye.
utl::TimeInterval * fSDTimeOffset
#define ERROR(message)
Macro for logging error messages.
bool IsInAquisition() const
utl::Point GetPosition() const
Eye position.
const utl::TimeStamp & GetCommissionTime() const
Telescope commission time.
utl::TabulatedFunction * fTimeCorrectionFactors
Status
Specifies success or (eventually) various possible failure modes.
double GetModelMaxWavelength() const
const std::string & GetName() const
Eye name.
bool IsVirtual() const
Returns whether this eye is a virtual eye.
InternalTelescopeIterator FullTelescopesEnd()