test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
SiPixelFedCablingTree Class Referencefinal

#include <SiPixelFedCablingTree.h>

Inheritance diagram for SiPixelFedCablingTree:
SiPixelFedCabling

Public Types

typedef
sipixelobjects::PixelFEDCabling 
PixelFEDCabling
 

Public Member Functions

void addFed (const PixelFEDCabling &f)
 add cabling for one fed More...
 
void addItem (unsigned int fedId, unsigned int linkId, const sipixelobjects::PixelROC &roc)
 
int checkNumbering () const
 
const PixelFEDCablingfed (unsigned int idFed) const
 get fed identified by its id More...
 
std::vector< const
PixelFEDCabling * > 
fedList () const
 
virtual const
sipixelobjects::PixelROC
findItem (const sipixelobjects::CablingPathToDetUnit &path) const
 
const sipixelobjects::PixelROCfindItemInFed (const sipixelobjects::CablingPathToDetUnit &path, const PixelFEDCabling *aFed) const
 
virtual std::vector
< sipixelobjects::CablingPathToDetUnit
pathToDetUnit (uint32_t rawDetId) const
 
std::string print (int depth=0) const
 
 SiPixelFedCablingTree (const std::string &version="")
 
virtual std::string version () const
 map version More...
 
virtual ~SiPixelFedCablingTree ()
 
- Public Member Functions inherited from SiPixelFedCabling
virtual ~SiPixelFedCabling ()
 

Private Attributes

std::unordered_map< int,
PixelFEDCabling
theFedCablings
 
std::string theVersion
 

Detailed Description

Definition at line 11 of file SiPixelFedCablingTree.h.

Member Typedef Documentation

Definition at line 14 of file SiPixelFedCablingTree.h.

Constructor & Destructor Documentation

SiPixelFedCablingTree::SiPixelFedCablingTree ( const std::string &  version = "")
inline

Definition at line 16 of file SiPixelFedCablingTree.h.

16 : theVersion(version) {}
virtual std::string version() const
map version
virtual SiPixelFedCablingTree::~SiPixelFedCablingTree ( )
inlinevirtual

Definition at line 18 of file SiPixelFedCablingTree.h.

18 {}

Member Function Documentation

void SiPixelFedCablingTree::addFed ( const PixelFEDCabling f)

add cabling for one fed

Definition at line 33 of file SiPixelFedCablingTree.cc.

References f, and sipixelobjects::PixelFEDCabling::id().

34 {
35  int id = f.id();
36  theFedCablings[id] = f;
37 }
double f[11][100]
std::unordered_map< int, PixelFEDCabling > theFedCablings
void SiPixelFedCablingTree::addItem ( unsigned int  fedId,
unsigned int  linkId,
const sipixelobjects::PixelROC roc 
)

Definition at line 69 of file SiPixelFedCablingTree.cc.

References sipixelobjects::PixelFEDCabling::addItem(), l1tstage2_dqm_sourceclient-live_cfg::fedId, and sipixelobjects::PixelFEDCabling::id().

Referenced by SiPixelFedCablingMapBuilder::produce().

70 {
72  if (cabling.id() != fedId) cabling=PixelFEDCabling(fedId);
73  cabling.addItem(linkId,roc);
74 }
void addItem(unsigned int linkId, const PixelROC &roc)
sipixelobjects::PixelFEDCabling PixelFEDCabling
std::unordered_map< int, PixelFEDCabling > theFedCablings
int SiPixelFedCablingTree::checkNumbering ( ) const

Definition at line 100 of file SiPixelFedCablingTree.cc.

References gather_cfg::cout, and mps_update::status.

101 {
102  int status = 0;
103  for (auto im = theFedCablings.begin(); im != theFedCablings.end(); ++im) {
104  if (im->first != static_cast<int>( im->second.id())) {
105  status = 1;
106  std::cout << "PROBLEM WITH FED ID!!" << im->first <<" vs: "<< im->second.id() << std::endl;
107  }
108  im->second.checkLinkNumbering();
109  }
110  return status;
111 }
std::unordered_map< int, PixelFEDCabling > theFedCablings
tuple cout
Definition: gather_cfg.py:145
tuple status
Definition: mps_update.py:57
const PixelFEDCabling * SiPixelFedCablingTree::fed ( unsigned int  idFed) const

get fed identified by its id

Definition at line 39 of file SiPixelFedCablingTree.cc.

40 {
41  auto it = theFedCablings.find(id);
42  return ( it == theFedCablings.end() ) ? 0 : & (*it).second;
43 }
std::unordered_map< int, PixelFEDCabling > theFedCablings
std::vector< const PixelFEDCabling * > SiPixelFedCablingTree::fedList ( ) const

Definition at line 58 of file SiPixelFedCablingTree.cc.

References a, b, sipixelobjects::PixelFEDCabling::id(), and mps_fire::result.

Referenced by SiPixelFedCablingMap::SiPixelFedCablingMap().

59 {
60  std::vector<const PixelFEDCabling *> result;
61  for (IMAP im = theFedCablings.begin(); im != theFedCablings.end(); im++) {
62  result.push_back( &(im->second) );
63  }
64  std::sort(result.begin(),result.end(),[](const PixelFEDCabling * a,const PixelFEDCabling * b){return a->id()<b->id();});
65  return result;
66 
67 }
tuple result
Definition: mps_fire.py:83
std::unordered_map< int, SiPixelFedCablingTree::PixelFEDCabling >::const_iterator IMAP
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
std::unordered_map< int, PixelFEDCabling > theFedCablings
const sipixelobjects::PixelROC * SiPixelFedCablingTree::findItem ( const sipixelobjects::CablingPathToDetUnit path) const
virtual

