CMS 3D CMS Logo

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

#include <SiPixelFedCablingMap.h>

Inheritance diagram for SiPixelFedCablingMap:
SiPixelFedCabling

Classes

struct  Key
 

Public Member Functions

std::unique_ptr
< SiPixelFedCablingTree
cablingTree () const
 
std::vector< unsigned int > fedIds () const
 
virtual const
sipixelobjects::PixelROC
findItem (const sipixelobjects::CablingPathToDetUnit &path) const
 
void initializeRocs ()
 
virtual std::vector
< sipixelobjects::CablingPathToDetUnit
pathToDetUnit (uint32_t rawDetId) const
 
 SiPixelFedCablingMap (const SiPixelFedCablingTree *cab)
 
 SiPixelFedCablingMap (const std::string &version="")
 
virtual std::string version () const
 
virtual ~SiPixelFedCablingMap ()
 
- Public Member Functions inherited from SiPixelFedCabling
virtual ~SiPixelFedCabling ()
 

Private Types

typedef std::map< Key,
sipixelobjects::PixelROC
Map
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

Map theMap
 
std::string theVersion
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 22 of file SiPixelFedCablingMap.h.

Member Typedef Documentation

Definition at line 53 of file SiPixelFedCablingMap.h.

Constructor & Destructor Documentation

SiPixelFedCablingMap::SiPixelFedCablingMap ( const SiPixelFedCablingTree cab)

Definition at line 62 of file SiPixelFedCablingMap.cc.

References SiPixelFedCablingTree::fedList(), HLT_Fake1_cff::fedList, relval_steps::key, MainPageGenerator::link, sipixelobjects::PixelFEDLink::numberOfROCs(), sipixelobjects::PixelFEDLink::roc(), and theMap.

63  : theVersion(cab->version())
64 {
65 
66  // Never called
67  std::vector<const PixelFEDCabling *> fedList = cab->fedList();
68  for (std::vector<const PixelFEDCabling *>::const_iterator ifed=fedList.begin();
69  ifed != fedList.end(); ifed++) {
70  unsigned int fed = (**ifed).id();
71  unsigned int numLink = (**ifed).numberOfLinks();
72  for (unsigned int link=1; link <= numLink; link++) {
73  const PixelFEDLink * pLink = (**ifed).link(link);
74  if (pLink==0) continue;
75  //unsigned int linkId = pLink->id();
76  //if (linkId != 0 && linkId!= link)
77  // std::cout << "PROBLEM WITH LINK NUMBER!!!!" << std::endl;
78  unsigned int numberROC = pLink->numberOfROCs();
79 
80  for (unsigned int roc=1; roc <= numberROC; roc++) {
81  const PixelROC * pROC = pLink->roc(roc);
82  if (pROC==0) continue;
83  //if (pROC->idInLink() != roc)
84  // std::cout << "PROBLEM WITH ROC NUMBER!!!!" << std::endl;
85  Key key = {fed, link, roc};
86  theMap[key] = (*pROC);
87  }
88  }
89  } // fed loop
90 
91 }
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
virtual std::string version() const
map version
std::vector< const PixelFEDCabling * > fedList() const
SiPixelFedCablingMap::SiPixelFedCablingMap ( const std::string &  version = "")
inline

Definition at line 28 of file SiPixelFedCablingMap.h.

28 : theVersion(version) {}
virtual std::string version() const
virtual SiPixelFedCablingMap::~SiPixelFedCablingMap ( )
inlinevirtual

Definition at line 32 of file SiPixelFedCablingMap.h.

32 {}

Member Function Documentation

std::unique_ptr< SiPixelFedCablingTree > SiPixelFedCablingMap::cablingTree ( ) const

Definition at line 93 of file SiPixelFedCablingMap.cc.

References l1tstage2_dqm_sourceclient-live_cfg::fedId, theMap, theVersion, and MainPageGenerator::tree.

93  {
94 
95  std::unique_ptr<SiPixelFedCablingTree> tree(new SiPixelFedCablingTree(theVersion));
96  for (Map::const_iterator im = theMap.begin(); im != theMap.end(); im++) {
97  const sipixelobjects::PixelROC & roc = im->second;
98  unsigned int fedId = im->first.fed;
99  unsigned int linkId = im->first.link;
100  tree->addItem(fedId, linkId, roc);
101  }
102  return tree;
103 }
std::vector< unsigned int > SiPixelFedCablingMap::fedIds ( ) const

Definition at line 105 of file SiPixelFedCablingMap.cc.

