UndershootCorr.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // UndershootCorr.h
3 //
4 // Tool to correct undershoot induced by AC-coupled front-end electronics
5 // It implements a time-domain removal with a fit for the pedestal and charge
6 // deposited before the event starts.
7 //
8 // Configuration:
9 // LogLevel - 0=silent, 1=init, 2=each event, >2=more
10 // CorrectFlag: switch per plane to turn the correction on and off
11 // TDecayConst: constant used to decay accumulated charge sum on each tick.
12 // csum *= TDecayConst on each tick and then
13 // new charge is accumulated after pedestal subtraction
14 // FSubConst: fraction of the accumulated charge to subtract from the next tick's data
15 // RestoreBaseline: If true (for each plane), the median signal is added back after correction
16 // to restore the input baseline.
17 // SignalThreshold: Ticks with signals greated than this are deweighted in the fit
18 // SignalUnit: If non-blank, then this is compared with sampleUnit and a warning
19 // broadcast if they differ.
20 // LCA, LCB, LCC, LCD: Linear combination coefficients to translate from slope and intercept of a linear fit
21 // to the underhsoot-corrected waveform with zero initial charge and pedesal offset to get the
22 // fit initial charge and pedestal offset.
23 //
24 // See DUNE-doc-11662
25 //
26 /////////////////////////////////////////////////////////////////////////
27 #ifndef UndershootCorr_H
28 #define UndershootCorr_H
29 
31 #include "fhiclcpp/ParameterSet.h"
33 #include <vector>
34 
36 
37 public:
38 
40 
41  ~UndershootCorr() override =default;
42 
43  DataMap update(AdcChannelData& acd) const override;
44 
45 private:
46 
47  // Configuration data.
49  std::vector<bool> m_CorrectFlag; // 0: U, 1: V, 2: Collection
50  std::vector<double> m_TDecayConst;
51  std::vector<double> m_FSubConst;
52  std::vector<bool> m_RestoreBaseline;
53  std::vector<double> m_SignalThreshold;
55  std::vector<double> m_LCA;
56  std::vector<double> m_LCB;
57  std::vector<double> m_LCC;
58  std::vector<double> m_LCD;
59 
60  // private methods
61 
62  void crc(std::vector<double> &orig, std::vector<double> &corr, double pedi, double csi, size_t plane) const;
63  void estimatepars(std::vector<double> &x, std::vector<double> &y, double &pedi, double &csi, size_t plane) const;
64  void wlinfit(std::vector<double> x, std::vector<double> &y, std::vector<double> &e, double &slope, double &intercept) const;
65 };
66 
67 
68 #endif
void estimatepars(std::vector< double > &x, std::vector< double > &y, double &pedi, double &csi, size_t plane) const
~UndershootCorr() override=default
std::string string
Definition: nybbler.cc:12
std::vector< double > m_TDecayConst
DataMap update(AdcChannelData &acd) const override
std::vector< double > m_SignalThreshold
std::vector< double > m_FSubConst
UndershootCorr(fhicl::ParameterSet const &ps)
std::string m_SignalUnit
std::vector< double > m_LCD
const double e
std::vector< bool > m_RestoreBaseline
std::vector< double > m_LCA
static constexpr double ps
Definition: Units.h:99
void crc(std::vector< double > &orig, std::vector< double > &corr, double pedi, double csi, size_t plane) const
std::vector< double > m_LCC
list x
Definition: train.py:276
std::vector< double > m_LCB
std::vector< bool > m_CorrectFlag
void wlinfit(std::vector< double > x, std::vector< double > &y, std::vector< double > &e, double &slope, double &intercept) const