ProtoDuneChannelRanges.h
Go to the documentation of this file.
1 // ProtoDuneChannelRanges.h
2 //
3 // David Adams
4 // July 2018
5 //
6 // Tool to return channel ranges for protoDUNE. The following are created:
7 // all - all channels
8 // tpsS - for TPC set S, e.g. tps0
9 // tppSP - TPC plane or plane pair P in TPC set S, e.g. tps0z
10 // apaA - APA, e.g. apa3
11 // fembAFFV - FEMB AFF orientation x, eg femb302x
12 //
13 // In the above
14 // S is the TPC set (offline APA) number in range [0,5]
15 // A is the APA number in range [1,6]
16 // P is the wire plane: u, v, z (TPC-side collection) or c (cryostat-side collection)
17 // or the wire plane pair x for (z, c) or i for (u, v)
18 // FF is the FEMB number in an APA in range [01,20]
19 // V is a wire orientation: u, v or x (collection)
20 //
21 // Where relevant, the ranges are assigned a second label location as one of:
22 // US-RaS, US-DaS, MS-RaS, MS-DaS, DS-RaS, DS-DaS
23 // and a third label indication the APA, e.g. APA3.
24 //
25 // Note there is the option to append another index range tool which can
26 // oveerride or extend the above set of ranges.
27 //
28 // The TPC set numbering follows the convention:
29 //
30 // ---> TPS1 TPS3 TPS5
31 // beam TPS0 TPS2 TPS4
32 //
33 // and APA numbering is
34 //
35 // ---> APA5 APA6 APA4
36 // beam APA3 APA2 APA1
37 //
38 // both viewed from above.
39 //
40 // Parameters:
41 // LogLevel - Message logging level (0=none, 1=ctor, 2=each call, ...)
42 // ExtraRanges - Name of tool with additional ranges. Blank for none.
43 
44 #ifndef ProtoDuneChannelRanges_H
45 #define ProtoDuneChannelRanges_H
46 
48 #include "fhiclcpp/ParameterSet.h"
50 #include <map>
51 
53 
54 public:
55 
56  using Name = std::string;
58  using IndexRangeMap = std::map<Name, IndexRange>;
59 
60  // Ctor.
62 
63  // Dtor.
64  ~ProtoDuneChannelRanges() override =default;
65 
66  // Return a range.
67  IndexRange get(Name nam) const override;
68 
69 private:
70 
71  // Configuration parameters.
74 
76  const IndexRangeTool* m_pExtraRanges =nullptr;
77 
78  // Add an entry to the range map.
79  void insertLen(Name nam, Index begin, Index len, Name lab, Name lab1 ="", Name lab2 ="");
80 
81 };
82 
83 
84 #endif
const IndexRangeTool * m_pExtraRanges
std::string string
Definition: nybbler.cc:12
void insertLen(Name nam, Index begin, Index len, Name lab, Name lab1="", Name lab2="")
IndexRange::Name Name
static constexpr double ps
Definition: Units.h:99
std::map< Name, IndexRange > IndexRangeMap
unsigned int Index
Definition: IndexRange.h:27
~ProtoDuneChannelRanges() override=default
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:72
ProtoDuneChannelRanges(fhicl::ParameterSet const &ps)