CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Friends
SiStripBadStrip Class Reference

#include <SiStripBadStrip.h>

Inheritance diagram for SiStripBadStrip:
SiStripQuality

Classes

struct  data
 
struct  DetRegistry
 
class  StrictWeakOrdering
 

Public Types

typedef std::vector< unsigned int > Container
 
typedef std::vector< unsigned int >::const_iterator ContainerIterator
 
typedef Container InputVector
 
typedef std::pair< ContainerIterator, ContainerIteratorRange
 
typedef std::vector< DetRegistryRegistry
 
typedef Registry::const_iterator RegistryIterator
 

Public Member Functions

data decode (const unsigned int &value) const
 
unsigned int encode (const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)
 
ContainerIterator getDataVectorBegin () const
 
ContainerIterator getDataVectorEnd () const
 
void getDetIds (std::vector< uint32_t > &DetIds_) const
 
const Range getRange (const uint32_t detID) const
 
Range getRangeByPos (unsigned short pos) const
 
RegistryIterator getRegistryVectorBegin () const
 
RegistryIterator getRegistryVectorEnd () const
 
void printDebug (std::stringstream &ss) const
 
void printSummary (std::stringstream &ss) const
 
bool put (const uint32_t &detID, const InputVector &vect)
 
bool put (const uint32_t &detID, Range input)
 
 SiStripBadStrip ()
 
 SiStripBadStrip (const SiStripBadStrip &orig)
 
virtual ~SiStripBadStrip ()
 

Protected Attributes

Registry indexes
 
Container v_badstrips
 

Private Member Functions

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

Friends

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

Detailed Description

Holds the list of bad components.
The bad components can be filled with two put methods, that receive a DetId and either a range of bad strips or a vector of bad strips.
The information is stored in two vectors:

Definition at line 29 of file SiStripBadStrip.h.

Member Typedef Documentation

typedef std::vector<unsigned int> SiStripBadStrip::Container

Definition at line 52 of file SiStripBadStrip.h.

typedef std::vector<unsigned int>::const_iterator SiStripBadStrip::ContainerIterator

Definition at line 53 of file SiStripBadStrip.h.

Definition at line 57 of file SiStripBadStrip.h.

Definition at line 54 of file SiStripBadStrip.h.

typedef std::vector<DetRegistry> SiStripBadStrip::Registry

Definition at line 55 of file SiStripBadStrip.h.

typedef Registry::const_iterator SiStripBadStrip::RegistryIterator

Definition at line 56 of file SiStripBadStrip.h.

Constructor & Destructor Documentation

SiStripBadStrip::SiStripBadStrip ( )
inline

Definition at line 59 of file SiStripBadStrip.h.

59 {};
SiStripBadStrip::SiStripBadStrip ( const SiStripBadStrip orig)
inline

Definition at line 60 of file SiStripBadStrip.h.

References indexes, and v_badstrips.

60  {
62  indexes=orig.indexes;
63  }
Container v_badstrips
virtual SiStripBadStrip::~SiStripBadStrip ( )
inlinevirtual

Definition at line 64 of file SiStripBadStrip.h.

64 {};

Member Function Documentation

data SiStripBadStrip::decode ( const unsigned int &  value) const
inline

Definition at line 80 of file SiStripBadStrip.h.

References a, sistrip::FirstBadStripMask_, sistrip::FirstBadStripShift_, SiStripBadStrip::data::firstStrip, SiStripBadStrip::data::flag, sistrip::FlagBadStripMask_, sistrip::FlagBadStripShift_, SiStripBadStrip::data::range, sistrip::RangeBadStripMask_, and sistrip::RangeBadStripShift_.

