LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
ShowerCalibrationGaloreScale.h
Go to the documentation of this file.
1 
13 #ifndef LAREXAMPLES_SERVICES_SHOWERCALIBRATIONGALORE_PROVIDERS_SHOWERCALIBRATIONGALORESCALE_H
14 #define LAREXAMPLES_SERVICES_SHOWERCALIBRATIONGALORE_PROVIDERS_SHOWERCALIBRATIONGALORESCALE_H
15 
16 
17 // LArSoft libraries
19 
20 // framework libraries
21 #include "fhiclcpp/types/Atom.h"
22 #include "fhiclcpp/types/Table.h"
23 
24 // C/C++ standard libraries
25 #include <sstream>
26 
27 
28 namespace lar {
29  namespace example {
30 
49  public:
50 
51  //---------------------------------------------------------------------
53  struct Config {
54  using Name = fhicl::Name;
56 
58  Name("factor"),
59  Comment("correction factor to be applied to all particles")
60  };
61 
63  Name("error"),
64  Comment("uncertainty on the correction factor")
65  };
66 
67  }; // struct Config
68 
71 
72 
73  //---------------------------------------------------------------------
76  : corr(config.factor(), config.error())
77  {}
78 
79  //---------------------------------------------------------------------
83  (parameters_type(pset, { "service_type", "service_provider" })())
84  {}
85 
86 
89 
90  //---------------------------------------------------------------------
100  virtual float correctionFactor
101  (recob::Shower const&, PDGID_t = unknownID) const override
102  { return corr.factor; }
103 
113  virtual Correction_t correction
114  (recob::Shower const&, PDGID_t = unknownID) const override
115  { return corr; }
116 
118 
119 
121  virtual std::string report() const override
122  {
123  std::ostringstream sstr;
124  sstr << "Uniform correction: " << corr;
125  return sstr.str();
126  }
127 
128 
129  //---------------------------------------------------------------------
130  private:
132 
133  }; // class ShowerCalibrationGaloreScale
134 
135 
136  } // namespace example
137 } // namespace lar
138 
139 
140 #endif // LAREXAMPLES_SERVICES_SHOWERCALIBRATIONGALORE_PROVIDERS_SHOWERCALIBRATIONGALORESCALE_H
141 
virtual Correction_t correction(recob::Shower const &, PDGID_t=unknownID) const override
Returns the correction for a given reconstructed shower.
A shower calibration service provider applying a uniform scale.
virtual float correctionFactor(recob::Shower const &, PDGID_t=unknownID) const override
Returns a correction factor for a given reconstructed shower.
A correction factor with global uncertainty.
virtual std::string report() const override
Returns a string with a short report of the current correctionß
ShowerCalibrationGaloreScale(fhicl::ParameterSet const &pset)
Constructor from a parameter set.
ShowerCalibrationGaloreScale(Config const &config)
Constructor from the complete configuration object.
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.
Interface for a shower calibration service provider.
LArSoft-specific namespace.
Collection of configuration parameters for the service.
Interface for a shower calibration service provider.