CMS 3D CMS Logo

RPCReadOutMappingWithFastSearch.cc
Go to the documentation of this file.
2 #include <vector>
3 #include <iostream>
4 
5 using namespace std;
6 
8  const LinkBoardElectronicIndex& lb2) const {
9  if (lb1.dccId < lb2.dccId)
10  return true;
11  if (lb1.dccId > lb2.dccId)
12  return false;
14  return true;
16  return false;
17  if (lb1.tbLinkInputNum < lb2.tbLinkInputNum)
18  return true;
19  if (lb1.tbLinkInputNum > lb2.tbLinkInputNum)
20  return false;
21  if (lb1.lbNumInLink < lb2.lbNumInLink)
22  return true;
23  if (lb1.lbNumInLink > lb2.lbNumInLink)
24  return false;
25  return false;
26 }
27 
29 
31  if (theVersion == arm->version())
32  return;
33 
34  theVersion = arm->version();
35  theLBMap.clear();
36  theMapping = arm;
37 
38  typedef vector<const DccSpec*> DCCLIST;
39  DCCLIST dccList = arm->dccList();
40  for (DCCLIST::const_iterator idcc = dccList.begin(), idccEnd = dccList.end(); idcc < idccEnd; ++idcc) {
41  const DccSpec& dccSpec = **idcc;
42  const std::vector<TriggerBoardSpec>& triggerBoards = dccSpec.triggerBoards();
43  for (std::vector<TriggerBoardSpec>::const_iterator it = triggerBoards.begin(); it != triggerBoards.end(); it++) {
44  const TriggerBoardSpec& triggerBoard = (*it);
45  typedef std::vector<const LinkConnSpec*> LINKS;
46  LINKS linkConns = triggerBoard.enabledLinkConns();
47  for (LINKS::const_iterator ic = linkConns.begin(); ic != linkConns.end(); ic++) {
48  const LinkConnSpec& link = **ic;
49  const std::vector<LinkBoardSpec>& boards = link.linkBoards();
50  for (std::vector<LinkBoardSpec>::const_iterator ib = boards.begin(); ib != boards.end(); ib++) {
51  const LinkBoardSpec& board = (*ib);
52 
53  LinkBoardElectronicIndex eleIndex;
54  eleIndex.dccId = dccSpec.id();
55  eleIndex.dccInputChannelNum = triggerBoard.dccInputChannelNum();
56  eleIndex.tbLinkInputNum = link.triggerBoardInputNumber();
57  eleIndex.lbNumInLink = board.linkBoardNumInLink();
58  LBMap::iterator inMap = theLBMap.find(eleIndex);
59  if (inMap != theLBMap.end()) {
60  cout << "The element in map already exists!" << endl;
61  } else {
62  theLBMap[eleIndex] = &board;
63  }
64  }
65  }
66  }
67  }
68 }
69 
71  const LinkBoardSpec& location, const LinkBoardPackedStrip& lbstrip) const {
72  return theMapping->detUnitFrame(location, lbstrip);
73 }
74 
76  LBMap::const_iterator inMap = theLBMap.find(ele);
77  return (inMap != theLBMap.end()) ? inMap->second : nullptr;
78  // return theMapping->location(ele);
79 }
RPCReadOutMappingWithFastSearch::location
const LinkBoardSpec * location(const LinkBoardElectronicIndex &ele) const override
conversion between electronic and detector indexing
Definition: RPCReadOutMappingWithFastSearch.cc:75
TriggerBoardSpec::enabledLinkConns
std::vector< const LinkConnSpec * > enabledLinkConns() const
not masked links belonging to this TB
Definition: TriggerBoardSpec.cc:18
MainPageGenerator.link
link
Definition: MainPageGenerator.py:271
LinkConnSpec
Definition: LinkConnSpec.h:14
gather_cfg.cout
cout
Definition: gather_cfg.py:144
LinkBoardElectronicIndex::dccId
int dccId
Definition: LinkBoardElectronicIndex.h:11
RPCReadOutMappingWithFastSearch::detUnitFrame
RPCReadOutMapping::StripInDetUnit detUnitFrame(const LinkBoardSpec &location, const LinkBoardPackedStrip &lbstrip) const override
convert strip location as in raw data (LB and LBchannel) to detUnit frame
Definition: RPCReadOutMappingWithFastSearch.cc:70
RPCReadOutMapping::version
const std::string & version() const
version as string
Definition: RPCReadOutMapping.h:43
LinkBoardElectronicIndex::dccInputChannelNum
int dccInputChannelNum
Definition: LinkBoardElectronicIndex.h:12
RPCReadOutMappingWithFastSearch::init
void init(const RPCReadOutMapping *arm)
takes ownership of map
Definition: RPCReadOutMappingWithFastSearch.cc:30
DccSpec::triggerBoards
const std::vector< TriggerBoardSpec > & triggerBoards() const
Definition: DccSpec.h:26
DccSpec::id
int id() const
id of FED
Definition: DccSpec.h:22
RPCReadOutMappingWithFastSearch::RPCReadOutMappingWithFastSearch
RPCReadOutMappingWithFastSearch()
Definition: RPCReadOutMappingWithFastSearch.cc:28
LinkBoardElectronicIndex::tbLinkInputNum
int tbLinkInputNum
Definition: LinkBoardElectronicIndex.h:13
RPCReadOutMappingWithFastSearch::lessMap::operator()
bool operator()(const LinkBoardElectronicIndex &lb1, const LinkBoardElectronicIndex &lb2) const
Definition: RPCReadOutMappingWithFastSearch.cc:7
RPCReadOutMapping::detUnitFrame
virtual StripInDetUnit detUnitFrame(const LinkBoardSpec &location, const LinkBoardPackedStrip &packedStrip) const
convert strip location as in raw data (LB and LBchannel) to detUnit frame
Definition: RPCReadOutMapping.cc:113
RPCReadOutMappingWithFastSearch::theVersion
std::string theVersion
Definition: RPCReadOutMappingWithFastSearch.h:22
LinkBoardSpec
Definition: LinkBoardSpec.h:13
LinkBoardSpec::linkBoardNumInLink
int linkBoardNumInLink() const
this LB number in link
Definition: LinkBoardSpec.h:26
RPCReadOutMapping
Definition: RPCReadOutMapping.h:22
cuy.ib
ib
Definition: cuy.py:662
RPCReadOutMapping::dccList
std::vector< const DccSpec * > dccList() const
all FEDs in map
Definition: RPCReadOutMapping.cc:26
LinkBoardElectronicIndex
Definition: LinkBoardElectronicIndex.h:10
std
Definition: JetResolutionObject.h:76
TriggerBoardSpec::dccInputChannelNum
int dccInputChannelNum() const
input channel number to DCC
Definition: TriggerBoardSpec.h:20
DccSpec
Definition: DccSpec.h:16
TriggerBoardSpec
Definition: TriggerBoardSpec.h:14
RPCReadOutMappingWithFastSearch.h
LinkBoardPackedStrip
Definition: LinkBoardPackedStrip.h:4
RPCReadOutMapping::StripInDetUnit
std::pair< uint32_t, int > StripInDetUnit
first member is DetUnit ID, second strip in DetUnit frame
Definition: RPCReadOutMapping.h:25
RPCReadOutMappingWithFastSearch::theLBMap
LBMap theLBMap
Definition: RPCReadOutMappingWithFastSearch.h:30
EcalCondDBWriter_cfi.location
location
Definition: EcalCondDBWriter_cfi.py:63
RPCReadOutMappingWithFastSearch::theMapping
const RPCReadOutMapping * theMapping
Definition: RPCReadOutMappingWithFastSearch.h:23
LinkBoardElectronicIndex::lbNumInLink
int lbNumInLink
Definition: LinkBoardElectronicIndex.h:14