LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
pmtana::PulseRecoManager Class Reference

#include "PulseRecoManager.h"

Public Member Functions

 PulseRecoManager ()
 Default constructor. More...
 
bool Reconstruct (const pmtana::Waveform_t &) const
 Implementation of ana_base::analyze method. More...
 
void AddRecoAlgo (pmtana::PMTPulseRecoBase *algo, PMTPedestalBase *ped_algo=nullptr)
 A method to set pulse reconstruction algorithm. More...
 
void SetDefaultPedAlgo (pmtana::PMTPedestalBase *algo)
 A method to set a choice of pedestal estimation method. More...
 

Private Attributes

std::vector< std::pair< pmtana::PMTPulseRecoBase *, pmtana::PMTPedestalBase * > > _reco_algo_v
 pulse reconstruction algorithm pointer More...
 
PMTPedestalBase_ped_algo
 ped_estimator object More...
 

Detailed Description

A manager class of pulse reconstruction which acts as an analysis unit (inherits from ana_base). This class executes various pulse reconstruction algorithm which inherits from PMTPulseRecoBase Refer to analyze() function implementation to check how a pulse reconstruction algorithm is called.

Definition at line 33 of file PulseRecoManager.h.

Constructor & Destructor Documentation

pmtana::PulseRecoManager::PulseRecoManager ( )

Default constructor.

Definition at line 17 of file PulseRecoManager.cxx.

References _reco_algo_v.

17  : _ped_algo(nullptr)
18  //*******************************************************
19  {
20  _reco_algo_v.clear();
21  }
std::vector< std::pair< pmtana::PMTPulseRecoBase *, pmtana::PMTPedestalBase * > > _reco_algo_v
pulse reconstruction algorithm pointer
PMTPedestalBase * _ped_algo
ped_estimator object

Member Function Documentation

void pmtana::PulseRecoManager::AddRecoAlgo ( pmtana::PMTPulseRecoBase algo,
PMTPedestalBase ped_algo = nullptr 
)

A method to set pulse reconstruction algorithm.

Definition at line 24 of file PulseRecoManager.cxx.

References _reco_algo_v.

Referenced by opdet::LEDCalibrationAna::LEDCalibrationAna(), opdet::OpHitFinder::OpHitFinder(), and pmtana::PMTAna::PMTAna().

26  {
27  if (!algo) throw OpticalRecoException("Invalid PulseReco algorithm!");
28 
29  _reco_algo_v.push_back(std::make_pair(algo, ped_algo));
30  }
std::vector< std::pair< pmtana::PMTPulseRecoBase *, pmtana::PMTPedestalBase * > > _reco_algo_v
pulse reconstruction algorithm pointer
bool pmtana::PulseRecoManager::Reconstruct ( const pmtana::Waveform_t wf) const

Implementation of ana_base::analyze method.

Definition at line 41 of file PulseRecoManager.cxx.

References _ped_algo, _reco_algo_v, pmtana::PMTPedestalBase::Evaluate(), pmtana::PMTPedestalBase::Mean(), and pmtana::PMTPedestalBase::Sigma().

Referenced by opdet::LEDCalibrationAna::analyze(), pmtana::PMTAna::analyze(), and opdet::RunHitFinder().

43  {
44  if (_reco_algo_v.empty() && !_ped_algo)
45 
46  throw OpticalRecoException("No Pulse/Pedestal reconstruction to run!");
47 
48  bool ped_status = true;
49 
50  if (_ped_algo) ped_status = _ped_algo->Evaluate(wf);
51 
52  bool pulse_reco_status = ped_status;
53 
54  for (auto& algo_pair : _reco_algo_v) {
55 
56  auto& pulse_algo = algo_pair.first;
57  auto& ped_algo = algo_pair.second;
58 
59  if (ped_algo) {
60 
61  ped_status = ped_status && ped_algo->Evaluate(wf);
62 
63  pulse_reco_status = (ped_status && pulse_reco_status &&
64  pulse_algo->Reconstruct(wf, ped_algo->Mean(), ped_algo->Sigma()));
65  }
66  else {
67 
68  if (!_ped_algo) {
69  std::stringstream ss;
70  ss << "No pedestal algorithm available for pulse algo " << pulse_algo->Name();
71  throw OpticalRecoException(ss.str());
72  }
73 
74  pulse_reco_status =
75  (pulse_reco_status && pulse_algo->Reconstruct(wf, _ped_algo->Mean(), _ped_algo->Sigma()));
76  }
77  }
78 
79  return pulse_reco_status;
80  }
double Mean(size_t i) const
Getter of the pedestal mean value.
bool Evaluate(const pmtana::Waveform_t &wf)
Method to compute a pedestal.
double Sigma(size_t i) const
Getter of the pedestal standard deviation.
std::vector< std::pair< pmtana::PMTPulseRecoBase *, pmtana::PMTPedestalBase * > > _reco_algo_v
pulse reconstruction algorithm pointer
PMTPedestalBase * _ped_algo
ped_estimator object
void pmtana::PulseRecoManager::SetDefaultPedAlgo ( pmtana::PMTPedestalBase algo)

A method to set a choice of pedestal estimation method.

Definition at line 33 of file PulseRecoManager.cxx.

References _ped_algo.

Referenced by opdet::LEDCalibrationAna::LEDCalibrationAna(), opdet::OpHitFinder::OpHitFinder(), and pmtana::PMTAna::PMTAna().

35  {
36  if (!algo) throw OpticalRecoException("Invalid Pedestal algorithm!");
37  _ped_algo = algo;
38  }
PMTPedestalBase * _ped_algo
ped_estimator object

Member Data Documentation

PMTPedestalBase* pmtana::PulseRecoManager::_ped_algo
private

ped_estimator object

Definition at line 53 of file PulseRecoManager.h.

Referenced by Reconstruct(), and SetDefaultPedAlgo().

std::vector<std::pair<pmtana::PMTPulseRecoBase*, pmtana::PMTPedestalBase*> > pmtana::PulseRecoManager::_reco_algo_v
private

pulse reconstruction algorithm pointer

Definition at line 50 of file PulseRecoManager.h.

Referenced by AddRecoAlgo(), PulseRecoManager(), and Reconstruct().


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