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
 
std::unique_ptr< const RPCReadOutMappingthePactCabling
 

Detailed Description

Definition at line 16 of file OmtfRpcPacker.h.

Constructor & Destructor Documentation

omtf::RpcPacker::RpcPacker ( )
inline

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);
29  thePact2Omtf = translatePact2Omtf(omtfLink2Ele,thePactCabling.get());
30 }
std::unique_ptr< const RPCReadOutMapping > thePactCabling
Definition: OmtfRpcPacker.h:29
MapLBIndex2EleIndex translatePact2Omtf(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
void initCabling(const edm::EventSetup &es)
MapLBIndex2EleIndex thePact2Omtf
Definition: OmtfRpcPacker.h:28
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);
37  thePact2Omtf = translatePact2Omtf(omtfLink2Ele,thePactCabling.get());
38 }
std::unique_ptr< const RPCReadOutMapping > thePactCabling
Definition: OmtfRpcPacker.h:29
MapLBIndex2EleIndex translatePact2Omtf(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
void initCabling(const edm::EventSetup &es)
MapLBIndex2EleIndex thePact2Omtf
Definition: OmtfRpcPacker.h:28
void omtf::RpcPacker::initCabling ( const edm::EventSetup es)
private

Definition at line 17 of file OmtfRpcPacker.cc.

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

Referenced by init().

17  {
18  edm::ESTransientHandle<RPCEMap> readoutMapping;
19  es.get<RPCEMapRcd>().get(readoutMapping);
20  thePactCabling.reset(readoutMapping->convert());
21  LogDebug("OmtfPacker") <<" Has PACT readout map, VERSION: " << thePactCabling->version() << std::endl;
22 }
#define LogDebug(id)
std::unique_ptr< const RPCReadOutMapping > thePactCabling
Definition: OmtfRpcPacker.h:29
T get() const
Definition: EventSetup.h:71
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.get());
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 }
std::unique_ptr< const RPCReadOutMapping > thePactCabling
Definition: OmtfRpcPacker.h:29
static std::vector< rpcrawtodigi::EventRecords > eventRecords(int fedId, int trigger_BX, const RPCDigiCollection *, const RPCRecordFormatter &)
#define LogTrace(id)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
MapLBIndex2EleIndex thePact2Omtf
Definition: OmtfRpcPacker.h:28

Member Data Documentation

MapLBIndex2EleIndex omtf::RpcPacker::thePact2Omtf
private

Definition at line 28 of file OmtfRpcPacker.h.

Referenced by init(), and pack().

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

Definition at line 29 of file OmtfRpcPacker.h.

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