CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Types | Private Attributes
SiPixelFedCablingMap Class Reference

#include <SiPixelFedCablingMap.h>

Inheritance diagram for SiPixelFedCablingMap:
SiPixelFedCabling

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 SiPixelFedCablingTree *cab)
 
 SiPixelFedCablingMap (const std::string &version="")
 
virtual std::string version () const
 
virtual ~SiPixelFedCablingMap ()
 
- Public Member Functions inherited from SiPixelFedCabling
virtual ~SiPixelFedCabling ()
 

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.

25  : theVersion(cab->version())
26 {
27 // std::cout << "HERE --- SiPixelFedCablingMap CTOR" << std::endl;
28 
29  std::vector<const PixelFEDCabling *> fedList = cab->fedList();
30  for (std::vector<const PixelFEDCabling *>::const_iterator ifed=fedList.begin();
31  ifed != fedList.end(); ifed++) {
32  unsigned int fed = (**ifed).id();
33  unsigned int numLink = (**ifed).numberOfLinks();
34  for (unsigned int link=1; link <= numLink; link++) {
35  const PixelFEDLink * pLink = (**ifed).link(link);
36  if (pLink==0) continue;
37  unsigned int linkId = pLink->id();
38  if (linkId != 0 && linkId!= link)
39  std::cout << "PROBLEM WITH LINK NUMBER!!!!" << std::endl;
40  unsigned int numberROC = pLink->numberOfROCs();
41  for (unsigned int roc=1; roc <= numberROC; roc++) {
42  const PixelROC * pROC = pLink->roc(roc);
43  if (pROC==0) continue;
44  if (pROC->idInLink() != roc)
45  std::cout << "PROBLEM WITH ROC NUMBER!!!!" << std::endl;
46  Key key = {fed, link, roc};
47  theMap[key] = (*pROC);
48  }
49  }
50  }
51 }
unsigned int idInLink() const
id of this ROC in parent Link.
Definition: PixelROC.h:46
std::string link(std::string &nm, std::string &ns)
Definition: hierarchy.cc:47
virtual std::string version() const
map version
list key
Definition: combine.py:13
tuple cout
Definition: gather_cfg.py:121
std::vector< const PixelFEDCabling * > fedList() const
SiPixelFedCablingMap::SiPixelFedCablingMap ( const std::string &  version = "")
inline

Definition at line 18 of file SiPixelFedCablingMap.h.

18 : theVersion(version) {}
virtual std::string version() const
virtual SiPixelFedCablingMap::~SiPixelFedCablingMap ( )
inlinevirtual

Definition at line 20 of file SiPixelFedCablingMap.h.

20 {}

Member Function Documentation

SiPixelFedCablingTree * SiPixelFedCablingMap::cablingTree ( ) const

Definition at line 53 of file SiPixelFedCablingMap.cc.

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

54 {
56  for (Map::const_iterator im = theMap.begin(); im != theMap.end(); im++) {
57  const sipixelobjects::PixelROC & roc = im->second;
58  unsigned int fedId = im->first.fed;
59  unsigned int linkId = im->first.link;
60  tree->addItem(fedId, linkId, roc);
61  }
62  return tree;
63 }
void addItem(unsigned int fedId, unsigned int linkId, const sipixelobjects::PixelROC &roc)
std::vector< unsigned int > SiPixelFedCablingMap::fedIds ( ) const

Definition at line 65 of file SiPixelFedCablingMap.cc.

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

66 {
67  std::vector<unsigned int> result;
68  for (Map::const_iterator im = theMap.begin(); im != theMap.end(); im++) {
69  unsigned int fedId = im->first.fed;
70  if (find(result.begin(),result.end(),fedId) == result.end()) result.push_back(fedId);
71  }
72  return result;
73 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
tuple result
Definition: query.py:137
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.

77 {
78  const PixelROC* roc = 0;
79  Key key = {path.fed, path.link, path.roc};
80  Map::const_iterator inMap = theMap.find(key);
81  if (inMap!= theMap.end()) roc = &(inMap->second);
82  return roc;
83 }
list key
Definition: combine.py:13
std::vector< sipixelobjects::CablingPathToDetUnit > SiPixelFedCablingMap::pathToDetUnit ( uint32_t  rawDetId) const
virtual

Implements SiPixelFedCabling.

Definition at line 85 of file SiPixelFedCablingMap.cc.

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

87 {
88  std::vector<sipixelobjects::CablingPathToDetUnit> result;
89  for (Map::const_iterator im = theMap.begin(); im != theMap.end(); ++im) {
90  if(im->second.rawId()==rawDetId ) {
91  CablingPathToDetUnit path = {im->first.fed, im->first.link, im->first.roc};
92  result.push_back(path);
93  }
94  }
95  return result;
96 }
list path
Definition: scaleCards.py:51
tuple result
Definition: query.py:137
virtual std::string SiPixelFedCablingMap::version ( ) const
inlinevirtual

Implements SiPixelFedCabling.

Definition at line 24 of file SiPixelFedCablingMap.h.

References theVersion.

24 { return theVersion; }

Member Data Documentation

Map SiPixelFedCablingMap::theMap
private
std::string SiPixelFedCablingMap::theVersion
private

Definition at line 36 of file SiPixelFedCablingMap.h.

Referenced by cablingTree(), and version().