RdStationPolarizationRejector.h
Go to the documentation of this file.
1 #ifndef _RdStationPolarizationRejector_RdStationPolarizationRejector_h_
2 #define _RdStationPolarizationRejector_RdStationPolarizationRejector_h_
3 
4 #include <fwk/VModule.h>
5 
6 #include <utl/Vector.h>
7 #include <utl/Point.h>
8 #include <utl/CoordinateSystem.h>
9 #include <utl/RadioGeometryUtilities.h>
10 
11 namespace evt {
12 
13  class ShowerRRecData;
14 
15 }
16 
18 
29 
30  public:
31 
32  fwk::VModule::ResultFlag Init() override;
33  fwk::VModule::ResultFlag Run(evt::Event& event) override;
35 
36  void SetMaxChargeExcess(double aMax) { fMaxChargeExcess = aMax; }
37  void SetMinChargeExcess(double aMin) { fMinChargeExcess = aMin; }
38 
39  double GetProbability() { return fProbability; }
40  void SetProbability(double prob);
41 
42  void GetCovarianceMatrix(const evt::Event& event, double covarianceMatrix[3], const evt::ShowerRRecData& rShower,
43  const utl::CoordinateSystemPtr& cs);
44  TVector3 GetStationPositionvxBvxvxB(const utl::Point stationPosition, const utl::Point& corePosition,
46  void GetLocalPolMaxima(double& pol1, double& pol2, const double angleToMagneticField, double maxChargeExcess);
47 
48  private:
49 
50  bool fConstantChargeExcess = false;
51  double fMaxChargeExcess = 0; //maximal acceptable charge excess strength
52  double fMinChargeExcess = 0; //minimal acceptable charge excess strength
53  double fProbability = 0; //percentile of region around SD core position
54  double fChiSquared = 0; //set depending on fProbability
55  double fMaxBeta = 0; //maximum discrepancy between expected and measured polarization with which a station is accepted immediately
56  double fMaxSigmaBeta = 0;
57  bool fZenithCut = false; //If set to true, polarization rejection will only be performed for reasonable zenith angles
59 
60  //storing charge excess limits
61  double fMaxChargeExcess30[20] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.45, 0.38, 0.34, 0.32, 0.29,
62  0.21, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3 };
63  double fMinChargeExcess30[20] = { 0.0, 0.1, 0.1, 0.08, 0.05, 0.02, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0,
64  0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
65  double fMaxChargeExcess40[20] = { 0.37, 0.37, 0.32, 0.32, 0.33, 0.33, 0.33, 0.35, 0.35, 0.31,
66  0.31, 0.28, 0.25, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3 };
67  double fMinChargeExcess40[20] = { 0.0, 0.09, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.05, 0.05, 0.05, 0.0,
68  0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
69  double fMaxChargeExcess50[20] = { 0.25, 0.25, 0.25, 0.25, 0.26, 0.3, 0.3, 0.35, 0.35, 0.33, 0.33,
70  0.32, 0.32, 0.24, 0.24, 0.23, 0.22, 0.22, 0.22, 0.22 };
71  double fMinChargeExcess50[20] = { 0.0, 0.0, 0.0, 0.0, 0.05, 0.05, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
72  0.1, 0.05, 0.05, 0.0, 0.0, 0.0, 0.0, 0.0 };
73  double fMaxChargeExcess60[20] = { 0.03, 0.03, 0.05, 0.08, 0.1, 0.12, 0.13, 0.15, 0.17, 0.18, 0.19,
74  0.2, 0.2, 0.2, 0.21, 0.21, 0.22, 0.22, 0.21, 0.21 };
75  double fMinChargeExcess60[20] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
76  0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
77  double fMaxZenith[12] = { 60. * utl::degree, 70. * utl::degree, 70. * utl::degree, 70. * utl::degree,
78  70. * utl::degree, 60. * utl::degree, 50. * utl::degree, 50. * utl::degree,
79  50. * utl::degree, 50. * utl::degree, 50. * utl::degree, 50. * utl::degree };
80 
81  void GetCoreErrorEllipsevxBvxvxB(TVector3& semiMajorAxisvxBvxvxB, TVector3& semiMinorAxisvxBvxvxB,
82  double& rotationAngleInVxB, const utl::Point& semiMajorAxis,
83  const utl::Point& semiMinorAxis, const utl::Point& corePosition,
84  const utl::RadioGeometryUtilities& rdGeometryUtilities);
85 
86  void GetCoreErrorEllipse(utl::Point& semiMajorAxis, utl::Point& semiMinorAxis, const utl::Point& corePosition,
87  const double covarianceMatrix[3], const utl::CoordinateSystemPtr& cs);
88 
89  bool IsStationInErrorEllipse(const TVector3& stationPositionvxBvxvxB, const TVector3& semiMajorAxisVxB,
90  const TVector3& semiMinorAxisVxB, const double rotationAngle);
91 
92  void GetErrorEllipseTangentPoints(TVector3& ellipseTangentPoint1, TVector3& ellipseTangentPoint2,
93  const TVector3& stationPositionvxBvxvxB, const TVector3& semiMajorAxisVxB,
94  const TVector3& semiMinorAxisVxB, const double rotationAngle);
95 
96  double GetTangentPol(const TVector3& stationPositionvxBvxvxB, const TVector3& tangentPoint,
97  const double chargeExcess, const double angleToMagneticField);
98 
99  TVector3 GetEfieldInShowerPlane(const utl::Vector& efield, const utl::CoordinateSystemPtr& cs,
100  const utl::RadioGeometryUtilities& rdGeometryUtilities);
101 
102  double GetPolAngleUncertainty(const double signalToNoise, const TVector3 efield,
103  const double noiseVxB, const double noiseVxVxB);
104 
105  double GetMaxChargeExcess(const double zenith, const double distToAxis, const double semiMajorAxisLength);
106  double GetMinChargeExcess(const double zenith, const double distToAxis, const double semiMajorAxisLength);
107 
108  bool CheckZenith(const double zenith, const double azimuth);
109 
110  REGISTER_MODULE("RdStationPolarizationRejector", RdStationPolarizationRejector);
111  };
112 
113 }
114 
115 #endif
Point object.
Definition: Point.h:32
double GetPolAngleUncertainty(const double signalToNoise, const TVector3 efield, const double noiseVxB, const double noiseVxVxB)
TVector3 GetEfieldInShowerPlane(const utl::Vector &efield, const utl::CoordinateSystemPtr &cs, const utl::RadioGeometryUtilities &rdGeometryUtilities)
void GetCovarianceMatrix(const evt::Event &event, double covarianceMatrix[3], const evt::ShowerRRecData &rShower, const utl::CoordinateSystemPtr &cs)
void GetCoreErrorEllipse(utl::Point &semiMajorAxis, utl::Point &semiMinorAxis, const utl::Point &corePosition, const double covarianceMatrix[3], const utl::CoordinateSystemPtr &cs)
void GetErrorEllipseTangentPoints(TVector3 &ellipseTangentPoint1, TVector3 &ellipseTangentPoint2, const TVector3 &stationPositionvxBvxvxB, const TVector3 &semiMajorAxisVxB, const TVector3 &semiMinorAxisVxB, const double rotationAngle)
Interface class to access to the RD Reconstruction of a Shower.
double GetMinChargeExcess(const double zenith, const double distToAxis, const double semiMajorAxisLength)
REGISTER_MODULE("RdStationPolarizationRejector", RdStationPolarizationRejector)
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
fwk::VModule::ResultFlag Init() override
Initialize: invoked at beginning of run (NOT beginning of event)
fwk::VModule::ResultFlag Finish() override
Finish: invoked at end of the run (NOT end of the event)
double GetMaxChargeExcess(const double zenith, const double distToAxis, const double semiMajorAxisLength)
constexpr double degree
void GetLocalPolMaxima(double &pol1, double &pol2, const double angleToMagneticField, double maxChargeExcess)
Module interface.
Definition: VModule.h:53
void GetCoreErrorEllipsevxBvxvxB(TVector3 &semiMajorAxisvxBvxvxB, TVector3 &semiMinorAxisvxBvxvxB, double &rotationAngleInVxB, const utl::Point &semiMajorAxis, const utl::Point &semiMinorAxis, const utl::Point &corePosition, const utl::RadioGeometryUtilities &rdGeometryUtilities)
double GetTangentPol(const TVector3 &stationPositionvxBvxvxB, const TVector3 &tangentPoint, const double chargeExcess, const double angleToMagneticField)
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
TVector3 GetStationPositionvxBvxvxB(const utl::Point stationPosition, const utl::Point &corePosition, const utl::RadioGeometryUtilities &)
Vector object.
Definition: Vector.h:30
bool IsStationInErrorEllipse(const TVector3 &stationPositionvxBvxvxB, const TVector3 &semiMajorAxisVxB, const TVector3 &semiMinorAxisVxB, const double rotationAngle)
fwk::VModule::ResultFlag Run(evt::Event &event) override
Run: invoked once per event.

, generated on Tue Sep 26 2023.