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

virtual RPCReadOutMapping::StripInDetUnit detUnitFrame (const LinkBoardSpec &location, const LinkBoardPackedStrip &lbstrip) const
 convert strip location as in raw data (LB and LBchannel) to detUnit frame More...
 
void init (const RPCReadOutMapping *arm)
 takes ownership of map More...
 
virtual const LinkBoardSpeclocation (const LinkBoardElectronicIndex &ele) const
 conversion between electronic and detector indexing More...
 
 RPCReadOutMappingWithFastSearch ()
 
virtual ~RPCReadOutMappingWithFastSearch ()
 
- 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

Definition at line 29 of file RPCReadOutMappingWithFastSearch.h.

Constructor & Destructor Documentation

RPCReadOutMappingWithFastSearch::RPCReadOutMappingWithFastSearch ( )

Definition at line 22 of file RPCReadOutMappingWithFastSearch.cc.

23  : theMapping(0)
24 {}
virtual RPCReadOutMappingWithFastSearch::~RPCReadOutMappingWithFastSearch ( )
inlinevirtual

Definition at line 11 of file RPCReadOutMappingWithFastSearch.h.

References detUnitFrame(), init(), and location().

11 {}

Member Function Documentation

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

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

Reimplemented from RPCReadOutMapping.

Definition at line 71 of file RPCReadOutMappingWithFastSearch.cc.

References RPCReadOutMapping::detUnitFrame(), and theMapping.

Referenced by ~RPCReadOutMappingWithFastSearch().

73 {
74  return theMapping->detUnitFrame(location,lbstrip);
75 }
virtual StripInDetUnit detUnitFrame(const LinkBoardSpec &location, const LinkBoardPackedStrip &packedStrip) const
convert strip location as in raw data (LB and LBchannel) to detUnit frame
void RPCReadOutMappingWithFastSearch::init ( const RPCReadOutMapping arm)

takes ownership of map

Definition at line 26 of file RPCReadOutMappingWithFastSearch.cc.

References gather_cfg::cout, LinkBoardElectronicIndex::dccId, LinkBoardElectronicIndex::dccInputChannelNum, TriggerBoardSpec::dccInputChannelNum(), RPCReadOutMapping::dccList(), TriggerBoardSpec::enabledLinkConns(), cuy::ib, DccSpec::id(), LinkBoardElectronicIndex::lbNumInLink, LinkBoardSpec::linkBoardNumInLink(), LinkConnSpec::linkBoards(), LinkBoardElectronicIndex::tbLinkInputNum, theLBMap, theMapping, theVersion, LinkConnSpec::triggerBoardInputNumber(), DccSpec::triggerBoards(), and RPCReadOutMapping::version().

Referenced by RPCUnpackingModule::beginRun(), and ~RPCReadOutMappingWithFastSearch().

27 {
28  if (theVersion==arm->version()) return;
29 
30  theVersion=arm->version();
31  theLBMap.clear();
32  theMapping = arm;
33 
34  typedef vector<const DccSpec*> DCCLIST;
35  DCCLIST dccList = arm->dccList();
36  for (DCCLIST::const_iterator idcc = dccList.begin(), idccEnd = dccList.end();
37  idcc < idccEnd; ++idcc) {
38  const DccSpec & dccSpec = **idcc;
39  const std::vector<TriggerBoardSpec> & triggerBoards = dccSpec.triggerBoards();
40  for ( std::vector<TriggerBoardSpec>::const_iterator
41  it = triggerBoards.begin(); it != triggerBoards.end(); it++) {
42  const TriggerBoardSpec & triggerBoard = (*it);
43  typedef std::vector<const LinkConnSpec* > LINKS;
44  LINKS linkConns = triggerBoard.enabledLinkConns();
45  for ( LINKS::const_iterator ic = linkConns.begin(); ic != linkConns.end(); ic++) {
46 
47  const LinkConnSpec & link = **ic;
48  const std::vector<LinkBoardSpec> & boards = link.linkBoards();
49  for ( std::vector<LinkBoardSpec>::const_iterator
50  ib = boards.begin(); ib != boards.end(); ib++) {
51 
52  const LinkBoardSpec & board = (*ib);
53 
54  LinkBoardElectronicIndex eleIndex;
55  eleIndex.dccId = dccSpec.id();
56  eleIndex.dccInputChannelNum = triggerBoard.dccInputChannelNum();
57  eleIndex.tbLinkInputNum = link.triggerBoardInputNumber();
58  eleIndex.lbNumInLink = board.linkBoardNumInLink();
59  LBMap::iterator inMap = theLBMap.find(eleIndex);
60  if (inMap != theLBMap.end()) {
61  cout <<"The element in map already exists!"<< endl;
62  } else {
63  theLBMap[eleIndex] = &board;
64  }
65  }
66  }
67  }
68  }
69 }
const std::vector< TriggerBoardSpec > & triggerBoards() const
Definition: DccSpec.h:27
int id() const
id of FED
Definition: DccSpec.h:23
std::vector< const LinkConnSpec * > enabledLinkConns() const
not masked links belonging to this TB
std::vector< const DccSpec * > dccList() const
all FEDs in map
int triggerBoardInputNumber() const
this link input number in TriggerBoard
Definition: LinkConnSpec.h:21
const std::string & version() const
version as string
int dccInputChannelNum() const
input channel number to DCC
int linkBoardNumInLink() const
this LB number in link
Definition: LinkBoardSpec.h:26
const std::vector< LinkBoardSpec > & linkBoards() const
Definition: LinkConnSpec.h:26
ib
Definition: cuy.py:660
const LinkBoardSpec * RPCReadOutMappingWithFastSearch::location ( const LinkBoardElectronicIndex ele) const
virtual

conversion between electronic and detector indexing

Reimplemented from RPCReadOutMapping.

Definition at line 77 of file RPCReadOutMappingWithFastSearch.cc.

References theLBMap.

Referenced by ~RPCReadOutMappingWithFastSearch().

78 {
79  LBMap::const_iterator inMap = theLBMap.find(ele);
80  return (inMap!= theLBMap.end()) ? inMap->second : 0;
81 // return theMapping->location(ele);
82 }

Member Data Documentation

LBMap RPCReadOutMappingWithFastSearch::theLBMap
private

Definition at line 30 of file RPCReadOutMappingWithFastSearch.h.

Referenced by init(), and location().

const RPCReadOutMapping* RPCReadOutMappingWithFastSearch::theMapping
private

Definition at line 23 of file RPCReadOutMappingWithFastSearch.h.

Referenced by detUnitFrame(), and init().

std::string RPCReadOutMappingWithFastSearch::theVersion
private

Definition at line 22 of file RPCReadOutMappingWithFastSearch.h.

Referenced by init().