6 #include "DataWriter.h"
14 using namespace RdAirplane;
15 using namespace boost;
16 namespace fs = filesystem;
18 RdAirplaneTiming::RdAirplaneTiming() :
19 _maxAngleBetweenAirplaneAndEventInRadians_(0),
20 _ads_bAntennaPosition_(),
21 _ads_bDataBase_(NULL),
31 string outputDirectory;
33 bool shouldPrintAirplaneInfo =
false;
45 string usedCorePositionForReconstruction;
46 CentralConfig::GetInstance()->GetTopBranch(
"RdWaveFit").GetChild(
"UsedCorePosition").GetData(usedCorePositionForReconstruction);
47 if(usedCorePositionForReconstruction!=
"RadioCoordinateOrigin") {
48 ERROR(
"The parameter 'UsedCorePosition' of the 'RdWaveFit'-Module must be set to 'RadioCoordinateOrigin' to have consistent coordinate systems.");
57 "The ADS-B antenna is at ("+
61 ") in the global coordinate system."
69 if(shouldPrintAirplaneInfo)
78 string eventIdAsString =
event.GetHeader().GetId();
79 INFO(
"Processing event " + eventIdAsString);
84 REvent& rEvent =
event.GetREvent();
87 const TimeStamp& eventTime =
event.GetHeader().GetTime();
89 const ShowerRRecData& showerRRecData =
event.GetRecShower().GetRRecShower();
97 INFO(
"Radio event was not successfully reconstructed.");
106 coreCoordinateSystem);
113 reconstructedRadioEventOrigin,
115 coreCoordinateSystem);
117 if(flightCandidates.empty()) {
118 INFO(
"No airplane corresponds this event.");
122 if(flightCandidates.size()>1) {
123 WARNING(
"Multiple airplanes correspond this event. Using closest one to the reconstructed position.");
126 INFO(
"Association of an airplane with this event was successful.");
128 const Flight& flight = *flightCandidates.begin()->getFlight();
129 Point coreCoordinateSystemOrigin(0, 0, 0, coreCoordinateSystem);
135 reconstructedRadioEventOrigin,
136 coreCoordinateSystem);
139 const Station& station = *stationsIter;
const StationInfo * registerStationInfo(const rdet::Station &pStation)
bool HasParameter(const Parameter i) const
double _maxAngleBetweenAirplaneAndEventInRadians_
boost::filter_iterator< CandidateStationFilter, AllStationIterator > CandidateStationIterator
Iterator over all CandidateStations (i.e., HasSignal, HasNoSignal)
Report success to RunController.
Detector description interface for Station-related data.
std::list< FlightAndPositionPair > FlightsAndCoordinatesList
StationRecData & GetRecData()
Get station level reconstructed data.
CandidateStationIterator CandidateStationsEnd()
Interface class to access to the Radio part of an event.
Class to hold and convert a point in geodetic coordinates.
Skip remaining modules in the current loop and continue with next iteration of the loop...
Interface class to access to the RD Reconstruction of a Shower.
const utl::TimeInterval & getTimeShift() const
#define INFO(message)
Macro for logging informational messages.
bool GetPulseFound() const
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
DataWriter * _dataWriter_
bool writePulseInfo(const revt::Station &pStation, const rdet::Station &pRadioStation)
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
A TimeStamp holds GPS second and nanosecond for some event.
Detector description interface for RDetector-related data.
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Class representing a document branch.
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
class to hold data at the radio Station level.
utl::CoordinateSystemPtr _globalCoordinateSystem_
double GetX(const CoordinateSystemPtr &coordinateSystem) const
Top of the hierarchy of the detector description interface.
CandidateStationIterator CandidateStationsBegin()
bool writeStationInfosToFile()
virtual ~RdAirplaneTiming()
#define WARNING(message)
Macro for logging warning messages.
void GetData(bool &b) const
Overloads of the GetData member template function.
FlightsAndCoordinatesList getFlights(const utl::TimeStamp &pTime, const utl::Point &pReconstructedEventPosition, const double &pMaxAngleDifferenceInRadian, utl::CoordinateSystemPtr pCoreCoordinateSystem)
double GetInterval() const
Get the time interval as a double (in Auger base units)
double GetY(const CoordinateSystemPtr &coordinateSystem) const
ResultFlag
Flag returned by module methods to the RunController.
std::string getInformations() const
utl::Point _ads_bAntennaPosition_
PulseInfoWriter * registerEvent(evt::Event &pEvent, const Flight &pFlight, const utl::Point &pReconstructedRadioEventOrigin, utl::CoordinateSystemPtr pCoreCoordinateSystem)
static Ads_bDataBase * getSharedDataBase()
Report failure to RunController, causing RunController to terminate execution.
utl::Point GetCorePosition() const
returns pointer of the position vector of the core in the reference coor system
Main configuration utility.
const rdet::RDetector & GetRDetector() const
double GetParameter(const Parameter i) const
double GetZ(const CoordinateSystemPtr &coordinateSystem) const
Point GetPoint(const CoordinateSystemPtr &theCS=CoordinateSystemPtr()) const
Get a cartesian point from an UTMPoint.
#define ERROR(message)
Macro for logging error messages.
const Station & GetStation(const int stationId) const
Get station by Station Id.
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)
Ads_bDataBase * _ads_bDataBase_