PhotonCalibratorStandard.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // \file PhotonCalibratorStandard.h
3 //
4 // \brief Standard service provider applying a flat scale factor to all optical hits.
5 //
6 // \author ahimmel@fnal.gov
7 //
8 ////////////////////////////////////////////////////////////////////////
9 
10 
11 #ifndef PHOTONCALIBRATORDEFAULT_H
12 #define PHOTONCALIBRATORDEFAULT_H
13 
15 
16 // ART includes
17 #include "fhiclcpp/ParameterSet.h"
20 
21 
22 namespace calib {
23 
25  {
26  public:
28  : fSPESize ( pset.get< float >("SPESize") ),
29  fSPEShift ( pset.get< float >("SPEShift", 0.)),
30  fUseArea ( pset.get< bool >("UseArea") )
31  {}
32 
33 
34  PhotonCalibratorStandard(float size, float shift, bool useArea)
35  : fSPESize ( size ),
36  fSPEShift ( shift ),
37  fUseArea ( useArea )
38  {}
39 
40  // Override base class functions
41  double PE(double adcs, int opchannel) const override { return adcs/fSPESize + fSPEShift; }
42  bool UseArea() const override { return fUseArea; }
43 
44  // Setters for this implementation
45  void SetSPESize (float size) { fSPESize = size; }
46  void SetSPEShift(float shift) { fSPEShift = shift; }
47  void SetUseArea (bool useArea) { fUseArea = useArea; }
48 
49  /// Need a 3D position because result depends on position along length of
50  /// bar. This is going to be pretty imprecise even so.
51  // virtual double GeV(double PE, int opchannel, TVector3 pos) override;
52 
53  private:
54  float fSPESize;
55  float fSPEShift;
56  bool fUseArea;
57 
58 
59  }; // class PhotonCalibratorStandard
60 }
61 
62 
63 
64 #endif
PhotonCalibratorStandard(float size, float shift, bool useArea)
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
double PE(double adcs, int opchannel) const override
PhotonCalibratorStandard(fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
auto const & get(AssnsNode< L, R, D > const &r)
Definition: AssnsNode.h:115
int bool
Definition: qglobal.h:345