References l1tstage2_dqm_sourceclient-live_cfg::fedId, spr::find(), mps_fire::result, and theMap.

Referenced by SiPixelCoordinates::fedid().

105  {
106  std::vector<unsigned int> result;
107  for (Map::const_iterator im = theMap.begin(); im != theMap.end(); im++) {
108  unsigned int fedId = im->first.fed;
109  if (find(result.begin(),result.end(),fedId) == result.end()) result.push_back(fedId);
110  }
111  return result;
112 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
tuple result
Definition: mps_fire.py:84
const sipixelobjects::PixelROC * SiPixelFedCablingMap::findItem ( const sipixelobjects::CablingPathToDetUnit path) const
virtual

Implements SiPixelFedCabling.

Definition at line 114 of file SiPixelFedCablingMap.cc.

References sipixelobjects::CablingPathToDetUnit::fed, relval_steps::key, sipixelobjects::CablingPathToDetUnit::link, sipixelobjects::CablingPathToDetUnit::roc, and theMap.

115  {
116  const PixelROC* roc = 0;
117  Key key = {path.fed, path.link, path.roc};
118  Map::const_iterator inMap = theMap.find(key);
119  if (inMap!= theMap.end()) roc = &(inMap->second);
120  return roc;
121 }
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
void SiPixelFedCablingMap::initializeRocs ( )

Definition at line 12 of file SiPixelFedCablingMap.cc.

References l1tstage2_dqm_sourceclient-live_cfg::fedId, plotBeamSpotDB::first, FEDNumbering::MINSiPixeluTCAFEDID, and findQualityFiles::v.

12  {
13 
14  // OLD Method
15  //for (auto & v : theMap) v.second.initFrameConversion();
16  // below is the new code, works for phase0 and phase1
17 
18  // Decide if it is phase0 or phase1 based on the first fed, 0-phase0, 1200-phase1
19  unsigned int fedId = (theMap.begin())->first.fed; // get the first fed
20 
21  if(fedId>=FEDNumbering::MINSiPixeluTCAFEDID) { // phase1 >= 1200
22  for (auto & v : theMap) v.second.initFrameConversionPhase1(); // works
23  } else { // phase0
24  for (auto & v : theMap) v.second.initFrameConversion(); // works
25  }
26 
27  // if(0) { // for testing
28  // for (Map::iterator im = theMap.begin(); im != theMap.end(); im++) {
29  // unsigned int fedId = im->first.fed;
30  // unsigned int linkId = im->first.link;
31  // unsigned int rocId = im->first.roc;
32  // auto rawDetID = im->second.rawId();
33  // auto idInDetUnit = im->second.idInDetUnit();
34  // auto idInLink = im->second.idInLink();
35  // //auto v = *im;
36  // if(fedId>=1200) {
37  // //v.second.initFrameConversionPhase1(); //
38  // im->second.initFrameConversionPhase1(); //
39  // } else {
40  // im->second.initFrameConversion();
41  // }
42  // } //
43  // } // end if(0)
44 
45 }
std::vector< sipixelobjects::CablingPathToDetUnit > SiPixelFedCablingMap::pathToDetUnit ( uint32_t  rawDetId) const
virtual

Implements SiPixelFedCabling.

Definition at line 123 of file SiPixelFedCablingMap.cc.

References fed_dqm_sourceclient-live_cfg::path, mps_fire::result, and theMap.

124  {
125 
126  std::vector<sipixelobjects::CablingPathToDetUnit> result;
127  for (Map::const_iterator im = theMap.begin(); im != theMap.end(); ++im) {
128  if(im->second.rawId()==rawDetId ) {
129  CablingPathToDetUnit path = {im->first.fed, im->first.link, im->first.roc};
130  result.push_back(path);
131  }
132  }
133  return result;
134 }
tuple result
Definition: mps_fire.py:84
template<class Archive >
void SiPixelFedCablingMap::serialize ( Archive &  ar,
const unsigned int  version 
)
private
virtual std::string SiPixelFedCablingMap::version ( ) const
inlinevirtual

Implements SiPixelFedCabling.

Definition at line 38 of file SiPixelFedCablingMap.h.

References theVersion.

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

38 { return theVersion; }

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 56 of file SiPixelFedCablingMap.h.

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 56 of file SiPixelFedCablingMap.h.

Member Data Documentation

Map SiPixelFedCablingMap::theMap
private
std::string SiPixelFedCablingMap::theVersion
private

Definition at line 52 of file SiPixelFedCablingMap.h.

Referenced by cablingTree(), and version().