RdBeamTimeOptimizer.cc
Go to the documentation of this file.
1 #include "RdBeamTimeOptimizer.h"
2 //#include "revt+points.h"
3 #include <utl/ErrorLogger.h>
4 
5 #include <evt/Event.h>
6 #include <evt/ShowerRecData.h>
7 #include <evt/ShowerRRecData.h>
8 #include <evt/BeamQuantities.h>
9 #include <revt/REvent.h>
10 #include <revt/Header.h>
11 #include <revt/Station.h>
12 
13 #include <rdet/RDetector.h>
14 
15 #include <utl/Trace.h>
16 #include <utl/TraceAlgorithm.h>
17 #include <utl/ErrorLogger.h>
18 #include <utl/Reader.h>
19 #include <utl/config.h>
20 #include <utl/AugerUnits.h>
21 #include <utl/Triple.h>
22 #include <utl/FFTDataContainerAlgorithm.h>
23 #include <utl/CoordinateSystemPtr.h>
24 
25 #include <fwk/CentralConfig.h>
26 #include <fwk/LocalCoordinateSystem.h>
27 
28 #include <Minuit2/MnMinimize.h>
29 #include <Minuit2/VariableMetricMinimizer.h>
30 #include <Minuit2/FunctionMinimum.h>
31 #include <Minuit2/MnPrint.h>
32 
33 using namespace std;
34 using namespace utl;
35 using namespace fwk;
36 using namespace revt;
37 
38 
39 //Just an abbreviation of repeated code from UserModule.cc skeleton
40 #define PRINT(...) {stringstream msg; msg << __VA_ARGS__; INFO(msg.str());}
41 
44  {
45  }
46 
47  RdBeamTimeOptimizer::~RdBeamTimeOptimizer()
48  {
49  }
50 
53  {
54  INFO("RdBeamTimeOptimizer::Init()");
55 
56  Branch conf =
57  CentralConfig::GetInstance()->GetTopBranch("RdBeamTimeOptimizer");
58 
59  conf.GetChild("startBin").GetData(startbin);
60  conf.GetChild("stopBin").GetData(stopbin);
61 
62  string confstring;
63  conf.GetChild("waveModel").GetData(confstring);
64  waveModel = (confstring == "ePlane") ? (RdWaveModel*) new RdPlaneWaveModel() :
66 
67 // const Branch txtOut = conf.GetChild("asciiOutput");
68 // if (txtOut) {
69 // txtOut.GetChild("outputFileName").GetData(outfile);
70 // txtOut.GetChild("outputGridType").GetData(confstring);
71 // gridtype = (confstring == "ePolar") ? polar :
72 // (confstring == "eCarthesian") ? carthesian : none;
73 // } else {
74 // gridtype = none; outfile = "";
75 // }
76 
77  return eSuccess;
78  }
79 
80  void RdBeamTimeOptimizer::shiftsToDelays(REvent& rEvent, TimeStamp meanTime, vector<double> &times) {
81  if ((uint)rEvent.GetNumberOfStations() != times.size()) {
82  throw utl::OutOfBoundException("Wrong number of delays supplied.");}
83 
84  REvent::StationIterator stat = rEvent.StationsBegin();
85  vector<double>::iterator time = times.begin();
86  for (; stat != rEvent.StationsEnd(); ++stat, ++time) {
87  (*time) += ( stat -> GetTraceStartTime() - meanTime).GetInterval();
88  }
89  }
90 
91  void RdBeamTimeOptimizer::delaysToShifts(REvent& rEvent, TimeStamp meanTime, vector<double> &times) {
92  if ((uint)rEvent.GetNumberOfStations() != times.size()) {
93  throw utl::OutOfBoundException("Wrong number of timeshifts supplied.");}
94 
95  REvent::StationIterator stat = rEvent.StationsBegin();
96  vector<double>::iterator time = times.begin();
97  for (; stat != rEvent.StationsEnd(); ++stat, ++time) {
98  (*time) -= ( stat -> GetTraceStartTime() - meanTime ).GetInterval();
99  }
100  }
101 
102  vector<double> RdBeamTimeOptimizer::delaysFromRRec(REvent& rEvent, evt::ShowerRRecData& rrec){
103  //#warning TH: replace Core Position with other reference?
104  Point skyPos = rrec.GetCorePosition() + rrec.GetAxis();
105  waveModel->setOrigin(rrec.GetCorePosition());
106  waveModel->setSkyPos (skyPos);
107  const rdet::RDetector& rDetector = det::Detector::GetInstance().GetRDetector();
108 
109  vector<double> delays;
110  REvent::StationIterator stat = rEvent.StationsBegin();
111 
112  for (; stat != rEvent.StationsEnd(); ++stat) {
113  const Point pos = rDetector.GetStation(*stat).GetPosition();
114  delays.push_back( waveModel->delay(pos) );
115  }
116  return delays;
117  }
118 
119  vector<double> RdBeamTimeOptimizer::shiftsFromRRec(REvent& rEvent, evt::ShowerRRecData& rrec){
120  //#warning TH: replace Core Position with other reference?
121  Point skyPos = rrec.GetCorePosition() + rrec.GetAxis();
122  waveModel->setOrigin(rrec.GetCorePosition());
123  waveModel->setSkyPos (skyPos);
124  const rdet::RDetector& rDetector = det::Detector::GetInstance().GetRDetector();
125 
126  vector<double> shifts;
127  REvent::StationIterator stat = rEvent.StationsBegin();
128 
129  double middleOfTrace;
130  {
131  int start = stat->GetConstStationTimeSeries().GetStart(),
132  stop = stat->GetConstStationTimeSeries().GetStop();
133  if ((startbin != -1) && (startbin > start)) start = startbin;
134  if ((stopbin != -1) && (stopbin < stop)) stop = stopbin;
135  middleOfTrace = (stop+start) * stat->GetConstStationTimeSeries().GetBinning() /2.0;
136  }
137 
138  //#warning TH: TraceStartTime to be replaced by new logic (ParameterStorage), replace core as reference?
139  for (; stat != rEvent.StationsEnd(); ++stat) {
140  const Point pos = rDetector.GetStation(*stat).GetPosition();
141  shifts.push_back( waveModel->delay(pos) - (stat -> GetTraceStartTime() - rrec.GetCoreTime()).GetInterval() + middleOfTrace );
142  }
143  return shifts;
144  }
145 
146  // this helper function is not functionally closed. it requires an out trace of the right
147  // dimension. a more selfcontained design would require more allocating and work.
148  // this is really just a helper to make beamtrace more readable, so don't overengineer.
149  inline void RdBeamTimeOptimizer::efieldtopower (const StationTimeSeries& in, TraceD& out, int start, int stop) const {
150  StationTimeSeries::ConstIterator it = in.Begin() + start;
151  for (int i = 0; i < (stop-start); i++, it++)
152  out[i] = it->GetMag2();
153  }
154 
155  TraceD RdBeamTimeOptimizer::powertrace (REvent& rEvent, evt::ShowerRRecData& /*rrec*/,
156  const vector<double>& shifts) const {
157 
158  static FFTDataContainerAlgorithm fft;
159 
160  //#warning TH: Code assumes that all traces have same binning and size!
161 
162  // trust that all traces are of same binning&size; if not, we are bound to fail anyway,
163  // if traces have to be adjusted, this could be handled elsewhere beforehand.
165 
166  int start = it->GetConstStationTimeSeries().GetStart(),
167  stop = it->GetConstStationTimeSeries().GetStop();
168  if ((startbin != -1) && (startbin > start)) start = startbin;
169  if ((stopbin != -1) && (stopbin < stop)) stop = stopbin;
170 
171  TraceD sum(stop-start, it->GetConstStationTimeSeries().GetBinning()),
172  addend(stop-start, it->GetConstStationTimeSeries().GetBinning());
173 
174  vector<double>::const_iterator shiftIt = shifts.begin();
175  uint num = 0;
176  for (; it != rEvent.StationsEnd(); ++it, ++shiftIt) {
177  StationFFTDataContainer data = it->GetFFTDataContainer();
178 
179  const TimeInterval shift = (*shiftIt);
180 
181  fft.ShiftTimeSeries(data, -shift);
182 
183  const StationTimeSeries& ts = data.GetTimeSeries();
184  efieldtopower (ts, addend, start, stop);
185  sum += addend;
186  ++ num;
187  }
188 
189  return sum * (1.0 / num) ; //sqrt (sum/rEvent.GetNumberOfStations())
190  }
191 
192 
193 
194 
195  // this helper function is not functionally closed. it requires an out trace of the right
196  // dimension. a more selfcontained design would require more allocating and work.
197  // this is really just a helper to make beamtrace more readable, so don't overengineer.
198  inline void RdBeamTimeOptimizer::efieldproduct (const StationTimeSeries& in1, const StationTimeSeries& in2, TraceD& out, int start, int stop) const {
199  StationTimeSeries::ConstIterator it1 = in1.Begin() + start, it2 = in2.Begin() + start;
200  uint n = it1->GetSize(); //should be 3 ;-)
201  for (int i = 0; i < (stop-start); ++i, ++it1, ++it2) {
202  double prod = 0.0;
203  for (uint j = 0; j < n; ++j)
204  prod += it1->At(j) * it2->At(j);
205  out[i] = prod;
206  }
207  }
208  TraceD RdBeamTimeOptimizer::crosscorr (REvent& rEvent, evt::ShowerRRecData& /*rrec*/,
209  const vector<double>& shifts) const {
210  static FFTDataContainerAlgorithm fft;
211 
212  // trust that all traces are of same binning&size; if not, we are bound to fail anyway,
213  // if traces have to be adjusted, this could be handled elsewhere beforehand.
215 
216  int start = it->GetConstStationTimeSeries().GetStart(),
217  stop = it->GetConstStationTimeSeries().GetStop();
218  if ((startbin != -1) && (startbin > start)) start = startbin;
219  if ((stopbin != -1) && (stopbin < stop)) stop = stopbin;
220 
221  TraceD sum(stop-start, it->GetConstStationTimeSeries().GetBinning()),
222  addend(stop-start, it->GetConstStationTimeSeries().GetBinning());
223 
224  uint n = rEvent.GetNumberOfStations();
225  StationFFTDataContainer stationData[n];
226  vector<double>::const_iterator shiftIt = shifts.begin();
227  for (uint i=0; it != rEvent.StationsEnd(); ++it, ++shiftIt, ++i) {
228  stationData[i] = it->GetFFTDataContainer();
229 
230  TimeInterval shift = (*shiftIt);
231  fft.ShiftTimeSeries(stationData[i], -shift);
232  }
233 
234  uint num = 0;
235  for (uint i=0; i < n; ++i)
236  for (uint j=i+1; j < n; ++j) {
237  efieldproduct (stationData[i].GetTimeSeries(),stationData[j].GetTimeSeries(), addend, start, stop);
238  sum += addend;
239  ++num;
240  }
241 
242  return sum * (1.0/num);
243  }
244 
245  TraceD
246  RdBeamTimeOptimizer::xtrace (TraceD ccTrace, double ccMean, TraceD pwNormal) {
247  TraceD result (ccTrace);
248  TraceD::Iterator it = result.Begin();
249  TraceD::ConstIterator itPW = pwNormal.Begin();
250  for (;it != result.End(); it++, itPW++) {
251  (*it) *= abs ( (*it - ccMean) / (*itPW) );
252  }
253  return result;
254  }
255 
256 
257  /* findPeak should probably use a very fancy algorithm.
258  For now a simple max-finder should do the trick.
259  There is no model for the peak shape anyway. */
260  evt::BeamPeak
261  RdBeamTimeOptimizer::findPeak (const TraceD& trace) {
262  TraceD::ConstIterator max = max_element( trace.Begin(), trace.End() );
263  const double maxval = *max;
264  const int maxi = (max - trace.Begin());
265  const double maxtime = maxi * trace.GetBinning();
266 
267  static TraceAlgorithm algo;
268  //#warning TH: replace call to RMS with RootMeanSquare everywhere
269  const double rms = algo.RMS ( trace, trace.GetStart(), trace.GetStop() -1 );
270  const double offset = algo.Mean ( trace, trace.GetStart(), trace.GetStop() -1);
271 
272  peakTime = maxtime;
273  return evt::BeamPeak ( maxval, maxtime, rms, offset);
274  }
275 
276  void
277  RdBeamTimeOptimizer::writeRecData(REvent &rEvent, std::vector<double> &shifts){
278 
279  std::vector<double>::const_iterator shift = shifts.begin();
280  for (REvent::StationIterator stat = rEvent.StationsBegin();
281  stat != rEvent.StationsEnd(); ++stat, ++shift){
282  if (!stat->HasRecData()) {stat->MakeRecData();}
283  stat->GetRecData().SetSignalTime(stat -> GetTraceStartTime() + ((*shift) + peakTime));
284  //#warning TH: change to new logic of signal times (ParameterStorage)
285  }
286 
287  }
288 
289 
291  RdBeamTimeOptimizer::Run(evt::Event& event)
292  {
293  DEBUGLOG("RdBeamTimeOptimizer::Run()");
294 
295  // Check if there are events at all
296  if(!event.HasREvent()) {
297  WARNING("No radio event found!");
298  return eContinueLoop;
299  }
300 
301  revt::REvent &rEvent = event.GetREvent();
302 
303  stringstream fMessage;
304  fMessage << "Radio event found with "
305  << rEvent.GetNumberOfStations()
306  << " stations!";
307 
308  INFO(fMessage.str());
309 
310  // Read event header
311  const Header& rHeader = rEvent.GetHeader();
312  fMessage.str("");
313  fMessage << "Header ID "
314  << rHeader.GetId();
315  // << " and timestamp: "
316  // << rHeader.GetTime();
317  INFO(fMessage.str());
318 
319  const uint nStat = rEvent.GetNumberOfStations();
320  // Unfortunately the "simple" minuit API does not work for me ...
321  // std::vector <double> startTimes (nStat,0.0);
322  // std::vector <double> startErrors (nStat, 100.0 * nanosecond);
323 
324  using namespace ROOT::Minuit2;
325  MnUserParameters upar;
326 
327  if (!event.HasRecShower() || !event.GetRecShower().HasRRecShower()) {
328  WARNING("No RRecShower found!");
329  WARNING("Falling back to: All time shifts 0.0 initially." );
330 
331  for (int i=0; i<nStat; i++)
332  { stringstream parname; parname << "shift " <<i;
333  upar.Add(parname.str(), 0.0, 10000.0 * nanosecond);
334  }
335  // upar.Fix(0);
336  }
337  else {
338  INFO("RRecShower found.\nCalculating start time shift values from wave model "
339  "with Axis and CorePosition.");
340 
341  evt::ShowerRRecData &rrec = event.GetRecShower().GetRRecShower();
342  std::vector <double> startTimes = shiftsFromRRec(rEvent, rrec);
343 
344  int i=0;
345  for (std::vector<double>::const_iterator it=startTimes.begin();
346  it!=startTimes.end();it++,i++)
347  { stringstream parname; parname << "shift " <<i;
348  upar.Add(parname.str(), (*it), 10000.0 * nanosecond);
349  }
350  }
351 
352  {
353  stringstream msg;
354  msg<< "Start parameters (time shifts): ";
355  vector<double> params = upar.Params();
356  copy (params.begin(),
357  params.end(),
358  ostream_iterator<double> (msg, "\t"));
359  INFO (msg.str());
360  }
361 
362  INFO ("Maximizing power peak ...");
363  {
364  powerFCN fcn (&rEvent,this);
365  MnMinimize m( static_cast<const FCNBase&>(fcn), upar);
366  FunctionMinimum fmin = m(10000);
367 
368  upar = fmin.UserParameters();
369  cout << fmin;
370  }
371 
372  {
373  stringstream msg;
374  msg<< "Shifts after optimizing power peak: ";
375  vector<double> params = upar.Params();
376  copy (params.begin(),
377  params.end(),
378  ostream_iterator<double> (msg, "\t"));
379  INFO (msg.str());
380  }
381 
382  INFO ("Maximizing cross corellation peak");
383  {
384  crossFCN fcn (&rEvent,this);
385  MnMinimize m( static_cast<const FCNBase&>(fcn), upar);
386  FunctionMinimum fmin = m(10000);
387 
388  upar = fmin.UserParameters();
389  }
390 
391  {
392  stringstream msg;
393  msg<< "Shifts after optimizing cross correlation peak: ";
394  vector<double> params = upar.Params();
395  copy (params.begin(),
396  params.end(),
397  ostream_iterator<double> (msg, "\t"));
398  INFO (msg.str());
399 
400  INFO ("Writing Params to StationRecData.");
401  writeRecData(rEvent, params);
402  }
403 
404  // MnMinimize m( static_cast<const FCNBase&>(*this), startTimes, startErrors, 1);
405 
406  // FunctionMinimum fmin = m(10000);
407 
408  // cout << fmin;
409 
410 // DEBUGLOG ("calculating beam trace");
411 
412 // TraceD cc = crosscorr (rEvent, rrec);
413 // TraceD power = powertrace (rEvent, rrec);
414 
415 // evt::BeamPeak ccPeak = findPeak (cc);
416 // evt::BeamPeak pwPeak = findPeak (power);
417 
418 // TraceD x = xtrace(cc, ccPeak.GetOffset(), power-pwPeak.GetOffset());
419 // evt::BeamPeak xPeak = findPeak (x);
420 
421 // CoordinateSystemPtr coreCS = fwk::LocalCoordinateSystem::Create( rrec.GetCorePosition() );
422 // if (gridtype == polar) {
423 // const utl::Triple polarCoords = rrec.GetAxis().GetSphericalCoordinates(coreCS);
424 // WriteASCIIPolar (cc, power, x, ccPeak, pwPeak, xPeak, polarCoords);
425 // }
426 // else if (gridtype == carthesian) {
427 // const utl::Triple xyz = rrec.GetAxis().GetCoordinates(coreCS);
428 // WriteASCII_XYZ (cc, power, x, ccPeak, pwPeak, xPeak, xyz);
429 // }
430 
431 // if (rrec.HasCurrentBeamMap()) {
432 // DEBUGLOG ("filling BeamQuantities into map");
433 
434 // evt::BeamQuantities quants (rrec.GetAxis().GetTheta(coreCS) ,
435 // rrec.GetAxis().GetPhi(coreCS) ,
436 // waveModel->curvature(rrec.GetAxis(),coreCS),
437 // waveModel->coneAngle(rrec.GetAxis(),coreCS),
438 // ccPeak, pwPeak, xPeak);
439 
440 // evt::BeamMap map = rrec.GetCurrentBeamMap();
441 // map.AddQuantities (quants);
442 // }
443 // if (!rrec.HasBeamResultQuantities()
444 // || (rrec.GetBeamResultQuantities().GetCCPeak().GetHeight() / rrec.GetBeamResultQuantities().GetCCPeak().GetRMS()
445 // < ccPeak.GetHeight() / ccPeak.GetRMS() )) {
446 // evt::BeamQuantities resultQuants (rrec.GetAxis().GetTheta(coreCS) ,
447 // rrec.GetAxis().GetPhi(coreCS) ,
448 // waveModel->curvature(rrec.GetAxis(),coreCS),
449 // waveModel->coneAngle(rrec.GetAxis(),coreCS),
450 // ccPeak, pwPeak, xPeak);
451 // rrec.SetBeamResultQuantities( resultQuants );
452 // }
453 
454  return eSuccess;
455  }
456 
458  RdBeamTimeOptimizer::Finish()
459  {
460  INFO("RdBeamTimeOptimizer::Finish()");
461  delete (waveModel);
462 
463  return eSuccess;
464  }
465 
466  void
467  RdBeamTimeOptimizer::WriteASCIISpectrum(const revt::Station& station,
468  const string& filename) const
469  {
470  // Get the frequency spectrum
471  const revt::StationFrequencySpectrum& spectrum =
472  station.GetConstStationFrequencySpectrum();
473 
474  // open file for output
475  ofstream outfile;
476  outfile.open(filename.c_str(),ios::out);
477 
478  // write the frequency axis and the amplitudes to the file
479  for (StationFrequencySpectrum::SizeType i = 0; i < spectrum.GetSize(); ++i)
480  outfile << station.GetFrequencyOfBin(i)/megahertz
481  << " "
482  << abs(spectrum[i][0])/((micro*volt)/(meter*megahertz))
483  << " "
484  << abs(spectrum[i][1])/((micro*volt)/(meter*megahertz))
485  << " "
486  << abs(spectrum[i][2])/((micro*volt)/(meter*megahertz))
487  << endl;
488 
489  outfile.close();
490  }
491 
492  void RdBeamTimeOptimizer::WriteASCIIPolar (const TraceD &power, const TraceD &cc, const TraceD &x,
493  const evt::BeamPeak &pwPeak, const evt::BeamPeak & ccPeak, const evt::BeamPeak &xPeak,
494  const utl::Triple &coords) const {
495 
496  utl::Triple rThetaPhi = boost::make_tuple( coords.get<0>() / km, coords.get<1>() / degree, coords.get<2>() / degree );
497 
498  WriteTrace3D((power-pwPeak.GetOffset()) / pwPeak.GetRMS(),
499  "pw_"+outfile, rThetaPhi);
500 
501  WriteTrace3D((cc-ccPeak.GetOffset()) / ccPeak.GetRMS(),
502  "cc_"+outfile, rThetaPhi);
503 
504  WriteTrace3D((x-xPeak.GetOffset()) / xPeak.GetRMS(),
505  "x_"+outfile, rThetaPhi);
506 
507  // uncomment to write out RMS values:
508  // writeValue3D(ccPeak.GetRMS()
509  // / ((micro*volt/meter)*(micro*volt/meter)),
510  // "cc_RMS.dat", rThetaPhi);
511  // writeValue3D(pwPeak.GetRMS()
512  // /((micro*volt/meter)*(micro*volt/meter)),
513  // "pw_RMS.dat", rThetaPhi);
514  // writeValue3D(xPeak.GetRMS()
515  // /((micro*volt/meter)*(micro*volt/meter)),
516  // "x_RMS.dat", rThetaPhi);
517  }
518 
519  void RdBeamTimeOptimizer::WriteASCII_XYZ (const TraceD &power, const TraceD &cc, const TraceD &x,
520  const evt::BeamPeak &pwPeak,
521  const evt::BeamPeak &ccPeak,
522  const evt::BeamPeak &xPeak,
523  const utl::Triple &coords) const {
524 
525  utl::Triple xyz = boost::make_tuple( coords.get<0>() / km, coords.get<1>() / km, coords.get<2>() / km );
526 
527  WriteTrace3D((power /*-pwPeak.GetOffset()*/ ) / pwPeak.GetRMS(),
528  "pw_"+outfile, xyz);
529 
530  WriteTrace3D((cc /*-ccPeak.GetOffset()*/) / ccPeak.GetRMS(),
531  "cc_"+outfile, xyz);
532 
533  WriteTrace3D((x /*-xPeak.GetOffset()*/) / xPeak.GetRMS(),
534  "x_"+outfile, xyz);
535  }
536 
537  void
538  RdBeamTimeOptimizer::WriteTrace3D(const TraceD& trace,
539  const string& filename,
540  const utl::Triple &coords) const
541  {
542  // open file for output
543  ofstream outfile;
544  outfile.open(filename.c_str(),ios::out|ios::app);
545 
546  // write the time axis and the amplitudes to the file
547  for (StationTimeSeries::SizeType i = 0; i < trace.GetSize(); ++i)
548  outfile << coords.get<0>() << " "
549  << coords.get<1>() << " "
550  << coords.get<2>() << " "
551  << trace.GetBinning()*static_cast<double>(i+startbin)/nanosecond
552  << " "
553  << trace[i]
554  << endl;
555  outfile << endl;
556 
557  outfile.close();
558  }
559 
560  void writeValue3D (double val, const string& filename,
561  const utl::Triple &coords) {
562  ofstream outfile;
563  outfile.open(filename.c_str(),ios::out|ios::app);
564  outfile << coords.get<0> () << " "
565  << coords.get<1> () << " "
566  << coords.get<2> () << " "
567  << val << endl;
568  outfile.close();
569  }
570 
571 
572  // void
573  // RdBeamTimeOptimizer::WriteTracePolar(const TraceD& trace,
574  // const string& filename,
575  // const Vector& skyVec ) const
576  // {
577  // // open file for output
578  // ofstream outfile;
579  // outfile.open(filename.c_str(),ios::out|ios::app);
580 
581  // // write the time axis and the amplitudes to the file
582  // for (StationTimeSeries::SizeType i = 0; i < trace.GetSize(); ++i)
583  // outfile << skyVec.GetTheta(skyVec.GetCoordinateSystem()) / M_PI * 180 << " "
584  // << skyVec.GetPhi(skyVec.GetCoordinateSystem()) / M_PI * 180 << " "
585 
586  // << " "
587  // << trace[i] // / ((micro*volt/meter)*(micro*volt/meter))
588  // << endl;
589  // outfile << endl;
590 
591  // outfile.close();
592  // }
593 
594 }
595 
596 #undef PRINT
Branch GetTopBranch() const
Definition: Branch.cc:63
utl::Vector GetAxis() const
Returns vector of the shower axis.
const double degree
Point object.
Definition: Point.h:32
double GetFrequencyOfBin(const StationFrequencySpectrum::SizeType bin) const
Get the frequency corresponding to a bin of the frequency spectrum.
SizeType GetStop() const
Get valid data stop bin.
Definition: Trace.h:148
bool HasRecShower() const
Interface class to access to the Radio part of an event.
Definition: REvent.h:42
static double Mean(const Trace< T > &trace, const unsigned int bin1, const unsigned int bin2)
Evaluate the mean of trace between bin1 and bin2.
Interface class to access to the RD Reconstruction of a Shower.
double GetBinning() const
size of one slot
Definition: Trace.h:138
const double meter
Definition: GalacticUnits.h:29
Plane wave arrival Delays for Radio Imaging.
#define INFO(message)
Macro for logging informational messages.
Definition: ErrorLogger.h:161
StationIterator StationsEnd()
Definition: REvent.h:130
StationIterator StationsBegin()
Definition: REvent.h:128
void Init()
Initialise the registry.
vector< t2list > out
output of the algorithm: a list of clusters
Definition: XbAlgo.cc:32
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
Definition: Branch.cc:211
boost::filter_iterator< StationFilter, AllStationIterator > StationIterator
Iterator over all (non-exculded) stations.
Definition: REvent.h:125
bool HasREvent() const
const phoenix::function< PowerToImpl > power
Definition: UnitGrammar.h:47
std::vector< T >::const_iterator ConstIterator
Definition: Trace.h:60
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
Exception for reporting variable out of valid range.
Detector description interface for RDetector-related data.
Definition: RDetector.h:46
Iterator Begin()
Definition: Trace.h:75
#define max(a, b)
Class representing a document branch.
Definition: Branch.h:107
boost::tuple< double, double, double > Triple
Coordinate triple for easy getting or setting of coordinates.
Definition: Triple.h:15
class to hold data at the radio Station level.
algorithms to manipulate traces
std::vector< T >::size_type SizeType
Definition: Trace.h:58
constexpr double nanosecond
Definition: AugerUnits.h:143
#define DEBUGLOG(message)
Macro for logging debugging messages.
Definition: ErrorLogger.h:157
double abs(const SVector< n, T > &v)
const Data result[]
static void ShiftTimeSeries(FFTDataContainer< C, T, F > &container, const TimeInterval &shift)
shifts the time series of the FFTDataContainer in time
Header & GetHeader()
access to REvent Header
Definition: REvent.h:239
int GetNumberOfStations() const
Get total number of stations in the event.
Definition: REvent.h:206
C< T > & GetTimeSeries()
read out the time series (write access)
static double RMS(const Trace< T > &trace, const unsigned int bin1, const unsigned int bin2)
constexpr double megahertz
Definition: AugerUnits.h:155
const double km
Algorithms working on FFTDataContainer objects.
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
void writeValue3D(double val, const string &filename, const utl::Triple &coords)
Template class for a data container that offers and takes both time series and corresponding frequenc...
A TimeInterval is used to represent time elapsed between two events.
Definition: TimeInterval.h:43
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
Header file holding the RD Event Trigger class definition (based on SD)
Definition: REvent/Header.h:14
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
SizeType GetStart() const
Get valid data start bin.
Definition: Trace.h:142
uint16_t * data
Definition: dump1090.h:228
utl::Point GetCorePosition() const
returns pointer of the position vector of the core in the reference coor system
constexpr double micro
Definition: AugerUnits.h:65
char * filename
Definition: dump1090.h:266
utl::Point GetPosition() const
Tank position in Site Cartesian Coordinates.
Iterator End()
Definition: Trace.h:76
constexpr double m
Definition: AugerUnits.h:121
const Station & GetStation(const int stationId) const
Get station by Station Id.
Definition: RDetector.cc:141
int GetId() const
Definition: REvent/Header.h:21
Spherical wave arrival Delays for Radio Imaging.
std::vector< double >::iterator Iterator
Definition: Trace.h:59
const double volt
Definition: GalacticUnits.h:38

, generated on Tue Sep 26 2023.