All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDMapAlg.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////
2 ///
3 /// \file PDMapAlg.h
4 ///
5 /// \brief This is the interface class for a tool to handle PD mapping
6 /// in SBN detectors, used for flash matching.
7 ///
8 /// \author Laura Paulucci, Franciole Marinho, Iker de Icaza, and W. Ketchum
9 ///
10 ////////////////////////////////////////////////////////////////////////
11 
12 #ifndef SBN_OpDet_PDMapAlg_H
13 #define SBN_OpDet_PDMapAlg_H
14 
15 #include "fhiclcpp/ParameterSet.h"
16 //#include "art/Utilities/ToolMacros.h"
17 
18 #include <string>
19 
20 namespace opdet {
21 
22  //virtual base class
23  class PDMapAlg {
24 
25  public:
26  //Default destructor
27  virtual ~PDMapAlg() noexcept = default;
28 
29  //only required element: define string per opdet channel number
30  virtual std::string pdType(size_t ch) const = 0;
31 
32  //helper for PDType lookup
33  virtual bool isPDType(size_t ch, std::string pdname) const
34  { return (pdType(ch)==pdname); }
35 
36  private:
37 
38  }; // class PDMapAlg
39 
40  /*
41  //a default dummy one
42  class PDMapAlgSimple : PDMapAlg
43  {
44  public:
45  explicit PDMapAlgSimple(const fhicl::ParameterSet& pset)
46  { fType = pset.get<std::string>("Type","pmt"); }
47 
48  ~PDMapAlgSimple();
49 
50  std::string pdType(size_t ch) const override { return fType; }
51 
52  private:
53  std::string fType;
54 
55  };
56 
57 
58  DEFINE_ART_CLASS_TOOL(PDMapAlgSimple)
59  */
60 } // namespace
61 
62 
63 #endif // SBN_OPDET_PDMAPALG_H
virtual bool isPDType(size_t ch, std::string pdname) const
Definition: PDMapAlg.h:33
virtual ~PDMapAlg() noexcept=default
virtual std::string pdType(size_t ch) const =0