CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types | Private Attributes
RPCReadOutMappingWithFastSearch Class Reference

#include <RPCReadOutMappingWithFastSearch.h>

Inheritance diagram for RPCReadOutMappingWithFastSearch:
RPCReadOutMapping

Classes

struct  lessMap
 

Public Member Functions

RPCReadOutMapping::StripInDetUnit detUnitFrame (const LinkBoardSpec &location, const LinkBoardPackedStrip &lbstrip) const override
 convert strip location as in raw data (LB and LBchannel) to detUnit frame More...
 
void init (const RPCReadOutMapping *arm)
 takes ownership of map More...
 
const LinkBoardSpeclocation (const LinkBoardElectronicIndex &ele) const override
 conversion between electronic and detector indexing More...
 
 RPCReadOutMappingWithFastSearch ()
 
 ~RPCReadOutMappingWithFastSearch () override
 
- Public Member Functions inherited from RPCReadOutMapping
void add (const DccSpec &dcc)
 attach FED to map More...
 
const DccSpecdcc (int dccId) const
 FED identified by ID. More...
 
std::vector< const DccSpec * > dccList () const
 all FEDs in map More...
 
std::pair< int, int > dccNumberRange () const
 Range of FED IDs in map (min and max id) More...
 
std::vector< const LinkBoardSpec * > getLBforChamber (const std::string &name) const
 
std::pair< LinkBoardElectronicIndex, int > getRAWSpecForCMSChamberSrip (uint32_t detId, int strip, int dccInputChannel) const
 
std::vector< std::pair< LinkBoardElectronicIndex, LinkBoardPackedStrip > > rawDataFrame (const StripInDetUnit &duFrame) const
 connection "paths" that lead from one digi to one strip More...
 
 RPCReadOutMapping (const std::string &version="")
 
const std::string & version () const
 version as string More...
 
virtual ~RPCReadOutMapping ()
 

Private Types

typedef std::map< LinkBoardElectronicIndex, const LinkBoardSpec *, lessMapLBMap
 

Private Attributes

LBMap theLBMap
 
const RPCReadOutMappingtheMapping
 
std::string theVersion
 

Additional Inherited Members

- Public Types inherited from RPCReadOutMapping
typedef std::pair< uint32_t, int > StripInDetUnit
 first member is DetUnit ID, second strip in DetUnit frame More...
 

Detailed Description

Definition at line 8 of file RPCReadOutMappingWithFastSearch.h.

Member Typedef Documentation

◆ LBMap

Definition at line 29 of file RPCReadOutMappingWithFastSearch.h.

Constructor & Destructor Documentation

◆ RPCReadOutMappingWithFastSearch()

RPCReadOutMappingWithFastSearch::RPCReadOutMappingWithFastSearch ( )

Definition at line 28 of file RPCReadOutMappingWithFastSearch.cc.

28 : theMapping(nullptr) {}

◆ ~RPCReadOutMappingWithFastSearch()

RPCReadOutMappingWithFastSearch::~RPCReadOutMappingWithFastSearch ( )
inlineoverride

Definition at line 11 of file RPCReadOutMappingWithFastSearch.h.

11 {}

Member Function Documentation

◆ detUnitFrame()

RPCReadOutMapping::StripInDetUnit RPCReadOutMappingWithFastSearch::detUnitFrame ( const LinkBoardSpec location,
const LinkBoardPackedStrip packedStrip 
) const
overridevirtual

convert strip location as in raw data (LB and LBchannel) to detUnit frame

Reimplemented from RPCReadOutMapping.

Definition at line 70 of file RPCReadOutMappingWithFastSearch.cc.

71  {
72  return theMapping->detUnitFrame(location, lbstrip);
73 }

References RPCReadOutMapping::detUnitFrame(), location(), and theMapping.

◆ init()

void RPCReadOutMappingWithFastSearch::init ( const RPCReadOutMapping arm)

takes ownership of map

Definition at line 30 of file RPCReadOutMappingWithFastSearch.cc.

30  {
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 }

References protons_cff::arm, gather_cfg::cout, LinkBoardElectronicIndex::dccId, LinkBoardElectronicIndex::dccInputChannelNum, TriggerBoardSpec::dccInputChannelNum(), RPCReadOutMapping::dccList(), TriggerBoardSpec::enabledLinkConns(), cuy::ib, DccSpec::id(), LinkBoardElectronicIndex::lbNumInLink, MainPageGenerator::link, LinkBoardSpec::linkBoardNumInLink(), LinkBoardElectronicIndex::tbLinkInputNum, theLBMap, theMapping, theVersion, and DccSpec::triggerBoards().

Referenced by RPCUnpackingModule::beginRun().

◆ location()

const LinkBoardSpec * RPCReadOutMappingWithFastSearch::location ( const LinkBoardElectronicIndex ele) const
overridevirtual

conversion between electronic and detector indexing

Reimplemented from RPCReadOutMapping.

Definition at line 75 of file RPCReadOutMappingWithFastSearch.cc.

75  {
76  LBMap::const_iterator inMap = theLBMap.find(ele);
77  return (inMap != theLBMap.end()) ? inMap->second : nullptr;
78  // return theMapping->location(ele);
79 }

References theLBMap.

Referenced by detUnitFrame().

Member Data Documentation

◆ theLBMap

LBMap RPCReadOutMappingWithFastSearch::theLBMap
private

Definition at line 30 of file RPCReadOutMappingWithFastSearch.h.

Referenced by init(), and location().

◆ theMapping

const RPCReadOutMapping* RPCReadOutMappingWithFastSearch::theMapping
private

Definition at line 23 of file RPCReadOutMappingWithFastSearch.h.

Referenced by detUnitFrame(), and init().

◆ theVersion

std::string RPCReadOutMappingWithFastSearch::theVersion
private

Definition at line 22 of file RPCReadOutMappingWithFastSearch.h.

Referenced by init().

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
LinkBoardElectronicIndex::dccInputChannelNum
int dccInputChannelNum
Definition: LinkBoardElectronicIndex.h:12
DccSpec::triggerBoards
const std::vector< TriggerBoardSpec > & triggerBoards() const
Definition: DccSpec.h:26
DccSpec::id
int id() const
id of FED
Definition: DccSpec.h:22
LinkBoardElectronicIndex::tbLinkInputNum
int tbLinkInputNum
Definition: LinkBoardElectronicIndex.h:13
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
cuy.ib
ib
Definition: cuy.py:661
RPCReadOutMapping::dccList
std::vector< const DccSpec * > dccList() const
all FEDs in map
Definition: RPCReadOutMapping.cc:26
LinkBoardElectronicIndex
Definition: LinkBoardElectronicIndex.h:10
protons_cff.arm
arm
Definition: protons_cff.py:39
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::theLBMap
LBMap theLBMap
Definition: RPCReadOutMappingWithFastSearch.h:30
RPCReadOutMappingWithFastSearch::theMapping
const RPCReadOutMapping * theMapping
Definition: RPCReadOutMappingWithFastSearch.h:23
LinkBoardElectronicIndex::lbNumInLink
int lbNumInLink
Definition: LinkBoardElectronicIndex.h:14