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 <unordered_map>
14#include <string>
15
16namespace dunedaq {
17namespace detchannelmaps {
18
20
21 public:
22
23 VDColdboxChannelMapService(std::string mapfile);
24
25 struct VDCBChanInfo {
26 int offlchan; // in gdml and channel sorting convention
27 int wib; // slot number +1: 1, 2, 3, or 4
28 int wibconnector; // which board on the WIB 1, 2, 3, or 4
29 int cebchan; // cold electronics channel on board: 0 to 127
30 int femb; // FEMB ID: 1 to 14
31 int asic; // ASIC: 1 to 8
32 int asicchan; // ASIC channel: 0 to 15
33 int connector; // detector connector
34 std::string stripid; // strip name, with plane and number. e.g. U79
35 bool valid; // true if valid, false if not
36 };
37
38 // Access methods
39
40 // The function below gets cold electronics info from offline channel number. Sets valid to be false if
41 // there is no corresponding cold electronics channel
42
44
45 // The function below uses conventions from Nitish's spreadsheet. WIB: 1-3, wibconnector: 1-4, cechan: 0-127
46 // It returns an offline channel number of -1 if the wib, wibconnector, and cechan are not in the map
47
48 int getOfflChanFromWIBConnectorInfo(int wib, int wibconnector, int cechan);
49
50 // For convenience, the function below uses conventions from the DAQ WIB header, with two FEMBs per fiber
51 // on FELIX readout: slot: 0-2, fiber=1 or 2, cehcan: 0-255
52
53 int getOfflChanFromSlotFiberChan(int slot, int fiber, int chan);
54
55
56 private:
57
58 // map so we can look up channel info by offline channel number
59
60 std::unordered_map<int,VDCBChanInfo> chantoinfomap;
61
62 // map so we can look up offline channel number by channel info (three keys), wib, wibconnector, and cechan
63
64 std::unordered_map<int,std::unordered_map<int,std::unordered_map<int,int> > > infotochanmap;
65
66};
67
68} // namespace detchannelmaps
69} // namespace dunedaq
70
71#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
Including Qt Headers.
Definition wib.pb.cc:23