test
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 Member Functions | Private Attributes | Friends
SiPixelFedCablingMap Class Reference

#include <SiPixelFedCablingMap.h>

Inheritance diagram for SiPixelFedCablingMap:
SiPixelFedCabling

Classes

struct  Key
 

Public Member Functions

std::unique_ptr
< SiPixelFedCablingTree
cablingTree () const
 
std::vector< unsigned int > fedIds () const
 
virtual const
sipixelobjects::PixelROC
findItem (const sipixelobjects::CablingPathToDetUnit &path) const
 
void initializeRocs ()
 
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 Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

Map theMap
 
std::string theVersion
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 22 of file SiPixelFedCablingMap.h.

Member Typedef Documentation

Definition at line 53 of file SiPixelFedCablingMap.h.

Constructor & Destructor Documentation

SiPixelFedCablingMap::SiPixelFedCablingMap ( const SiPixelFedCablingTree cab)

Definition at line 34 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.

35  : theVersion(cab->version())
36 {
37 // std::cout << "HERE --- SiPixelFedCablingMap CTOR" << std::endl;
38 
39  std::vector<const PixelFEDCabling *> fedList = cab->fedList();
40  for (std::vector<const PixelFEDCabling *>::const_iterator ifed=fedList.begin();
41  ifed != fedList.end(); ifed++) {
42  unsigned int fed = (**ifed).id();
43  unsigned int numLink = (**ifed).numberOfLinks();
44  for (unsigned int link=1; link <= numLink; link++) {
45  const PixelFEDLink * pLink = (**ifed).link(link);
46  if (pLink==0) continue;
47  unsigned int linkId = pLink->id();
48  if (linkId != 0 && linkId!= link)
49  std::cout << "PROBLEM WITH LINK NUMBER!!!!" << std::endl;
50  unsigned int numberROC = pLink->numberOfROCs();
51  for (unsigned int roc=1; roc <= numberROC; roc++) {
52  const PixelROC * pROC = pLink->roc(roc);
53  if (pROC==0) continue;
54  if (pROC->idInLink() != roc)
55  std::cout << "PROBLEM WITH ROC NUMBER!!!!" << std::endl;
56  Key key = {fed, link, roc};
57  theMap[key] = (*pROC);
58  }
59  }
60  }
61 }
unsigned int idInLink() const
id of this ROC in parent Link.
Definition: PixelROC.h:42
std::string link(std::string &nm, std::string &ns)
Definition: hierarchy.cc:24
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 28 of file SiPixelFedCablingMap.h.

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

Definition at line 32 of file SiPixelFedCablingMap.h.

32 {}

Member Function Documentation

std::unique_ptr< SiPixelFedCablingTree > SiPixelFedCablingMap::cablingTree ( ) const

Definition at line 63 of file SiPixelFedCablingMap.cc.

References theMap, theVersion, and MainPageGenerator::tree.

64 {
65  std::unique_ptr<SiPixelFedCablingTree> tree(new SiPixelFedCablingTree(theVersion));
66  for (Map::const_iterator im = theMap.begin(); im != theMap.end(); im++) {
67  const sipixelobjects::PixelROC & roc = im->second;
68  unsigned int fedId = im->first.fed;
69  unsigned int linkId = im->first.link;
70  tree->addItem(fedId, linkId, roc);
71  }
72  return tree;
73 }
std::vector< unsigned int > SiPixelFedCablingMap::fedIds ( ) const

Definition at line 75 of file SiPixelFedCablingMap.cc.

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

76 {
77  std::vector<unsigned int> result;
78  for (Map::const_iterator im = theMap.begin(); im != theMap.end(); im++) {
79  unsigned int fedId = im->first.fed;
80  if (find(result.begin(),result.end(),fedId) == result.end()) result.push_back(fedId);
81  }
82  return result;
83 }
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 85 of file SiPixelFedCablingMap.cc.

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

87 {
88  const PixelROC* roc = 0;
89  Key key = {path.fed, path.link, path.roc};
90  Map::const_iterator inMap = theMap.find(key);
91  if (inMap!= theMap.end()) roc = &(inMap->second);
92  return roc;
93 }
list key
Definition: combine.py:13
void SiPixelFedCablingMap::initializeRocs ( )

Definition at line 13 of file SiPixelFedCablingMap.cc.

References findQualityFiles::v.

13  {
14  // std::cout << "initialize PixelRocs" << std::endl;
15  for (auto & v : theMap) v.second.initFrameConversion();
16 
17 }
std::vector< sipixelobjects::CablingPathToDetUnit > SiPixelFedCablingMap::pathToDetUnit ( uint32_t  rawDetId) const
virtual

Implements SiPixelFedCabling.

Definition at line 95 of file SiPixelFedCablingMap.cc.

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

97 {
98  std::vector<sipixelobjects::CablingPathToDetUnit> result;
99  for (Map::const_iterator im = theMap.begin(); im != theMap.end(); ++im) {
100  if(im->second.rawId()==rawDetId ) {
101  CablingPathToDetUnit path = {im->first.fed, im->first.link, im->first.roc};
102  result.push_back(path);
103  }
104  }
105  return result;
106 }
tuple path
else: Piece not in the list, fine.
tuple result
Definition: query.py:137
template<class Archive >
void SiPixelFedCablingMap::serialize ( Archive &  ar,
const unsigned int  version 
)
private
virtual std::string SiPixelFedCablingMap::version ( ) const
inlinevirtual

Implements SiPixelFedCabling.

Definition at line 38 of file SiPixelFedCablingMap.h.

References theVersion.

38 { return theVersion; }

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 56 of file SiPixelFedCablingMap.h.

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 56 of file SiPixelFedCablingMap.h.

Member Data Documentation

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

Definition at line 52 of file SiPixelFedCablingMap.h.

Referenced by cablingTree(), and version().