CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
sipixelobjects::PixelFEDLink Class Reference

#include <PixelFEDLink.h>

Public Types

typedef std::vector< PixelROCROCs
 ROCs served be this link. More...
 

Public Member Functions

void add (const ROCs &rocs)
 add connection (defined by connection spec and ROCs) More...
 
void addItem (const PixelROC &roc)
 
bool checkRocNumbering () const
 
unsigned int id () const
 link id More...
 
unsigned int numberOfROCs () const
 number of ROCs in fed More...
 
 PixelFEDLink (unsigned int id=0)
 ctor with id of link and parent FED More...
 
std::string print (int depth=0) const
 
const PixelROCroc (unsigned int id) const
 return ROC identified by id. ROC ids are ranged [1,numberOfROCs] More...
 

Private Member Functions

std::string printForMap () const
 

Private Attributes

unsigned int theId
 
ROCs theROCs
 

Detailed Description

Definition at line 17 of file PixelFEDLink.h.

Member Typedef Documentation

◆ ROCs

ROCs served be this link.

Definition at line 20 of file PixelFEDLink.h.

Constructor & Destructor Documentation

◆ PixelFEDLink()

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

ctor with id of link and parent FED

Definition at line 23 of file PixelFEDLink.h.

23 : theId(id) {}

Member Function Documentation

◆ add()

void PixelFEDLink::add ( const ROCs rocs)

add connection (defined by connection spec and ROCs)

Definition at line 32 of file PixelFEDLink.cc.

References PixelMapPlotter::rocs.

Referenced by counter.Counter::register(), SequenceTypes._TaskBase::remove(), and SequenceTypes._TaskBase::replace().

32 { theROCs.insert(theROCs.end(), rocs.begin(), rocs.end()); }

◆ addItem()

void PixelFEDLink::addItem ( const PixelROC roc)

Definition at line 11 of file PixelFEDLink.cc.

References PixelMapPlotter::roc.

11  {
12  // INFO roc numbering vs vector has offset=1
13  if (roc.idInLink() > theROCs.size())
14  theROCs.resize(roc.idInLink());
15  theROCs[roc.idInLink() - 1] = roc;
16 }
unsigned int idInLink() const
id of this ROC in parent Link.
Definition: PixelROC.h:40

◆ checkRocNumbering()

bool PixelFEDLink::checkRocNumbering ( ) const

check ROC in link numbering consistency, ie. that ROC position in vector is the same as its id. To be called by owner

Definition at line 18 of file PixelFEDLink.cc.

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

18  {
19  bool result = true;
20  unsigned int idx_expected = 0;
21  typedef ROCs::const_iterator CIR;
22  for (CIR it = theROCs.begin(); it != theROCs.end(); it++) {
23  idx_expected++;
24  if (idx_expected != (*it).idInLink()) {
25  result = false;
26  cout << "** PixelFEDLink, idInLink in ROC, expected: " << idx_expected << " has: " << (*it).idInLink() << endl;
27  }
28  }
29  return result;
30 }

◆ id()

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

link id

Definition at line 29 of file PixelFEDLink.h.

References theId.

29 { return theId; }

◆ numberOfROCs()

unsigned int sipixelobjects::PixelFEDLink::numberOfROCs ( ) const
inline

number of ROCs in fed

Definition at line 32 of file PixelFEDLink.h.

References theROCs.

Referenced by SiPixelFedCablingMap::SiPixelFedCablingMap().

32 { return theROCs.size(); }

◆ print()

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

Definition at line 34 of file PixelFEDLink.cc.

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

34  {
35  ostringstream out;
36  // if (id() < 0) return out.str(); // id() >= 0, since it returns an unsigned
37 
38  if (depth-- >= 0) {
39  if (id() < 10)
40  out << " LNK: " << id();
41  else
42  out << " LNK: " << id();
43  if (depth == 0)
44  out << printForMap();
45  else {
46  out << endl;
47  typedef ROCs::const_iterator CIR;
48  for (CIR ir = theROCs.begin(); ir != theROCs.end(); ir++)
49  out << (ir)->print(depth);
50  out << "# total number of ROCs: " << numberOfROCs() << endl;
51  }
52  }
53  return out.str();
54 }

◆ printForMap()

string PixelFEDLink::printForMap ( ) const
private

Definition at line 56 of file PixelFEDLink.cc.

References Reference_intrackfit_cff::barrel, dqmdumpme::first, PixelModuleName::isBarrel(), SiStripPI::max, SiStripPI::min, PixelBarrelName::name(), PixelEndcapName::name(), MillePedeFileConverter_cfg::out, DetId::rawId(), and createJobs::tmp.

56  {
57  typedef ROCs::const_iterator CIR;
58  ostringstream out;
59 
60  // barrel
61  {
62  int minroc = 9999;
63  int maxroc = -1;
64  bool first = true;
65  PixelBarrelName prev;
66  for (CIR ir = theROCs.begin(); ir < theROCs.end(); ir++) {
67  DetId detid = DetId(ir->rawId());
68  bool barrel = PixelModuleName::isBarrel(detid.rawId());
69  if (!barrel)
70  continue;
71  PixelBarrelName curr(detid);
72  if (first)
73  prev = curr;
74 
75  int idRoc = ir->idInDetUnit();
76  if (curr == prev) {
77  minroc = min(idRoc, minroc);
78  maxroc = max(idRoc, maxroc);
79  }
80 
81  if (!(curr == prev)) {
82  out << " MOD: " << prev.name() << " ROC: " << minroc << ", " << maxroc << std::endl;
83  prev = curr;
84  maxroc = minroc = idRoc;
85  // minroc = idRoc;
86  // maxroc = idRoc;
87  }
88 
89  if (ir == theROCs.end() - 1) {
90  out << " MOD: " << curr.name() << " ROC: " << minroc << ", " << maxroc << std::endl;
91  }
92  }
93  }
94 
95  // same for endcpap
96  {
97  bool first = true;
98  PixelEndcapName prev;
99  for (CIR ir = theROCs.begin(); ir < theROCs.end(); ir++) {
100  DetId detid = DetId(ir->rawId());
101  bool barrel = PixelModuleName::isBarrel(detid.rawId());
102  if (barrel)
103  continue;
104  PixelEndcapName tmp(detid);
105  PixelEndcapName curr(tmp.halfCylinder(), tmp.diskName(), tmp.bladeName(), tmp.pannelName());
106  if (first)
107  prev = curr;
108  if (!(curr == prev))
109  out << " MOD: " << prev.name() << std::endl;
110  if (ir == theROCs.end() - 1)
111  out << " MOD: " << curr.name() << std::endl;
112  }
113  }
114  return out.str();
115 }
std::string name() const override
from base class
Definition: DetId.h:17
virtual bool isBarrel() const
true for barrel modules
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::string name() const override
from base class
tmp
align.sh
Definition: createJobs.py:716

◆ roc()

const PixelROC* sipixelobjects::PixelFEDLink::roc ( unsigned int  id) const
inline

return ROC identified by id. ROC ids are ranged [1,numberOfROCs]

Definition at line 35 of file PixelFEDLink.h.

References theROCs.

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

35 { return (id > 0 && id <= theROCs.size()) ? &theROCs[id - 1] : nullptr; }

Member Data Documentation

◆ theId

unsigned int sipixelobjects::PixelFEDLink::theId
private

Definition at line 46 of file PixelFEDLink.h.

Referenced by id().

◆ theROCs

ROCs sipixelobjects::PixelFEDLink::theROCs
private

Definition at line 47 of file PixelFEDLink.h.

Referenced by numberOfROCs(), and roc().