FclStickyCodeFlagger.h
Go to the documentation of this file.
1 // FclStickyCodeFlagger.h
2 
3 // David Adams
4 // October 2018
5 //
6 // Tool to flag sticky codes (i.e. set acd.flags) from fcl.
7 //
8 // Configuration:
9 // LogLevel - 0=silent, 1=init, 2=each event, >2=more
10 // StickyCodes - Array fcl-mapped vectors of sticky codes.
11 // StickyRanges - Array of inclusive code ranges.
12 //
13 // Example syntax for the code map:
14 // StickyCode: {
15 // chan0001: [2002, 2004, 226, 2008]
16 // chan0016: [2016]
17 // }
18 // StickyRange: {
19 // chan0003: [0, 300]
20 // chan0024: [1, 50]
21 // chan0024: [3960, 4095]
22 // }
23 //
24 // Channel numbers are encoded in the fcl element names and are obtained
25 // by stripping the leading "chan" followed by an arbitrary number of '0'
26 // and stripping an arbitrary number of trailing 'x'. The latter allow
27 // multiple entries for a single channel.
28 
29 #ifndef FclStickyCodeFlagger_H
30 #define FclStickyCodeFlagger_H
31 
34 #include "fhiclcpp/ParameterSet.h"
35 #include <vector>
36 #include <map>
37 
39 
40 public:
41 
42  using Index = unsigned int;
43  using IndexVector = std::vector<Index>;
44  using IndexVectorMap = std::map<Index, IndexVector>;
45  using IndexPair = std::pair<Index, Index>;
46  using IndexPairMap = std::multimap<Index, IndexPair>;
47  using Name = std::string;
48 
50 
51  ~FclStickyCodeFlagger() override =default;
52 
53  DataMap update(AdcChannelData& acds) const override;
54 
55 private:
56 
57  // Configuration data.
60 
61  // Configuration derived data.
64 
65 };
66 
67 
68 #endif
DataMap update(AdcChannelData &acds) const override
std::map< Index, IndexVector > IndexVectorMap
short AdcFlag
Definition: AdcTypes.h:29
unsigned int Index
std::string string
Definition: nybbler.cc:12
FclStickyCodeFlagger(fhicl::ParameterSet const &ps)
IndexVectorMap m_stickyCodes
~FclStickyCodeFlagger() override=default
static constexpr double ps
Definition: Units.h:99
std::vector< Index > IndexVector
std::pair< Index, Index > IndexPair
std::multimap< Index, IndexPair > IndexPairMap