3 #include <fwk/CentralConfig.h>
5 #include <utl/ErrorLogger.h>
6 #include <utl/Reader.h>
7 #include <utl/config.h>
8 #include <utl/TraceAlgorithm.h>
10 #include <evt/Event.h>
11 #include <revt/REvent.h>
12 #include <revt/Station.h>
13 #include <revt/Channel.h>
14 #include <rdet/RDetector.h>
15 #include <rdet/Channel.h>
30 RdDummyStationToChannelConverter::~RdDummyStationToChannelConverter()
44 INFO(
"RdDummyStationToChannelConverter::Init()");
56 WARNING(
"No radio event found!");
60 REvent& rEvent =
event.GetREvent();
91 det::Detector::GetInstance().GetRDetector();
97 if (orientAzimuth < 0 && orientAzimuth > -360 *
deg)
98 orientAzimuth += 360 *
deg;
103 stringstream fMessage;
105 double alignMargin = 5*
deg;
106 if ( orientZenith > alignMargin ) {
107 fMessage <<
"Encountering a channel that seems to be vertically aligned, not converting.";
112 double correspondingCoordinate;
113 double correspondingSign;
115 fMessage <<
"Associating channel " << channel.
GetId() <<
" for station " << station.
GetId() <<
" at " <<
116 orientAzimuth/
deg <<
" deg azimuthal angle";
117 if ( orientAzimuth < alignMargin or orientAzimuth > 360 *
deg - alignMargin ) {
118 fMessage <<
"with a positive x coordinate.";
119 INFO(fMessage.str());
120 correspondingCoordinate = 0;
121 correspondingSign = 1;
122 }
else if ( orientAzimuth > 90 *
deg - alignMargin or orientAzimuth < 90 *
deg + alignMargin ) {
123 fMessage <<
" with a positive y coordinate.";
124 INFO(fMessage.str());
125 correspondingCoordinate = 1;
126 correspondingSign = 1;
127 }
else if ( orientAzimuth > 180 *
deg - alignMargin or orientAzimuth < 180 *
deg + alignMargin ) {
128 fMessage <<
" with a negative x coordinate.";
129 INFO(fMessage.str());
130 correspondingCoordinate = 0;
131 correspondingSign = -1;
132 }
else if ( orientAzimuth > 270 *
deg - alignMargin or orientAzimuth < 270 *
deg + alignMargin ) {
133 fMessage <<
" with a negative y coordinate.";
134 INFO(fMessage.str());
135 correspondingCoordinate = 1;
136 correspondingSign = -1;
139 fMessage <<
"No good dodgy conversion possible because the antenna does not seem to be aligned with " <<
140 "any spatial coordinate within " << alignMargin/
deg <<
"deg.";
145 channeltrace.
PushBack(stationtrace[i][correspondingCoordinate]*correspondingSign);
155 RdDummyStationToChannelConverter::Finish()
160 INFO(
"RdDummyStationToChannelConverter::Finish()");
int GetId() const
Return Id of the Channel.
boost::indirect_iterator< InternalChannelIterator, Channel & > ChannelIterator
Iterator over station for read/write.
Interface class to access to the Radio part of an event.
double GetBinning() const
size of one slot
#define INFO(message)
Macro for logging informational messages.
StationIterator StationsEnd()
StationIterator StationsBegin()
void Init()
Initialise the registry.
Detector description interface for Channel-related data.
double GetOrientationZenith() const
Get zenith-direction of Antenna for this Channel.
ChannelIterator ChannelsBegin()
begin Channel iterator for read/write
boost::filter_iterator< StationFilter, AllStationIterator > StationIterator
Iterator over all (non-exculded) stations.
unsigned int GetNyquistZone() const
Get the Nyquist zone.
StationTimeSeries & GetStationTimeSeries()
retrieve Station Time Series (write access, only use this if you intend to change the data) ...
ChannelTimeSeries & GetChannelTimeSeries()
retrieve Channel Time Series (write access, only use this if you intend to change the data) ...
ChannelIterator ChannelsEnd()
end Channel iterator for read/write
Detector description interface for RDetector-related data.
class to hold data at the radio Station level.
std::vector< T >::size_type SizeType
#define WARNING(message)
Macro for logging warning messages.
int GetId() const
Get the station Id.
void SetBinning(const double binning)
ResultFlag
Flag returned by module methods to the RunController.
Template class for a FADC data or calibrated data container. Use the typedefs (TraceD, TraceI, etc.) defined in Trace-fwd.h.
Class that holds the data associated to an individual radio channel.
void SetNyquistZone(const unsigned int zone)
Set the Nyquist zone.
void PushBack(const T &value)
Insert a single value at the end.
const Station & GetStation(const int stationId) const
Get station by Station Id.
double GetOrientationAzimuth() const
Get azimuth-direction of Antenna for this Channel.