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
 
const RPCReadOutMappingthePactCabling
 

Detailed Description

Definition at line 15 of file OmtfRpcUnpacker.h.

Constructor & Destructor Documentation

omtf::RpcUnpacker::RpcUnpacker ( )
inline

Definition at line 18 of file OmtfRpcUnpacker.h.

References init, parseEventContent::prod, AlCaHLTBitMon_QueryRunRegistry::string, and timeUnitHelper::unpack().

18 : thePactCabling(nullptr) {}
const RPCReadOutMapping * thePactCabling

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().

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

Definition at line 37 of file OmtfRpcUnpacker.cc.

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

38 {
39  initCabling(es);
40  RpcLinkMap omtfLink2Ele;
41  omtfLink2Ele.init(connectionFile);
43 }
const RPCReadOutMapping * thePactCabling
void initCabling(const edm::EventSetup &es)
MapEleIndex2LBIndex translateOmtf2Pact(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
MapEleIndex2LBIndex theOmtf2Pact
void omtf::RpcUnpacker::initCabling ( const edm::EventSetup es)
private

Definition at line 22 of file OmtfRpcUnpacker.cc.

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

Referenced by init().

22  {
23  edm::ESTransientHandle<RPCEMap> readoutMapping;
24  es.get<RPCEMapRcd>().get(readoutMapping);
25  thePactCabling = readoutMapping->convert();
26  LogDebug("OmtfUnpacker") <<" Has PACT readout map, VERSION: " << thePactCabling->version() << std::endl;
27 }
#define LogDebug(id)
const RPCReadOutMapping * thePactCabling
const std::string & version() const
version as string
const T & get() const
Definition: EventSetup.h:59
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 45 of file OmtfRpcUnpacker.cc.

References rpcrawtodigi::EventRecords::add(), omtf::RpcDataWord64::bxNum(), rpcrawtodigi::DataRecord::ChamberData, rpcrawtodigi::EventRecords::complete(), data, omtf::RpcDataWord64::frame1(), omtf::RpcDataWord64::frame2(), omtf::RpcDataWord64::frame3(), rpcrawtodigi::RecordCD::lbInLink(), omtf::RpcDataWord64::linkNum(), LogTrace, rpcrawtodigi::RecordCD::partitionData(), rpcrawtodigi::RecordCD::partitionNumber(), rpcrawtodigi::EventRecords::print(), RPCRecordFormatter::recordUnpack(), rpcrawtodigi::DataRecord::StartOfBXData, rpcrawtodigi::DataRecord::StartOfTbLinkInputNumberData, theOmtf2Pact, and thePactCabling.

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

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

Member Data Documentation

MapEleIndex2LBIndex omtf::RpcUnpacker::theOmtf2Pact
private

Definition at line 27 of file OmtfRpcUnpacker.h.

Referenced by init(), and unpack().

const RPCReadOutMapping* omtf::RpcUnpacker::thePactCabling
private

Definition at line 28 of file OmtfRpcUnpacker.h.

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