HalfApaChannelRanges.h
Go to the documentation of this file.
1 // HalfApaChannelRanges.h
2 //
3 // David Adams
4 // March 2020
5 //
6 // Tool to return channel ranges for one or more "half" APAs mapped to TPC sets.
7 // A half APA has 1280 channels: 400 u, 400 v and 240 z1 and 240 z2.
8 // Iceberg has one such APA.
9 //
10 // The TPC sets are numbered 0, 1, ..., NAPA-1.
11 // For inly one APA, the numbers are omitted.
12 // The following are created:
13 // all - all channels
14 // tpsS - for TPC set S, e.g. tps0
15 // tppSP - TPC plane or plane pair P in TPC set S, e.g. tps0z
16 // apaA - APA A -- one-to-one mapping to tps
17 // fembAFFV - FEMB AFF orientation x, eg femb302x
18 //
19 // In the above
20 // S=A is the TPC set (APA) number
21 // A is the APA number
22 // P is the wire plane: u, v, z (TPC-side collection) or c (cryostat-side collection)
23 // or the wire plane pair x for (z, c) or i for (u, v)
24 // FF is the FEMB number in an APA in range [01,20]
25 // V is a wire orientation: u, v or x (collection)
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. # entries is the # APAs.
33 // ExtraRanges - Name of tool with additional ranges. Blank for none.
34 
35 #ifndef ApaChannelRanges_H
36 #define ApaChannelRanges_H
37 
39 #include "fhiclcpp/ParameterSet.h"
41 #include <map>
42 
44 
45 public:
46 
47  using Name = std::string;
48  using NameVector = std::vector<Name>;
50  using IndexVector = std::vector<Index>;
51  using IndexRangeMap = std::map<Name, IndexRange>;
52 
53  // Ctor.
55 
56  // Dtor.
57  ~HalfApaChannelRanges() override =default;
58 
59  // Return a range.
60  IndexRange get(Name nam) const override;
61 
62 private:
63 
64  // Configuration parameters.
68 
70  const IndexRangeTool* m_pExtraRanges =nullptr;
71 
72  // Add an entry to the range map.
73  void insertLen(Name nam, Index begin, Index len, Name lab, Name lab1 ="", Name lab2 ="");
74 
75 };
76 
77 
78 #endif
std::string string
Definition: nybbler.cc:12
void insertLen(Name nam, Index begin, Index len, Name lab, Name lab1="", Name lab2="")
HalfApaChannelRanges(fhicl::ParameterSet const &ps)
IndexRange::Index Index
std::vector< Index > IndexVector
IndexRange::Name Name
static constexpr double ps
Definition: Units.h:99
const IndexRangeTool * m_pExtraRanges
unsigned int Index
Definition: IndexRange.h:27
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:72
~HalfApaChannelRanges() override=default
std::vector< Name > NameVector
std::map< Name, IndexRange > IndexRangeMap