CMS 3D CMS Logo

Classes | Public Member Functions | Private Types | Private Attributes

SiPixelFedCablingMap Class Reference

#include <SiPixelFedCablingMap.h>

Inheritance diagram for SiPixelFedCablingMap:
SiPixelFedCabling

List of all members.

Classes

struct  Key

Public Member Functions

SiPixelFedCablingTreecablingTree () const
std::vector< unsigned int > fedIds () const
virtual const
sipixelobjects::PixelROC
findItem (const sipixelobjects::CablingPathToDetUnit &path) const
virtual std::vector
< sipixelobjects::CablingPathToDetUnit
pathToDetUnit (uint32_t rawDetId) const
 SiPixelFedCablingMap (const std::string &version="")
 SiPixelFedCablingMap (const SiPixelFedCablingTree *cab)
virtual std::string version () const
virtual ~SiPixelFedCablingMap ()

Private Types

typedef std::map< Key,
sipixelobjects::PixelROC
Map

Private Attributes

Map theMap
std::string theVersion

Detailed Description

Definition at line 12 of file SiPixelFedCablingMap.h.


Member Typedef Documentation

Definition at line 37 of file SiPixelFedCablingMap.h.


Constructor & Destructor Documentation

SiPixelFedCablingMap::SiPixelFedCablingMap ( const SiPixelFedCablingTree cab)

Definition at line 24 of file SiPixelFedCablingMap.cc.

References gather_cfg::cout, SiPixelFedCablingTree::fedList(), sipixelobjects::PixelFEDLink::id(), sipixelobjects::PixelROC::idInLink(), combine::key, link(), sipixelobjects::PixelFEDLink::numberOfROCs(), sipixelobjects::PixelFEDLink::roc(), and theMap.

  : theVersion(cab->version())
{
// std::cout << "HERE --- SiPixelFedCablingMap CTOR" << std::endl;
  
  std::vector<const PixelFEDCabling *> fedList = cab->fedList();
  for (std::vector<const PixelFEDCabling *>::const_iterator ifed=fedList.begin();
   ifed != fedList.end(); ifed++) {
    int fed = (**ifed).id();
    int numLink = (**ifed).numberOfLinks();
    for (int link=1; link <= numLink; link++) {
      const PixelFEDLink * pLink = (**ifed).link(link); 
      if (pLink==0) continue;
      int linkId = static_cast<int>(pLink->id());
      if (linkId != 0 && linkId!= link) 
          std::cout << "PROBLEM WITH LINK NUMBER!!!!" << std::endl;
      int numberROC = pLink->numberOfROCs(); 
      for (int roc=1; roc <= numberROC; roc++) {
        const PixelROC * pROC = pLink->roc(roc);
        if (pROC==0) continue;
        if (static_cast<int>(pROC->idInLink()) != roc) 
            std::cout << "PROBLEM WITH ROC NUMBER!!!!" << std::endl;
        Key key = {fed, link, roc}; 
        theMap[key] = (*pROC);
      }
    } 
  }  
}
SiPixelFedCablingMap::SiPixelFedCablingMap ( const std::string &  version = "") [inline]

Definition at line 18 of file SiPixelFedCablingMap.h.

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

Definition at line 20 of file SiPixelFedCablingMap.h.

{}

Member Function Documentation

SiPixelFedCablingTree * SiPixelFedCablingMap::cablingTree ( ) const

Definition at line 53 of file SiPixelFedCablingMap.cc.

References SiPixelFedCablingTree::addItem(), theMap, theVersion, and diffTreeTool::tree.

{
  SiPixelFedCablingTree * tree = new SiPixelFedCablingTree(theVersion); 
  for (Map::const_iterator im = theMap.begin(); im != theMap.end(); im++) {
    const sipixelobjects::PixelROC & roc = im->second;
    unsigned int fedId = im->first.fed;
    unsigned int linkId = im->first.link;
    tree->addItem(fedId, linkId,  roc);
  }
  return tree;
}
std::vector< unsigned int > SiPixelFedCablingMap::fedIds ( ) const

Definition at line 65 of file SiPixelFedCablingMap.cc.

References spr::find(), query::result, and theMap.

{
  std::vector<unsigned int> result;
  for (Map::const_iterator im = theMap.begin(); im != theMap.end(); im++) {
    unsigned int fedId = im->first.fed;
    if (find(result.begin(),result.end(),fedId) == result.end()) result.push_back(fedId);
  }
  return result;
}
const sipixelobjects::PixelROC * SiPixelFedCablingMap::findItem ( const sipixelobjects::CablingPathToDetUnit path) const [virtual]

Implements SiPixelFedCabling.

Definition at line 75 of file SiPixelFedCablingMap.cc.

References sipixelobjects::CablingPathToDetUnit::fed, combine::key, sipixelobjects::CablingPathToDetUnit::link, sipixelobjects::CablingPathToDetUnit::roc, and theMap.

{
  const PixelROC* roc = 0;
  Key key = {path.fed, path.link, path.roc};
  Map::const_iterator inMap = theMap.find(key);
  if (inMap!= theMap.end()) roc = &(inMap->second);
  return roc;
}
std::vector< sipixelobjects::CablingPathToDetUnit > SiPixelFedCablingMap::pathToDetUnit ( uint32_t  rawDetId) const [virtual]

Implements SiPixelFedCabling.

Definition at line 85 of file SiPixelFedCablingMap.cc.

References getHLTPrescaleColumns::path, query::result, and theMap.

{
  std::vector<sipixelobjects::CablingPathToDetUnit> result;
  for (Map::const_iterator im = theMap.begin(); im != theMap.end(); ++im) {
    if(im->second.rawId()==rawDetId ) {
      CablingPathToDetUnit path = {im->first.fed, im->first.link, im->first.roc};
      result.push_back(path);
    }
  }
  return result;
}
virtual std::string SiPixelFedCablingMap::version ( ) const [inline, virtual]

Implements SiPixelFedCabling.

Definition at line 24 of file SiPixelFedCablingMap.h.

References theVersion.

{ return theVersion; }

Member Data Documentation

std::string SiPixelFedCablingMap::theVersion [private]

Definition at line 36 of file SiPixelFedCablingMap.h.

Referenced by cablingTree(), and version().