CMS 3D CMS Logo

Classes | Public Member Functions | Private Types | Private Attributes

RPCReadOutMappingWithFastSearch Class Reference

#include <RPCReadOutMappingWithFastSearch.h>

Inheritance diagram for RPCReadOutMappingWithFastSearch:
RPCReadOutMapping

List of all members.

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
void init (const RPCReadOutMapping *arm)
 takes ownership of map
virtual const LinkBoardSpeclocation (const LinkBoardElectronicIndex &ele) const
 conversion between electronic and detector indexing
 RPCReadOutMappingWithFastSearch ()
virtual ~RPCReadOutMappingWithFastSearch ()

Private Types

typedef std::map
< LinkBoardElectronicIndex,
const LinkBoardSpec *, lessMap
LBMap

Private Attributes

LBMap theLBMap
const RPCReadOutMappingtheMapping
std::string theVersion

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.

   : theMapping(0)
{}
virtual RPCReadOutMappingWithFastSearch::~RPCReadOutMappingWithFastSearch ( ) [inline, virtual]

Definition at line 11 of file RPCReadOutMappingWithFastSearch.h.

{} 

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.

{
  return theMapping->detUnitFrame(location,lbstrip);
}
void RPCReadOutMappingWithFastSearch::init ( const RPCReadOutMapping arm)

takes ownership of map

Definition at line 26 of file RPCReadOutMappingWithFastSearch.cc.

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

Referenced by RPCUnpackingModule::beginRun().

{
  if (theVersion==arm->version()) return;

  theVersion=arm->version();
  theLBMap.clear();
  theMapping = arm;

  typedef vector<const DccSpec*> DCCLIST;
  DCCLIST dccList = arm->dccList();
  for (DCCLIST::const_iterator idcc = dccList.begin(), idccEnd = dccList.end(); 
      idcc < idccEnd; ++idcc) {
    const DccSpec & dccSpec = **idcc;
    const std::vector<TriggerBoardSpec> & triggerBoards = dccSpec.triggerBoards();
    for ( std::vector<TriggerBoardSpec>::const_iterator
        it = triggerBoards.begin(); it != triggerBoards.end(); it++) {
      const TriggerBoardSpec & triggerBoard = (*it);
      typedef std::vector<const LinkConnSpec* > LINKS;
      LINKS linkConns = triggerBoard.enabledLinkConns();
      for ( LINKS::const_iterator ic = linkConns.begin(); ic != linkConns.end(); ic++) {

        const LinkConnSpec & link = **ic;
        const std::vector<LinkBoardSpec> & boards = link.linkBoards();
        for ( std::vector<LinkBoardSpec>::const_iterator
            ib = boards.begin(); ib != boards.end(); ib++) {

          const LinkBoardSpec & board = (*ib);

          LinkBoardElectronicIndex eleIndex;
          eleIndex.dccId = dccSpec.id();
          eleIndex.dccInputChannelNum = triggerBoard.dccInputChannelNum();
          eleIndex.tbLinkInputNum = link.triggerBoardInputNumber();
          eleIndex.lbNumInLink = board.linkBoardNumInLink();
          LBMap::iterator inMap = theLBMap.find(eleIndex);  
          if (inMap != theLBMap.end()) {
            cout <<"The element in map already exists!"<< endl;
          } else {
            theLBMap[eleIndex] = &board;
          }
        }
      }  
    }
  }
}
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.

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

Member Data Documentation

Definition at line 30 of file RPCReadOutMappingWithFastSearch.h.

Referenced by init(), and location().

Definition at line 23 of file RPCReadOutMappingWithFastSearch.h.

Referenced by detUnitFrame(), and init().

Reimplemented from RPCReadOutMapping.

Definition at line 22 of file RPCReadOutMappingWithFastSearch.h.

Referenced by init().