AdcUnderflowFlagger.h
Go to the documentation of this file.
1 // AdcUnderflowFlagger.h
2 
3 // David Adams
4 // October 2017
5 //
6 // Tool to flag underflows in ADC data.
7 //
8 // Configuration:
9 // LogLevel - 0=silent, 1=init, 2=minor errors each event, >2=more
10 // AdcThresholds - vector with threshold for each channel
11 // DefaultThreshold - If this is >= 0, then this value is used for channels
12 // that are not set in (negative) or beyond the range of
13 // the AdcThresholds vector.
14 // Otherwise no action is taken and an error is returned.
15 //
16 // Output in DataMap:
17 // status: 0 - success
18 // 1 - channel not set in ADC data
19 // 2,3 - threshold not set for the requested channel
20 // int channel - channel number
21 // int nUnderflow - # ticks flagged as underflow
22 // int nModify - # calls to modify methods
23 
24 #ifndef AdcUnderflowFlagger_H
25 #define AdcUnderflowFlagger_H
26 
28 #include "fhiclcpp/ParameterSet.h"
30 #include <string>
31 #include <vector>
32 
33 class HistogramManager;
34 class TH1;
35 
37 : public TpcDataTool {
38 
39 public:
40 
41  using IntVector = std::vector<short>;
42 
44 
45  DataMap view(const AdcChannelData& acd) const override;
46 
47  DataMap update(AdcChannelData& acd) const override;
48 
49  // Allow user to modify thresholds on the fly.
51  const AdcCountVector& adcThreshold() const { return m_AdcThresholds; }
54 
55 private:
56 
57  // Configuration data.
61 
62  // Counter for access to modifiers.
64 
65 
66 };
67 
68 
69 #endif
DataMap view(const AdcChannelData &acd) const override
AdcUnderflowFlagger(fhicl::ParameterSet const &ps)
std::vector< AdcCount > AdcCountVector
Definition: AdcTypes.h:19
DataMap update(AdcChannelData &acd) const override
AdcCount defaultThreshold() const
const AdcCountVector & adcThreshold() const
AdcCountVector & adcThreshold()
static constexpr double ps
Definition: Units.h:99
unsigned int AdcIndex
Definition: AdcTypes.h:15
short AdcCount
Definition: AdcTypes.h:18
std::vector< short > IntVector