CMS 3D CMS Logo

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

#include <OmtfRpcPacker.h>

Public Member Functions

void init (const edm::EventSetup &es)
 
void init (const edm::EventSetup &es, const std::string &connectionFile)
 
void pack (const RPCDigiCollection *prod, FedAmcRawsMap &raws)
 
 RpcPacker ()
 

Private Member Functions

void initCabling (const edm::EventSetup &es)
 

Private Attributes

MapLBIndex2EleIndex thePact2Omtf
 
const RPCReadOutMappingthePactCabling
 

Detailed Description

Definition at line 14 of file OmtfRpcPacker.h.

Constructor & Destructor Documentation

omtf::RpcPacker::RpcPacker ( )
inline

Definition at line 17 of file OmtfRpcPacker.h.

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

17 : thePactCabling(nullptr) {}
const RPCReadOutMapping * thePactCabling
Definition: OmtfRpcPacker.h:27

Member Function Documentation

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

Definition at line 24 of file OmtfRpcPacker.cc.

References omtf::RpcLinkMap::init(), initCabling(), thePact2Omtf, thePactCabling, and omtf::translatePact2Omtf().

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

25 {
26  initCabling(es);
27  RpcLinkMap omtfLink2Ele;
28  omtfLink2Ele.init(es);
30 }
MapLBIndex2EleIndex translatePact2Omtf(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
void initCabling(const edm::EventSetup &es)
const RPCReadOutMapping * thePactCabling
Definition: OmtfRpcPacker.h:27
MapLBIndex2EleIndex thePact2Omtf
Definition: OmtfRpcPacker.h:26
void omtf::RpcPacker::init ( const edm::EventSetup es,
const std::string &  connectionFile 
)

Definition at line 32 of file OmtfRpcPacker.cc.

References omtf::RpcLinkMap::init(), initCabling(), thePact2Omtf, thePactCabling, and omtf::translatePact2Omtf().

33 {
34  initCabling(es);
35  RpcLinkMap omtfLink2Ele;
36  omtfLink2Ele.init(connectionFile);
38 }
MapLBIndex2EleIndex translatePact2Omtf(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
void initCabling(const edm::EventSetup &es)
const RPCReadOutMapping * thePactCabling
Definition: OmtfRpcPacker.h:27
MapLBIndex2EleIndex thePact2Omtf
Definition: OmtfRpcPacker.h:26
void omtf::RpcPacker::initCabling ( const edm::EventSetup es)
private

Definition at line 17 of file OmtfRpcPacker.cc.

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

Referenced by init().

17  {
18  edm::ESTransientHandle<RPCEMap> readoutMapping;
19  es.get<RPCEMapRcd>().get(readoutMapping);
20  thePactCabling = readoutMapping->convert();
21  LogDebug("OmtfPacker") <<" Has PACT readout map, VERSION: " << thePactCabling->version() << std::endl;
22 }
#define LogDebug(id)
const std::string & version() const
version as string
const RPCReadOutMapping * thePactCabling
Definition: OmtfRpcPacker.h:27
const T & get() const
Definition: EventSetup.h:55
RPCReadOutMapping const * convert() const
Definition: RPCEMap.h:67
void omtf::RpcPacker::pack ( const RPCDigiCollection prod,
FedAmcRawsMap raws 
)

Definition at line 40 of file OmtfRpcPacker.cc.

References omtf::EleIndex::amc(), omtf::RpcDataWord64::bxNum_, data, RPCPackingModule::eventRecords(), omtf::EleIndex::fed(), omtf::RpcDataWord64::frame1_, omtf::EleIndex::link(), omtf::RpcDataWord64::linkNum_, LogTrace, omtf::RpcDataWord64::rawData, thePact2Omtf, and thePactCabling.

Referenced by pyrootRender.interactiveRender::draw(), and omtf::OmtfPacker::produce().

41 {
42  LogTrace("")<<" HERE HERE !!! RPC PACKER" << rpcrawtodigi::DebugDigisPrintout()(digis);
43  for (int dcc=790; dcc <= 792; dcc++) {
44  RPCRecordFormatter formatter(dcc, thePactCabling);
45  const std::vector<rpcrawtodigi::EventRecords> & merged = RPCPackingModule::eventRecords(dcc,200, digis ,formatter);
46  LogTrace("") << " SIZE OF MERGED, for DCC="<<dcc<<" is: "<<merged.size()<<std::endl;
47  for (const auto & rpcEvent : merged) {
48  RpcDataWord64 data;
49  data.bxNum_ = rpcEvent.dataToTriggerDelay();
50  data.frame1_ = rpcEvent.recordCD().data();
51  LinkBoardElectronicIndex rpcEle = { dcc, rpcEvent.recordSLD().rmb(), rpcEvent.recordSLD().tbLinkInputNumber(), rpcEvent.recordCD().lbInLink() };
52  auto it = thePact2Omtf.find(rpcEle);
53  if (it != thePact2Omtf.end()) {
54  const EleIndex & omtfEle1 = it->second.first;
55  const EleIndex & omtfEle2 = it->second.second;
56  if(omtfEle1.fed()) { data.linkNum_ = omtfEle1.link(); raws[std::make_pair(omtfEle1.fed(), omtfEle1.amc()*2-1)].push_back(data.rawData); }
57  if(omtfEle2.fed()) { data.linkNum_ = omtfEle2.link(); raws[std::make_pair(omtfEle2.fed(), omtfEle2.amc()*2-1)].push_back(data.rawData); }
58  }
59  }
60  }
61 
62 }
static std::vector< rpcrawtodigi::EventRecords > eventRecords(int fedId, int trigger_BX, const RPCDigiCollection *, const RPCRecordFormatter &)
#define LogTrace(id)
const RPCReadOutMapping * thePactCabling
Definition: OmtfRpcPacker.h:27
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
MapLBIndex2EleIndex thePact2Omtf
Definition: OmtfRpcPacker.h:26

Member Data Documentation

MapLBIndex2EleIndex omtf::RpcPacker::thePact2Omtf
private

Definition at line 26 of file OmtfRpcPacker.h.

Referenced by init(), and pack().

const RPCReadOutMapping* omtf::RpcPacker::thePactCabling
private

Definition at line 27 of file OmtfRpcPacker.h.

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