Referenced by SiStripQuality::add(), SiStripPopConFEDErrorsHandlerFromDQM::addErrors(), SiStripHitEffFromCalibTree::algoAnalyze(), SiStripBadStripReader::analyze(), SiStripBadComponentsDQMServiceReader::analyze(), SiStripQualityStatistics::analyze(), SiStripMonitorQuality::analyze(), SiStripQualityHistory::beginRun(), SiStripQuality::compact(), edm::DataMixingSiStripMCDigiWorker::DMinitializeDetUnit(), SiStripQuality::fillBadComponents(), SiStripQualityDQM::fillGrandSummaryMEs(), ztail.Decoder::follow(), ztail.Decoder::initial_synchronize(), SiStripDigitizerAlgorithm::initializeDetUnit(), MeasurementTrackerImpl::initializeStripStatus(), SiStripQuality::IsStripBad(), SiStripCorrelateBadStripAndNoise::iterateOnBadStrips(), SiStripQuality::nBadStripsOnTheLeft(), SiStripQuality::nBadStripsOnTheRight(), SiStripQuality::operator-=(), printDebug(), SiStripQuality::ReduceGranularity(), DigiSimLinkAlgorithm::run(), and SiStripQuality::subtraction().

80  {
81  data a;
85  return a;
86  }
static const uint32_t FirstBadStripShift_
static const uint32_t RangeBadStripShift_
static const uint32_t FirstBadStripMask_
Definition: value.py:1
static const uint32_t RangeBadStripMask_
static const uint32_t FlagBadStripShift_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
double a
Definition: hdecay.h:121
static const uint32_t FlagBadStripMask_
unsigned int SiStripBadStrip::encode ( const unsigned short &  first,
const unsigned short &  NconsecutiveBadStrips,
const unsigned short &  flag = 0 
)
inline

Definition at line 88 of file SiStripBadStrip.h.

References sistrip::FirstBadStripMask_, sistrip::FirstBadStripShift_, SiStripBadStrip::data::flag, sistrip::FlagBadStripMask_, sistrip::FlagBadStripShift_, sistrip::RangeBadStripMask_, and sistrip::RangeBadStripShift_.

