BaselineDetrend.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////////
2 //
3 // Remove trends in baseline fluctuations. This is basically a very low pass
4 // filter removing oscillations at ~1 kHz. The smoothed version of the pedestal
5 // is contructed using LOWESS smoothing algorithm implemented in TSmoothGraph
6 // See docdb DUNE-doc-21111
7 //
8 // Parametres:
9 // LogLevel: controls level of printout
10 //
11 // UseBasicROI: use basic ROI finder (para: Threshold and Pad ticks)
12 // to bypass the signal regions
13 //
14 // Threshold: to bypass signals during smoothing
15 //
16 // Pad ticks: number of ticks around signal candidates
17 //
18 // MinFrac: min number of pedestal samples to build the smoothed representation
19 //
20 // Span: span parameters between 0 ... 1. The larger it is the smoother the
21 // result. The value that works the best (follows baseline variations
22 // at ~1kHz rate) is around 0.04.
23 //
24 //
25 // Written: V. Galymov
26 // April 2020
27 //
28 ////////////////////////////////////////////////////////////////////////////////////
29 
30 #ifndef __BASELINEDETREND_H__
31 #define __BASELINEDETREND_H__
32 
33 // dune interfaces
35 #include "fhiclcpp/ParameterSet.h"
37 
38 #include <vector>
39 
40 class TGraphSmooth;
41 class TGraph;
42 
43 //typedef std::vector<float> AdcSignalVector;
44 
46 {
47 
48  public:
50  ~BaselineDetrend() override;
51 
52  DataMap update(AdcChannelData& acd) const override;
53 
54  private:
57  float m_Thresh;
58  unsigned m_Pad;
59  float m_MinFrac;
60  float m_Span;
61 
62  //
63  // smoother
64  TGraphSmooth *m_GS;
65 
66  //
68  const std::vector<unsigned> &pedidx ) const;
69 };
70 
71 
72 #endif
DataMap update(AdcChannelData &acd) const override
AdcSignalVector Smoother(const AdcSignalVector &data, const std::vector< unsigned > &pedidx) const
BaselineDetrend(fhicl::ParameterSet const &ps)
static constexpr double ps
Definition: Units.h:99
TGraphSmooth * m_GS
std::vector< AdcSignal > AdcSignalVector
Definition: AdcTypes.h:22