Legacy35tZeroSuppressService.h
Go to the documentation of this file.
1 // Legacy35tZeroSuppressService.h
2 //
3 // David Adams
4 // November 2015
5 //
6 // Service wrapper for legacy 35-ton zero suppression.
7 // Code taken from run.cxx in dunetpc v04.29.02.
8 // Parameters:
9 // AdcThreshold - threshold
10 // TickRange - range
11 // SuppressStickyBits - treat sticky bits as below threshold
12 // If a tick I has pedestal-corrected |ADC| > AdcThreshold, ticks
13 // [i-TickRange, i+TickRange] are retained.
14 // If tick I has sticky bits and has pedestal-corrected ADC < 64,
15 // it is treated as though its pedstal-corrected ADC is zero.
16 // If the gap between unsuppressed blocks is less that MinTickGap,
17 // then the bins in that gap are not suppressed. Edges (bins
18 // outside the tick range are treated as unsupressed.
19 
20 #ifndef Legacy35tZeroSuppressService_H
21 #define Legacy35tZeroSuppressService_H
22 
24 
25 #include <memory>
26 #include <string>
27 #include <iostream>
28 
29 namespace fhicl {
30 class ParameterSet;
31 }
32 namespace art {
33 class ActivityRegistry;
34 }
35 
37 
38 public:
39 
40  // Ctor from fcl.
42 
43  // Ctor from direct params.
44  Legacy35tZeroSuppressService(float aAdcThreshold,
45  unsigned int aTickRange,
46  unsigned int aMinTickGap,
47  bool aSuppressStickyBits);
48 
49  // Filter an array of signals. Result is written to keep.
50  int filter(const AdcCountVector& sigs, Channel chan, AdcPedestal ped, AdcFilterVector& keep) const;
51 
52  // Print the configuration.
53  std::ostream& print(std::ostream& out =std::cout, std::string prefix ="") const;
54 
55 
56 private:
57 
58  // Parameters.
60  unsigned int m_TickRange;
61  unsigned int m_MinTickGap;
63 
64 
65 };
66 
68 
69 #endif
std::vector< AdcCount > AdcCountVector
Definition: AdcTypes.h:19
std::string string
Definition: nybbler.cc:12
DECLARE_ART_SERVICE_INTERFACE_IMPL(MySharedService, art::test::MyServiceInterface, SHARED) DEFINE_ART_SERVICE_INTERFACE_IMPL(MySharedService
std::vector< bool > AdcFilterVector
Definition: AdcTypes.h:27
float AdcPedestal
Definition: AdcTypes.h:25