LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
ShowerCalibrationGalore.h
Go to the documentation of this file.
1 
12 #ifndef LAREXAMPLES_SERVICES_SHOWERCALIBRATIONGALORE_PROVIDERS_SHOWERCALIBRATIONGALORE_H
13 #define LAREXAMPLES_SERVICES_SHOWERCALIBRATIONGALORE_PROVIDERS_SHOWERCALIBRATIONGALORE_H
14 
15 
19 
20 // C/C++ standard libraries
21 #include <string>
22 
23 
24 namespace lar {
25  namespace example {
26 
46  {
47  public:
48 
49  //---------------------------------------------------------------------
51  struct Correction_t {
52  float factor;
53  float error;
54 
55  Correction_t(float val = 1., float err = 0.)
56  : factor(val), error(err)
57  {}
58 
59  bool operator== (Correction_t const& as) const
60  { return (factor == as.factor) && (error == as.error); }
61  bool operator!= (Correction_t const& as) const
62  { return (factor != as.factor) || (error != as.error); }
63  }; // Correction_t
64 
66  using PDGID_t = int;
67 
69  static constexpr PDGID_t unknownID = 0;
70 
71 
72  //---------------------------------------------------------------------
73  // Virtual destructor
74  virtual ~ShowerCalibrationGalore() = default;
75 
76 
79 
80  //---------------------------------------------------------------------
95  virtual float correctionFactor
96  (recob::Shower const& shower, PDGID_t PDGID = unknownID) const = 0;
97 
112  virtual Correction_t correction
113  (recob::Shower const& shower, PDGID_t PDGID = unknownID) const = 0;
114 
115 
117 
118 
120  virtual std::string report() const = 0;
121 
122  //---------------------------------------------------------------------
123 
124  }; // class ShowerCalibrationGalore
125 
126 
128  template <typename Stream>
129  Stream& operator<<
130  (Stream&& out, ShowerCalibrationGalore::Correction_t const& corr)
131  {
132  out << corr.factor << " +/- " << corr.error;
133  return out;
134  } // operator<< (Correction_t)
135 
136 
137  } // namespace example
138 } // namespace lar
139 
140 
141 #endif // LAREXAMPLES_SERVICES_SHOWERCALIBRATIONGALORE_PROVIDERS_SHOWERCALIBRATIONGALORE_H
142 
An empty class that can&#39;t be copied nor moved.
Defines a class that can&#39;t be copied nor moved.
virtual Correction_t correction(recob::Shower const &shower, PDGID_t PDGID=unknownID) const =0
Returns the correction for a given reconstructed shower.
A correction factor with global uncertainty.
static constexpr PDGID_t unknownID
A mnemonic constant for unknown particle ID.
int PDGID_t
A type representing a particle ID in Particle Data Group convention.
LArSoft-specific namespace.
virtual ~ShowerCalibrationGalore()=default
virtual float correctionFactor(recob::Shower const &shower, PDGID_t PDGID=unknownID) const =0
Returns a correction factor for a given reconstructed shower.
virtual std::string report() const =0
Returns a string with a short report of the current corrections.
Interface for a shower calibration service provider.