Public Member Functions | Private Attributes | List of all members
reco_tool::PeakFitterGaussElimination Class Reference
Inheritance diagram for reco_tool::PeakFitterGaussElimination:
reco_tool::IPeakFitter

Public Member Functions

 PeakFitterGaussElimination (const fhicl::ParameterSet &pset)
 
void findPeakParameters (const std::vector< float > &, const ICandidateHitFinder::HitCandidateVec &, PeakParamsVec &, double &, int &) const override
 

Private Attributes

float fStepSize
 Step size used by gaussian elim alg. More...
 
float fMax
 Max. More...
 
std::unique_ptr< util::GaussianEliminationAlgfGEAlg
 

Additional Inherited Members

- Private Types inherited from reco_tool::IPeakFitter
using PeakParamsVec = std::vector< PeakFitParams_t >
 
- Private Member Functions inherited from reco_tool::IPeakFitter
virtual ~IPeakFitter ()=default
 

Detailed Description

Definition at line 16 of file PeakFitterGaussElimination_tool.cc.

Constructor & Destructor Documentation

reco_tool::PeakFitterGaussElimination::PeakFitterGaussElimination ( const fhicl::ParameterSet pset)
explicit

Definition at line 37 of file PeakFitterGaussElimination_tool.cc.

38 {
39  // Start by recovering the parameters
40  fStepSize = pset.get<float>("StepSize", 0.1);
41  fMax = pset.get<float>("Max", 0.5);
42 
43 // fGEAlg = std::make_unique<util::GaussianEliminationAlg>(fStepSize, fMax);
44 
45  return;
46 }
float fStepSize
Step size used by gaussian elim alg.
T get(std::string const &key) const
Definition: ParameterSet.h:271

Member Function Documentation

void reco_tool::PeakFitterGaussElimination::findPeakParameters ( const std::vector< float > &  roiSignalVec,
const ICandidateHitFinder::HitCandidateVec hitCandidateVec,
PeakParamsVec peakParamsVec,
double &  chi2PerNDF,
int &  NDF 
) const
overridevirtual

Implements reco_tool::IPeakFitter.

Definition at line 49 of file PeakFitterGaussElimination_tool.cc.

54 {
55  // This module tries to use the method for fitting hits found in the RRFHitFinder
56  // from Wes Ketchum. It uses the gaussian elimation algorithm he set up.
57  //
58  // *** NOTE: this algorithm assumes the reference time for input hit candidates is to
59  // the first tick of the input waveform (ie 0)
60  //
61  if (hitCandidateVec.empty()) return;
62 
63  std::vector<float> meanVec;
64  std::vector<float> sigmaVec;
65  std::vector<float> heightVec;
66 
67  for(const auto& hitCandidate : hitCandidateVec)
68  {
69  float candMean = hitCandidate.hitCenter;
70  float candSigma = hitCandidate.hitSigma;
71  size_t bin = std::floor(candMean);
72 
73  bin = std::min(bin, roiSignalVec.size() - 1);
74 
75  float candHeight = roiSignalVec[bin] - (candMean-(float)bin)*(roiSignalVec[bin]-roiSignalVec[bin+1]);
76 
77  meanVec.push_back(candMean);
78  sigmaVec.push_back(candSigma);
79  heightVec.push_back(candHeight);
80  }
81 
82  return;
83 }
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
QTextStream & bin(QTextStream &s)

Member Data Documentation

std::unique_ptr<util::GaussianEliminationAlg> reco_tool::PeakFitterGaussElimination::fGEAlg
private

Definition at line 32 of file PeakFitterGaussElimination_tool.cc.

float reco_tool::PeakFitterGaussElimination::fMax
private

Max.

Definition at line 30 of file PeakFitterGaussElimination_tool.cc.

float reco_tool::PeakFitterGaussElimination::fStepSize
private

Step size used by gaussian elim alg.

Definition at line 29 of file PeakFitterGaussElimination_tool.cc.


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