CMS 3D CMS Logo

OmtfRpcUnpacker.cc
Go to the documentation of this file.
2 
4 
11 
16 
17 namespace omtf {
18 
19  void RpcUnpacker::initCabling(const RPCEMap& readoutMapping) {
20  thePactCabling.reset(readoutMapping.convert());
21 
22  LogDebug("OmtfUnpacker") << " Has PACT readout map, VERSION: " << thePactCabling->version() << std::endl;
23  }
24 
25  void RpcUnpacker::init(const RPCEMap& readoutMapping, const RPCAMCLinkMap& linkMap) {
26  initCabling(readoutMapping);
27  RpcLinkMap omtfLink2Ele;
28  omtfLink2Ele.init(linkMap);
29  theOmtf2Pact = translateOmtf2Pact(omtfLink2Ele, thePactCabling.get());
30  }
31 
32  void RpcUnpacker::init(const RPCEMap& readoutMapping, const std::string& connectionFile) {
33  initCabling(readoutMapping);
34  RpcLinkMap omtfLink2Ele;
35  omtfLink2Ele.init(connectionFile);
36  theOmtf2Pact = translateOmtf2Pact(omtfLink2Ele, thePactCabling.get());
37  }
38 
40  int triggerBX, unsigned int fed, unsigned int amc, const RpcDataWord64& data, RPCDigiCollection* prod) {
41  LogTrace("RpcUnpacker:") << data;
42 
43  // EleIndex omtfEle(fedHeader.sourceID(), bh.getAMCNumber()/2+1, data.linkNum());
44  EleIndex omtfEle(fed, amc, data.linkNum());
45  LinkBoardElectronicIndex rpcEle = theOmtf2Pact.at(omtfEle);
46  RPCRecordFormatter formater(rpcEle.dccId, thePactCabling.get());
47 
48  rpcrawtodigi::EventRecords records(triggerBX);
49  rpcrawtodigi::RecordBX recordBX(triggerBX + data.bxNum() - 3);
50  records.add(recordBX); // warning: event records must be added in right order
51  rpcrawtodigi::RecordSLD recordSLD(rpcEle.tbLinkInputNum, rpcEle.dccInputChannelNum);
52  records.add(recordSLD); // warning: event records must be added in right order
53 
54  for (unsigned int iframe = 1; iframe <= 3; iframe++) {
55  uint16_t frame = (iframe == 1) ? data.frame1() : ((iframe == 2) ? data.frame2() : data.frame3());
56  if (frame == 0)
57  continue;
58  rpcrawtodigi::RecordCD recordCD(frame);
59  records.add(recordCD);
60 
61  LogTrace("") << "OMTF->RPC Event isComplete: " << records.complete()
62  << records.print(rpcrawtodigi::DataRecord::StartOfBXData); // << std::endl;
63  LogTrace("") << "OMTF->RPC Event: "
64  << records.print(rpcrawtodigi::DataRecord::StartOfTbLinkInputNumberData) << std::endl;
65  LogTrace("") << "OMTF->RPC Event: " << records.print(rpcrawtodigi::DataRecord::ChamberData)
66  << " lb:" << recordCD.lbInLink() << " part: " << recordCD.partitionNumber()
67  << " partData: " << recordCD.partitionData() << std::endl
68  << std::endl;
69 
70  if (records.complete())
71  formater.recordUnpack(records, prod, nullptr, nullptr);
72  }
73  }
74 } // namespace omtf
rpcrawtodigi::RecordBX
Definition: RecordBX.h:7
RPCRecordFormatter
Definition: RPCRecordFormatter.h:15
MessageLogger.h
RPCEMap::convert
RPCReadOutMapping const * convert() const
Definition: RPCEMap.h:64
RPCRecordFormatter.h
rpcrawtodigi::RecordCD
Definition: RecordCD.h:8
rpcrawtodigi::RecordCD::partitionNumber
int partitionNumber() const
Definition: RecordCD.cc:30
omtf::RpcUnpacker::theOmtf2Pact
MapEleIndex2LBIndex theOmtf2Pact
Definition: OmtfRpcUnpacker.h:33
RPCAMCLinkMap
Definition: RPCAMCLinkMap.h:11
omtf::RpcLinkMap::init
void init(const RPCAMCLinkMap &es)
Definition: OmtfLinkMappingRpc.cc:75
DebugDigisPrintout.h
omtf::RpcUnpacker::init
void init(const RPCEMap &readoutMapping, const RPCAMCLinkMap &linkMap)
Definition: OmtfRpcUnpacker.cc:25
RPCEMapRcd.h
RecordSLD.h
RPCDigiCollection
rpcrawtodigi::DataRecord::StartOfTbLinkInputNumberData
Definition: DataRecord.h:16
RPCEMap
Definition: RPCEMap.h:13
omtf::EleIndex
Definition: OmtfEleIndex.h:9
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
omtf::RpcLinkMap
Definition: OmtfLinkMappingRpc.h:30
rpcrawtodigi::RecordSLD
Definition: RecordSLD.h:7
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
OmtfRpcDataWord64.h
rpcrawtodigi::EventRecords
Definition: EventRecords.h:11
omtf::translateOmtf2Pact
MapEleIndex2LBIndex translateOmtf2Pact(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
Definition: OmtfLinkMappingRpc.cc:33
omtf::RpcDataWord64
Definition: OmtfRpcDataWord64.h:9
rpcrawtodigi::RecordCD::lbInLink
int lbInLink() const
Definition: RecordCD.cc:28
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LinkBoardElectronicIndex
Definition: LinkBoardElectronicIndex.h:10
DataRecord.h
RPCPackingModule.h
rpcrawtodigi::RecordCD::partitionData
int partitionData() const
Definition: RecordCD.cc:36
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
RecordCD.h
amc
Definition: AMCSpec.h:8
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
RPCEMap.h
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
omtf::RpcUnpacker::thePactCabling
std::unique_ptr< const RPCReadOutMapping > thePactCabling
Definition: OmtfRpcUnpacker.h:34
omtf::RpcUnpacker::initCabling
void initCabling(const RPCEMap &readoutMapping)
Definition: OmtfRpcUnpacker.cc:19
omtf::RpcUnpacker::unpack
void unpack(int triggerBX, unsigned int fed, unsigned int amc, const RpcDataWord64 &raw, RPCDigiCollection *prod)
Definition: OmtfRpcUnpacker.cc:39
rpcrawtodigi::DataRecord::StartOfBXData
Definition: DataRecord.h:15
RecordBX.h
omtf
Definition: OmtfCscDataWord64.h:7
OmtfRpcUnpacker.h
rpcrawtodigi::DataRecord::ChamberData
Definition: DataRecord.h:17