Implements SiPixelFedCabling.

Definition at line 76 of file SiPixelFedCablingTree.cc.

References sipixelobjects::CablingPathToDetUnit::fed, sipixelobjects::CablingPathToDetUnit::link, sipixelobjects::PixelFEDCabling::link(), sipixelobjects::CablingPathToDetUnit::roc, and sipixelobjects::PixelFEDLink::roc().

78 {
79  const PixelROC* roc = 0;
80  const PixelFEDCabling * aFed = fed(path.fed);
81  if (aFed) {
82  const PixelFEDLink * aLink = aFed->link(path.link);
83  if (aLink) roc = aLink->roc(path.roc);
84  }
85  return roc;
86 }
const PixelFEDCabling * fed(unsigned int idFed) const
get fed identified by its id
const PixelFEDLink * link(unsigned int id) const
return link identified by id. Link id&#39;s are ranged [1, numberOfLinks]
const sipixelobjects::PixelROC * SiPixelFedCablingTree::findItemInFed ( const sipixelobjects::CablingPathToDetUnit path,
const PixelFEDCabling aFed 
) const

Definition at line 89 of file SiPixelFedCablingTree.cc.

References sipixelobjects::CablingPathToDetUnit::link, sipixelobjects::PixelFEDCabling::link(), sipixelobjects::CablingPathToDetUnit::roc, and sipixelobjects::PixelFEDLink::roc().

Referenced by SiPixelFrameConverter::toRoc().

92 {
93  const PixelROC* roc = 0;
94  const PixelFEDLink * aLink = aFed->link(path.link);
95  if (aLink) roc = aLink->roc(path.roc);
96  return roc;
97 }
const PixelFEDLink * link(unsigned int id) const
return link identified by id. Link id&#39;s are ranged [1, numberOfLinks]
std::vector< sipixelobjects::CablingPathToDetUnit > SiPixelFedCablingTree::pathToDetUnit ( uint32_t  rawDetId) const
virtual

Implements SiPixelFedCabling.

Definition at line 11 of file SiPixelFedCablingTree.cc.

References sipixelobjects::PixelFEDLink::id(), sipixelobjects::PixelFEDCabling::id(), sipixelobjects::PixelROC::idInLink(), sipixelobjects::PixelFEDCabling::link(), MainPageGenerator::link, sipixelobjects::PixelFEDCabling::numberOfLinks(), sipixelobjects::PixelFEDLink::numberOfROCs(), fed_dqm_sourceclient-live_cfg::path, sipixelobjects::PixelROC::rawId(), mps_fire::result, and sipixelobjects::PixelFEDLink::roc().

13 {
14  std::vector<sipixelobjects::CablingPathToDetUnit> result;
15  for (auto im = theFedCablings.begin(); im != theFedCablings.end(); ++im) {
16  const PixelFEDCabling & aFed = im->second;
17  for (unsigned int idxLink = 1; idxLink <= aFed.numberOfLinks(); idxLink++) {
18  const PixelFEDLink * link = aFed.link(idxLink);
19  if (!link) continue;
20  unsigned int numberOfRocs = link->numberOfROCs();
21  for(unsigned int idxRoc = 1; idxRoc <= numberOfRocs; idxRoc++) {
22  const PixelROC * roc = link->roc(idxRoc);
23  if (rawDetId == roc->rawId() ) {
24  CablingPathToDetUnit path = {aFed.id(), link->id(), roc->idInLink()};
25  result.push_back(path);
26  }
27  }
28  }
29  }
30  return result;
31 }
unsigned int numberOfLinks() const
number of links in FED
unsigned int idInLink() const
id of this ROC in parent Link.
Definition: PixelROC.h:42
tuple result
Definition: mps_fire.py:83
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: PixelROC.h:36
const PixelFEDLink * link(unsigned int id) const
return link identified by id. Link id&#39;s are ranged [1, numberOfLinks]
std::unordered_map< int, PixelFEDCabling > theFedCablings
string SiPixelFedCablingTree::print ( int  depth = 0) const

Definition at line 45 of file SiPixelFedCablingTree.cc.

References GenerateHcalLaserBadRunList::out.

46 {
47  ostringstream out;
48  if ( depth-- >=0 ) {
49  out << theVersion << endl;
50  for(IMAP it=theFedCablings.begin(); it != theFedCablings.end(); it++) {
51  out << (*it).second.print(depth);
52  }
53  }
54  out << endl;
55  return out.str();
56 }
std::unordered_map< int, SiPixelFedCablingTree::PixelFEDCabling >::const_iterator IMAP
std::unordered_map< int, PixelFEDCabling > theFedCablings
virtual std::string SiPixelFedCablingTree::version ( ) const
inlinevirtual

map version

Implements SiPixelFedCabling.

Definition at line 29 of file SiPixelFedCablingTree.h.

References theVersion.

Referenced by validation.Sample::datasetpattern(), and validation.Sample::filename().

29 { return theVersion; }

Member Data Documentation

std::unordered_map<int, PixelFEDCabling> SiPixelFedCablingTree::theFedCablings
private

Definition at line 46 of file SiPixelFedCablingTree.h.

std::string SiPixelFedCablingTree::theVersion
private

Definition at line 45 of file SiPixelFedCablingTree.h.

Referenced by version().