SdSignalRecovery.h
Go to the documentation of this file.
1 #ifndef _SdSignalRecoveryKLT_SdSignalRecovery_h_
2 #define _SdSignalRecoveryKLT_SdSignalRecovery_h_
3 
4 #include <fwk/VModule.h>
5 #include <utl/Trace.h>
6 
7 
8 namespace evt {
9  class Event;
10 }
11 
12 namespace sevt {
13  class PMT;
14  class Station;
15 }
16 
17 namespace SdSignalRecoveryKLT {
18 
30  class SignalRecovery : public fwk::VModule {
31 
32  public:
35 
39 
42  // fitting vars
43  double fSigma = 0;
44  double fSigmaErr = 0;
45  double fAmpl = 0;
46  double fAmplErr = 0;
47  double fx0 = 0;
48  double fx0Err = 0;
49  double fChi2 = 0;
50  int fNdof = 0;
51 
52  // "phys" vars
53  double fSignal = 0;
54  double fSignalErr = 0;
55  double fSignalErrNL = 0; //uncertainty from the Nl
56 
57  // init variables
58  double fMaximum = 0;
59  unsigned int fFirstBin = 0;
60  unsigned int fFirstSatBin = 0;
61  unsigned int fLastSatBin = 0;
62  double fVEMPeak = 0;
63  double fVEMCharge = 0;
64  double fGainRatio = 0;
65 
66  double fUndershootValue = 0;
67  };
68 
69  SignalRecovery(sevt::Station& station, const double distance, const double alt, const int satflag);
70 
71  private:
72  struct NonLinearity {
73  std::vector<double> fSignalLimits;
74  std::vector<double> fAlpha;
75  std::vector<double> fBeta;
76  };
77 
78  bool RecoverSignal();
80  static void SaturationFitFnc(int& nPar, double* const grad,
81  double& value, double* par, const int flag);
82  double ComputeAmplitude(SaturationFitInterface& sfi) const;
83 
84  double RecoverSignalUndershoot(const utl::TraceI& dynodeTrace, // high gain, low gain
85  const utl::TraceI& anodeTrace,
86  const int saturationValue) const;
87 
88  bool RecoverSignal(const sevt::PMT& pmt, SaturationFitInterface& sfi,
89  const int saturationValue);
90 
91  bool SetNonLinearityCurve(const NonLinearity& nL);
92 
93  static double fgVEMTrace[768];
95 
99 
100  REGISTER_MODULE("SdSignalRecoveryKLT", SignalRecovery);
101 
102  };
103 
104 }
105 
106 
107 #endif
static void SaturationFitFnc(int &nPar, double *const grad, double &value, double *par, const int flag)
class to hold data at PMT level
Definition: SEvent/PMT.h:28
Report success to RunController.
Definition: VModule.h:62
double RecoverSignalUndershoot(const utl::TraceI &dynodeTrace, const utl::TraceI &anodeTrace, const int saturationValue) const
fwk::VModule::ResultFlag Init()
Initialize: invoked at beginning of run (NOT beginning of event)
double ComputeAmplitude(SaturationFitInterface &sfi) const
fwk::VModule::ResultFlag Run(evt::Event &event)
Run: invoked once per event.
fwk::VModule::ResultFlag Finish()
Finish: invoked at end of the run (NOT end of the event)
class to hold data at Station level
double SaturationFitDriver(SaturationFitInterface &sfi) const
bool SetNonLinearityCurve(const NonLinearity &nL)
Module interface.
Definition: VModule.h:53
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
const int nPar
Definition: GeomAsym.h:37
Definition: XbArray.h:7
REGISTER_MODULE("SdSignalRecoveryKLT", SignalRecovery)

, generated on Tue Sep 26 2023.