CMS 3D CMS Logo

Classes | Public Member Functions | Private Member Functions | Private Attributes

SiPixelQuality Class Reference

#include <SiPixelQuality.h>

List of all members.

Classes

class  BadComponentStrictWeakOrdering
struct  disabledModuleType

Public Member Functions

void add (const SiStripDetVOff *)
void addDisabledModule (disabledModuleType module)
void addDisabledModule (std::vector< disabledModuleType > &idVector)
int BadModuleNumber ()
const std::vector
< disabledModuleType
getBadComponentList () const
const std::vector< LocalPointgetBadRocPositions (const uint32_t &detid, const TrackerGeometry &theTracker, const SiPixelFedCabling *map) const
short getBadRocs (const uint32_t &detid) const
bool IsAreaBad (uint32_t detid, sipixelobjects::GlobalPixel global, const edm::EventSetup &es, const SiPixelFedCabling *map) const
bool IsModuleBad (const uint32_t &detid) const
bool IsModuleUsable (const uint32_t &detid) const
bool IsRocBad (const uint32_t &detid, const short &rocNb) const
void setDisabledModuleList (std::vector< disabledModuleType > &disabledModules)
 SiPixelQuality (std::vector< disabledModuleType > &disabledModules)
 SiPixelQuality ()
virtual ~SiPixelQuality ()

Private Member Functions

bool IsFedBad (const uint32_t &detid) const

Private Attributes

std::vector< disabledModuleTypetheDisabledModules

Detailed Description

Definition at line 26 of file SiPixelQuality.h.


Constructor & Destructor Documentation

SiPixelQuality::SiPixelQuality ( ) [inline]

Definition at line 64 of file SiPixelQuality.h.

SiPixelQuality::SiPixelQuality ( std::vector< disabledModuleType > &  disabledModules) [inline]

Definition at line 67 of file SiPixelQuality.h.

: theDisabledModules(disabledModules) {;}
virtual SiPixelQuality::~SiPixelQuality ( ) [inline, virtual]

Definition at line 69 of file SiPixelQuality.h.

{;}

Member Function Documentation

void SiPixelQuality::add ( const SiStripDetVOff Voff)

Definition at line 57 of file SiPixelQuality.cc.

References SiPixelQuality::disabledModuleType::BadRocs, SiPixelQuality::disabledModuleType::DetID, SiPixelQuality::disabledModuleType::errorType, and SiStripDetVOff::getDetIds().

                                                   {
  
  //Get vector of Voff dets
  std::vector<uint32_t> vdets;
  Voff->getDetIds(vdets);

  std::vector<uint32_t>::const_iterator iter=vdets.begin();
  std::vector<uint32_t>::const_iterator iterEnd=vdets.end();

  for(;iter!=iterEnd;++iter){
    SiPixelQuality::disabledModuleType BadModule;  
    BadModule.DetID = *iter;
    BadModule.errorType = 0;
    BadModule.BadRocs = 65535; //NOTE: here all module is bad - no difference for half modules
    if(IsModuleUsable(BadModule.DetID))
      addDisabledModule(BadModule);
    
  }
}
void SiPixelQuality::addDisabledModule ( disabledModuleType  module) [inline]

Definition at line 76 of file SiPixelQuality.h.

References theDisabledModules.

Referenced by SiPixelFakeQualityESSource::produce().

  { theDisabledModules.push_back(module); }
void SiPixelQuality::addDisabledModule ( std::vector< disabledModuleType > &  idVector)
int SiPixelQuality::BadModuleNumber ( )

Definition at line 98 of file SiPixelQuality.cc.

                                    {
  std::vector<SiPixelQuality::disabledModuleType>disabledModules = theDisabledModules;
  //does not distinguish between partially dead or not 
  return disabledModules.size();
}
const std::vector<disabledModuleType> SiPixelQuality::getBadComponentList ( ) const [inline]

Definition at line 108 of file SiPixelQuality.h.

References theDisabledModules.

    { return theDisabledModules; }
const std::vector< LocalPoint > SiPixelQuality::getBadRocPositions ( const uint32_t &  detid,
const TrackerGeometry theTracker,
const SiPixelFedCabling map 
) const

Definition at line 150 of file SiPixelQuality.cc.

References sipixelobjects::GlobalPixel::col, SiPixelFedCabling::findItem(), i, sipixelobjects::PixelROC::idInDetUnit(), TrackerGeometry::idToDet(), Topology::localPosition(), getHLTPrescaleColumns::path, SiPixelFedCabling::pathToDetUnit(), sipixelobjects::GlobalPixel::row, PixelGeomDetUnit::specificTopology(), and sipixelobjects::PixelROC::toGlobal().

