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 17 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 30 of file OmtfRpcUnpacker.cc.

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

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

31 {
32  initCabling(es);
33  RpcLinkMap omtfLink2Ele;
34  omtfLink2Ele.init(es);
35  theOmtf2Pact = translateOmtf2Pact(omtfLink2Ele,thePactCabling.get());
36 }
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 38 of file OmtfRpcUnpacker.cc.

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

39 {
40  initCabling(es);
41  RpcLinkMap omtfLink2Ele;
42  omtfLink2Ele.init(connectionFile);
43  theOmtf2Pact = translateOmtf2Pact(omtfLink2Ele,thePactCabling.get());
44 }
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().

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

Definition at line 46 of file OmtfRpcUnpacker.cc.

References omtf::RpcDataWord64::bxNum(), rpcrawtodigi::DataRecord::ChamberData, data, 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().

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

Member Data Documentation

MapEleIndex2LBIndex omtf::RpcUnpacker::theOmtf2Pact
private

Definition at line 29 of file OmtfRpcUnpacker.h.

Referenced by init(), and unpack().

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

Definition at line 30 of file OmtfRpcUnpacker.h.

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