CMS 3D CMS Logo

BoardDataReader.h
Go to the documentation of this file.
1 
2 #ifndef L1Trigger_DemonstratorTools_BoardDataReader_h
3 #define L1Trigger_DemonstratorTools_BoardDataReader_h
4 
5 #include <map>
6 #include <string>
7 #include <vector>
8 
13 
14 namespace l1t::demo {
15 
16  // Reads I/O buffer files created from hardware/firmware tests, verifying that
17  // received packets conform to the declared structure, separating out each
18  // event (accounting for different TM periods of specific links and of the
19  // data-processor itself), and transparently switching to data from new buffer
20  // files as needed
22  public:
23  // map of logical channel ID -> [TMUX period, interpacket-gap & offset; channel indices]
24  typedef std::map<LinkId, std::pair<ChannelSpec, std::vector<size_t>>> ChannelMap_t;
25 
27  const std::vector<std::string>&,
28  const size_t framesPerBX,
29  const size_t tmux,
30  const size_t emptyFramesAtStart,
31  const ChannelMap_t&);
32 
34  const std::vector<std::string>&,
35  const size_t framesPerBX,
36  const size_t tmux,
37  const size_t emptyFramesAtStart,
38  const std::map<LinkId, std::vector<size_t>>&,
39  const std::map<std::string, ChannelSpec>&);
40 
42 
43  private:
44  static ChannelMap_t mergeMaps(const std::map<LinkId, std::vector<size_t>>&,
45  const std::map<std::string, ChannelSpec>&);
46 
48 
49  std::vector<std::string> fileNames_;
50 
51  size_t framesPerBX_;
52 
53  size_t boardTMUX_;
54 
56 
57  // map of logical channel ID -> [TMUX period, interpacket-gap & offset; channel indices]
59 
60  std::vector<EventData> events_;
61 
62  std::vector<EventData>::const_iterator eventIt_;
63  };
64 
65 } // namespace l1t::demo
66 
67 #endif
BoardDataReader(FileFormat, const std::vector< std::string > &, const size_t framesPerBX, const size_t tmux, const size_t emptyFramesAtStart, const ChannelMap_t &)
Logical ID for link within any given time slice (e.g. ["tracks", 0] -> ["tracks", 17] for links from ...
Definition: LinkId.h:10
static ChannelMap_t mergeMaps(const std::map< LinkId, std::vector< size_t >> &, const std::map< std::string, ChannelSpec > &)
std::vector< std::string > fileNames_
std::map< LinkId, std::pair< ChannelSpec, std::vector< size_t > > > ChannelMap_t
std::vector< EventData >::const_iterator eventIt_
std::vector< EventData > events_
Class representing information phase-2 ATCA I/O data corresponding to a single event, with logical channel IDs (essentially string-uint pairs, e.g. tracks-0 to tracks-17).
Definition: EventData.h:28