CMS 3D CMS Logo

RPCReadOutMappingWithFastSearch Class Reference

#include <EventFilter/RPCRawToDigi/plugins/RPCReadOutMappingWithFastSearch.h>

Inheritance diagram for RPCReadOutMappingWithFastSearch:

RPCReadOutMapping

List of all members.

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

Classes

struct  lessMap


Detailed Description

Definition at line 8 of file RPCReadOutMappingWithFastSearch.h.


Member Typedef Documentation

typedef std::map<LinkBoardElectronicIndex, const LinkBoardSpec*, lessMap> RPCReadOutMappingWithFastSearch::LBMap [private]

Definition at line 29 of file RPCReadOutMappingWithFastSearch.h.


Constructor & Destructor Documentation

RPCReadOutMappingWithFastSearch::RPCReadOutMappingWithFastSearch (  ) 

Definition at line 22 of file RPCReadOutMappingWithFastSearch.cc.

00023    : theMapping(0)
00024 {}

virtual RPCReadOutMappingWithFastSearch::~RPCReadOutMappingWithFastSearch (  )  [inline, virtual]

Definition at line 11 of file RPCReadOutMappingWithFastSearch.h.

00011 {} 


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.

00073 {
00074   return theMapping->detUnitFrame(location,lbstrip);
00075 }

void RPCReadOutMappingWithFastSearch::init ( const RPCReadOutMapping arm  ) 

takes ownership of map

Definition at line 26 of file RPCReadOutMappingWithFastSearch.cc.

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

Referenced by RPCUnpackingModule::produce().

00027 {
00028   if (theVersion==arm->version()) return;
00029 
00030   theVersion=arm->version();
00031   theLBMap.clear();
00032   theMapping = arm;
00033 
00034   typedef vector<const DccSpec*> DCCLIST;
00035   DCCLIST dccList = arm->dccList();
00036   for (DCCLIST::const_iterator idcc = dccList.begin(), idccEnd = dccList.end(); 
00037       idcc < idccEnd; ++idcc) {
00038     const DccSpec & dccSpec = **idcc;
00039     const std::vector<TriggerBoardSpec> & triggerBoards = dccSpec.triggerBoards();
00040     for ( std::vector<TriggerBoardSpec>::const_iterator
00041         it = triggerBoards.begin(); it != triggerBoards.end(); it++) {
00042       const TriggerBoardSpec & triggerBoard = (*it);
00043       typedef std::vector<const LinkConnSpec* > LINKS;
00044       LINKS linkConns = triggerBoard.enabledLinkConns();
00045       for ( LINKS::const_iterator ic = linkConns.begin(); ic != linkConns.end(); ic++) {
00046 
00047         const LinkConnSpec & link = **ic;
00048         const std::vector<LinkBoardSpec> & boards = link.linkBoards();
00049         for ( std::vector<LinkBoardSpec>::const_iterator
00050             ib = boards.begin(); ib != boards.end(); ib++) {
00051 
00052           const LinkBoardSpec & board = (*ib);
00053 
00054           LinkBoardElectronicIndex eleIndex;
00055           eleIndex.dccId = dccSpec.id();
00056           eleIndex.dccInputChannelNum = triggerBoard.dccInputChannelNum();
00057           eleIndex.tbLinkInputNum = link.triggerBoardInputNumber();
00058           eleIndex.lbNumInLink = board.linkBoardNumInLink();
00059           LBMap::iterator inMap = theLBMap.find(eleIndex);  
00060           if (inMap != theLBMap.end()) {
00061             cout <<"The element in map already exists!"<< endl;
00062           } else {
00063             theLBMap[eleIndex] = &board;
00064           }
00065         }
00066       }  
00067     }
00068   }
00069 }

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.

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


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]

Reimplemented from RPCReadOutMapping.

Definition at line 22 of file RPCReadOutMappingWithFastSearch.h.

Referenced by init().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:31:05 2009 for CMSSW by  doxygen 1.5.4