CMS 3D CMS Logo

OmtfRpcPacker.cc
Go to the documentation of this file.
2 
6 
14 
15 namespace omtf {
16 
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 }
23 
25 {
26  initCabling(es);
27  RpcLinkMap omtfLink2Ele;
28  omtfLink2Ele.init(es);
30 }
31 
32 void RpcPacker::init(const edm::EventSetup & es, const std::string & connectionFile)
33 {
34  initCabling(es);
35  RpcLinkMap omtfLink2Ele;
36  omtfLink2Ele.init(connectionFile);
38 }
39 
40 void RpcPacker::pack(const RPCDigiCollection * digis, FedAmcRawsMap & raws)
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) {
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 }
63 
64 };
#define LogDebug(id)
MapLBIndex2EleIndex translatePact2Omtf(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
void initCabling(const edm::EventSetup &es)
static std::vector< rpcrawtodigi::EventRecords > eventRecords(int fedId, int trigger_BX, const RPCDigiCollection *, const RPCRecordFormatter &)
std::map< std::pair< unsigned int, unsigned int >, std::vector< Word64 > > FedAmcRawsMap
void pack(const RPCDigiCollection *prod, FedAmcRawsMap &raws)
unsigned int fed() const
Definition: OmtfEleIndex.h:19
const std::string & version() const
version as string
#define LogTrace(id)
const RPCReadOutMapping * thePactCabling
Definition: OmtfRpcPacker.h:27
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
unsigned int amc() const
Definition: OmtfEleIndex.h:20
T get() const
Definition: EventSetup.h:63
MapLBIndex2EleIndex thePact2Omtf
Definition: OmtfRpcPacker.h:26
RPCReadOutMapping const * convert() const
Definition: RPCEMap.h:67
void init(const edm::EventSetup &es)
unsigned int link() const
Definition: OmtfEleIndex.h:21
void init(const edm::EventSetup &es)