LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
RFFHitFitter.h
Go to the documentation of this file.
1 #ifndef RFFHITFITTER_H
2 #define RFFHITFITTER_H
3 
18 #include <set>
19 #include <vector>
20 
21 #include "GaussianEliminationAlg.h"
22 
23 namespace hit {
24 
25  struct SignalSetComp {
26  bool operator()(const std::pair<float, float>& lhs, const std::pair<float, float>& rhs) const
27  {
28  return lhs.first < rhs.first;
29  }
30  };
31 
32  class RFFHitFitter {
33 
34  typedef std::pair<float, float> MeanSigmaPair;
35 
36  public:
37  RFFHitFitter(float, unsigned int, float, float step = 0.1, float max = 5.0);
38  RFFHitFitter(float step = 0.1, float max = 5.0);
39 
40  void SetFitterParams(float, unsigned int, float);
41 
42  void RunFitter(const std::vector<float>& signal);
43 
44  const std::vector<float>& MeanVector() { return fMeanVector; }
45  const std::vector<float>& SigmaVector() { return fSigmaVector; }
46  const std::vector<float>& MeanErrorVector() { return fMeanErrorVector; }
47  const std::vector<float>& SigmaErrorVector() { return fSigmaErrorVector; }
48  const std::vector<float>& AmplitudeVector() { return fAmpVector; }
49  const std::vector<float>& AmplitudeErrorVector() { return fAmpErrorVector; }
50  unsigned int NHits() { return fMeanVector.size(); }
51 
52  void ClearResults();
53 
54  void PrintResults();
55 
56  private:
58  unsigned int fMinMergeMultiplicity;
60 
61  // Clang: private field is not used (x2):
62  // float fGEAlgStepSize;
63  // float fGEAlgMax;
65 
66  std::vector<float> fMeanVector;
67  std::vector<float> fSigmaVector;
68  std::vector<float> fMeanErrorVector;
69  std::vector<float> fSigmaErrorVector;
70  std::vector<float> fAmpVector;
71  std::vector<float> fAmpErrorVector;
72 
73  std::multiset<MeanSigmaPair, SignalSetComp> fSignalSet;
75 
76  void CalculateAllMeansAndSigmas(const std::vector<float>& signal);
77  void CalculateMergedMeansAndSigmas(std::size_t signal_size);
78  void CalculateAmplitudes(const std::vector<float>& signal);
79  void CreateMergeVector();
80 
81  bool HitsBelowThreshold();
82  };
83 
84 }
85 
86 #endif
intermediate_table::iterator iterator
const std::vector< float > & AmplitudeVector()
Definition: RFFHitFitter.h:48
std::vector< float > fAmpErrorVector
Definition: RFFHitFitter.h:71
unsigned int fMinMergeMultiplicity
Definition: RFFHitFitter.h:58
const std::vector< float > & MeanVector()
Definition: RFFHitFitter.h:44
std::vector< std::vector< std::multiset< MeanSigmaPair >::iterator > > fMergeVector
Definition: RFFHitFitter.h:74
const std::vector< float > & SigmaVector()
Definition: RFFHitFitter.h:45
std::pair< float, float > MeanSigmaPair
Definition: RFFHitFitter.h:34
std::vector< float > fSigmaVector
Definition: RFFHitFitter.h:67
util::GaussianEliminationAlg fGEAlg
Definition: RFFHitFitter.h:64
float fFinalAmpThreshold
Definition: RFFHitFitter.h:59
std::multiset< MeanSigmaPair, SignalSetComp > fSignalSet
Definition: RFFHitFitter.h:73
const std::vector< float > & MeanErrorVector()
Definition: RFFHitFitter.h:46
std::vector< float > fAmpVector
Definition: RFFHitFitter.h:70
Detector simulation of raw signals on wires.
std::vector< float > fSigmaErrorVector
Definition: RFFHitFitter.h:69
float fMeanMatchThreshold
Definition: RFFHitFitter.h:57
unsigned int NHits()
Definition: RFFHitFitter.h:50
const std::vector< float > & AmplitudeErrorVector()
Definition: RFFHitFitter.h:49
bool operator()(const std::pair< float, float > &lhs, const std::pair< float, float > &rhs) const
Definition: RFFHitFitter.h:26
std::vector< float > fMeanVector
Definition: RFFHitFitter.h:66
std::vector< float > fMeanErrorVector
Definition: RFFHitFitter.h:68
const std::vector< float > & SigmaErrorVector()
Definition: RFFHitFitter.h:47