CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

sipixelobjects::PixelFEDCabling Class Reference

#include <PixelFEDCabling.h>

List of all members.

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]
int numberOfLinks () const
 number of links in FED
 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.

: 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().

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

Definition at line 14 of file PixelFEDCabling.cc.

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

{
  if ( link.id() < 1) return;
  if ( theLinks.size() < link.id() ) theLinks.resize(link.id());
  theLinks[link.id()-1] = link;
}
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 query::result.

{
  bool result = true;
  typedef Links::const_iterator IL;
  unsigned int idx_expected = 0;
  for (IL il = theLinks.begin(); il != theLinks.end(); il++) {
    idx_expected++;
    if ((*il).id() != 0 && idx_expected != (*il).id() ) {
      result = false;
      cout << " ** PixelFEDCabling ** link numbering inconsistency, expected id: "
           << idx_expected <<" has: " << (*il).id() << endl;
    } 
    if (! (*il).checkRocNumbering() ) {
      result = false;
      cout << "** PixelFEDCabling ** inconsistent ROC numbering in link id: "
           << (*il).id() << endl;
    }
  }
  return result;
}
unsigned int sipixelobjects::PixelFEDCabling::id ( void  ) 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(), and SiPixelFedCablingTree::pathToDetUnit().

    { return (id > 0 && id <= theLinks.size()) ? &theLinks[id-1] : 0; }
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().

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

Definition at line 50 of file PixelFEDCabling.cc.

References dbtoconf::out.

{
  ostringstream out;
  typedef vector<PixelFEDLink>::const_iterator IT; 
  if (depth-- >=0 ) {
    out <<"FED: "<<id()<< endl;
    for (IT it=theLinks.begin(); it != theLinks.end(); it++)
         out << (*it).print(depth);
    out <<"# total number of Links: "<< numberOfLinks() << endl;
  }
  out << endl;
  return out.str();
}
void PixelFEDCabling::setLinks ( Links links)

Definition at line 9 of file PixelFEDCabling.cc.

Referenced by SiPixelFedCablingMapBuilder::produce().

{
  theLinks = links;
}

Member Data Documentation

Definition at line 48 of file PixelFEDCabling.h.

Referenced by id().

Definition at line 49 of file PixelFEDCabling.h.

Referenced by link(), and numberOfLinks().