CMS 3D CMS Logo

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< SiPixelFedCablingTreecablingTree () const
 
std::vector< unsigned int > fedIds () const
 
virtual const sipixelobjects::PixelROCfindItem (const sipixelobjects::CablingPathToDetUnit &path) const
 
void initializeRocs ()
 
virtual std::vector< sipixelobjects::CablingPathToDetUnitpathToDetUnit (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::PixelROCMap
 

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(), crabWrapper::key, 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 }
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.

References initializeRocs().

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

Definition at line 32 of file SiPixelFedCablingMap.h.

References cablingTree().

32 {}

Member Function Documentation

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

Definition at line 93 of file SiPixelFedCablingMap.cc.

References theMap, theVersion, and compare::tree.

Referenced by PixelUnpackingRegions::initialize(), SiPixelDigiToRaw::produce(), SiPixelRawToDigi::produce(), SelectedElectronFEDListProducer< TEle, TCand >::produce(), and ~SiPixelFedCablingMap().

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 }
Definition: tree.py:1
std::vector< unsigned int > SiPixelFedCablingMap::fedIds ( ) const

Definition at line 105 of file SiPixelFedCablingMap.cc.

References spr::find(), mps_fire::result, and theMap.

Referenced by SiPixelCoordinates::fedid(), SiPixelDigiToRaw::produce(), SiPixelRawToDigi::produce(), and version().

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
const sipixelobjects::PixelROC * SiPixelFedCablingMap::findItem ( const sipixelobjects::CablingPathToDetUnit path) const
virtual
void SiPixelFedCablingMap::initializeRocs ( )

Definition at line 12 of file SiPixelFedCablingMap.cc.

References plotBeamSpotDB::first, FEDNumbering::MINSiPixeluTCAFEDID, and findQualityFiles::v.

Referenced by SiPixelFedCablingMap().

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 callgraph::path, mps_fire::result, and theMap.

Referenced by Phase2TrackerDigitizerAlgorithm::module_killing_DB(), SiPixelDigitizerAlgorithm::module_killing_DB(), and version().

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 }
template<class Archive >
void SiPixelFedCablingMap::serialize ( Archive &  ar,
const unsigned int  version 
)
private
virtual std::string SiPixelFedCablingMap::version ( ) const
inlinevirtual

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