DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
VDColdboxChannelMapService.hpp
Go to the documentation of this file.
1
2// Class: VDColdboxChannelMapService
3// Module type: service
4// File: VDColdboxChannelMapService.h
5// Author: Tom Junk, October 2021
6//
7// Implementation of hardware-offline channel mapping reading from a file.
9
10#ifndef DETCHANNELSMAP_VDCOLDBOXCHANNELMAPSERVICE_H_
11#define DETCHANNELSMAP_VDCOLDBOXCHANNELMAPSERVICE_H_
12
13#include <string>
14#include <unordered_map>
15
16namespace dunedaq {
17namespace detchannelmaps {
18
20{
21
22public:
23 VDColdboxChannelMapService(std::string mapfile);
24
26 {
27 int offlchan; // in gdml and channel sorting convention
28 int wib; // slot number +1: 1, 2, 3, or 4
29 int wibconnector; // which board on the WIB 1, 2, 3, or 4
30 int cebchan; // cold electronics channel on board: 0 to 127
31 int femb; // FEMB ID: 1 to 14
32 int asic; // ASIC: 1 to 8
33 int asicchan; // ASIC channel: 0 to 15
34 int connector; // detector connector
35 std::string stripid; // strip name, with plane and number. e.g. U79
36 bool valid; // true if valid, false if not
37 };
38
39 // Access methods
40
41 // The function below gets cold electronics info from offline channel number. Sets valid to be false if
42 // there is no corresponding cold electronics channel
43
45
46 // The function below uses conventions from Nitish's spreadsheet. WIB: 1-3, wibconnector: 1-4, cechan: 0-127
47 // It returns an offline channel number of -1 if the wib, wibconnector, and cechan are not in the map
48
49 int getOfflChanFromWIBConnectorInfo(int wib, int wibconnector, int cechan);
50
51 // For convenience, the function below uses conventions from the DAQ WIB header, with two FEMBs per fiber
52 // on FELIX readout: slot: 0-2, fiber=1 or 2, cehcan: 0-255
53
54 int getOfflChanFromSlotFiberChan(int slot, int fiber, int chan);
55
56private:
57 // map so we can look up channel info by offline channel number
58
59 std::unordered_map<int, VDCBChanInfo> chantoinfomap;
60
61 // map so we can look up offline channel number by channel info (three keys), wib, wibconnector, and cechan
62
63 std::unordered_map<int, std::unordered_map<int, std::unordered_map<int, int>>> infotochanmap;
64};
65
66} // namespace detchannelmaps
67} // namespace dunedaq
68
69#endif /* DETCHANNELSMAP_VDCOLDBOXCHANNELMAPSERVICE_H_ */
int getOfflChanFromWIBConnectorInfo(int wib, int wibconnector, int cechan)
std::unordered_map< int, std::unordered_map< int, std::unordered_map< int, int > > > infotochanmap
The DUNE-DAQ namespace.
Definition wib.pb.cc:23