LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
PedAlgoMakerToolBase.h
Go to the documentation of this file.
1 
10 #ifndef LARANA_OPTICALDETECTOR_PEDALGOMAKERTOOLBASE_H
11 #define LARANA_OPTICALDETECTOR_PEDALGOMAKERTOOLBASE_H
12 
13 // LArSoft libraries
17 
18 // framework libraries
21 #include "fhiclcpp/ParameterSet.h"
24 
25 namespace opdet {
26  template <class PedAlgoClass>
28 }
29 
66 template <class PedAlgoClass>
68 
69 public:
70  struct Config {
71 
73  fhicl::Name{"PedAlgoPset"},
74  fhicl::Comment{"configuration of the pedestal estimator algorithm"}};
75 
76  }; // struct Config
77 
79 
81  PedAlgoMakerToolBase(Parameters const& params);
82 
84  virtual std::unique_ptr<pmtana::PMTPedestalBase> makeAlgo() override;
85 
86 protected:
88 
89 }; // opdet::PedAlgoMakerToolBase
90 
91 // -----------------------------------------------------------------------------
92 // --- template implementation
93 // -----------------------------------------------------------------------------
94 template <class PedAlgoClass>
96  : fConfig{params()}
97 {}
98 
99 // -----------------------------------------------------------------------------
100 template <class PedAlgoClass>
101 std::unique_ptr<pmtana::PMTPedestalBase> opdet::PedAlgoMakerToolBase<PedAlgoClass>::makeAlgo()
102 {
103 
104  return std::make_unique<PedAlgoClass>(fConfig.PedAlgoPset.template get<fhicl::ParameterSet>());
105 
106 } // opdet::PedAlgoMakerToolBase::makeAlgo()
107 
108 // -----------------------------------------------------------------------------
109 
110 #endif // LARANA_OPTICALDETECTOR_PEDALGOMAKERTOOLBASE_H
Base art tool class wrapping a pedestal estimator algorithm.
virtual std::unique_ptr< pmtana::PMTPedestalBase > makeAlgo() override
Creates and returns the algorithm from the configuration on construction.
Tool interface for creating a pedestal estimator algorithm.
Interfacce class for a tool to calculate the pulse rise time.
PedAlgoMakerToolBase(Parameters const &params)
Constructor: copies and stores the configuration for the algorithm.
Class definition file of PMTPedestalBase.
Config fConfig
Tool configuration cache.
fhicl::DelegatedParameter PedAlgoPset
Tool interface for creating a pedestal estimator algorithm.