IPhotonCalibrator.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // \file IPhotonCalibrator.h
3 //
4 // \brief Generic interface for service provider for calibrating optical hits
5 //
6 // \author ahimmel@fnal.gov
7 //
8 ////////////////////////////////////////////////////////////////////////
9 
10 #ifndef IPHOTONCALIBRATOR_H
11 #define IPHOTONCALIBRATOR_H
12 
13 // LArSoft includes
16 
17 // ART includes
18 #include "fhiclcpp/ParameterSet.h"
21 
22 
23 
24 
25 namespace calib
26 {
27  /// May want to swap in dummy charge and photon calibrations in various
28  /// combinations.
30  {
31  public:
32  // Make non-copiable
33  IPhotonCalibrator(IPhotonCalibrator const &) = delete;
37 
39  virtual ~IPhotonCalibrator() = default;
40 
41  virtual double PE(double adcs, int opchannel) const = 0;
42  virtual bool UseArea() const = 0;
43 
44  /// Need a 3D position because result depends on position along length of
45  /// bar. This is going to be pretty imprecise even so.
46  // virtual double GeV(double PE, int opchannel, TVector3 pos) = 0;
47 
48  /// Convenience
49  double PE(const recob::OpHit& oh) const
50  {
51  return oh.PE();
52  }
53 
54  double PE(const recob::OpFlash& of) const
55  {
56  return of.TotalPE();
57  }
58 
59  // double GeV(const recob::OpHit& oh, TVector3 pos)
60  //{
61  // return GeV(oh.PE(), oh.OpChannel(), pos);
62  //}
63 
64  //double GeV(const OpFlash& of, TVector3 pos)
65  //{
66  // // This function would be in the .cxx in practice
67  // const std::vector<double>& pes = of.PEs();
68  // double ret = 0;
69  // for(int chan = 0; chan < pes.size(); ++chan)
70  // ret += GeV(of.PE(chan), chan, pos);
71  // return ret;
72  //}
73 
74 
75  };
76 
77 }
78 
79 
80 #endif
IPhotonCalibrator & operator=(IPhotonCalibrator const &)=delete
virtual bool UseArea() const =0
virtual double PE(double adcs, int opchannel) const =0
double PE(const recob::OpHit &oh) const
Convenience.
virtual ~IPhotonCalibrator()=default
double PE() const
Definition: OpHit.h:69
double PE(const recob::OpFlash &of) const
double TotalPE() const
Definition: OpFlash.cxx:68