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 RPCEMap &readoutMapping, const RPCAMCLinkMap &linkMap)
 
void init (const RPCEMap &readoutMapping, const std::string &connectionFile)
 
void pack (const RPCDigiCollection *prod, FedAmcRawsMap &raws)
 
 RpcPacker ()
 

Private Member Functions

void initCabling (const RPCEMap &readoutMapping)
 

Private Attributes

MapLBIndex2EleIndex thePact2Omtf
 
std::unique_ptr< const RPCReadOutMappingthePactCabling
 

Detailed Description

Definition at line 18 of file OmtfRpcPacker.h.

Constructor & Destructor Documentation

◆ RpcPacker()

omtf::RpcPacker::RpcPacker ( )
inline

Definition at line 20 of file OmtfRpcPacker.h.

20 {}

Member Function Documentation

◆ init() [1/2]

void omtf::RpcPacker::init ( const RPCEMap readoutMapping,
const RPCAMCLinkMap linkMap 
)

Definition at line 19 of file OmtfRpcPacker.cc.

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

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

19  {
20  initCabling(readoutMapping);
21  RpcLinkMap omtfLink2Ele;
22  omtfLink2Ele.init(linkMap);
23  thePact2Omtf = translatePact2Omtf(omtfLink2Ele, thePactCabling.get());
24  }
std::unique_ptr< const RPCReadOutMapping > thePactCabling
Definition: OmtfRpcPacker.h:30
MapLBIndex2EleIndex translatePact2Omtf(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
void initCabling(const RPCEMap &readoutMapping)
MapLBIndex2EleIndex thePact2Omtf
Definition: OmtfRpcPacker.h:29

◆ init() [2/2]

void omtf::RpcPacker::init ( const RPCEMap readoutMapping,
const std::string &  connectionFile 
)

Definition at line 26 of file OmtfRpcPacker.cc.

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

26  {
27  initCabling(readoutMapping);
28  RpcLinkMap omtfLink2Ele;
29  omtfLink2Ele.init(connectionFile);
30  thePact2Omtf = translatePact2Omtf(omtfLink2Ele, thePactCabling.get());
31  }
std::unique_ptr< const RPCReadOutMapping > thePactCabling
Definition: OmtfRpcPacker.h:30
MapLBIndex2EleIndex translatePact2Omtf(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
void initCabling(const RPCEMap &readoutMapping)
MapLBIndex2EleIndex thePact2Omtf
Definition: OmtfRpcPacker.h:29

◆ initCabling()

void omtf::RpcPacker::initCabling ( const RPCEMap readoutMapping)
private

Definition at line 14 of file OmtfRpcPacker.cc.

References RPCEMap::convert(), LogDebug, and thePactCabling.

Referenced by init().

14  {
15  thePactCabling.reset(readoutMapping.convert());
16  LogDebug("OmtfPacker") << " Has PACT readout map, VERSION: " << thePactCabling->version() << std::endl;
17  }
std::unique_ptr< const RPCReadOutMapping > thePactCabling
Definition: OmtfRpcPacker.h:30
RPCReadOutMapping const * convert() const
Definition: RPCEMap.h:64
#define LogDebug(id)

◆ pack()

void omtf::RpcPacker::pack ( const RPCDigiCollection prod,
FedAmcRawsMap raws 
)

Definition at line 33 of file OmtfRpcPacker.cc.

References omtf::EleIndex::amc(), data, RPCPackingModule::eventRecords(), omtf::EleIndex::fed(), postprocess-scan-build::formatter, omtf::EleIndex::link(), LogTrace, push_back(), thePact2Omtf, and thePactCabling.

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

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

Member Data Documentation

◆ thePact2Omtf

MapLBIndex2EleIndex omtf::RpcPacker::thePact2Omtf
private

Definition at line 29 of file OmtfRpcPacker.h.

Referenced by init(), and pack().

◆ thePactCabling

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

Definition at line 30 of file OmtfRpcPacker.h.

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