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.reset(readoutMapping->convert());
21  LogDebug("OmtfPacker") << " Has PACT readout map, VERSION: " << thePactCabling->version() << std::endl;
22  }
23 
24  void RpcPacker::init(const edm::EventSetup& es) {
25  initCabling(es);
26  RpcLinkMap omtfLink2Ele;
27  omtfLink2Ele.init(es);
28  thePact2Omtf = translatePact2Omtf(omtfLink2Ele, thePactCabling.get());
29  }
30 
31  void RpcPacker::init(const edm::EventSetup& es, const std::string& connectionFile) {
32  initCabling(es);
33  RpcLinkMap omtfLink2Ele;
34  omtfLink2Ele.init(connectionFile);
35  thePact2Omtf = translatePact2Omtf(omtfLink2Ele, thePactCabling.get());
36  }
37 
38  void RpcPacker::pack(const RPCDigiCollection* digis, FedAmcRawsMap& raws) {
39  LogTrace("") << " HERE HERE !!! RPC PACKER" << rpcrawtodigi::DebugDigisPrintout()(digis);
40  for (int dcc = 790; dcc <= 792; dcc++) {
41  RPCRecordFormatter formatter(dcc, thePactCabling.get());
42  const std::vector<rpcrawtodigi::EventRecords>& merged =
43  RPCPackingModule::eventRecords(dcc, 200, digis, formatter);
44  LogTrace("") << " SIZE OF MERGED, for DCC=" << dcc << " is: " << merged.size() << std::endl;
45  for (const auto& rpcEvent : merged) {
47  data.bxNum_ = rpcEvent.dataToTriggerDelay();
48  data.frame1_ = rpcEvent.recordCD().data();
49  LinkBoardElectronicIndex rpcEle = {
50  dcc, rpcEvent.recordSLD().rmb(), rpcEvent.recordSLD().tbLinkInputNumber(), rpcEvent.recordCD().lbInLink()};
51  auto it = thePact2Omtf.find(rpcEle);
52  if (it != thePact2Omtf.end()) {
53  const EleIndex& omtfEle1 = it->second.first;
54  const EleIndex& omtfEle2 = it->second.second;
55  if (omtfEle1.fed()) {
56  data.linkNum_ = omtfEle1.link();
57  raws[std::make_pair(omtfEle1.fed(), omtfEle1.amc() * 2 - 1)].push_back(data.rawData);
58  }
59  if (omtfEle2.fed()) {
60  data.linkNum_ = omtfEle2.link();
61  raws[std::make_pair(omtfEle2.fed(), omtfEle2.amc() * 2 - 1)].push_back(data.rawData);
62  }
63  }
64  }
65  }
66  }
67 
68 }; // namespace omtf
omtf::RpcPacker::thePact2Omtf
MapLBIndex2EleIndex thePact2Omtf
Definition: OmtfRpcPacker.h:28
RPCRecordFormatter
Definition: RPCRecordFormatter.h:15
ESTransientHandle.h
MessageLogger.h
RPCReadOutMapping.h
omtf::RpcPacker::initCabling
void initCabling(const edm::EventSetup &es)
Definition: OmtfRpcPacker.cc:17
RPCEMap::convert
RPCReadOutMapping const * convert() const
Definition: RPCEMap.h:64
RPCRecordFormatter.h
omtf::EleIndex::amc
unsigned int amc() const
Definition: OmtfEleIndex.h:23
omtf::RpcLinkMap::init
void init(const edm::EventSetup &es)
Definition: OmtfLinkMappingRpc.cc:78
DebugDigisPrintout.h
RPCEMapRcd.h
RPCDigiCollection
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
omtf::EleIndex
Definition: OmtfEleIndex.h:9
omtf::RpcPacker::pack
void pack(const RPCDigiCollection *prod, FedAmcRawsMap &raws)
Definition: OmtfRpcPacker.cc:38
omtf::RpcPacker::init
void init(const edm::EventSetup &es)
Definition: OmtfRpcPacker.cc:24
omtf::FedAmcRawsMap
std::map< std::pair< unsigned int, unsigned int >, std::vector< Word64 > > FedAmcRawsMap
Definition: OmtfDataWord64.h:13
omtf::RpcLinkMap
Definition: OmtfLinkMappingRpc.h:32
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
omtf::EleIndex::link
unsigned int link() const
Definition: OmtfEleIndex.h:24
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
OmtfRpcDataWord64.h
omtf::RpcPacker::thePactCabling
std::unique_ptr< const RPCReadOutMapping > thePactCabling
Definition: OmtfRpcPacker.h:29
omtf::RpcDataWord64
Definition: OmtfRpcDataWord64.h:9
edm::EventSetup
Definition: EventSetup.h:57
omtf::translatePact2Omtf
MapLBIndex2EleIndex translatePact2Omtf(const RpcLinkMap &omtfLnks, const RPCReadOutMapping *pactCabling)
Definition: OmtfLinkMappingRpc.cc:63
get
#define get
RPCEMapRcd
Definition: RPCEMapRcd.h:5
omtf::EleIndex::fed
unsigned int fed() const
Definition: OmtfEleIndex.h:22
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
OmtfRpcPacker.h
LinkBoardElectronicIndex
Definition: LinkBoardElectronicIndex.h:10
RPCPackingModule.h
EventSetup.h
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
rpcrawtodigi::DebugDigisPrintout
Definition: DebugDigisPrintout.h:11
RPCPackingModule::eventRecords
static std::vector< rpcrawtodigi::EventRecords > eventRecords(int fedId, int trigger_BX, const RPCDigiCollection *, const RPCRecordFormatter &)
Definition: RPCPackingModule.cc:129
RPCEMap.h
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
omtf
Definition: OmtfCscDataWord64.h:7