SmallPMTCalibData.h
Go to the documentation of this file.
1 #ifndef _sevt_SmallPMTCalibData_h_
2 #define _sevt_SmallPMTCalibData_h_
3 
4 #include <utl/ShadowPtr_fwd.h>
5 
6 
7 namespace sevt {
8 
9  class SmallPMTData;
10 
11 
25 
26  public:
27  bool IsTubeOk() const { return fIsTubeOk; }
28  // Get version of the small-shower inter-calibration algorithm
29  int GetVersion() const { return fVersion; }
30 
31  // Calibration factor - Q_LPMT(VEM) = beta * Q_SPMT(FADC counts)
32  // where Q_LPMT is the average over the unmasked LPMT signals
33  double GetBeta() const { return fBeta; }
34  double GetBetaError() const { return fBetaError; }
35  // Calibration factors and errors obtained wrt each single LPMT
36  double GetBeta(const unsigned int lpmtId) const { return Checked(fBetaLPMTs, lpmtId); }
37  double GetBetaError(const unsigned int lpmtId) const { return Checked(fBetaErrorLPMTs, lpmtId); }
38 
39  // Chi^2 obtained from the SPMT calibration procedure
40  // using the average over the unmasked LPMT signals
41  double GetChi2() const { return fChi2; }
42  // Same wrt each LPMT
43  double GetChi2(const unsigned int lpmtId) const { return Checked(fChi2LPMTs, lpmtId); }
44 
45  // Correction factor (usually = 1)
46  // For instance, correction wrt temperature
47  // Also, negative if the calibration is unsuccessful or problematic
48  double GetCorrectionFactor() const { return fCorrectionFactor; }
49  // Same wrt each LPMT
50  double GetCorrectionFactor(const unsigned int lpmtId) const { return Checked(fCorrectionFactorLPMTs, lpmtId); }
51 
52  void SetIsTubeOk(const bool ok) { fIsTubeOk = ok; }
53  void SetVersion(const int vers) { fVersion = vers; }
54 
55  void SetBeta(const double beta) { fBeta = beta; }
56  void SetBetaError(const double betaerr) { fBetaError = betaerr; }
57  void SetChi2(const double chi2) { fChi2 = chi2; }
58  void SetCorrectionFactor(const double fact) { fCorrectionFactor = fact; }
59  // Set values for each LPMT
60  void SetBeta(const double beta, const unsigned int lpmtId) { Checked(fBetaLPMTs, lpmtId) = beta; }
61  void SetBetaError(const double betaerr, const unsigned int lpmtId) { Checked(fBetaErrorLPMTs, lpmtId) = betaerr; }
62  void SetChi2(const double chi2, const unsigned int lpmtId) { Checked(fChi2LPMTs, lpmtId) = chi2; }
63  void SetCorrectionFactor(const double fact, const unsigned int lpmtId) { Checked(fCorrectionFactorLPMTs, lpmtId) = fact; }
64 
65  private:
66  SmallPMTCalibData() = default;
67  ~SmallPMTCalibData() = default;
68 
69  template<typename T, std::size_t n>
70  static T& Checked(T (&)[n], const unsigned int i);
71 
72  bool fIsTubeOk = false;
73 
74  int fVersion = 0;
75  double fBeta = 0;
76  double fBetaError = 0;
77  double fChi2 = 0;
78  double fCorrectionFactor = -1;
79 
80  double fBetaLPMTs[3] = { 0 };
81  double fBetaErrorLPMTs[3] = { 0 };
82  double fChi2LPMTs[3] = { 0 };
83  double fCorrectionFactorLPMTs[3] = { -1, -1, -1 };
84 
85  friend class SmallPMTData;
87 
88  };
89 
90 }
91 
92 
93 #endif
pointer with built-in initialization, deletion, deep copying
Definition: ShadowPtr.h:163
void SetIsTubeOk(const bool ok)
static T & Checked(T(&)[n], const unsigned int i)
void SetBetaError(const double betaerr, const unsigned int lpmtId)
void SetCorrectionFactor(const double fact, const unsigned int lpmtId)
double GetBetaError() const
bool ok(bool okay)
Definition: testlib.cc:89
double GetBeta(const unsigned int lpmtId) const
Persistent SmallPMTData using ROOT.
double GetChi2(const unsigned int lpmtId) const
void SetVersion(const int vers)
double GetBetaError(const unsigned int lpmtId) const
class to hold data for station SPMT
Definition: SmallPMTData.h:18
void SetBeta(const double beta)
SPMT Calibration data.
void SetChi2(const double chi2, const unsigned int lpmtId)
void SetBeta(const double beta, const unsigned int lpmtId)
double GetCorrectionFactor(const unsigned int lpmtId) const
void SetCorrectionFactor(const double fact)
double GetCorrectionFactor() const
void SetChi2(const double chi2)
void SetBetaError(const double betaerr)

, generated on Tue Sep 26 2023.