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 edm::EventSetup &es)
 
void init (const edm::EventSetup &es, 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 edm::EventSetup &es)
 

Private Attributes

MapEleIndex2LBIndex theOmtf2Pact
 
std::unique_ptr< const RPCReadOutMappingthePactCabling
 

Detailed Description

Definition at line 21 of file OmtfRpcUnpacker.h.

Constructor & Destructor Documentation

omtf::RpcUnpacker::RpcUnpacker ( )
inline

Member Function Documentation

void omtf::RpcUnpacker::init ( const edm::EventSetup es)

Definition at line 29 of file OmtfRpcUnpacker.cc.

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

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

29  {
30  initCabling(es);
31  RpcLinkMap omtfLink2Ele;
32  omtfLink2Ele.init(es);
33  theOmtf2Pact = translateOmtf2Pact(omtfLink2Ele, thePactCabling.get());
34  }
void initCabling(const edm::EventSetup &es)
MapEleIndex2LBIndex translateOmtf2Pact(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
std::unique_ptr< const RPCReadOutMapping > thePactCabling
MapEleIndex2LBIndex theOmtf2Pact
void omtf::RpcUnpacker::init ( const edm::EventSetup es,
const std::string &  connectionFile 
)

Definition at line 36 of file OmtfRpcUnpacker.cc.

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

36  {
37  initCabling(es);
38  RpcLinkMap omtfLink2Ele;
39  omtfLink2Ele.init(connectionFile);
40  theOmtf2Pact = translateOmtf2Pact(omtfLink2Ele, thePactCabling.get());
41  }
void initCabling(const edm::EventSetup &es)
MapEleIndex2LBIndex translateOmtf2Pact(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
std::unique_ptr< const RPCReadOutMapping > thePactCabling
MapEleIndex2LBIndex theOmtf2Pact
void omtf::RpcUnpacker::initCabling ( const edm::EventSetup es)
private

Definition at line 21 of file OmtfRpcUnpacker.cc.

References RPCEMap::convert(), edm::EventSetup::get(), LogDebug, and thePactCabling.

Referenced by init().

21  {
22  edm::ESTransientHandle<RPCEMap> readoutMapping;
23  es.get<RPCEMapRcd>().get(readoutMapping);
24  thePactCabling.reset(readoutMapping->convert());
25 
26  LogDebug("OmtfUnpacker") << " Has PACT readout map, VERSION: " << thePactCabling->version() << std::endl;
27  }
#define LogDebug(id)
T get() const
Definition: EventSetup.h:73
std::unique_ptr< const RPCReadOutMapping > thePactCabling
RPCReadOutMapping const * convert() const
Definition: RPCEMap.h:64
void omtf::RpcUnpacker::unpack ( int  triggerBX,
unsigned int  fed,
unsigned int  amc,
const RpcDataWord64 raw,
RPCDigiCollection prod 
)

Definition at line 43 of file OmtfRpcUnpacker.cc.

References omtf::RpcDataWord64::bxNum(), rpcrawtodigi::DataRecord::ChamberData, data, amptDefault_cfi::frame, omtf::RpcDataWord64::frame1(), omtf::RpcDataWord64::frame2(), omtf::RpcDataWord64::frame3(), rpcrawtodigi::RecordCD::lbInLink(), omtf::RpcDataWord64::linkNum(), LogTrace, rpcrawtodigi::RecordCD::partitionData(), rpcrawtodigi::RecordCD::partitionNumber(), rpcrawtodigi::DataRecord::StartOfBXData, rpcrawtodigi::DataRecord::StartOfTbLinkInputNumberData, theOmtf2Pact, and thePactCabling.

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

44  {
45  LogTrace("RpcUnpacker:") << data;
46 
47  // EleIndex omtfEle(fedHeader.sourceID(), bh.getAMCNumber()/2+1, data.linkNum());
48  EleIndex omtfEle(fed, amc, data.linkNum());
49  LinkBoardElectronicIndex rpcEle = theOmtf2Pact.at(omtfEle);
50  RPCRecordFormatter formater(rpcEle.dccId, thePactCabling.get());
51 
52  rpcrawtodigi::EventRecords records(triggerBX);
53  rpcrawtodigi::RecordBX recordBX(triggerBX + data.bxNum() - 3);
54  records.add(recordBX); // warning: event records must be added in right order
55  rpcrawtodigi::RecordSLD recordSLD(rpcEle.tbLinkInputNum, rpcEle.dccInputChannelNum);
56  records.add(recordSLD); // warning: event records must be added in right order
57 
58  for (unsigned int iframe = 1; iframe <= 3; iframe++) {
59  uint16_t frame = (iframe == 1) ? data.frame1() : ((iframe == 2) ? data.frame2() : data.frame3());
60  if (frame == 0)
61  continue;
62  rpcrawtodigi::RecordCD recordCD(frame);
63  records.add(recordCD);
64 
65  LogTrace("") << "OMTF->RPC Event isComplete: " << records.complete()
66  << records.print(rpcrawtodigi::DataRecord::StartOfBXData); // << std::endl;
67  LogTrace("") << "OMTF->RPC Event: "
68  << records.print(rpcrawtodigi::DataRecord::StartOfTbLinkInputNumberData) << std::endl;
69  LogTrace("") << "OMTF->RPC Event: " << records.print(rpcrawtodigi::DataRecord::ChamberData)
70  << " lb:" << recordCD.lbInLink() << " part: " << recordCD.partitionNumber()
71  << " partData: " << recordCD.partitionData() << std::endl
72  << std::endl;
73 
74  if (records.complete())
75  formater.recordUnpack(records, prod, nullptr, nullptr);
76  }
77  }
#define LogTrace(id)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
std::unique_ptr< const RPCReadOutMapping > thePactCabling
Definition: AMCSpec.h:8
MapEleIndex2LBIndex theOmtf2Pact

Member Data Documentation

MapEleIndex2LBIndex omtf::RpcUnpacker::theOmtf2Pact
private

Definition at line 32 of file OmtfRpcUnpacker.h.

Referenced by init(), and unpack().

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

Definition at line 33 of file OmtfRpcUnpacker.h.

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