CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
omtf::RpcUnpacker Class Reference

#include <OmtfRpcUnpacker.h>

Public Member Functions

void init (const RPCEMap &readoutMapping, const RPCAMCLinkMap &linkMap)
 
void init (const RPCEMap &readoutMapping, const std::string &connectionFile)
 
 RpcUnpacker ()
 
void unpack (int triggerBX, unsigned int fed, unsigned int amc, const RpcDataWord64 &raw, RPCDigiCollection *prod)
 

Private Member Functions

void initCabling (const RPCEMap &readoutMapping)
 

Private Attributes

MapEleIndex2LBIndex theOmtf2Pact
 
std::unique_ptr< const RPCReadOutMappingthePactCabling
 

Detailed Description

Definition at line 22 of file OmtfRpcUnpacker.h.

Constructor & Destructor Documentation

◆ RpcUnpacker()

omtf::RpcUnpacker::RpcUnpacker ( )
inline

Definition at line 24 of file OmtfRpcUnpacker.h.

24 {}

Member Function Documentation

◆ init() [1/2]

void omtf::RpcUnpacker::init ( const RPCEMap readoutMapping,
const RPCAMCLinkMap linkMap 
)

Definition at line 25 of file OmtfRpcUnpacker.cc.

25  {
26  initCabling(readoutMapping);
27  RpcLinkMap omtfLink2Ele;
28  omtfLink2Ele.init(linkMap);
29  theOmtf2Pact = translateOmtf2Pact(omtfLink2Ele, thePactCabling.get());
30  }

References omtf::RpcLinkMap::init(), initCabling(), theOmtf2Pact, thePactCabling, and omtf::translateOmtf2Pact().

Referenced by omtf::OmtfUnpacker::beginRun().

◆ init() [2/2]

void omtf::RpcUnpacker::init ( const RPCEMap readoutMapping,
const std::string &  connectionFile 
)

Definition at line 32 of file OmtfRpcUnpacker.cc.

32  {
33  initCabling(readoutMapping);
34  RpcLinkMap omtfLink2Ele;
35  omtfLink2Ele.init(connectionFile);
36  theOmtf2Pact = translateOmtf2Pact(omtfLink2Ele, thePactCabling.get());
37  }

References omtf::RpcLinkMap::init(), initCabling(), theOmtf2Pact, thePactCabling, and omtf::translateOmtf2Pact().

◆ initCabling()

void omtf::RpcUnpacker::initCabling ( const RPCEMap readoutMapping)
private

Definition at line 19 of file OmtfRpcUnpacker.cc.

19  {
20  thePactCabling.reset(readoutMapping.convert());
21 
22  LogDebug("OmtfUnpacker") << " Has PACT readout map, VERSION: " << thePactCabling->version() << std::endl;
23  }

References RPCEMap::convert(), LogDebug, and thePactCabling.

Referenced by init().

◆ unpack()

void omtf::RpcUnpacker::unpack ( int  triggerBX,
unsigned int  fed,
unsigned int  amc,
const RpcDataWord64 raw,
RPCDigiCollection prod 
)

Definition at line 39 of file OmtfRpcUnpacker.cc.

40  {
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  }

References rpcrawtodigi::DataRecord::ChamberData, data, amptDefault_cfi::frame, rpcrawtodigi::RecordCD::lbInLink(), LogTrace, rpcrawtodigi::RecordCD::partitionData(), rpcrawtodigi::RecordCD::partitionNumber(), dumpMFGeometry_cfg::prod, rpcrawtodigi::DataRecord::StartOfBXData, rpcrawtodigi::DataRecord::StartOfTbLinkInputNumberData, theOmtf2Pact, and thePactCabling.

Referenced by omtf::OmtfUnpacker::produce().

Member Data Documentation

◆ theOmtf2Pact

MapEleIndex2LBIndex omtf::RpcUnpacker::theOmtf2Pact
private

Definition at line 33 of file OmtfRpcUnpacker.h.

Referenced by init(), and unpack().

◆ thePactCabling

std::unique_ptr<const RPCReadOutMapping> omtf::RpcUnpacker::thePactCabling
private

Definition at line 34 of file OmtfRpcUnpacker.h.

Referenced by init(), initCabling(), and unpack().

rpcrawtodigi::RecordBX
Definition: RecordBX.h:7
RPCRecordFormatter
Definition: RPCRecordFormatter.h:15
RPCEMap::convert
RPCReadOutMapping const * convert() const
Definition: RPCEMap.h:64
rpcrawtodigi::RecordCD
Definition: RecordCD.h:8
omtf::RpcUnpacker::theOmtf2Pact
MapEleIndex2LBIndex theOmtf2Pact
Definition: OmtfRpcUnpacker.h:33
rpcrawtodigi::DataRecord::StartOfTbLinkInputNumberData
Definition: DataRecord.h:16
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
rpcrawtodigi::RecordSLD
Definition: RecordSLD.h:7
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
rpcrawtodigi::EventRecords
Definition: EventRecords.h:11
omtf::translateOmtf2Pact
MapEleIndex2LBIndex translateOmtf2Pact(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
Definition: OmtfLinkMappingRpc.cc:33
LinkBoardElectronicIndex
Definition: LinkBoardElectronicIndex.h:10
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
amc
Definition: AMCSpec.h:8
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
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
rpcrawtodigi::DataRecord::StartOfBXData
Definition: DataRecord.h:15
rpcrawtodigi::DataRecord::ChamberData
Definition: DataRecord.h:17