Referenced by SiStripQuality::add(), SiStripPopConFEDErrorsHandlerFromDQM::addBadStrips(), SiStripPopConFEDErrorsHandlerFromDQM::addErrors(), SiStripQuality::addInvalidConnectionFromCabling(), SiStripQuality::addNotConnectedConnectionFromCabling(), SiStripBadFiberBuilder::algoAnalyze(), SiStripBadChannelBuilder::algoAnalyze(), SiStripBadAPVAlgorithmFromClusterOccupancy::AnalyzeOccupancy(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::AnalyzeOccupancy(), SiStripQuality::compact(), SiStripPopConBadComponentsHandlerFromDQM::dqmEndJob(), SiStripBadStripFromASCIIFile::getNewObject(), SiStripBadModuleByHandBuilder::getNewObject(), SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy::iterativeSearch(), SiStripHotStripAlgorithmFromClusterOccupancy::iterativeSearch(), SiStripHitEffFromCalibTree::makeSQLite(), SiStripQuality::ReduceGranularity(), SiStripCondObjBuilderFromDb::setDefaultValuesCabling(), SiStripCondObjBuilderFromDb::setValuesCabling(), SiStripQuality::subtraction(), and SiStripQuality::turnOffFeds().

88  {
90  }
static const uint32_t FirstBadStripShift_
static const uint32_t RangeBadStripShift_
static const uint32_t FirstBadStripMask_
static const uint32_t RangeBadStripMask_
static const uint32_t FlagBadStripShift_
static const uint32_t FlagBadStripMask_
ContainerIterator SiStripBadStrip::getDataVectorBegin ( ) const
inline
ContainerIterator SiStripBadStrip::getDataVectorEnd ( ) const
inline

Definition at line 75 of file SiStripBadStrip.h.

References v_badstrips.

Referenced by SiStripQualityHistory::beginRun().

75 {return v_badstrips.end();}
Container v_badstrips
void SiStripBadStrip::getDetIds ( std::vector< uint32_t > &  DetIds_) const

Definition at line 50 of file SiStripBadStrip.cc.

References begin, end, indexes, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by SiStripBadStripReader::analyze(), SiStripBadComponentsDQMServiceReader::analyze(), SiStripQualityDQM::getActiveDetIds(), StripClusterizerAlgorithm::initialize(), and put().

50  {
51  // returns vector of DetIds in map
54  for (SiStripBadStrip::RegistryIterator p=begin; p != end; ++p) {
55  DetIds_.push_back(p->detid);
56  }
57 }
Registry::const_iterator RegistryIterator
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
const SiStripBadStrip::Range SiStripBadStrip::getRange ( const uint32_t  detID) const

Definition at line 26 of file SiStripBadStrip.cc.

References indexes, AlCaHLTBitMon_ParallelJobs::p, and v_badstrips.

Referenced by SiStripAPVRestorer::AbnormalBaselineInspect(), SiStripQuality::add(), SiStripBadStripReader::analyze(), SiStripBadComponentsDQMServiceReader::analyze(), SiStripMonitorCluster::analyze(), SiStripMonitorTrack::clusterInfos(), edm::DataMixingSiStripMCDigiWorker::DMinitializeDetUnit(), SiStripMonitorPedestals::fillCondDBMEs(), SiStripQualityDQM::fillMEsForDet(), SiStripQualityDQM::fillMEsForLayer(), StripClusterizerAlgorithm::findDetId(), SiStripDigitizerAlgorithm::initializeDetUnit(), MeasurementTrackerImpl::initializeStripStatus(), SiStripQuality::IsStripBad(), SiStripAPVRestorer::NullInspect(), SiStripQuality::operator-=(), printDebug(), put(), DigiSimLinkAlgorithm::run(), TT6CMNSubtractor::subtract_(), and IteratedMedianCMNSubtractor::subtract_().

26  {
27  // get SiStripBadStrip Range of DetId
28 
29  RegistryIterator p = std::lower_bound(indexes.begin(),indexes.end(),DetId,SiStripBadStrip::StrictWeakOrdering());
30  if (p==indexes.end()|| p->detid!=DetId)
31  return SiStripBadStrip::Range(v_badstrips.end(),v_badstrips.end());
32  else {
33  __builtin_prefetch((&v_badstrips.front())+p->ibegin);
34  __builtin_prefetch((&v_badstrips.front())+p->ibegin+24);
35  __builtin_prefetch((&v_badstrips.front())+p->iend-24);
36  return SiStripBadStrip::Range(v_badstrips.begin()+p->ibegin,v_badstrips.begin()+p->iend);
37  }
38 }
Registry::const_iterator RegistryIterator
Definition: DetId.h:18
Container v_badstrips
std::pair< ContainerIterator, ContainerIterator > Range
SiStripBadStrip::Range SiStripBadStrip::getRangeByPos ( unsigned short  pos) const

Definition at line 40 of file SiStripBadStrip.cc.

References indexes, AlCaHLTBitMon_ParallelJobs::p, and v_badstrips.

Referenced by StripClusterizerAlgorithm::findDetId(), and put().

40  {
41  if (pos>indexes.size()) return Range(v_badstrips.end(),v_badstrips.end());
42  auto p = indexes.begin()+pos;
43  __builtin_prefetch((&v_badstrips.front())+p->ibegin);
44  __builtin_prefetch((&v_badstrips.front())+p->ibegin+24);
45  __builtin_prefetch((&v_badstrips.front())+p->iend-24);
46  return Range(v_badstrips.begin()+p->ibegin,v_badstrips.begin()+p->iend);
47 }
Container v_badstrips
std::pair< ContainerIterator, ContainerIterator > Range
RegistryIterator SiStripBadStrip::getRegistryVectorBegin ( ) const
inline
RegistryIterator SiStripBadStrip::getRegistryVectorEnd ( ) const
inline
void SiStripBadStrip::printDebug ( std::stringstream &  ss) const

Definition at line 75 of file SiStripBadStrip.cc.

References decode(), SiStripBadStrip::data::firstStrip, SiStripBadStrip::data::flag, getRange(), indexes, and SiStripBadStrip::data::range.

Referenced by SiStripQuality::cabling(), put(), and SiStripQuality::setPrintDebugOutput().

75  {
76  ss << "Printing all bad strips for all DetIds" << std::endl;
77  // Loop on the vector<DetRegistry> and take the bad modules and bad strips
78  Registry::const_iterator it = indexes.begin();
79  for( ; it!=indexes.end(); ++it ) {
80 // ss << "For DetId = " << it->detid << std::endl;
81  SiStripBadStrip::Range range(getRange(it->detid));
82  for( std::vector<unsigned int>::const_iterator badStrip = range.first;
83  badStrip != range.second; ++badStrip ) {
84  ss << "DetId="<<it->detid << " Strip=" << decode(*badStrip).firstStrip <<":"<<decode(*badStrip).range << " flag="<< decode(*badStrip).flag << std::endl;
85  }
86  }
87 }
unsigned short range
unsigned short firstStrip
const Range getRange(const uint32_t detID) const
std::pair< ContainerIterator, ContainerIterator > Range
data decode(const unsigned int &value) const
void SiStripBadStrip::printSummary ( std::stringstream &  ss) const

Definition at line 59 of file SiStripBadStrip.cc.

References SiStripDetSummary::add(), indexes, and SiStripDetSummary::print().

Referenced by SiStripPopConBadComponentsHandlerFromDQM::getMetaDataString(), and put().

59  {
60  SiStripDetSummary summaryBadModules;
61  SiStripDetSummary summaryBadStrips;
62 
63  // Loop on the vector<DetRegistry> and take the bad modules and bad strips
64  Registry::const_iterator it = indexes.begin();
65  for( ; it!=indexes.end(); ++it ) {
66  summaryBadModules.add(it->detid);
67  summaryBadStrips.add(it->iend - it->ibegin);
68  }
69  ss << "Summary of bad modules in detector:" << std::endl;
70  summaryBadModules.print(ss, false);
71  ss << "Summary of bad strip in detectors:" << std::endl;
72  summaryBadStrips.print(ss, false);
73 }
void print(std::stringstream &ss, const bool mean=true) const
void add(const DetId &detid, const float &value)
Used to compute the mean value of the value variable divided by subdetector, layer and mono/stereo...
bool SiStripBadStrip::put ( const uint32_t &  detID,
const InputVector vect 
)
inline
bool SiStripBadStrip::put ( const uint32_t &  detID,
Range  input 
)

Definition at line 7 of file SiStripBadStrip.cc.

References SiStripBadStrip::DetRegistry::detid, SiStripBadStrip::DetRegistry::ibegin, SiStripBadStrip::DetRegistry::iend, indexes, AlCaHLTBitMon_ParallelJobs::p, sd, and v_badstrips.

7  {
8  // put in SiStripBadStrip::v_badstrips of DetId
9  Registry::iterator p = std::lower_bound(indexes.begin(),indexes.end(),DetId,SiStripBadStrip::StrictWeakOrdering());
10  if (p!=indexes.end() && p->detid==DetId){
11  edm::LogError("SiStripBadStrip") << "[" << __PRETTY_FUNCTION__ << "] SiStripBadStrip for DetID " << DetId << " is already stored. Skippig this put" << std::endl;
12  return false;
13  }
14 
15  size_t sd= input.second-input.first;
16  DetRegistry detregistry;
17  detregistry.detid=DetId;
18  detregistry.ibegin=v_badstrips.size();
19  detregistry.iend=v_badstrips.size()+sd;
20  indexes.insert(p,detregistry);
21 
22  v_badstrips.insert(v_badstrips.end(),input.first,input.second);
23  return true;
24 }
static std::string const input
Definition: EdmProvDump.cc:44
Definition: DetId.h:18
Container v_badstrips
double sd
template<class Archive >
void SiStripBadStrip::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 96 of file SiStripBadStrip.h.

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

Definition at line 96 of file SiStripBadStrip.h.

Member Data Documentation

Registry SiStripBadStrip::indexes
protected
Container SiStripBadStrip::v_badstrips
protected