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.

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 }

References PixelMapPlotter::roc.

Referenced by SiPixelFedCablingTree::addItem().

◆ addLink()

void PixelFEDCabling::addLink ( const PixelFEDLink link)

Definition at line 11 of file PixelFEDCabling.cc.

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 }

References MainPageGenerator::link.

◆ 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.

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 }

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

◆ id()

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

◆ link()

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 27 of file PixelFEDCabling.h.

27  {
28  return (id > 0 && id <= theLinks.size()) ? &theLinks[id - 1] : nullptr;
29  }

References theLinks.

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

◆ numberOfLinks()

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

number of links in FED

Definition at line 32 of file PixelFEDCabling.h.

32 { return theLinks.size(); }

References theLinks.

Referenced by SiPixelFedCablingTree::pathToDetUnit(), and SiPixelFedCablingTree::pathToDetUnitHasDetUnit().

◆ print()

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

Definition at line 48 of file PixelFEDCabling.cc.

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 }

References LEDCalibrationChannels::depth, triggerObjects_cff::id, and MillePedeFileConverter_cfg::out.

◆ setLinks()

void PixelFEDCabling::setLinks ( Links links)

Definition at line 9 of file PixelFEDCabling.cc.

9 { theLinks = links; }

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

sipixelobjects::PixelFEDCabling::id
unsigned int id() const
Definition: PixelFEDCabling.h:34
sipixelobjects::PixelFEDCabling::link
const PixelFEDLink * link(unsigned int id) const
return link identified by id. Link id's are ranged [1, numberOfLinks]
Definition: PixelFEDCabling.h:27
gather_cfg.cout
cout
Definition: gather_cfg.py:144
sipixelobjects::PixelFEDCabling::numberOfLinks
unsigned int numberOfLinks() const
number of links in FED
Definition: PixelFEDCabling.h:32
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
sipixelobjects::PixelFEDCabling::theFedId
unsigned int theFedId
Definition: PixelFEDCabling.h:47
IT
std::vector< LinkConnSpec >::const_iterator IT
Definition: TriggerBoardSpec.cc:5
sipixelobjects::PixelFEDCabling::theLinks
Links theLinks
Definition: PixelFEDCabling.h:48
electronStore.links
links
Definition: electronStore.py:149
PixelMapPlotter.roc
roc
Definition: PixelMapPlotter.py:498
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
mps_fire.result
result
Definition: mps_fire.py:311