RdBeamFormer.h
Go to the documentation of this file.
1 
9 /* #################################################################
10 
11  The class evt/BeamQuantities.h and further support in the framework
12  have been deleted with r34469 (29.10.21).
13 
14 ################################################################# */
15 
16 #ifndef _RdBeamFormer_h_
17 #define _RdBeamFormer_h_
18 
19 #include "RdWaveModel.h"
20 
21 #include <evt/ShowerRRecData.h>
22 #include <evt/BeamQuantities.h>
23 #include <revt/REvent.h>
24 #include <revt/Station.h>
25 #include <revt/StationRecData.h>
26 
27 #include <utl/Vector.h>
28 #include <utl/AxialVector.h>
29 #include <utl/Trace.h>
30 #include <utl/Triple.h>
31 
32 #include <fwk/VModule.h>
33 
34 #include <string>
35 #include <vector>
36 
37 namespace evt {
38  class Event;
39 }
40 
41 namespace revt {
42  class Station;
43 }
44 
45 namespace RdBeamFormer {
46 
58  enum gridtype_t { none = 0, polar = 1, carthesian = 2};
59 
60  class RdBeamFormer : public fwk::VModule {
61 
62  public:
63  // If you define a constructor, you MUST provide an implementation
64  // for it, otherwise the REGISTER_MODULE macro will not register
65  // your module. (Here, implementation is in RdBeamFormer.cc)
66  RdBeamFormer();
67  ~RdBeamFormer();
68 
72 
73  //shift the radio traces according to the calculated time delays
74  double shiftTraces(std::vector<revt::StationFFTDataContainer>& stationData, int& nStat, double& binning, int& start, int& stop,
75  evt::Event& event);
76  //calculate the cross-correlation beam
77  utl::TraceD crosscorr (std::vector<revt::StationFFTDataContainer>& stationData, int nStat, double binning, int start, int stop);
78  //calculate the power-beam
79  utl::TraceD powertrace (std::vector<revt::StationFFTDataContainer>& stationData, int nStat, double binning, int start, int stop);
80  //calculate the x-beam
81  utl::TraceD xtrace (utl::TraceD ccTrace, utl::TraceD ccNormal, utl::TraceD pwNormal);
82 
83  protected:
84  RdWaveModel* waveModel; //specify which wavefront model to use
85  std::string waveModelConf;
86 
87  int startbin, stopbin; //configured start and stop times of the traces in bins
88  double offsetfactor; //configured artificial time offset for the traces in ns
89 
90  enum gridtype_t gridtype; // configured type of ASCII output grid
91  std::string outfile; // configured output ASCII file name which is prefixed by cc_, pw_ and x_.
92 
93  //find the maximum value and corresponding time of the beam-forming trace and calculate its RMS and SNR
94  evt::BeamPeak findPeak (const utl::TraceD& trace, const double timeOffset);
95 
96  private:
98  //helper function for the cross-correlation beam calculation
99  inline void efieldproduct (const revt::StationTimeSeries& in1, const revt::StationTimeSeries& in2,
100  utl::TraceD& out, int start, int stop);
101  //helper function for the power-beam calculation
102  inline void efieldtopower (const revt::StationTimeSeries& in, utl::TraceD& out, int start, int stop);
103 
104  //write out results into ASCII file using either polar or carthesian coordinate system
105  void WriteASCII (const utl::TraceD &cc, const utl::TraceD &power, const utl::TraceD &x,
106  const evt::BeamPeak &ccPeak, const evt::BeamPeak &pwPeak, const evt::BeamPeak &xPeak,
107  const evt::Event& event) const;
108 
109  //write the whole beam-forming trace into ASCII file
110  void WriteTrace(const utl::TraceD& trace, const evt::BeamPeak& Peak,
111  const std::string& filename, const evt::ShowerRRecData& rrec) const;
112 
113  //write just the maximum value of the beam-forming trace into ASCII file
114  void WritePeak(const evt::BeamPeak& Peak, const std::string& filename, const evt::ShowerRRecData& rrec) const;
115 
116  mutable long fNumCalls; //needed to shape the output in ASCII files (to put a blank line in a proper place) in the form Gnuplot can deal with
117 
118  // The REGISTER_MODULE macro makes the framework aware of your module.
119  // You need to put this macro at the very end of your module class definition.
120  // Give your module a name (first argument) and specify its
121  // class name (second argument). In the ModuleSequenceExample.xml file,
122  // you can see this module being refered to by the name we give it here.
123 
124  REGISTER_MODULE("RdBeamFormer", RdBeamFormer);
125  };
126 }
127 
128 #endif
129 
130 // Configure (x)emacs for this file ...
131 // Local Variables:
132 // mode:c++
133 // compile-command: "make -k"
134 // End:
This is the supporting utility to calculate time delays relative to the origin according to the chose...
evt::BeamPeak findPeak(const utl::TraceD &trace, const double timeOffset)
Interface class to access to the RD Reconstruction of a Shower.
vector< t2list > out
output of the algorithm: a list of clusters
Definition: XbAlgo.cc:32
const phoenix::function< PowerToImpl > power
Definition: UnitGrammar.h:47
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
REGISTER_MODULE("RdBeamFormer", RdBeamFormer)
utl::TraceD powertrace(std::vector< revt::StationFFTDataContainer > &stationData, int nStat, double binning, int start, int stop)
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
Definition: RdBeamFormer.cc:91
void efieldproduct(const revt::StationTimeSeries &in1, const revt::StationTimeSeries &in2, utl::TraceD &out, int start, int stop)
Module interface.
Definition: VModule.h:53
utl::TraceD crosscorr(std::vector< revt::StationFFTDataContainer > &stationData, int nStat, double binning, int start, int stop)
utl::TraceD xtrace(utl::TraceD ccTrace, utl::TraceD ccNormal, utl::TraceD pwNormal)
void efieldtopower(const revt::StationTimeSeries &in, utl::TraceD &out, int start, int stop)
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
void WriteASCII(const utl::TraceD &cc, const utl::TraceD &power, const utl::TraceD &x, const evt::BeamPeak &ccPeak, const evt::BeamPeak &pwPeak, const evt::BeamPeak &xPeak, const evt::Event &event) const
void WritePeak(const evt::BeamPeak &Peak, const std::string &filename, const evt::ShowerRRecData &rrec) const
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
enum gridtype_t gridtype
Definition: RdBeamFormer.h:90
char * filename
Definition: dump1090.h:266
double shiftTraces(std::vector< revt::StationFFTDataContainer > &stationData, int &nStat, double &binning, int &start, int &stop, evt::Event &event)
The main module for the beam-forming calculations. This means obtaining power, cross-correlation and ...
utl::CoordinateSystemPtr coreCS
Definition: RdBeamFormer.h:97
Definition: XbArray.h:7
void WriteTrace(const utl::TraceD &trace, const evt::BeamPeak &Peak, const std::string &filename, const evt::ShowerRRecData &rrec) const

, generated on Tue Sep 26 2023.