BlockIndexMapTool.h
Go to the documentation of this file.
1 // BlockIndexMapTool.h
2 //
3 // David Adams
4 // November 2020
5 //
6 // Tool to map a block of indices (e.g. a channel) to an index (e.g. wire plane index).
7 //
8 // Parameters:
9 // LogLevel - Message logging level:
10 // 0: none
11 // 1: show config
12 // 2: check for duplicates
13 // Starts: Index for which each block starts
14 // Values: Value to which each blokc of indices is mapped
15 // Period: Mapping is repeated with this period
16 //
17 // The starts and values do not need to be ordered.
18 // If any starts are duplicated, the value for last one takes precedence.
19 // If there are fewer values than starts, value zer is used for the extra starts.
20 // If Period is nonzero the mapping is done with the remainder after dividing by that value.
21 
22 #ifndef BlockIndexMapTool_H
23 #define BlockIndexMapTool_H
24 
26 #include "fhiclcpp/ParameterSet.h"
28 #include <vector>
29 #include <map>
30 
32 
33 public:
34 
36 
37  // Ctor.
39 
40  // Dtor.
41  ~BlockIndexMapTool() override =default;
42 
43  // Return the channel status.
44  Index get(Index icha) const override;
45 
46 private:
47 
48  using IndexVector = std::vector<Index>;
49  using IndexMap = std::map<Index, Index>;
50 
51  // Parameters.
56 
57  // Derived data.
59 
60 };
61 
62 
63 #endif
std::map< Index, Index > IndexMap
static constexpr double ps
Definition: Units.h:99
~BlockIndexMapTool() override=default
IndexMapTool::Index Index
unsigned int Index
Definition: IndexMapTool.h:16
std::vector< Index > IndexVector
BlockIndexMapTool(fhicl::ParameterSet const &ps)