RdStationQualityAssessor.cc
Go to the documentation of this file.
2 
3 #include <fwk/CentralConfig.h>
4 #include <fwk/CoordinateSystemRegistry.h>
5 
6 #include <utl/ErrorLogger.h>
7 #include <utl/Reader.h>
8 #include <utl/config.h>
9 #include <utl/Trace.h>
10 #include <utl/TraceAlgorithm.h>
11 #include <utl/TimeStamp.h>
12 #include <utl/TimeInterval.h>
13 #include <utl/AugerUnits.h>
14 #include <utl/AugerException.h>
15 #include <utl/FFTDataContainerAlgorithm.h>
16 #include <utl/Math.h>
17 #include <utl/Vector.h>
18 #include <utl/AxialVector.h>
19 #include <utl/AugerCoordinateSystem.h>
20 #include <utl/CoordinateSystemPtr.h>
21 #include <utl/UTMPoint.h>
22 
23 #include <evt/Event.h>
24 #include <revt/REvent.h>
25 #include <revt/Header.h>
26 #include <evt/ShowerRecData.h>
27 #include <evt/ShowerSimData.h>
28 #include <evt/ShowerRRecData.h>
29 #include <evt/ShowerFRecData.h>
30 #include <evt/ShowerSRecData.h>
31 #include <revt/Channel.h>
32 
33 #include <rdet/RDetector.h>
34 #include <rdet/Station.h>
35 
36 #include <fwk/LocalCoordinateSystem.h>
37 
38 
39 using namespace revt;
40 using namespace fwk;
41 using namespace utl;
42 using namespace std;
43 
45 
47  : fInfoLevel(0)
48  {}
49 
50  RdStationQualityAssessor::~RdStationQualityAssessor() {}
51 
53  {
54  INFO("RdStationQualityAssessor::Init()");
55 
56  // Read in the configurations of the xml file
57  Branch topBranch =
58  CentralConfig::GetInstance()->GetTopBranch("RdStationQualityAssessor");
59  topBranch.GetChild("InfoLevel").GetData(fInfoLevel);
60  topBranch.GetChild("VectorialComponent").GetData(fVectorialComponent);
61  return eSuccess;
62  }
63 
64 
65  VModule::ResultFlag RdStationQualityAssessor::Run(evt::Event& event)
66  {
67  INFO("RdStationQualityAssessor::Run()");
68 
69  // Check wether there are events at all
70  if(!event.HasREvent()) {
71  WARNING("No radio event found!");
72  return eContinueLoop;
73  }
74 
75  REvent& rEvent = event.GetREvent();
76  // loop through stations
78  sIt != rEvent.SignalStationsEnd(); ++sIt) {
79 
80  StationRecData &recData(sIt->GetRecData());
81  double signalSearchWindowStart = recData.GetParameter(eSignalSearchWindowStart);
82  double signalSearchWindowStop = recData.GetParameter(eSignalSearchWindowStop);
83 
84  StationTimeSeries &timeSeries = sIt->GetFFTDataContainer().GetTimeSeries();
85  double binning = timeSeries.GetBinning();
86 
87  double maxOutsideSignalSearchWindow = 0;
88  double amplitude = 0;
89  for (unsigned int i = 0; i < timeSeries.GetSize(); ++i) {
90  if (fVectorialComponent == 0) // absolute value of vectorial sum
91  amplitude = timeSeries[i].GetMag();
92  else if (fVectorialComponent == 1) // x
93  amplitude = fabs(timeSeries[i][0]);
94  else if (fVectorialComponent == 2) // y
95  amplitude = fabs(timeSeries[i][1]);
96  else if (fVectorialComponent == 3) // z
97  amplitude = fabs(timeSeries[i][2]);
98  else if (fVectorialComponent == 4) // xy-plane
99  amplitude = sqrt(pow(timeSeries[i][0], 2) + pow(timeSeries[i][1], 2));
100  bool isOutside = i * binning < signalSearchWindowStart or i * binning > signalSearchWindowStop;
101  if ( amplitude > maxOutsideSignalSearchWindow and isOutside) {
102  maxOutsideSignalSearchWindow = amplitude;
103  }
104  }
105  recData.SetParameter(eMaxAmplitudeOutsideSignalSearchWindow, maxOutsideSignalSearchWindow);
106  }
107  return eSuccess;
108  }
109 
111  RdStationQualityAssessor::Finish()
112  {
113 
114  INFO("RdStationQualityAssessor::Finish()");
115 
116  return eSuccess;
117  }
118 
119 }
Branch GetTopBranch() const
Definition: Branch.cc:63
Class to access station level reconstructed data.
Report success to RunController.
Definition: VModule.h:62
Interface class to access to the Radio part of an event.
Definition: REvent.h:42
Skip remaining modules in the current loop and continue with next iteration of the loop...
Definition: VModule.h:68
double GetBinning() const
size of one slot
Definition: Trace.h:138
#define INFO(message)
Macro for logging informational messages.
Definition: ErrorLogger.h:161
void Init()
Initialise the registry.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
Definition: Branch.cc:211
double pow(const double x, const unsigned int i)
bool HasREvent() const
Class representing a document branch.
Definition: Branch.h:107
SizeType GetSize() const
Definition: Trace.h:156
#define WARNING(message)
Macro for logging warning messages.
Definition: ErrorLogger.h:163
void GetData(bool &b) const
Overloads of the GetData member template function.
Definition: Branch.cc:644
double GetParameter(const Parameter i) const
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
Template class for a FADC data or calibrated data container. Use the typedefs (TraceD, TraceI, etc.) defined in Trace-fwd.h.
Definition: Trace-fwd.h:19
SignalStationIterator SignalStationsEnd()
Definition: REvent.h:114
boost::filter_iterator< SignalStationFilter, AllStationIterator > SignalStationIterator
Iterator over all signal stations.
Definition: REvent.h:109
SignalStationIterator SignalStationsBegin()
Definition: REvent.h:112

, generated on Tue Sep 26 2023.