CMS 3D CMS Logo

OmtfRpcPacker.cc
Go to the documentation of this file.
2 
4 
11 
12 namespace omtf {
13 
14  void RpcPacker::initCabling(const RPCEMap& readoutMapping) {
15  thePactCabling.reset(readoutMapping.convert());
16  LogDebug("OmtfPacker") << " Has PACT readout map, VERSION: " << thePactCabling->version() << std::endl;
17  }
18 
19  void RpcPacker::init(const RPCEMap& readoutMapping, const RPCAMCLinkMap& linkMap) {
20  initCabling(readoutMapping);
21  RpcLinkMap omtfLink2Ele;
22  omtfLink2Ele.init(linkMap);
23  thePact2Omtf = translatePact2Omtf(omtfLink2Ele, thePactCabling.get());
24  }
25 
26  void RpcPacker::init(const RPCEMap& readoutMapping, const std::string& connectionFile) {
27  initCabling(readoutMapping);
28  RpcLinkMap omtfLink2Ele;
29  omtfLink2Ele.init(connectionFile);
30  thePact2Omtf = translatePact2Omtf(omtfLink2Ele, thePactCabling.get());
31  }
32 
33  void RpcPacker::pack(const RPCDigiCollection* digis, FedAmcRawsMap& raws) {
34  LogTrace("") << " HERE HERE !!! RPC PACKER" << rpcrawtodigi::DebugDigisPrintout()(digis);
35  for (int dcc = 790; dcc <= 792; dcc++) {
37  const std::vector<rpcrawtodigi::EventRecords>& merged =
38  RPCPackingModule::eventRecords(dcc, 200, digis, formatter);
39  LogTrace("") << " SIZE OF MERGED, for DCC=" << dcc << " is: " << merged.size() << std::endl;
40  for (const auto& rpcEvent : merged) {
42  data.bxNum_ = rpcEvent.dataToTriggerDelay();
43  data.frame1_ = rpcEvent.recordCD().data();
44  LinkBoardElectronicIndex rpcEle = {
45  dcc, rpcEvent.recordSLD().rmb(), rpcEvent.recordSLD().tbLinkInputNumber(), rpcEvent.recordCD().lbInLink()};
46  auto it = thePact2Omtf.find(rpcEle);
47  if (it != thePact2Omtf.end()) {
48  const EleIndex& omtfEle1 = it->second.first;
49  const EleIndex& omtfEle2 = it->second.second;
50  if (omtfEle1.fed()) {
51  data.linkNum_ = omtfEle1.link();
52  raws[std::make_pair(omtfEle1.fed(), omtfEle1.amc() * 2 - 1)].push_back(data.rawData);
53  }
54  if (omtfEle2.fed()) {
55  data.linkNum_ = omtfEle2.link();
56  raws[std::make_pair(omtfEle2.fed(), omtfEle2.amc() * 2 - 1)].push_back(data.rawData);
57  }
58  }
59  }
60  }
61  }
62 
63 }; // namespace omtf
omtf::RpcPacker::thePact2Omtf
MapLBIndex2EleIndex thePact2Omtf
Definition: OmtfRpcPacker.h:29
RPCRecordFormatter
Definition: RPCRecordFormatter.h:15
MessageLogger.h
RPCReadOutMapping.h
RPCEMap::convert
RPCReadOutMapping const * convert() const
Definition: RPCEMap.h:64
RPCRecordFormatter.h
omtf::EleIndex::amc
unsigned int amc() const
Definition: OmtfEleIndex.h:23
RPCAMCLinkMap
Definition: RPCAMCLinkMap.h:11
omtf::RpcLinkMap::init
void init(const RPCAMCLinkMap &es)
Definition: OmtfLinkMappingRpc.cc:75
DebugDigisPrintout.h
RPCDigiCollection
RPCEMap
Definition: RPCEMap.h:13
omtf::EleIndex
Definition: OmtfEleIndex.h:9
omtf::RpcPacker::init
void init(const RPCEMap &readoutMapping, const RPCAMCLinkMap &linkMap)
Definition: OmtfRpcPacker.cc:19
omtf::RpcPacker::pack
void pack(const RPCDigiCollection *prod, FedAmcRawsMap &raws)
Definition: OmtfRpcPacker.cc:33
omtf::FedAmcRawsMap
std::map< std::pair< unsigned int, unsigned int >, std::vector< Word64 > > FedAmcRawsMap
Definition: OmtfDataWord64.h:13
omtf::RpcLinkMap
Definition: OmtfLinkMappingRpc.h:30
omtf::EleIndex::link
unsigned int link() const
Definition: OmtfEleIndex.h:24
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
OmtfRpcDataWord64.h
postprocess-scan-build.formatter
formatter
Definition: postprocess-scan-build.py:49
omtf::RpcPacker::thePactCabling
std::unique_ptr< const RPCReadOutMapping > thePactCabling
Definition: OmtfRpcPacker.h:30
omtf::RpcDataWord64
Definition: OmtfRpcDataWord64.h:9
omtf::translatePact2Omtf
MapLBIndex2EleIndex translatePact2Omtf(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
Definition: OmtfLinkMappingRpc.cc:60
omtf::EleIndex::fed
unsigned int fed() const
Definition: OmtfEleIndex.h:22
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
OmtfRpcPacker.h
LinkBoardElectronicIndex
Definition: LinkBoardElectronicIndex.h:10
RPCPackingModule.h
omtf::RpcPacker::initCabling
void initCabling(const RPCEMap &readoutMapping)
Definition: OmtfRpcPacker.cc:14
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
rpcrawtodigi::DebugDigisPrintout
Definition: DebugDigisPrintout.h:11
RPCPackingModule::eventRecords
static std::vector< rpcrawtodigi::EventRecords > eventRecords(int fedId, int trigger_BX, const RPCDigiCollection *, const RPCRecordFormatter &)
Definition: RPCPackingModule.cc:128
RPCEMap.h
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
omtf
Definition: OmtfCscDataWord64.h:7