Risetime1000LLL.h
Go to the documentation of this file.
1 #ifndef _Risetime1000_Risetime1000LLL_h_
2 #define _Risetime1000_Risetime1000LLL_h_
3 
4 // Offline headers
5 #include <fwk/VModule.h>
6 #include <evt/Event.h>
7 #include <sevt/SEvent.h>
8 #include <sevt/Station.h>
9 #include <sevt/StationConstants.h>
10 
11 // ROOT headers
12 #include <TGraphErrors.h>
13 #include <TF1.h>
14 
15 // Standard c++ headers
16 #include <vector>
17 
18 
19 namespace Risetime1000 {
20 
22  unsigned int fStationId;
23  double fCorrRisetime;
25  double fDistance;
27  unsigned short fRejectCode;
28  };
29 
30 
32  ~RisetimeResultsLLL() { for (auto p : fStationData) delete p; }
33 
34  std::vector<StationRisetimeDataLLL*> fStationData;
35  double fFitPar0 = 0;
36  double fFitPar1 = 0;
37  double fRisetime1000 = -1;
38  double fRisetime1000Error = -1;
39  double fRisetime1000Chi2 = -1;
40  double fRisetime1000NDF = -1;
41  double fXmax = -1;
42  double fXmaxErrorUp = -1;
43  double fXmaxErrorDown = -1;
44  };
45 
46 
62  class Risetime1000LLL : public fwk::VModule {
63 
64  public:
65  Risetime1000LLL() = default;
66  virtual ~Risetime1000LLL();
67 
68  // Init, Run, and Finish functions
69  fwk::VModule::ResultFlag Init() override;
70  fwk::VModule::ResultFlag Run(evt::Event& event) override;
71  fwk::VModule::ResultFlag Finish() override { return eSuccess; }
72 
73  // Static public members for access outside this module
74  static double fgRisetime;
75  static double fgRisetimeError;
76  static double fgRisetimeReducedChi2;
78 
79  protected:
80  // Variables read from the xml file to configure the
81  // risetime recalculation (if used)
82  float fRiseTimeStartFraction = 0.1; // 10%
83  float fRiseTimeStopFraction = 0.5; // 50%
84 
85  private:
86  // Calculate the Risetime and return that value
87  double FitEventRiseTime();
88  double RecalculateRiseTime(const sevt::Station& station);
90 
91  // Variables used for the riestime fit
92  TFormula* fRTWeights = nullptr;
93  unsigned int fRejectedStations = 0;
94 
95  // Variables read from the xml file to configure the risetime routines
96  float fMinimumSignalForRiseTimeFit = 10; // Signal size in VEM
97  float fMinimumDistanceForRiseTimeFit = 0*utl::meter; // Distance in meters
98  float fMaximumDistanceForRiseTimeFit = 1600*utl::meter; // Distance in meters
99  float fDistanceToInterpolateFitResult = 1000*utl::meter; // Distance in meters to evaluate the fit at
101  bool fDoRiseTimeFit = true;
102  bool fForceRiseTimeRecalculation = false; // Don't trust others to calculate it
103  std::string fRTWeightingFunction; // Function describing the
104  // weight as a function of
105  // distance/signal size
106 
107  // Derived variables
109 
110  REGISTER_MODULE("Risetime1000LLL", Risetime1000LLL);
111 
112  };
113 
114 }
115 
116 
117 #endif
static RisetimeResultsLLL * fgRisetimeResults
Report success to RunController.
Definition: VModule.h:62
total (shower and background)
This module calculates the risetime for an event.
double RecalculateRiseTime(const sevt::Station &station)
fwk::VModule::ResultFlag Run(evt::Event &event) override
Run: invoked once per event.
std::vector< StationRisetimeDataLLL * > fStationData
fwk::VModule::ResultFlag Finish() override
Finish: invoked at end of the run (NOT end of the event)
REGISTER_MODULE("Risetime1000LLL", Risetime1000LLL)
class to hold data at Station level
constexpr double meter
Definition: AugerUnits.h:81
Module interface.
Definition: VModule.h:53
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
sevt::StationConstants::SignalComponent fComponent
fwk::VModule::ResultFlag Init() override
Initialize: invoked at beginning of run (NOT beginning of event)

, generated on Tue Sep 26 2023.