11 using namespace RdAirplane;
12 using namespace boost;
14 namespace fs = boost::filesystem;
16 RdAirplaneArrivalDirectionSetter::RdAirplaneArrivalDirectionSetter() :
17 _ads_bDataBase_(NULL) {}
22 Detector& detector = Detector::GetInstance();
24 string eventAirplaneAssociationFile;
26 Branch directionSetterTopBranch = centralConfig->
GetTopBranch(
"RdAirplaneArrivalDirectionSetter");
27 directionSetterTopBranch.
GetChild(
"AirplaneEventAssociationFile").
GetData(eventAirplaneAssociationFile);
28 INFO(
"Loading event ids and associated airplane ids from file " + eventAirplaneAssociationFile);
30 ERROR(
"Could not load event-airplane-associations.");
44 INFO(
"Event is not from an airplane");
47 const EventInfo& eventInfo = iter->second;
50 INFO(
"No airplane with the right id found.");
56 INFO(
"Airplane was not over the AERA field at that time.");
60 if(airplanePosition==NULL) {
61 INFO(
"No position data for airplane at that time.");
64 REvent& radioEvent =
event.GetREvent();
69 Station& station = *stationIter;
73 recData.
SetParameter(eSignalArrivalDirectionX, airplanePosition->
GetX(stationCS));
74 recData.
SetParameter(eSignalArrivalDirectionY, airplanePosition->
GetY(stationCS));
75 recData.
SetParameter(eSignalArrivalDirectionZ, airplanePosition->
GetZ(stationCS));
83 ShowerRRecData& showerRRecData =
event.GetRecShower().GetRRecShower();
87 showerRRecData.
SetParameter(eShowerAxisX, airplanePosition->
GetX(coreCoordinateSystem));
88 showerRRecData.
SetParameter(eShowerAxisY, airplanePosition->
GetY(coreCoordinateSystem));
89 showerRRecData.
SetParameter(eShowerAxisZ, airplanePosition->
GetZ(coreCoordinateSystem));
91 showerRRecData.
SetParameter(eRecStage, ShowerRRecData::kSphericalWaveFitVarC);
104 fs::path pathToFile = fs::path(pFile);
108 ifstream
file(pFile.c_str());
113 while(getline(
file,line)) {
114 if(line.empty() || line==
" ")
121 stringstream lineAsStream(line);
122 lineAsStream >> eventId;
123 lineAsStream >> airplaneId;
124 lineAsStream >> coreX;
125 lineAsStream >> coreY;
126 lineAsStream >> coreZ;
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
Get the Auger reference system centered on the station.
Class to access station level reconstructed data.
void SetParameter(Parameter i, double value, bool lock=true)
utl::CoordinateSystemPtr _globalCoordinateSystem_
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
Report success to RunController.
Detector description interface for Station-related data.
bool _readInEventAirplaneAssociations(const std::string &pFile)
StationRecData & GetRecData()
Get station level reconstructed data.
Interface class to access to the Radio part of an event.
utl::Point * getPosition(const utl::TimeStamp &pTime, Ads_bEvent::AltitudeType pAltitudeType) const
Skip remaining modules in the current loop and continue with next iteration of the loop...
EventIdToEventInfoMap _eventAirplaneAssociation_
Interface class to access to the RD Reconstruction of a Shower.
Flight * getFlight(const utl::TimeStamp &pTime) const
#define INFO(message)
Macro for logging informational messages.
Ads_bDataBase * _ads_bDataBase_
StationIterator StationsEnd()
StationIterator StationsBegin()
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
boost::filter_iterator< StationFilter, AllStationIterator > StationIterator
Iterator over all (non-exculded) stations.
A TimeStamp holds GPS second and nanosecond for some event.
Detector description interface for RDetector-related data.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Class representing a document branch.
class to hold data at the radio Station level.
virtual ~RdAirplaneArrivalDirectionSetter()
double GetX(const CoordinateSystemPtr &coordinateSystem) const
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
Top of the hierarchy of the detector description interface.
void GetData(bool &b) const
Overloads of the GetData member template function.
double GetY(const CoordinateSystemPtr &coordinateSystem) const
ResultFlag
Flag returned by module methods to the RunController.
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
utl::CoordinateSystemPtr GetReferenceCoordinateSystem() const
Get the reference coordinate system used for analysis (usually PampaAmarilla for Auger) ...
utl::Point coreCoordinates
void SetParameter(Parameter i, double value, bool lock=true)
static Ads_bDataBase * getSharedDataBase()
Report failure to RunController, causing RunController to terminate execution.
Main configuration utility.
Airplane * getAirplaneById(const std::string &pId)
const rdet::RDetector & GetRDetector() const
double GetZ(const CoordinateSystemPtr &coordinateSystem) const
#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)