ApaChannelRanges.h
Go to the documentation of this file.
1 // ApaChannelRanges.h
2 //
3 // David Adams
4 // July 2018
5 //
6 // Tool to return channel ranges for one or more APAs mapped to TPC sets.
7 // The TPC sets are numbered 0, 1, ..., NAPA-1.
8 // The following are created:
9 // all - all channels
10 // tpsS - for TPC set S, e.g. tps0
11 // tppSP - TPC plane or plane pair P in TPC set S, e.g. tps0z
12 // apaA - APA, e.g. apa3
13 // fembAFFV - FEMB AFF orientation x, eg femb302x
14 //
15 // In the above
16 // S is the TPC set (offline APA) number
17 // A is the APA number
18 // P is the wire plane: u, v, z (TPC-side collection) or c (cryostat-side collection)
19 // or the wire plane pair x for (z, c) or i for (u, v)
20 // FF is the FEMB number in an APA in range [01,20]
21 // V is a wire orientation: u, v or x (collection)
22 //
23 // Where relevant, the ranges are assigned a second label location
24 // taken from ApaLocatioNames, e.g US-RaS, ColdBox, FD-UL08,
25 // and a third label indication the APA, e.g. APA3.
26 //
27 // Note there is the option to append another index range tool which can
28 // oveerride or extend the above set of ranges.
29 //
30 // Parameters:
31 // LogLevel - Message logging level (0=none, 1=ctor, 2=each call, ...)
32 // ApaNumbers - Apa number for each TPC set.
33 // ApaLocatioNames - Location name for each TPC set. Padded with "".
34 // ExtraRanges - Name of tool with additional ranges. Blank for none.
35 
36 #ifndef ApaChannelRanges_H
37 #define ApaChannelRanges_H
38 
40 #include "fhiclcpp/ParameterSet.h"
42 #include <map>
43 
45 
46 public:
47 
48  using Name = std::string;
49  using NameVector = std::vector<Name>;
51  using IndexVector = std::vector<Index>;
52  using IndexRangeMap = std::map<Name, IndexRange>;
53 
54  // Ctor.
56 
57  // Dtor.
58  ~ApaChannelRanges() override =default;
59 
60  // Return a range.
61  IndexRange get(Name nam) const override;
62 
63 private:
64 
65  // Configuration parameters.
70 
72  const IndexRangeTool* m_pExtraRanges =nullptr;
73 
74  // Add an entry to the range map.
75  void insertLen(Name nam, Index begin, Index len, Name lab, Name lab1 ="", Name lab2 ="");
76 
77 };
78 
79 
80 #endif
~ApaChannelRanges() override=default
std::string string
Definition: nybbler.cc:12
const IndexRangeTool * m_pExtraRanges
NameVector m_ApaLocationNames
ApaChannelRanges(fhicl::ParameterSet const &ps)
IndexRange::Index Index
IndexRange::Name Name
std::vector< Index > IndexVector
static constexpr double ps
Definition: Units.h:99
std::vector< Name > NameVector
unsigned int Index
Definition: IndexRange.h:27
IndexRangeMap m_Ranges
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:72
std::map< Name, IndexRange > IndexRangeMap
IndexVector m_ApaNumbers
void insertLen(Name nam, Index begin, Index len, Name lab, Name lab1="", Name lab2="")