3 #include <fwk/CentralConfig.h>
4 #include <fwk/RandomEngineRegistry.h>
7 #include <revt/REvent.h>
8 #include <revt/Station.h>
9 #include <revt/StationRecData.h>
11 #include <det/Detector.h>
12 #include <rdet/RDetector.h>
13 #include <sdet/SDetector.h>
15 #include <sevt/SEvent.h>
16 #include <sevt/Station.h>
17 #include <sevt/StationSimData.h>
19 #include <utl/AugerUnits.h>
20 #include <utl/Branch.h>
21 #include <utl/RandomEngine.h>
23 #include <CLHEP/Random/RandGauss.h>
30 using CLHEP::RandGauss;
42 info <<
"\n\t RdTimeJitterAdder is set up with sigma of " << fSigma /
ns <<
" ns.\n";
56 WARNING(
"No radio event found!");
60 REvent& rEvent =
event.GetREvent();
63 for (
auto& station : rEvent.StationsRange()) {
65 if (!station.HasRecData()) {
67 error <<
"Station " << station.GetId() <<
" does not have rec data.";
74 error <<
"Station " << station.GetId() <<
" does not have Parameter eTraceStartTime set!";
86 const int stationId = station.GetId();
87 const int rdSdStationIdLink = det::Detector::GetInstance().GetRDetector().GetRdSdStationIdLink();
89 if (stationId > rdSdStationIdLink) {
93 if (sEvent.
HasStation(stationId - rdSdStationIdLink)) {
97 const double traceStartTime = sRec.
GetParameter(eTraceStartTime);
99 const double timingUncertainty =
100 det::Detector::GetInstance().GetSDetector().GetStation(stationId - rdSdStationIdLink).GetTimingUncertainty();
103 sRec.
SetParameter(eTraceStartTime, traceStartTime + timeJitter,
false);
115 const double mean = 0;
116 const double traceStartTime = sRec.
GetParameter(eTraceStartTime);
117 const double jitter = RandGauss::shoot(fRandomEngine, mean, fSigma);
120 sRec.
SetParameter(eTraceStartTime, traceStartTime + jitter,
false);
133 RdTimeJitterAdder::Finish()
Class to access station level reconstructed data.
void SetParameterError(Parameter i, double value, bool lock=true)
bool HasStation(const int stationId) const
Check whether station exists.
Interface class to access to the Radio part of an event.
Interface class to access to the SD part of an event.
#define INFO(message)
Macro for logging informational messages.
void Init()
Initialise the registry.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
Class representing a document branch.
class to hold data at Station level
bool HasSimData() const
Check whether station simulated data exists.
#define WARNING(message)
Macro for logging warning messages.
void GetData(bool &b) const
Overloads of the GetData member template function.
Station & GetStation(const int stationId)
retrieve station by id throw utl::NonExistentComponentException if n.a.
utl::TimeInterval GetAbsoluteTimeOffset() const
double GetParameter(const Parameter i) const
ResultFlag
Flag returned by module methods to the RunController.
bool HasParameter(const Parameter i) const
static CentralConfig * GetInstance()
Use this the first time you get an instance of central configuration.
void SetParameter(Parameter i, double value, bool lock=true)
sevt::StationSimData & GetSimData()
Get simulated data at station level.
#define ERROR(message)
Macro for logging error messages.
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)