Referenced by MeasurementTrackerImpl::initializePixelStatus().

                                                                                                                                                           {
  std::vector<LocalPoint> badrocpositions (0);
  std::pair<uint8_t, uint8_t> coord(1,1);
   for(unsigned int i = 0; i < 16; i++){
     if (IsRocBad(detid, i) == true){
    std::vector<CablingPathToDetUnit> path = map->pathToDetUnit(detid);
    typedef  std::vector<CablingPathToDetUnit>::const_iterator IT;
       for  (IT it = path.begin(); it != path.end(); ++it) {
          const PixelROC * myroc = map->findItem(*it);
          if( myroc->idInDetUnit() == i) {
              LocalPixel::RocRowCol  local = { 39, 25};   //corresponding to center of ROC row, col
              GlobalPixel global = myroc->toGlobal( LocalPixel(local) );
              //       edm::ESHandle<TrackerGeometry> geom;
              //     es.get<TrackerDigiGeometryRecord>().get( geom );
              //    const TrackerGeometry& theTracker(*geom);
              const PixelGeomDetUnit * theGeomDet = dynamic_cast<const PixelGeomDetUnit*> (theTracker.idToDet(detid) );

              PixelTopology const * topology = &(theGeomDet->specificTopology());

              MeasurementPoint thepoint(global.row, global.col);
              LocalPoint localpoint = topology->localPosition(thepoint);
              badrocpositions.push_back(localpoint);
         break;
          }
       }
     }
   }
  return badrocpositions;
}
short SiPixelQuality::getBadRocs ( const uint32_t &  detid) const

Definition at line 141 of file SiPixelQuality.cc.

References cond::rpcobgas::detid, and python::multivaluedict::sort().

Referenced by MeasurementTrackerImpl::initializePixelStatus().

                                                           {
  std::vector<SiPixelQuality::disabledModuleType>disabledModules = theDisabledModules;
  std::sort(disabledModules.begin(),disabledModules.end(),SiPixelQuality::BadComponentStrictWeakOrdering());
  std::vector<disabledModuleType>::const_iterator iter = std::lower_bound(disabledModules.begin(),disabledModules.end(),detid,SiPixelQuality::BadComponentStrictWeakOrdering());
  if (iter != disabledModules.end() && iter->DetID==detid)
    return iter->BadRocs;
  return 0;
}
bool SiPixelQuality::IsAreaBad ( uint32_t  detid,
sipixelobjects::GlobalPixel  global,
const edm::EventSetup es,
const SiPixelFedCabling map 
) const

Definition at line 128 of file SiPixelQuality.cc.

References SiPixelFrameReverter::findRocInDet(), and IsRocBad().

                                                                                                                                             {
 
  SiPixelFrameReverter reverter(es,map);
  int rocfromarea = -1;  
  rocfromarea = reverter.findRocInDet(detid, global);

  return SiPixelQuality::IsRocBad(detid, rocfromarea);
  return false;
}
bool SiPixelQuality::IsFedBad ( const uint32_t &  detid) const [private]

Definition at line 181 of file SiPixelQuality.cc.

                                                         {
  return false;
}
bool SiPixelQuality::IsModuleBad ( const uint32_t &  detid) const

Definition at line 105 of file SiPixelQuality.cc.

References cond::rpcobgas::detid, and python::multivaluedict::sort().

                                                              {
   if(IsFedBad(detid))
     return true;
   std::vector<SiPixelQuality::disabledModuleType>disabledModules = theDisabledModules;
   std::sort(disabledModules.begin(),disabledModules.end(),SiPixelQuality::BadComponentStrictWeakOrdering());
   std::vector<disabledModuleType>::const_iterator iter = std::lower_bound(disabledModules.begin(),disabledModules.end(),detid,SiPixelQuality::BadComponentStrictWeakOrdering());
   if (iter != disabledModules.end() && iter->DetID==detid && iter->errorType == 0) //errorType 0 corresponds to "whole" dead module
      return true;
   return false;
}
bool SiPixelQuality::IsModuleUsable ( const uint32_t &  detid) const

Definition at line 87 of file SiPixelQuality.cc.

References cond::rpcobgas::detid, and python::multivaluedict::sort().

Referenced by MeasurementTrackerImpl::initializePixelStatus().

                                                               {
   if(IsFedBad(detid))
     return true;
   std::vector<SiPixelQuality::disabledModuleType>disabledModules = theDisabledModules;
   std::sort(disabledModules.begin(),disabledModules.end(),SiPixelQuality::BadComponentStrictWeakOrdering());
   std::vector<disabledModuleType>::const_iterator iter = std::lower_bound(disabledModules.begin(),disabledModules.end(),detid,SiPixelQuality::BadComponentStrictWeakOrdering());
   if (iter != disabledModules.end() && iter->DetID==detid && iter->errorType ==0)
    return false;
  return true;
}
bool SiPixelQuality::IsRocBad ( const uint32_t &  detid,
const short &  rocNb 
) const

Definition at line 117 of file SiPixelQuality.cc.

References cond::rpcobgas::detid, and python::multivaluedict::sort().

Referenced by IsAreaBad(), and PixelDataFormatter::word2digi().

                                                                             {
  if(IsModuleBad(detid))
    return true;
   std::vector<SiPixelQuality::disabledModuleType>disabledModules = theDisabledModules;
   std::sort(disabledModules.begin(),disabledModules.end(),SiPixelQuality::BadComponentStrictWeakOrdering());
   std::vector<disabledModuleType>::const_iterator iter = std::lower_bound(disabledModules.begin(),disabledModules.end(),detid,SiPixelQuality::BadComponentStrictWeakOrdering());
   if (iter != disabledModules.end() && iter->DetID == detid){
     return ((iter->BadRocs >> rocNb)&0x1);}
  return false;
}
void SiPixelQuality::setDisabledModuleList ( std::vector< disabledModuleType > &  disabledModules) [inline]

Definition at line 72 of file SiPixelQuality.h.

References theDisabledModules.

  { theDisabledModules = disabledModules; }

Member Data Documentation

Definition at line 116 of file SiPixelQuality.h.

Referenced by addDisabledModule(), getBadComponentList(), and setDisabledModuleList().