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.

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

References PixelMapPlotter::rocs.

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

◆ addItem()

void PixelFEDLink::addItem ( const PixelROC roc)

Definition at line 11 of file PixelFEDLink.cc.

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 }

References PixelMapPlotter::roc.

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

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 }

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

◆ id()

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

link id

Definition at line 29 of file PixelFEDLink.h.

29 { return theId; }

References theId.

◆ numberOfROCs()

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

number of ROCs in fed

Definition at line 32 of file PixelFEDLink.h.

32 { return theROCs.size(); }

References theROCs.

Referenced by SiPixelFedCablingMap::SiPixelFedCablingMap().

◆ print()

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

Definition at line 34 of file PixelFEDLink.cc.

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 }

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

◆ printForMap()

string PixelFEDLink::printForMap ( ) const
private

Definition at line 56 of file PixelFEDLink.cc.

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 }

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

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

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

References theROCs.

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

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

PixelMapPlotter.rocs
rocs
Definition: PixelMapPlotter.py:497
Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
min
T min(T a, T b)
Definition: MathUtil.h:58
gather_cfg.cout
cout
Definition: gather_cfg.py:144
PixelBarrelName
Definition: PixelBarrelName.h:16
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
dqmdumpme.first
first
Definition: dqmdumpme.py:55
DetId
Definition: DetId.h:17
PixelBarrelName::name
std::string name() const override
from base class
Definition: PixelBarrelName.cc:731
PixelEndcapName
Definition: PixelEndcapName.h:16
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
sipixelobjects::PixelROC::idInLink
unsigned int idInLink() const
id of this ROC in parent Link.
Definition: PixelROC.h:40
PixelModuleName::isBarrel
virtual bool isBarrel() const
true for barrel modules
Definition: PixelModuleName.h:20
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
mps_fire.result
result
Definition: mps_fire.py:311
PixelEndcapName::name
std::string name() const override
from base class
Definition: PixelEndcapName.cc:365