LArSoft  v08_35_01
Liquid Argon Software toolkit - http://larsoft.org/
TruncMean.h
Go to the documentation of this file.
1 
12 #ifndef TRUNCMEAN_H
13 #define TRUNCMEAN_H
14 
15 #include <vector>
16 #include <limits>
17 
32 
33 class TruncMean{
34 
35  public:
36 
54  void CalcTruncMeanProfile(const std::vector<float>& rr_v, const std::vector<float>& dq_v,
55  std::vector<float>& dq_trunc_v, const float& nsigma = 1);
56 
68  float CalcIterativeTruncMean(std::vector<float> v, const size_t& nmin,
69  const size_t& nmax, const size_t& currentiteration,
70  const size_t& lmin,
71  const float& convergencelimit,
72  const float& nsigma, const float& oldmed = kINVALID_FLOAT);
73 
77  void setRadius(const float& rad) { _rad = rad; }
78 
79  private:
80 
81  float Mean (const std::vector<float>& v);
82  float Median(const std::vector<float>& v);
83  float RMS (const std::vector<float>& v);
84 
89  double _rad;
90 
91 };
92 
93 #endif
94  // end of doxygen group
static const float kINVALID_FLOAT
Definition: TruncMean.h:31
Int_t max
Definition: plot.C:27
float Median(const std::vector< float > &v)
Definition: TruncMean.cxx:114
void setRadius(const float &rad)
Set the smearing radius over which to take hits for truncated mean computaton.
Definition: TruncMean.h:77
double _rad
Definition: TruncMean.h:89
float RMS(const std::vector< float > &v)
Definition: TruncMean.cxx:128
float CalcIterativeTruncMean(std::vector< float > v, const size_t &nmin, const size_t &nmax, const size_t &currentiteration, const size_t &lmin, const float &convergencelimit, const float &nsigma, const float &oldmed=kINVALID_FLOAT)
Iteratively calculate the truncated mean of a distribution std::vector<float> v -> vector of values ...
Definition: TruncMean.cxx:7
float Mean(const std::vector< float > &v)
Definition: TruncMean.cxx:104
void CalcTruncMeanProfile(const std::vector< float > &rr_v, const std::vector< float > &dq_v, std::vector< float > &dq_trunc_v, const float &nsigma=1)
Given residual range and dq vectors return truncated local dq. Input vectors are assumed to be match ...
Definition: TruncMean.cxx:43