CMS 3D CMS Logo

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

◆ Links

Definition at line 18 of file PixelFEDCabling.h.

Constructor & Destructor Documentation

◆ PixelFEDCabling()

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

Definition at line 20 of file PixelFEDCabling.h.

20 : theFedId(id) {}

Member Function Documentation

◆ addItem()

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

Definition at line 19 of file PixelFEDCabling.cc.

References PixelMapPlotter::roc.

Referenced by SiPixelFedCablingTree::addItem().

19  {
20  if (linkId < 1)
21  return;
22  if (theLinks.size() < linkId)
23  theLinks.resize(linkId);
24  if (theLinks[linkId - 1].id() != linkId)
25  theLinks[linkId - 1] = PixelFEDLink(linkId);
26  theLinks[linkId - 1].addItem(roc);
27 }

◆ addLink()

void PixelFEDCabling::addLink ( const PixelFEDLink link)

Definition at line 11 of file PixelFEDCabling.cc.

References sipixelobjects::PixelFEDLink::id().

11  {
12  if (link.id() < 1)
13  return;
14  if (theLinks.size() < link.id())
15  theLinks.resize(link.id());
16  theLinks[link.id() - 1] = link;
17 }
const PixelFEDLink * link(unsigned int id) const
return link identified by id. Link id&#39;s are ranged [1, numberOfLinks]

◆ checkLinkNumbering()

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.

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

◆ id()

unsigned int sipixelobjects::PixelFEDCabling::id ( ) const
inline

◆ link()

const PixelFEDLink* sipixelobjects::PixelFEDCabling::link ( unsigned int  id) const
inline

◆ numberOfLinks()

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(), and SiPixelFedCablingTree::pathToDetUnitHasDetUnit().

32 { return theLinks.size(); }

◆ print()

string PixelFEDCabling::print ( int  depth = 0) const

Definition at line 48 of file PixelFEDCabling.cc.

References hcalRecHitTable_cff::depth, EcalPhiSymFlatTableProducers_cfi::id, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and MillePedeFileConverter_cfg::out.

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

◆ setLinks()

void PixelFEDCabling::setLinks ( Links links)

Member Data Documentation

◆ theFedId

unsigned int sipixelobjects::PixelFEDCabling::theFedId
private

Definition at line 47 of file PixelFEDCabling.h.

Referenced by id().

◆ theLinks

Links sipixelobjects::PixelFEDCabling::theLinks
private

Definition at line 48 of file PixelFEDCabling.h.

Referenced by link(), and numberOfLinks().