3 #include <fwk/CentralConfig.h>
5 #include <det/Detector.h>
6 #include <rdet/RDetector.h>
8 #include <utl/Branch.h>
9 #include <utl/ErrorLogger.h>
10 #include <utl/RadioGeometryUtilities.h>
11 #include <utl/CoordinateSystem.h>
12 #include <utl/Point.h>
14 #include <evt/Event.h>
15 #include <evt/RadioSimulation.h>
16 #include <evt/ShowerSimData.h>
18 #include <revt/REvent.h>
19 #include <revt/Station.h>
21 #include <sevt/SEvent.h>
22 #include <sevt/StationTriggerData.h>
38 const Branch topB = CentralConfig::GetInstance()->
GetTopBranch(
"RdStationSimulationRejector");
40 topB.
GetChild(
"RejectStationAffectedByThinning").
GetData(fRejectStationAffectedByThinning);
41 topB.
GetChild(
"RemoveNonTriggeredRdStationsFromEvent").
GetData(fRemoveNonTriggeredRdStationsFromEvent);
44 info <<
"Module config:"
45 <<
"\n\tReject station affected by thinning: " << fRejectStationAffectedByThinning
46 <<
"\n\tReject RD station when WCD is not triggered: " << fRemoveNonTriggeredRdStationsFromEvent;
54 RdStationSimulationRejector::Run(
Event& event)
59 REvent& rEvent =
event.GetREvent();
60 const Detector& detector = Detector::GetInstance();
63 unsigned int numberOfNotTriggeredRDStations = 0;
64 unsigned int numberOfAcceptedStations = 0;
67 for (
auto& station : rEvent.StationsRange()) {
68 const int rStationID = station.GetId();
78 info <<
"Not add RD station " << rStationID
79 <<
". No corresponding SD station in has trigger data.";
81 ++numberOfNotTriggeredRDStations;
87 if (!trig.IsT2() && !trig.IsT1()) {
89 info <<
"Not add RD station " << rStationID
90 <<
". No corresponding SD station in has trigger data.";
92 ++numberOfNotTriggeredRDStations;
98 if (fRejectStationAffectedByThinning) {
105 const double zenith = refShowerAxis.
GetTheta(corsys);
108 if (zenith > 65*
deg) {
110 const double maximumAllowedDistance = RdStationSimulationRejector::thinning_distance(zenith);
113 const double axisDistance = RadioGeometryUtilities::GetDistanceToAxis(refShowerAxis, simCore, Position);
116 if (axisDistance > maximumAllowedDistance) {
118 info <<
"Station " << rStationID <<
" excluded because of thinning:";
123 numberOfAcceptedStations++;
127 if (numberOfAcceptedStations / rsim.
GetNumPulses() < 0.3) {
128 WARNING(
"A lot of stations have been excluded due to the thinning cut.\n"
129 "Please check if the core definition (e.g. SimShowerData or RadioSimulation core) is correct!");
134 if (numberOfNotTriggeredRDStations) {
136 info << numberOfNotTriggeredRDStations <<
" RD stations have not been triggered.";
145 RdStationSimulationRejector::Finish()
Branch GetTopBranch() const
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
Get the Auger coordinate system associated to the shower core position.
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.
double GetTheta(const CoordinateSystemPtr &coordinateSystem) const
zenith (theta) angle in spherical coordinates
bool HasTriggerData() const
Check whether trigger data object exists.
Data structure for a radio simulation (including several SimRadioPulses)
#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.
Detector description interface for RDetector-related data.
Interface class to access Shower Simulated parameters.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Class representing a document branch.
int GetRdSdStationIdLink() const
Get Rd - Sd Station Id link.
const utl::Vector & GetDirection() const
Get the direction of the shower axis. This is the true direction of shower movement.
RadioSimulation & GetRadioSimulation()
Get the radio simulation data.
const utl::Point & GetPosition() const
Get the position of the shower core.
Top of the hierarchy of the detector description interface.
#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.
ResultFlag
Flag returned by module methods to the RunController.
Station Trigger Data description
const rdet::RDetector & GetRDetector() const
sevt::StationTriggerData & GetTriggerData()
Get Trigger data for the station.
long GetNumPulses() const
Get the number of radio pulses contained in the RadioSimulation.
utl::Point GetPosition() const
Tank position in Site Cartesian Coordinates.
const Station & GetStation(const int stationId) const
Get station by Station Id.