LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
opdet::HitAlgoMakerToolBase< HitAlgoClass > Class Template Reference

Base art tool class wrapping a hit algorithm. More...

#include "HitAlgoMakerToolBase.h"

Inheritance diagram for opdet::HitAlgoMakerToolBase< HitAlgoClass >:
opdet::IHitAlgoMakerTool

Classes

struct  Config
 

Public Types

using Parameters = art::ToolConfigTable< Config >
 

Public Member Functions

 HitAlgoMakerToolBase (Parameters const &params)
 Constructor: copies and stores the configuration for the algorithm. More...
 
virtual std::unique_ptr< pmtana::PMTPulseRecoBasemakeAlgo () override
 Creates and returns the algorithm from the configuration on construction. More...
 

Protected Attributes

Config fConfig
 Tool configuration cache. More...
 

Detailed Description

template<class HitAlgoClass>
class opdet::HitAlgoMakerToolBase< HitAlgoClass >

Base art tool class wrapping a hit algorithm.

Template Parameters
HitAlgoClassthe hit finder algorithm class being created

Algorithms of the hit finding mini-framework in larana follow a factory pattern which is not the one native in art.

This base class provides the backbone to a art tool wrapping one of the hit finder algorithms. The only function of these tools is to create and configure a hit finder algorithm object: the tools do not offer any hit finding functionality by themselves.

Note that these tools all implement a single art tool interface, which is defined as opdet::IHitAlgoMakerTool.

The current art plugin system will be content with a simple declaration like:

for defining the tool that creates a pmtana::AlgoSlidingWindow algorithm. This definition needs to live in a source file with an appropriate name (e.g. AlgoSlidingWindowMaker_tool.cc), as the source name will be used to identify which library to load at run time.

Hit finder class (HitAlgoClass) requirements

The constructor of the hit finder class, HitAlgoClass, must support two parameters:

HitAlgoClass::HitAlgoClass(
  fhicl::ParameterSet const& config,
  std::unique_ptr<pmtana::RiseTimeCalculatorBase>&& riseCalcAlgo
  );

Definition at line 27 of file HitAlgoMakerToolBase.h.

Member Typedef Documentation

template<class HitAlgoClass >
using opdet::HitAlgoMakerToolBase< HitAlgoClass >::Parameters = art::ToolConfigTable<Config>

Definition at line 84 of file HitAlgoMakerToolBase.h.

Constructor & Destructor Documentation

template<class HitAlgoClass >
opdet::HitAlgoMakerToolBase< HitAlgoClass >::HitAlgoMakerToolBase ( Parameters const &  params)

Constructor: copies and stores the configuration for the algorithm.

Definition at line 101 of file HitAlgoMakerToolBase.h.

102  : fConfig{params()}
103 {}
Config fConfig
Tool configuration cache.

Member Function Documentation

template<class HitAlgoClass >
std::unique_ptr< pmtana::PMTPulseRecoBase > opdet::HitAlgoMakerToolBase< HitAlgoClass >::makeAlgo ( )
overridevirtual

Creates and returns the algorithm from the configuration on construction.

Implements opdet::IHitAlgoMakerTool.

Definition at line 107 of file HitAlgoMakerToolBase.h.

References opdet::HitAlgoMakerToolBase< HitAlgoClass >::fConfig, fhicl::OptionalDelegatedParameter::hasValue(), opdet::HitAlgoMakerToolBase< HitAlgoClass >::Config::HitAlgoPset, opdet::HitAlgoMakerToolBase< HitAlgoClass >::Config::RiseTimeCalculator, and value.

108 {
109 
110  std::unique_ptr<pmtana::RiseTimeCalculatorBase> riseCalcAlgo =
112  art::make_tool<pmtana::RiseTimeCalculatorBase>(
113  fConfig.RiseTimeCalculator.template get_if_present<fhicl::ParameterSet>().value()) :
114  nullptr;
115 
116  return std::make_unique<HitAlgoClass>(fConfig.HitAlgoPset.template get<fhicl::ParameterSet>(),
117  std::move(riseCalcAlgo));
118 
119 } // opdet::HitAlgoMakerToolBase::makeAlgo()
double value
Definition: spectrum.C:18
fhicl::DelegatedParameter HitAlgoPset
Config fConfig
Tool configuration cache.
fhicl::OptionalDelegatedParameter RiseTimeCalculator

Member Data Documentation

template<class HitAlgoClass >
Config opdet::HitAlgoMakerToolBase< HitAlgoClass >::fConfig
protected

Tool configuration cache.

Definition at line 93 of file HitAlgoMakerToolBase.h.

Referenced by opdet::HitAlgoMakerToolBase< HitAlgoClass >::makeAlgo().


The documentation for this class was generated from the following file: