AdcCodeHelper.h
Go to the documentation of this file.
1 // AdcCodeHelper.h
2 //
3 // David Adams
4 // November 2015
5 //
6 // Utility class to help interprete ADC signals.
7 // Parameters:
8 // SupressedSignalMax - Signals with |sig-ped| >= this are not suppressed.
9 // If 0, all are suppressed
10 //
11 // Legacy behavior, i.e. that for ADCStickyCodeCheck in
12 // dunetpc v04.29.02 is recovered with parameter value
13 // SuppressedSignalMax = 64
14 
15 #ifndef AdcCodeHelper_H
16 #define AdcCodeHelper_H
17 
19 
21 
22 public:
23 
24  // Ctor.
25  AdcCodeHelper(AdcCount aSuppressedSignalMax =0);
26 
27  // Return if the sticky bits are set.
28  bool hasStickyBits(AdcCount sig);
29 
30  // Return if |pedsig| < SuppressedSignalMax.
31  // Returns true if SuppressedSignalMax <= 0.
32  bool isSmall(AdcCount sig, AdcSignal ped =0.0);
33 
34  // Convert a float signal to an integer signal.
35  AdcCount intSignal(AdcSignal fsig) const;
36 
37  // Return a pedestal-subtracted signal.
38  AdcSignal subtract(AdcCount sig, AdcSignal ped) const;
39 
40  // Return a pedestal-subtracted signal as an integer.
41  AdcCount intSubtract(AdcCount sig, AdcSignal ped) const;
42 
43 private:
44 
45  // Properties.
46  //AdcCount m_SupresssedValue; // unused
48 
49 };
50 
51 #endif
AdcCount intSignal(AdcSignal fsig) const
AdcCodeHelper(AdcCount aSuppressedSignalMax=0)
float AdcSignal
Definition: AdcTypes.h:21
AdcSignal m_SuppressedSignalMax
Definition: AdcCodeHelper.h:47
AdcSignal subtract(AdcCount sig, AdcSignal ped) const
AdcCount intSubtract(AdcCount sig, AdcSignal ped) const
bool isSmall(AdcCount sig, AdcSignal ped=0.0)
bool hasStickyBits(AdcCount sig)
short AdcCount
Definition: AdcTypes.h:18