test
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
sipixelobjects::PixelFEDCabling Class Reference

#include <PixelFEDCabling.h>

Public Types

typedef std::vector< PixelFEDLinkLinks
 

Public Member Functions

void addItem (unsigned int linkId, const PixelROC &roc)
 
void addLink (const PixelFEDLink &link)
 
bool checkLinkNumbering () const
 
unsigned int id () const
 
const PixelFEDLinklink (unsigned int id) const
 return link identified by id. Link id's are ranged [1, numberOfLinks] More...
 
unsigned int numberOfLinks () const
 number of links in FED More...
 
 PixelFEDCabling (unsigned int id=0)
 
std::string print (int depth=0) const
 
void setLinks (Links &links)
 

Private Attributes

unsigned int theFedId
 
Links theLinks
 

Detailed Description

Definition at line 16 of file PixelFEDCabling.h.

Member Typedef Documentation

Definition at line 19 of file PixelFEDCabling.h.

Constructor & Destructor Documentation

sipixelobjects::PixelFEDCabling::PixelFEDCabling ( unsigned int  id = 0)
inline

Definition at line 21 of file PixelFEDCabling.h.

21 : theFedId(id) { }

Member Function Documentation

void PixelFEDCabling::addItem ( unsigned int  linkId,
const PixelROC roc 
)

Definition at line 21 of file PixelFEDCabling.cc.

Referenced by SiPixelFedCablingTree::addItem().

22 {
23  if ( linkId < 1) return;
24  if ( theLinks.size() < linkId ) theLinks.resize(linkId);
25  if ( theLinks[linkId-1].id() != linkId) theLinks[linkId-1] = PixelFEDLink(linkId);
26  theLinks[linkId-1].addItem(roc);
27 }
void PixelFEDCabling::addLink ( const PixelFEDLink link)

Definition at line 14 of file PixelFEDCabling.cc.

References sipixelobjects::PixelFEDLink::id(), and MainPageGenerator::link.

15 {
16  if ( link.id() < 1) return;
17  if ( theLinks.size() < link.id() ) theLinks.resize(link.id());
18  theLinks[link.id()-1] = link;
19 }
const PixelFEDLink * link(unsigned int id) const
return link identified by id. Link id&#39;s are ranged [1, numberOfLinks]
bool PixelFEDCabling::checkLinkNumbering ( ) const

check link numbering consistency, ie. that link position in vector is the same as its id. Futhermore it checks numbering consistency for ROCs belonging to Link.

Definition at line 29 of file PixelFEDCabling.cc.

References gather_cfg::cout, and mps_fire::result.

30 {
31  bool result = true;
32  typedef Links::const_iterator IL;
33  unsigned int idx_expected = 0;
34  for (IL il = theLinks.begin(); il != theLinks.end(); il++) {
35  idx_expected++;
36  if ((*il).id() != 0 && idx_expected != (*il).id() ) {
37  result = false;
38  cout << " ** PixelFEDCabling ** link numbering inconsistency, expected id: "
39  << idx_expected <<" has: " << (*il).id() << endl;
40  }
41  if (! (*il).checkRocNumbering() ) {
42  result = false;
43  cout << "** PixelFEDCabling ** inconsistent ROC numbering in link id: "
44  << (*il).id() << endl;
45  }
46  }
47  return result;
48 }
tuple result
Definition: mps_fire.py:83
tuple cout
Definition: gather_cfg.py:145
unsigned int sipixelobjects::PixelFEDCabling::id ( ) const
inline
const PixelFEDLink* sipixelobjects::PixelFEDCabling::link ( unsigned int  id) const
inline

return link identified by id. Link id's are ranged [1, numberOfLinks]

Definition at line 28 of file PixelFEDCabling.h.

References theLinks.

Referenced by SiPixelFedCablingTree::findItem(), SiPixelFedCablingTree::findItemInFed(), and SiPixelFedCablingTree::pathToDetUnit().

29  { return (id > 0 && id <= theLinks.size()) ? &theLinks[id-1] : 0; }
unsigned int sipixelobjects::PixelFEDCabling::numberOfLinks ( ) const
inline

number of links in FED

Definition at line 32 of file PixelFEDCabling.h.

References theLinks.

Referenced by SiPixelFedCablingTree::pathToDetUnit().

32 { return theLinks.size(); }
string PixelFEDCabling::print ( int  depth = 0) const

Definition at line 50 of file PixelFEDCabling.cc.

References GenerateHcalLaserBadRunList::out.

51 {
52  ostringstream out;
53  typedef vector<PixelFEDLink>::const_iterator IT;
54  if (depth-- >=0 ) {
55  out <<"FED: "<<id()<< endl;
56  for (IT it=theLinks.begin(); it != theLinks.end(); it++)
57  out << (*it).print(depth);
58  out <<"# total number of Links: "<< numberOfLinks() << endl;
59  }
60  out << endl;
61  return out.str();
62 }
unsigned int numberOfLinks() const
number of links in FED
std::vector< LinkConnSpec >::const_iterator IT
void PixelFEDCabling::setLinks ( Links links)

Definition at line 9 of file PixelFEDCabling.cc.

References electronStore::links.

Member Data Documentation

unsigned int sipixelobjects::PixelFEDCabling::theFedId
private

Definition at line 48 of file PixelFEDCabling.h.

Referenced by id().

Links sipixelobjects::PixelFEDCabling::theLinks
private

Definition at line 49 of file PixelFEDCabling.h.

Referenced by link(), and numberOfLinks().