All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 namespace calib
18 {
19  /// May want to swap in dummy charge and photon calibrations in various
20  /// combinations.
22  {
23  public:
24  // Make non-copiable
25  IPhotonCalibrator(IPhotonCalibrator const &) = delete;
29 
31  virtual ~IPhotonCalibrator() = default;
32 
33  virtual double PE(double adcs, int opchannel) const = 0;
34  virtual bool UseArea() const = 0;
35 
36  /// Need a 3D position because result depends on position along length of
37  /// bar. This is going to be pretty imprecise even so.
38  // virtual double GeV(double PE, int opchannel, TVector3 pos) = 0;
39 
40  /// Convenience
41  double PE(const recob::OpHit& oh) const
42  {
43  return oh.PE();
44  }
45 
46  double PE(const recob::OpFlash& of) const
47  {
48  return of.TotalPE();
49  }
50 
51  // double GeV(const recob::OpHit& oh, TVector3 pos)
52  //{
53  // return GeV(oh.PE(), oh.OpChannel(), pos);
54  //}
55 
56  //double GeV(const OpFlash& of, TVector3 pos)
57  //{
58  // // This function would be in the .cxx in practice
59  // const std::vector<double>& pes = of.PEs();
60  // double ret = 0;
61  // for(int chan = 0; chan < pes.size(); ++chan)
62  // ret += GeV(of.PE(chan), chan, pos);
63  // return ret;
64  //}
65 
66 
67  };
68 
69 }
70 
71 
72 #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:95
double PE(const recob::OpFlash &of) const
double TotalPE() const
Definition: OpFlash.cxx:68