CMS 3D CMS Logo

SiPixelQuality.cc
Go to the documentation of this file.
1 // SiPixelQuality.cc
2 //
3 // class implementation to hold a list of disabled pixel modules
4 //
5 // M. Eads
6 // Apr 2008
7 
18 
19 #include <algorithm>
20 #include <iostream>
21 
22 using namespace sipixelobjects;
23 
25 // errortype "whole" = int 0 in DB //
26 // errortype "tbmA" = int 1 in DB //
27 // errortype "tbmB" = int 2 in DB //
28 // errortype "none" = int 3 in DB //
30 
32 //each bad roc correspond to a bit to 1: num= //
33 // 0 <-> all good rocs //
34 // 1 <-> only roc 0 bad //
35 // 2<-> only roc 1 bad //
36 // 3<-> roc 0 and 1 bad //
37 // 4 <-> only roc 2 bad //
38 // ... //
40 
41 // add a list of modules to the vector of disabled modules
42 void SiPixelQuality::addDisabledModule(std::vector<SiPixelQuality::disabledModuleType>& idVector) {
43  theDisabledModules.insert(theDisabledModules.end(), idVector.begin(), idVector.end());
44 }
45 
47  //Get vector of Voff dets
48  std::vector<uint32_t> vdets;
49  Voff->getDetIds(vdets);
50 
51  std::vector<uint32_t>::const_iterator iter = vdets.begin();
52  std::vector<uint32_t>::const_iterator iterEnd = vdets.end();
53 
54  for (; iter != iterEnd; ++iter) {
56  BadModule.DetID = *iter;
57  BadModule.errorType = 0;
58  BadModule.BadRocs = 65535; //NOTE: here all module is bad - no difference for half modules
59  if (IsModuleUsable(BadModule.DetID))
60  addDisabledModule(BadModule);
61  }
62 }
63 
64 // bool SiPixelQuality::removeDisabledModule(const uint32_t & detid){
65 // std::vector<disabledModuleType>::const_iterator iter = std::lower_bound(theDisabledModules.begin(),theDisabledModules.end(),detid,SiPixelQuality::BadComponentStrictWeakOrdering());
66 // if (iter != theDisabledModules.end() && iter->DetID==detid){
67 // theDisabledModules.erase(iter);
68 // return true;
69 // }
70 // return false;
71 // }
72 
73 // ask if module is OK
74 bool SiPixelQuality::IsModuleUsable(const uint32_t& detid) const {
75  if (IsFedBad(detid))
76  return true;
77  std::vector<SiPixelQuality::disabledModuleType> disabledModules = theDisabledModules;
78  std::sort(disabledModules.begin(), disabledModules.end(), SiPixelQuality::BadComponentStrictWeakOrdering());
79  std::vector<disabledModuleType>::const_iterator iter = std::lower_bound(
80  disabledModules.begin(), disabledModules.end(), detid, SiPixelQuality::BadComponentStrictWeakOrdering());
81  if (iter != disabledModules.end() && iter->DetID == detid && iter->errorType == 0)
82  return false;
83  return true;
84 }
85 
87  std::vector<SiPixelQuality::disabledModuleType> disabledModules = theDisabledModules;
88  //does not distinguish between partially dead or not
89  return disabledModules.size();
90 }
91 
92 //ask if module is bad
93 bool SiPixelQuality::IsModuleBad(const uint32_t& detid) const {
94  if (IsFedBad(detid))
95  return true;
96  std::vector<SiPixelQuality::disabledModuleType> disabledModules = theDisabledModules;
97  std::sort(disabledModules.begin(), disabledModules.end(), SiPixelQuality::BadComponentStrictWeakOrdering());
98  std::vector<disabledModuleType>::const_iterator iter = std::lower_bound(
99  disabledModules.begin(), disabledModules.end(), detid, SiPixelQuality::BadComponentStrictWeakOrdering());
100  //errorType 0 corresponds to "whole" dead module
101  if (iter != disabledModules.end() && iter->DetID == detid && iter->errorType == 0)
102  return true;
103  return false;
104 }
105 
106 //ask if roc is bad
107 bool SiPixelQuality::IsRocBad(const uint32_t& detid, const short& rocNb) const {
108  if (IsModuleBad(detid))
109  return true;
110  std::vector<SiPixelQuality::disabledModuleType> disabledModules = theDisabledModules;
111  std::sort(disabledModules.begin(), disabledModules.end(), SiPixelQuality::BadComponentStrictWeakOrdering());
112  std::vector<disabledModuleType>::const_iterator iter = std::lower_bound(
113  disabledModules.begin(), disabledModules.end(), detid, SiPixelQuality::BadComponentStrictWeakOrdering());
114  if (iter != disabledModules.end() && iter->DetID == detid) {
115  return ((iter->BadRocs >> rocNb) & 0x1);
116  }
117  return false;
118 }
119 
120 //ask for bad ROCS
121 
122 short SiPixelQuality::getBadRocs(const uint32_t& detid) const {
123  std::vector<SiPixelQuality::disabledModuleType> disabledModules = theDisabledModules;
124  std::sort(disabledModules.begin(), disabledModules.end(), SiPixelQuality::BadComponentStrictWeakOrdering());
125  std::vector<disabledModuleType>::const_iterator iter = std::lower_bound(
126  disabledModules.begin(), disabledModules.end(), detid, SiPixelQuality::BadComponentStrictWeakOrdering());
127  if (iter != disabledModules.end() && iter->DetID == detid)
128  return iter->BadRocs;
129  return 0;
130 }
131 
132 const std::vector<LocalPoint> SiPixelQuality::getBadRocPositions(const uint32_t& detid,
133  const TrackerGeometry& theTracker,
134  const SiPixelFedCabling* map) const {
135  std::vector<LocalPoint> badrocpositions(0);
136  for (unsigned int i = 0; i < 16; i++) {
137  if (IsRocBad(detid, i) == true) {
138  std::vector<CablingPathToDetUnit> path = map->pathToDetUnit(detid);
139  typedef std::vector<CablingPathToDetUnit>::const_iterator IT;
140  for (IT it = path.begin(); it != path.end(); ++it) {
141  const PixelROC* myroc = map->findItem(*it);
142  if (myroc->idInDetUnit() == i) {
143  LocalPixel::RocRowCol local = {39, 25}; //corresponding to center of ROC row, col
144  GlobalPixel global = myroc->toGlobal(LocalPixel(local));
145  const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(theTracker.idToDet(detid));
146 
147  PixelTopology const* topology = &(theGeomDet->specificTopology());
148 
149  MeasurementPoint thepoint(global.row, global.col);
150  LocalPoint localpoint = topology->localPosition(thepoint);
151  badrocpositions.push_back(localpoint);
152  break;
153  }
154  }
155  }
156  }
157  return badrocpositions;
158 }
159 
160 bool SiPixelQuality::IsFedBad(const uint32_t& detid) const { return false; }
TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
Point2DBase
Definition: Point2DBase.h:9
SiPixelQuality::IsModuleBad
bool IsModuleBad(const uint32_t &detid) const
Definition: SiPixelQuality.cc:93
mps_fire.i
i
Definition: mps_fire.py:428
TrackerGeometry.h
SiPixelQuality::getBadRocs
short getBadRocs(const uint32_t &detid) const
Definition: SiPixelQuality.cc:122
SiPixelQuality::add
void add(const SiStripDetVOff *)
Definition: SiPixelQuality.cc:46
SiPixelQuality::BadComponentStrictWeakOrdering
Definition: SiPixelQuality.h:54
SiPixelQuality::disabledModuleType
Definition: SiPixelQuality.h:29
SiPixelFedCablingMap.h
sipixelobjects::GlobalPixel::row
int row
Definition: GlobalPixel.h:7
SiPixelQuality::disabledModuleType::errorType
int errorType
Definition: SiPixelQuality.h:31
SiPixelFedCablingTree.h
SiPixelFedCabling
Definition: SiPixelFedCabling.h:10
sipixelobjects::GlobalPixel::col
int col
Definition: GlobalPixel.h:8
sipixelobjects::LocalPixel
identify pixel inside single ROC
Definition: LocalPixel.h:7
SiPixelQuality::IsModuleUsable
bool IsModuleUsable(const uint32_t &detid) const
Definition: SiPixelQuality.cc:74
SiPixelQuality::BadModuleNumber
int BadModuleNumber()
Definition: SiPixelQuality.cc:86
sipixelobjects::GlobalPixel
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition: GlobalPixel.h:6
sipixelobjects
Definition: CablingPathToDetUnit.h:4
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
SiStripDetVOff::getDetIds
void getDetIds(std::vector< uint32_t > &DetIds_) const
Definition: SiStripDetVOff.cc:64
Point3DBase< float, LocalTag >
PixelTopology
Definition: PixelTopology.h:10
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
SiPixelFrameConverter.h
PixelROC.h
SiPixelFedCablingMapRcd.h
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
PixelGeomDetUnit::specificTopology
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
Definition: PixelGeomDetUnit.cc:17
SiPixelQuality::disabledModuleType::DetID
uint32_t DetID
Definition: SiPixelQuality.h:30
SiPixelQuality::addDisabledModule
void addDisabledModule(disabledModuleType module)
Definition: SiPixelQuality.h:71
LocalPixel.h
SiStripDetVOff
Definition: SiStripDetVOff.h:31
sipixelobjects::PixelROC::toGlobal
GlobalPixel toGlobal(const LocalPixel &loc) const
Definition: PixelROC.h:55
IT
std::vector< LinkConnSpec >::const_iterator IT
Definition: TriggerBoardSpec.cc:5
SiPixelQuality::getBadRocPositions
const std::vector< LocalPoint > getBadRocPositions(const uint32_t &detid, const TrackerGeometry &theTracker, const SiPixelFedCabling *map) const
Definition: SiPixelQuality.cc:132
sipixelobjects::PixelROC
Definition: PixelROC.h:23
SiPixelQuality::disabledModuleType::BadRocs
unsigned short BadRocs
Definition: SiPixelQuality.h:32
sipixelobjects::LocalPixel::RocRowCol
row and collumn in ROC representation
Definition: LocalPixel.h:13
PixelGeomDetUnit.h
SiPixelQuality.h
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
DTRecHitClients_cfi.local
local
Definition: DTRecHitClients_cfi.py:10
genParticles_cff.map
map
Definition: genParticles_cff.py:11
SiPixelQuality::IsRocBad
bool IsRocBad(const uint32_t &detid, const short &rocNb) const
Definition: SiPixelQuality.cc:107
SiPixelQuality::IsFedBad
bool IsFedBad(const uint32_t &detid) const
Definition: SiPixelQuality.cc:160
sipixelobjects::PixelROC::idInDetUnit
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
Definition: PixelROC.h:37
TrackerGeometry
Definition: TrackerGeometry.h:14
SiPixelFrameReverter.h