CMS 3D CMS Logo

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

#include <SiPixelFedCablingTree.h>

Inheritance diagram for SiPixelFedCablingTree:
SiPixelFedCabling

Public Types

typedef
sipixelobjects::PixelFEDCabling 
PixelFEDCabling
 

Public Member Functions

void addFed (const PixelFEDCabling &f)
 add cabling for one fed More...
 
void addItem (unsigned int fedId, unsigned int linkId, const sipixelobjects::PixelROC &roc)
 
int checkNumbering () const
 
const PixelFEDCablingfed (unsigned int idFed) const
 get fed identified by its id More...
 
std::vector< const
PixelFEDCabling * > 
fedList () const
 
virtual const
sipixelobjects::PixelROC
findItem (const sipixelobjects::CablingPathToDetUnit &path) const
 
virtual std::vector
< sipixelobjects::CablingPathToDetUnit
pathToDetUnit (uint32_t rawDetId) const
 
std::string print (int depth=0) const
 
 SiPixelFedCablingTree (const std::string &version="")
 
virtual std::string version () const
 map version More...
 
virtual ~SiPixelFedCablingTree ()
 
- Public Member Functions inherited from SiPixelFedCabling
virtual ~SiPixelFedCabling ()
 

Private Attributes

std::map< int, PixelFEDCablingtheFedCablings
 
std::string theVersion
 

Detailed Description

Definition at line 11 of file SiPixelFedCablingTree.h.

Member Typedef Documentation

Definition at line 14 of file SiPixelFedCablingTree.h.

Constructor & Destructor Documentation

SiPixelFedCablingTree::SiPixelFedCablingTree ( const std::string &  version = "")
inline

Definition at line 16 of file SiPixelFedCablingTree.h.

16 : theVersion(version) {}
virtual std::string version() const
map version
virtual SiPixelFedCablingTree::~SiPixelFedCablingTree ( )
inlinevirtual

Definition at line 18 of file SiPixelFedCablingTree.h.

18 {}

Member Function Documentation

void SiPixelFedCablingTree::addFed ( const PixelFEDCabling f)

add cabling for one fed

Definition at line 33 of file SiPixelFedCablingTree.cc.

References f, sipixelobjects::PixelFEDCabling::id(), and errorMatrix2Lands_multiChannel::id.

Referenced by SiPixelFedCablingMapBuilder::produce().

34 {
35  int id = f.id();
36  theFedCablings[id] = f;
37 }
std::map< int, PixelFEDCabling > theFedCablings
double f[11][100]
void SiPixelFedCablingTree::addItem ( unsigned int  fedId,
unsigned int  linkId,
const sipixelobjects::PixelROC roc 
)

Definition at line 68 of file SiPixelFedCablingTree.cc.

References sipixelobjects::PixelFEDCabling::addItem(), and sipixelobjects::PixelFEDCabling::id().

Referenced by SiPixelFedCablingMap::cablingTree(), and SiPixelFedCablingMapBuilder::produce().

69 {
70  PixelFEDCabling & cabling = theFedCablings[fedId];
71  if (cabling.id() != fedId) cabling=PixelFEDCabling(fedId);
72  cabling.addItem(linkId,roc);
73 }
std::map< int, PixelFEDCabling > theFedCablings
void addItem(unsigned int linkId, const PixelROC &roc)
sipixelobjects::PixelFEDCabling PixelFEDCabling
int SiPixelFedCablingTree::checkNumbering ( ) const

Definition at line 87 of file SiPixelFedCablingTree.cc.

References gather_cfg::cout, and ntuplemaker::status.

88 {
89  int status = 0;
90  for (std::map<int, PixelFEDCabling>::const_iterator im = theFedCablings.begin();
91  im != theFedCablings.end(); ++im) {
92  if (im->first != static_cast<int>( im->second.id())) {
93  status = 1;
94  std::cout << "PROBLEM WITH FED ID!!" << im->first <<" vs: "<< im->second.id() << std::endl;
95  }
96  im->second.checkLinkNumbering();
97  }
98  return status;
99 }
std::map< int, PixelFEDCabling > theFedCablings
tuple cout
Definition: gather_cfg.py:121
tuple status
Definition: ntuplemaker.py:245
const PixelFEDCabling * SiPixelFedCablingTree::fed ( unsigned int  idFed) const

get fed identified by its id

Definition at line 39 of file SiPixelFedCablingTree.cc.

40 {
41  IMAP it = theFedCablings.find(id);
42  return ( it == theFedCablings.end() ) ? 0 : & (*it).second;
43 }
std::map< int, PixelFEDCabling > theFedCablings
std::map< int, SiPixelFedCablingTree::PixelFEDCabling >::const_iterator IMAP
std::vector< const PixelFEDCabling * > SiPixelFedCablingTree::fedList ( ) const

Definition at line 58 of file SiPixelFedCablingTree.cc.

References query::result.

