RdStationAssociator.cc
Go to the documentation of this file.
1 #include "RdStationAssociator.h"
2 
3 #include <fwk/CentralConfig.h>
4 
5 #include <utl/AugerUnits.h>
6 #include <utl/CoordinateSystem.h>
7 #include <utl/Minou.h>
8 #include <utl/PhysicalConstants.h>
9 #include <utl/Point.h>
10 #include <utl/RadioGeometryUtilities.h>
11 #include <utl/ReferenceEllipsoid.h>
12 #include <utl/TimeStamp.h>
13 #include <utl/TimeInterval.h>
14 #include <utl/Trace.h>
15 #include <utl/UTMPoint.h>
16 #include <utl/TraceAlgorithm.h>
17 
18 #include <rdet/RDetector.h>
19 #include <rdet/Station.h>
20 #include <rdet/Channel.h>
21 #include <rdet/RStationListManager.h>
22 #include <rdet/RSimulationStationListManager.h>
23 
24 #include <evt/RadioSimulation.h>
25 #include <evt/Event.h>
26 #include <evt/ShowerSimData.h>
27 
28 #include <revt/REvent.h>
29 #include <revt/EventTrigger.h>
30 #include <revt/Station.h>
31 #include <revt/Header.h>
32 #include <revt/StationTriggerData.h>
33 #include <revt/StationSimData.h>
34 
35 #include <sevt/SEvent.h>
36 #include <sevt/StationTriggerData.h>
37 
38 
39 using namespace std;
40 using namespace evt;
41 using namespace det;
42 using namespace utl;
43 using namespace fwk;
44 
45 
47 
50  {
51  Branch topBranch = CentralConfig::GetInstance()->GetTopBranch("RdStationAssociator");
52  topBranch.GetChild("InfoLevel").GetData(fInfoLevel);
53  topBranch.GetChild("AddVirtualStations").GetData(fAddVirtualStations);
54  topBranch.GetChild("FirstStationId").GetData(fFirstStationId);
55  topBranch.GetChild("ExtrapolateTheTailOfThePulses").GetData(fExtrapolateTheTailOfThePulses);
56  topBranch.GetChild("MaximumAllowedDistance").GetData(fMaximumDistance);
57  topBranch.GetChild("TracePaddingAtFront").GetData(fTracePaddingAtFront);
58  topBranch.GetChild("MinimumTraceLength").GetData(fMinimumTraceLength);
59  topBranch.GetChild("IncludedStationIds").GetData(fIncludedStationIds);
60  topBranch.GetChild("ExcludedStationIds").GetData(fExcludedStationIds);
61  topBranch.GetChild("AddNoSignalStations").GetData(fAddNoSignalStations);
62  topBranch.GetChild("AddEmptyTriggeredRDStations").GetData(fAddEmptyTriggeredRDStations);
63  topBranch.GetChild("MaximumDistanceOfNoSignalStations").GetData(fMaximumDistanceOfNoSignalStations);
64  topBranch.GetChild("CreateAllSDStationsWithRDTrace").GetData(fCreateAllSDStationsWithRDTrace);
65 
66  ostringstream info;
67  info << "\n\tMaximum allowed distance "<< fMaximumDistance/meter << " m\n"
68  << "\tAdding time series data at front by " << fTracePaddingAtFront / nanosecond
69  << " ns and at end to a total length of at least " << fMinimumTraceLength / nanosecond << " ns.\n"
70  << "\tAdd virtual stations: " << fAddVirtualStations << "(" << fFirstStationId << ")\n";
71 
72  if (fAddNoSignalStations) {
73  if (fAddEmptyTriggeredRDStations)
74  info << "\tAdd empty traces for triggered but not simulated RD stations\n";
75  else {
76  info << "\tAdd empty traces for all stations within " << fMaximumDistanceOfNoSignalStations / utl::km
77  << " km around the shower axis.\n";
78  }
79  }
80 
81  INFOFinal(info);
82  return eSuccess;
83  }
84 
85 
87  RdStationAssociator::Run(Event& theevent)
88  {
89  ostringstream out;
90 
91  if (fAddEmptyTriggeredRDStations && !theevent.HasSEvent()) {
92  ERROR("SEvent not available but required!");
93  return eFailure;
94  }
95 
96  auto& simshow = theevent.GetSimShower();
97  auto& rsim = simshow.GetRadioSimulation();
98  auto corsys = simshow.GetLocalCoordinateSystem();
99  auto pulsecorsys = rsim.GetLocalCoordinateSystem();
100 
101  const auto& eventtime = simshow.GetTimeStamp();
102  const auto& det = Detector::GetInstance();
103  const auto& radioDet = det.GetRDetector();
104 
105  // Add generic stations to detector describtion at the exact positions of the simulated pulses
106  if (fAddVirtualStations) {
107  RdStationAssociator::AddVirtualStations(theevent, pulsecorsys);
108  }
109 
110  // check if the event time has an uninitialized (illegal) value
111  if (eventtime == TimeStamp(0, 0)) {
112  WARNING("RdStationAssociator: Event time is not available. Event is skipped!");
113  return eContinueLoop;
114  }
115 
116  if (!theevent.HasREvent())
117  theevent.MakeREvent();
118 
119  revt::REvent& therev = theevent.GetREvent();
120 
121  if (!rsim.GoToFirstSimRadioPulse()) {
122  WARNING("RdStationAssociator: No SimRadioPulse in RadioSimulation. Event is skipped!");
123  return eContinueLoop;
124  }
125 
126  therev.GetHeader().SetId(rsim.GetEventNumber());
127  therev.GetHeader().SetRunNumber(rsim.GetRunNumber());
128  therev.GetHeader().SetTime(eventtime);
129 
130  /* Add Trigger Information to the Event. By default Event are assumed as Externally triggered
131  Once somebody implements a module for RdTrigger simulation in OffLine this part
132  should become obsolete */
133  therev.MakeTrigger();
134  therev.GetTrigger().SetExternalTrigger(true);
135  // End of Trigger Information part
136 
137  if (fInfoLevel >= eInfoDebug) {
138  out.str("");
139  for (const auto& detStation : radioDet.StationsRange()) {
140  auto position = detStation.GetPosition();
141  out << "Station " << detStation.GetId() << ": " << position.GetX(corsys) << ", "
142  << position.GetY(corsys) << ", " << position.GetZ(corsys) << endl;
143  }
144  INFODebug(out);
145  }
146 
147  bool ok;
148  // association between RDetector station and sim. pulse
149  do {
150  const SimRadioPulse& srpulse = rsim.GetNextSimRadioPulse(ok);
151 
152  // leave the loop if there were no further SimRadioPulses
153  if (!ok)
154  break;
155 
156  srpulse.SetLocalCoordinateSystem(pulsecorsys);
157 
158  // check if there is a station in the close vicinity of the SimRadioPulse
159  const utl::Point loc = srpulse.GetLocation();
160  const int statID = FindClosestStationFromPoint(loc, radioDet, 1);
161 
162  if (statID != -1) {
163  out.str("");
164  out << "associated station " << statID << " ("
165  << (radioDet.GetStation(statID).GetPosition() - loc).GetMag() / meter << " m)";
166  INFODebug(out);
167  } else {
168  out.str("");
169  out << "Did not find any station at position ("
170  << loc.GetX(corsys) << ", " << loc.GetY(corsys) << ", " << loc.GetZ(corsys) << ")";
171  INFOFinal(out);
172 
173  // if there was no station corresponding to the current SimRadioPulse, go to next SimRadioPulse
174  continue;
175  }
176 
177  // if station id is listed in fExcludedStationIds, skip this simulated radio pulse
178  // (it will not be re-used for the second-closest antenna station!)
179  if (!fExcludedStationIds.empty())
180  if (find(fExcludedStationIds.begin(), fExcludedStationIds.end(), statID) != fExcludedStationIds.end()) {
181  out.str("");
182  out << "Station " << statID << " not associated as it is in the exclude list.";
183  INFOFinal(out);
184  continue;
185  }
186 
187  // if there is a list of fIncludedStationIds skip this simulated radio pulse if station id is not in the list
188  if (!fIncludedStationIds.empty()) {
189  if (find(fIncludedStationIds.begin(), fIncludedStationIds.end(), statID) == fIncludedStationIds.end()) {
190  out.str("");
191  out << "Station " << statID << " not associated as it is not in the include list.";
192  INFOFinal(out);
193  continue;
194  }
195  }
196 
197  // If a station does not have a valid detector describtion == not at least two AntennaHighGain channel, skip it
198  // (will not be added to the event). It can happen that such stations are simulated for real events while
199  // their real conterpart is not taken data.
200  const auto& station = radioDet.GetStation(statID);
201  const unsigned int numberOfValidConfiguredChannel = count_if(station.ChannelsBegin(), station.ChannelsEnd(),
202  [&](auto const& channel) { return channel.GetChannelType() == "AntennaHighGain"; }
203  );
204 
205  if (numberOfValidConfiguredChannel < 2) {
206  out.str("");
207  out << "Station " << statID << " is not associated with a pulse as"
208  << " its description is incomplete! (Does not has two channel with type: \"AntennaHighGain\"";
209  WARNING(out);
210  continue;
211  }
212 
213  // Create all SD stations already here if you activated the RD triggering.
214  // Otherwise you can get errors during SD Reconstruction
215  if (fCreateAllSDStationsWithRDTrace) {
216  const int sStID = statID - radioDet.GetRdSdStationIdLink();
217 
218  sevt::SEvent& sEvent = theevent.GetSEvent();
219  if (!sEvent.HasStation(sStID)) {
220  sEvent.MakeStation(sStID);
221  sEvent.GetStation(sStID).MakeSimData();
222  }
223  }
224 
225  // otherwise, fill SimRadioPulse into the associated station
226  therev.MakeStation(statID); // Create a new Station, already checks if the station exists
227  auto& stat = therev.GetStation(statID);
228 
229  // create data structures
230  stat.MakeGPSData(); // should check before if exists?
231  stat.MakeTriggerData(); // should check before if exists?
232  stat.MakeSimData(); // should check before if exists?
233 
234  const auto& simtimeseries = srpulse.GetEfieldTimeSeries();
235 
236  // maybe have to check if there is data already and throw an exception?
237  auto& statTimeSeries = stat.GetStationTimeSeries();
238 
239  // fill the Station SimData TimeSeries with the (unpadded) simulated time series data
240  stat.GetSimData().SetSimulatedTrace(simtimeseries);
241 
242  // copy over the simtimeseries to the Station TimeSeries, padding appropriately at the front
243  Vector3D v3DZero;
244  v3DZero = 0.0, 0.0, 0.0;
245 
246  const double binning = simtimeseries.GetBinning();
247  statTimeSeries.SetBinning(binning);
248  long numpaddedsamples = static_cast<long>(fTracePaddingAtFront / binning + 0.5);
249 
250  // set the start time of the station trace, taking into account the front padding appropriately
251  stat.SetRawTraceStartTime(therev.GetHeader().GetTime()
252  + TimeInterval(srpulse.GetStartTime() - numpaddedsamples * binning));
253 
254  // pad the station time series trace at the front
255  for (long i = 0; i < numpaddedsamples; ++i)
256  statTimeSeries.PushBack(v3DZero);
257 
258  out.str("");
259  out << "sim time series has size " << simtimeseries.GetSize();
260  INFODebug(out);
261 
262  // copy over the simulated trace
263  for (const auto& el : simtimeseries)
264  statTimeSeries.PushBack(el);
265 
266  /* Extrapolating the tail of the sim. pulse (for each polarisation) migh be nessecary because
267  the pulse has not converged to 0 in the time window it was simulated. This introduces a cut-off when
268  padded with zeros at the end. Bandpass filtered, this cutoff can look like a regular pulse. With the
269  extrapolation the pulse amplitude can be brought close to 0 before padding */
270  if (fExtrapolateTheTailOfThePulses) {
271  unsigned int fitRangeStart = statTimeSeries.GetSize() - int((50 * utl::ns) / binning);
272 
273  vector<double> vPowerOrig{0, 0, 0}; // to compare with extrapolated trace
274  vector<vector<double>> extraPulse;
275 
276  for (unsigned int pol = 0; pol < 3; pol++) {
277  vector<pair<double, double>> fitData;
278 
279  for (unsigned int sample = 0; sample < statTimeSeries.GetSize(); ++sample) {
280  vPowerOrig.at(pol) += Sqr(statTimeSeries[sample][pol]);
281  if (sample >= fitRangeStart)
282  fitData.emplace_back(sample * binning, move(statTimeSeries[sample][pol]));
283  }
284 
285  // Initalize parameters (WARNING: Take care of correct ordering)
286  vector<utl::Minou::ParameterDef> parameters;
287  // name, value, step, min, max, fixed
288  parameters.emplace_back("a", fitData[0].second, 1e-6, -1, 1, false);
289  parameters.emplace_back("b", -5e-3, 1e-3, -1, -1e-3, false);
290 
291  ExpoTail eT(parameters);
292  eT.Setx0(fitRangeStart * binning);
293  eT.SetData(fitData);
295  min.Minimize();
296 
297  const auto result = min.GetParameters();
298  if (result.at(1) >= -1.00001e-3)
299  ERROR("Extrapolating the radio pulse, slope at bondary");
300 
301  vector<double> extraPulsePol;
302  for (int sample = 0; sample < int(2000 * utl::ns / binning); ++sample) {
303  double time = (statTimeSeries.GetSize() + sample) * binning;
304  extraPulsePol.push_back(eT.GetY(time, result));
305  }
306  extraPulse.push_back(extraPulsePol);
307  }
308 
309  Vector3D v3D;
310  for (int sample = 0; sample < int(2000 * utl::ns / binning); ++sample) {
311  v3D = extraPulse.at(0).at(sample), extraPulse.at(1).at(sample), extraPulse.at(2).at(sample);
312  statTimeSeries.PushBack(v3D);
313  }
314 
315  for (unsigned int pol = 0; pol < 3; pol++) {
316  double powerExt = 0;
317  for (const auto& el : statTimeSeries)
318  powerExt += Sqr(el[pol]);
319 
320  if ((fabs(powerExt / vPowerOrig.at(pol) - 1) > 0.1) &&
321  (vPowerOrig.at(pol) * binning * kConversionRadioSignalToEnergyFluence > 1 * utl::eV / utl::m2)) {
322  out.str("");
323  out << "Due to the extrapolation of the pulse tail, the power (i.e., sum over squared amplitudes) "
324  << "changed by more than 10%. Please be cautious. Station: "
325  << statID << ", Polarisation: " << pol << ": (extrapolated/original) "
326  << powerExt << " / " << vPowerOrig.at(pol) << " = " << powerExt / vPowerOrig.at(pol);
327  WARNING(out);
328  }
329  }
330  }
331 
332  /* Check amplitudes at the end of the pulse, the amplitudes should be close to zero.
333  See also the comment above for fExtrapolateTheTailOfThePulses == True */
334  Trace<double> statTimeSeriesMag;
335  statTimeSeriesMag.SetBinning(statTimeSeries.GetBinning());
336  for (const auto& el : statTimeSeries)
337  statTimeSeriesMag.PushBack(el.GetMag());
338 
339  const double noiseRMS = TraceAlgorithm::RootMeanSquare(statTimeSeriesMag,
340  statTimeSeriesMag.GetSize() - int(20 * utl::ns / binning), statTimeSeriesMag.GetSize() - 1);
341  if (noiseRMS > 50 * utl::microvolt) {
342  out.str("");
343  out << "Found a RMS amplitude of " << noiseRMS / utl::microvolt
344  << " muV/m in the last 20ns of the simulated pulse. "
345  << "Such a cutoff might introduces a second pulse. "
346  << "Condider using fExtrapolateTheTailOfThePulses";
347  WARNING(out);
348  }
349 
350  out.str("");
351  out << "station time series has size " << statTimeSeries.GetSize();
352  INFODebug(out);
353 
354  // now pad the station trace at the end up to the given minimum trace length
355  while ((fMinimumTraceLength - statTimeSeries.GetSize() * binning) > 1e-6)
356  statTimeSeries.PushBack(v3DZero);
357 
358  // if number of samples is uneven after padding, pad one more sample
359  // (otherwise it will again be clipped at the next FFT)
360  if (statTimeSeries.GetSize() % 2 == 1)
361  statTimeSeries.PushBack(v3DZero);
362 
363  } while (true);
364 
365  // add empty stations with empty trace for stations that do not have been simulated but where
366  // no signal is expected -> trace of zeros can be added
367  if (fAddNoSignalStations) {
368  unsigned numberOfEmptyButTriggeredRDStations = 0;
369 
370  for (const auto& station : radioDet.StationsRange()) {
371  const unsigned int rdId = station.GetId();
372 
373  if (!fExcludedStationIds.empty()) {
374  if (find(fExcludedStationIds.begin(), fExcludedStationIds.end(), station.GetId()) != fExcludedStationIds.end())
375  continue;
376  }
377 
378  if (!therev.HasStation(rdId)) { // check is station has no data yet
379  utl::Point positionStat = station.GetPosition();
380  utl::Vector mcAxis = -1 * simshow.GetDirection();
381  const Point& mcCore = simshow.GetPosition();
382 
383  const double dist = RadioGeometryUtilities::GetDistanceToAxis(
384  mcAxis, mcCore, positionStat);
385 
386  if (fAddEmptyTriggeredRDStations) {
387  const int sStID = rdId - radioDet.GetRdSdStationIdLink();
388 
389  const sevt::SEvent& sEvent = theevent.GetSEvent();
390  if (!sEvent.HasStation(sStID) || !sEvent.GetStation(sStID).HasTriggerData())
391  continue; // skip this station
392 
393  const auto& trig = sEvent.GetStation(sStID).GetTriggerData();
394  if (!trig.IsT2() && !trig.IsT1())
395  // This is not equal to station.IsSilent() but this is desired here
396  continue; // skip this station
397 
398  // the station is being added
399  numberOfEmptyButTriggeredRDStations++;
400  } else {
401  // decide upon distance
402  if (dist > fMaximumDistanceOfNoSignalStations)
403  continue; // skip this station
404  }
405 
406  therev.MakeStation(rdId); // Create a new Station, already checks if the station exists
407  revt::Station& stat = therev.GetStation(rdId);
408 
409  // create data structures
410  stat.MakeGPSData(); // should check before if exists?
411  stat.MakeTriggerData(); // should check before if exists?
412  stat.MakeSimData(); // should check before if exists?
413 
414  // maybe have to check if there is data already and throw an exception?
415  auto& statTimeSeries = stat.GetStationTimeSeries();
416 
417  Vector3D v3DZero;
418  v3DZero = 0.0, 0.0, 0.0;
419 
420  // hardcoded binning of 1ns, will anyway be resampled to detector sampling
421  const double binning = 1 * utl::ns;
422  statTimeSeries.SetBinning(binning);
423 
424  out.str("");
425  out << "adding zero trace to station " << rdId;
426  INFODebug(out);
427 
428  for(unsigned int i=0; i < (fMinimumTraceLength / binning); ++i) {
429  statTimeSeries.PushBack(v3DZero);
430  }
431 
432  // if number of samples is uneven after padding, pad one more sample
433  // (otherwise it will again be clipped at the next FFT)
434  if (statTimeSeries.GetSize() % 2 == 1) {
435  statTimeSeries.PushBack(v3DZero);
436  }
437 
438  // Calculating expected pulse time if event had a pulse. the trace start time is then set,
439  // so that this time is within the trace
440  const CoordinateSystemPtr coreCS = LocalCoordinateSystem::Create(mcCore);
441 
442  // calculate Rd station distance to Sd core
443  const Vector VecDistanceToSdCore = positionStat - mcCore;
444 
445  // project the vector on shower direction
446  const double projVec = -mcAxis.GetX(coreCS) * VecDistanceToSdCore.GetX(coreCS)
447  - mcAxis.GetY(coreCS) * VecDistanceToSdCore.GetY(coreCS)
448  - mcAxis.GetZ(coreCS) * VecDistanceToSdCore.GetZ(coreCS);
449 
450  // calculate expected pulse arrival time
451  const TimeInterval relativePulseTime = projVec / (kSpeedOfLight) - fTracePaddingAtFront;
452 
453  out.str("");
454  out << "Set relative pulse time of noSignalStation to " << relativePulseTime
455  << " relative to rd event time";
456  INFODebug(out);
457 
458  const TimeStamp traceStartTime = therev.GetHeader().GetTime() + relativePulseTime;
459  stat.SetRawTraceStartTime(traceStartTime);
460 
461  out.str("");
462  out << "created empty trace with " << statTimeSeries.GetSize() << " samples";
463  INFODebug(out);
464  }
465  }
466 
467  INFOIntermediate(out);
468 
469  if (numberOfEmptyButTriggeredRDStations) {
470  out.str("");
471  out << numberOfEmptyButTriggeredRDStations
472  << " empty traces have been add for triggered but not simulated RD stations.";
473  INFO(out);
474  }
475 
476  }
477 
478  return eSuccess;
479  }
480 
481 
483  RdStationAssociator::Finish()
484  {
485  return eSuccess;
486  }
487 
488 
489  int
490  RdStationAssociator::FindClosestStationFromPoint(const utl::Point& pt,
491  const rdet::RDetector& rDet,
492  double maxDistanceFactor)
493  {
494  double dist = 0; // distance between point and station
495  double foundmindist = fMaximumDistance * maxDistanceFactor;
496  int stid = -1;
497 
498  for (const auto& station : rDet.StationsRange()) {
499  const utl::Point Position = station.GetPosition();
500 
501  dist = (Position - pt).GetMag();
502  if (dist < foundmindist) {
503  stid = station.GetId(); // make current station the closest one
504  foundmindist = dist;
505  }
506  }
507 
508  return stid;
509  }
510 
511 
512  void
513  RdStationAssociator::AddVirtualStations(evt::Event& event, utl::CoordinateSystemPtr corsys)
514  const
515  {
516  // initialize starshaped station with id (without proper position)
517  INFODebug("Use RdStationAssociator to create generic (starshaped) stations.");
518  ostringstream out;
519 
520  Detector& det = Detector::GetInstance();
521 
524  (det.GetRManagerRegister().GetManager("RSimulationStationListManager"));
525 
526  if (!event.HasSimShower()) {
527  const string err = "Attempt to generate radio array with starshaped pattern failed because "
528  "no simulated shower is present in the event.";
529  throw MissingEventDataException(err);
530  }
531 
532  const string fEllipsoid_string = "WGS84";
533  const string fBand = "H";
534  const int fZone = 19;
535 
537  ReferenceEllipsoid::GetEllipsoidIDFromString(fEllipsoid_string));
538 
539  RadioSimulation& radiosim = event.GetSimShower().GetRadioSimulation();
540  const int numberOfAntennas = radiosim.GetNumPulses();
541  unsigned int nstat = 0;
542  // starting station id, increment ids from that on
543  for (int stationId = fFirstStationId; stationId < fFirstStationId + numberOfAntennas; stationId++) {
544 
546  station.fSource = "XML";
547 
548  station.fId = stationId;
549  station.fCommissionTime = "2000-01-01T00:00:00Z";
550  station.fDecommissionTime = "2030-01-01T00:00:00Z";
551  station.fNChannels = 2;
552  station.fFirstChannelId = 0;
553  station.fLastChannelId = 1;
554  station.fEllipsoid = fEllipsoid_string;
555  station.fBand = fBand;
556  station.fZone = fZone;
557 
558  station.fIsVirtual = 1;
559 
560  // get index of pulse -> accosciation between arbitary station and pulse
561  // the RdStationAssociator will make sure that everything is fine
562  // however once a station id is accoiated with a pulse index this should not change!
563  const int pulseIndex = stationId - fFirstStationId;
564 
565  if (radiosim.HasSimPulseByIndex(pulseIndex)) {
566  // if the station was initialized as starshaped station
567  const SimRadioPulse& srpulse = radiosim.GetSimPulseByIndex(pulseIndex); // get specific SimRadioPulse
568  srpulse.SetLocalCoordinateSystem(corsys);
569  const Point pos = srpulse.GetLocation();
570  const UTMPoint stationUTM(pos, ellipsoid);
571 
572  station.fNorthing = stationUTM.GetNorthing();
573  station.fEasting = stationUTM.GetEasting();
574  station.fAltitude = stationUTM.GetHeight();
575  station.fName = srpulse.GetAntennaName();
576 
577  listManager.AddVirtualStation(station);
578  nstat++;
579  } else {
580  ERROR("Something went wrong during reading of virtual stations");
581  }
582 
583  }
584 
585  // Force update of the RDetector after virtual stations were added to RStationListManager
586  det.Update(det.GetTime(), false, false, true);
587 
588  out.str("");
589  out << "Initialized " << nstat << " virtual stations.";
590  INFO(out);
591  }
592 
593 }
Branch GetTopBranch() const
Definition: Branch.cc:63
void Update(const utl::TimeStamp &time, const bool invData=true, const bool invComp=true, const bool forceRadio=false)
Update detector: deletes currently constructed stations and sets new time.
Definition: Detector.cc:179
constexpr double eV
Definition: AugerUnits.h:185
ManagerRegister & GetRManagerRegister() const
Definition: Detector.h:99
constexpr T Sqr(const T &x)
Point object.
Definition: Point.h:32
bool HasStation(const int stationId) const
Check whether station exists.
Definition: SEvent.cc:81
double GetY(double x, const std::vector< double > &p) const
constexpr double km
Definition: AugerUnits.h:125
void MakeSimData()
Make station simulated data object.
const SimRadioPulse & GetSimPulseByIndex(const int index)
Interface class to access to the Radio part of an event.
Definition: REvent.h:42
Interface class to access to the SD part of an event.
Definition: SEvent.h:39
std::string GetAntennaName() const
Get the name of simulated antenna related to pulse.
Definition: SimRadioPulse.h:68
utl::TimeStamp GetTime() const
Get time pertaining to the detector description.
Definition: Detector.h:134
Class to hold and convert a point in geodetic coordinates.
Definition: UTMPoint.h:40
void MakeSimData()
Make station simulated data object.
bool HasTriggerData() const
Check whether trigger data object exists.
Data structure for simulated Radio pulses.
Definition: SimRadioPulse.h:29
utl::TimeStamp GetTime() const
Definition: REvent/Header.h:17
EventTrigger & GetTrigger()
Get the object with central trigger data, throw if n.a.
Definition: REvent.h:229
bool HasSimShower() const
Data structure for a radio simulation (including several SimRadioPulses)
const double meter
Definition: GalacticUnits.h:29
#define INFO(message)
Macro for logging informational messages.
Definition: ErrorLogger.h:161
utl::Point GetLocation() const
Definition: SimRadioPulse.h:51
void Init()
Initialise the registry.
constexpr double m2
Definition: AugerUnits.h:122
revt::REvent & GetREvent()
vector< t2list > out
output of the algorithm: a list of clusters
Definition: XbAlgo.cc:32
bool ok(bool okay)
Definition: testlib.cc:89
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
Definition: Branch.cc:211
bool HasREvent() const
Station & GetStation(const int stationId)
retrieve station by id throw utl::NonExistentComponentException if n.a.
Definition: REvent.h:190
double GetNorthing() const
Get the northing.
Definition: UTMPoint.h:206
StationTimeSeries & GetStationTimeSeries()
retrieve Station Time Series (write access, only use this if you intend to change the data) ...
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
void SetTime(const utl::TimeStamp &time)
Version of the AERAEvent used by the DAQ software.
Definition: REvent/Header.h:27
Detector description interface for RDetector-related data.
Definition: RDetector.h:46
void MakeGPSData()
Make GPS data object.
void MakeTriggerData()
Make trigger data object.
void SetLocalCoordinateSystem(utl::CoordinateSystemPtr localCS) const
Definition: SimRadioPulse.h:70
void SetExternalTrigger(const bool trig)
Set if Event was externally triggered.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
#define INFOIntermediate(y)
Definition: VModule.h:162
Class representing a document branch.
Definition: Branch.h:107
class to hold data at the radio Station level.
Reference ellipsoids for UTM transformations.
void SetRawTraceStartTime(const utl::TimeStamp &time)
Set absolute start time of the station-level trace as originally provided in raw data, for reconstructions use eTraceStartTime in StationRecData!
double GetHeight() const
Get the height.
Definition: UTMPoint.h:212
double GetX(const CoordinateSystemPtr &coordinateSystem) const
Definition: BasicVector.h:206
void AddVirtualStation(RStationListManager::StationData &station)
void MakeTrigger()
Create the central trigger object.
Definition: REvent.cc:174
RadioSimulation & GetRadioSimulation()
Get the radio simulation data.
constexpr double nanosecond
Definition: AugerUnits.h:143
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
get local coordinate system anchored at the core position
const Data result[]
Header & GetHeader()
access to REvent Header
Definition: REvent.h:239
Top of the hierarchy of the detector description interface.
Definition: Detector.h:81
const double second
Definition: GalacticUnits.h:32
ShowerSimData & GetSimShower()
double GetEasting() const
Get the easting.
Definition: UTMPoint.h:209
static std::size_t GetSize()
Definition: SVector.h:41
SizeType GetSize() const
Definition: Trace.h:156
void MakeStation(const int stationId)
make a station with specifying Id, throw if invalid stationId
Definition: SEvent.cc:65
#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
#define INFODebug(y)
Definition: VModule.h:163
Station & GetStation(const int stationId)
retrieve station by id throw utl::NonExistentComponentException if n.a.
Definition: SEvent.h:116
constexpr double microvolt
Definition: AugerUnits.h:231
Manager for RD description in SQL or XML station lists.
const VManager & GetManager(const std::string &managerName) const
Get a specific manager by name.
void SetData(std::vector< std::pair< double, double >> data)
void SetBinning(const double binning)
Definition: Trace.h:139
Base class for exceptions arising because required info not present in the Event. ...
double GetY(const CoordinateSystemPtr &coordinateSystem) const
Definition: BasicVector.h:209
constexpr double kSpeedOfLight
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
int Minimize(const int n=500)
Definition: Minou.h:250
void SetId(const int id)
Definition: REvent/Header.h:28
Vector object.
Definition: Vector.h:30
bool HasSimPulseByIndex(const int index)
constexpr double kConversionRadioSignalToEnergyFluence
void SetRunNumber(const int run)
Definition: REvent/Header.h:32
constexpr double ns
Definition: AugerUnits.h:162
utl::CoordinateSystemPtr Get(const std::string &id)
Get a well-known Coordinate System.
sevt::StationTriggerData & GetTriggerData()
Get Trigger data for the station.
long GetNumPulses() const
Get the number of radio pulses contained in the RadioSimulation.
bool HasStation(const int stationId) const
Check whether station exists.
Definition: REvent.cc:132
double GetZ(const CoordinateSystemPtr &coordinateSystem) const
Definition: BasicVector.h:212
#define INFOFinal(y)
Definition: VModule.h:161
void PushBack(const T &value)
Insert a single value at the end.
Definition: Trace.h:119
#define ERROR(message)
Macro for logging error messages.
Definition: ErrorLogger.h:165
const utl::TraceV3D & GetEfieldTimeSeries() const
Get the Trace of the simulated electric field.
Definition: SimRadioPulse.h:44
void MakeStation(const int stationId)
make a station with specifying Id, throw if invalid stationId
Definition: REvent.cc:94
sevt::SEvent & GetSEvent()
bool HasSEvent() const
double GetStartTime() const
Get the timestamp of the first sample.
Definition: SimRadioPulse.h:39

, generated on Tue Sep 26 2023.