CMS 3D CMS Logo

RPCTwinMuxPacker.cc
Go to the documentation of this file.
2 
5 
7  , int min_bx, int max_bx, unsigned int bcn
8  , RPCDigiCollection const & digis
9  , std::map<RPCAMCLink, std::vector<std::pair<int, rpctwinmux::RPCRecord> > > & amc_bx_tmrecord
10  , bool ignore_eod)
11 {
12  std::map<RPCLBLink, std::vector<std::pair<int, RPCLBRecord> > > mlb_bx_lbrecord;
14  , min_bx, max_bx, bcn
15  , digis
16  , mlb_bx_lbrecord
17  , ignore_eod);
18 
19  for (std::map<RPCLBLink, std::vector<std::pair<int, RPCLBRecord> > >::const_iterator mlb_bx_lbrecord_it = mlb_bx_lbrecord.begin()
20  ; mlb_bx_lbrecord_it != mlb_bx_lbrecord.end() ; ++mlb_bx_lbrecord_it) {
21  // multimap, but no splitting for TwinMux inputs
22  RPCInverseAMCLinkMap::map_type::const_iterator amc_it(amc_map.getMap().find(mlb_bx_lbrecord_it->first));
23  if (amc_it == amc_map.getMap().end()) {
24  continue;
25  }
26 
27  RPCAMCLink amc_id(amc_it->second);
28  int amc_input(amc_id.getAMCInput());
29  amc_id.setAMCInput();
30  std::vector<std::pair<int, rpctwinmux::RPCRecord> > & bx_tmrecord(amc_bx_tmrecord[amc_id]);
31  std::vector<std::pair<int, rpctwinmux::RPCRecord> >::iterator tmrecord_it(bx_tmrecord.begin());
32  for (std::vector<std::pair<int, RPCLBRecord> >::const_iterator bx_lbrecord = mlb_bx_lbrecord_it->second.begin()
33  ; bx_lbrecord != mlb_bx_lbrecord_it->second.end() ; ++bx_lbrecord) {
34  // find the first record at this bx for this amc without this input
35  for ( ; tmrecord_it != bx_tmrecord.end() && tmrecord_it->first < bx_lbrecord->first; ++tmrecord_it);
36  if (tmrecord_it == bx_tmrecord.end() || tmrecord_it->first != bx_lbrecord->first) {
37  tmrecord_it = bx_tmrecord.insert(tmrecord_it
38  , std::pair<int, rpctwinmux::RPCRecord>(bx_lbrecord->first
40  tmrecord_it->second.setBXOffset(bx_lbrecord->first);
41  }
42  rpctwinmux::RPCLinkRecord tm_link_record;
43  tm_link_record.setAcknowledge(true);
44  tm_link_record.setEOD(bx_lbrecord->second.isEOD());
45  tm_link_record.setDelay(bx_lbrecord->second.getDelay());
46  tm_link_record.setLinkBoard(bx_lbrecord->second.getLinkBoard());
47  tm_link_record.setConnector(bx_lbrecord->second.getConnector());
48  tm_link_record.setPartition(bx_lbrecord->second.getPartition());
49  tm_link_record.setPartitionData(bx_lbrecord->second.getPartitionData());
50 
51  tmrecord_it->second.setRPCLinkRecord(amc_input, tm_link_record);
52  // make sure we don't fill this input twice if ignore_eod == true
53  ++tmrecord_it;
54  }
55  }
56 }
void setAcknowledge(bool da)
void setLinkBoard(unsigned int link_board)
void setDelay(unsigned int delay)
static void getRPCLBRecords(RPCInverseLBLinkMap const &lb_map, int min_bx, int max_bx, unsigned int bcn, RPCDigiCollection const &digis, std::map< RPCLBLink, std::vector< std::pair< int, RPCLBRecord > > > &mlb_bx_lbrecord, bool ignore_eod=false)
Definition: RPCLBPacker.cc:8
void setPartition(unsigned int partition)
static void getRPCTwinMuxRecords(RPCInverseLBLinkMap const &lb_map, RPCInverseAMCLinkMap const &amc_map, int min_bx, int max_bx, unsigned int bcn, RPCDigiCollection const &digis, std::map< RPCAMCLink, std::vector< std::pair< int, rpctwinmux::RPCRecord > > > &amc_bx_tmrecord, bool ignore_eod=false)
void setConnector(unsigned int connector)
void setPartitionData(std::uint8_t data)