Referenced by SiPixelDigiToRaw::produce(), and SiPixelFedCablingMap::SiPixelFedCablingMap().

59 {
60  std::vector<const PixelFEDCabling *> result;
61  for (IMAP im = theFedCablings.begin(); im != theFedCablings.end(); im++) {
62  result.push_back( &(im->second) );
63  }
64  return result;
65 
66 }
std::map< int, PixelFEDCabling > theFedCablings
tuple result
Definition: query.py:137
std::map< int, SiPixelFedCablingTree::PixelFEDCabling >::const_iterator IMAP
const sipixelobjects::PixelROC * SiPixelFedCablingTree::findItem ( const sipixelobjects::CablingPathToDetUnit path) const
virtual

Implements SiPixelFedCabling.

Definition at line 75 of file SiPixelFedCablingTree.cc.

References sipixelobjects::CablingPathToDetUnit::fed, sipixelobjects::CablingPathToDetUnit::link, sipixelobjects::PixelFEDCabling::link(), sipixelobjects::CablingPathToDetUnit::roc, and sipixelobjects::PixelFEDLink::roc().

77 {
78  const PixelROC* roc = 0;
79  const PixelFEDCabling * aFed = fed(path.fed);
80  if (aFed) {
81  const PixelFEDLink * aLink = aFed->link(path.link);
82  if (aLink) roc = aLink->roc(path.roc);
83  }
84  return roc;
85 }
const PixelFEDCabling * fed(unsigned int idFed) const
get fed identified by its id
const PixelFEDLink * link(unsigned int id) const
return link identified by id. Link id&#39;s are ranged [1, numberOfLinks]
std::vector< sipixelobjects::CablingPathToDetUnit > SiPixelFedCablingTree::pathToDetUnit ( uint32_t  rawDetId) const
virtual

Implements SiPixelFedCabling.

Definition at line 10 of file SiPixelFedCablingTree.cc.

References sipixelobjects::PixelFEDLink::id(), sipixelobjects::PixelFEDCabling::id(), sipixelobjects::PixelROC::idInLink(), sipixelobjects::PixelFEDCabling::link(), link(), sipixelobjects::PixelFEDCabling::numberOfLinks(), sipixelobjects::PixelFEDLink::numberOfROCs(), scaleCards::path, sipixelobjects::PixelROC::rawId(), query::result, and sipixelobjects::PixelFEDLink::roc().

12 {
13  std::vector<sipixelobjects::CablingPathToDetUnit> result;
14  typedef std::map<int, PixelFEDCabling>::const_iterator IM;
15  for (IM im = theFedCablings.begin(); im != theFedCablings.end(); ++im) {
16  const PixelFEDCabling & aFed = im->second;
17  for (int idxLink = 1; idxLink <= aFed.numberOfLinks(); idxLink++) {
18  const PixelFEDLink * link = aFed.link(idxLink);
19  if (!link) continue;
20  int numberOfRocs = link->numberOfROCs();
21  for(int idxRoc = 1; idxRoc <= numberOfRocs; idxRoc++) {
22  const PixelROC * roc = link->roc(idxRoc);
23  if (rawDetId == roc->rawId() ) {
24  CablingPathToDetUnit path = {aFed.id(), link->id(), roc->idInLink()};
25  result.push_back(path);
26  }
27  }
28  }
29  }
30  return result;
31 }
std::map< int, PixelFEDCabling > theFedCablings
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
list path
Definition: scaleCards.py:51
tuple result
Definition: query.py:137
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: PixelROC.h:40
const PixelFEDLink * link(unsigned int id) const
return link identified by id. Link id&#39;s are ranged [1, numberOfLinks]
int numberOfLinks() const
number of links in FED
string SiPixelFedCablingTree::print ( int  depth = 0) const

Definition at line 45 of file SiPixelFedCablingTree.cc.

References dbtoconf::out.

46 {
47  ostringstream out;
48  if ( depth-- >=0 ) {
49  out << theVersion << endl;
50  for(IMAP it=theFedCablings.begin(); it != theFedCablings.end(); it++) {
51  out << (*it).second.print(depth);
52  }
53  }
54  out << endl;
55  return out.str();
56 }
std::map< int, PixelFEDCabling > theFedCablings
std::map< int, SiPixelFedCablingTree::PixelFEDCabling >::const_iterator IMAP
tuple out
Definition: dbtoconf.py:99
virtual std::string SiPixelFedCablingTree::version ( ) const
inlinevirtual

map version

Implements SiPixelFedCabling.

Definition at line 29 of file SiPixelFedCablingTree.h.

References theVersion.

Referenced by SiPixelDigiToRaw::produce().

29 { return theVersion; }

Member Data Documentation

std::map<int, PixelFEDCabling> SiPixelFedCablingTree::theFedCablings
private

Definition at line 44 of file SiPixelFedCablingTree.h.

std::string SiPixelFedCablingTree::theVersion
private

Definition at line 43 of file SiPixelFedCablingTree.h.

Referenced by version().