CMS 3D CMS Logo

SiStripHotStripAlgorithmFromClusterOccupancy Class Reference

Description: <one line="" class="" summary>="">. More...

#include <CalibTracker/SiStripQuality/src/SiStripHotStripAlgorithmFromClusterOccupancy.cc>

List of all members.

Public Types

typedef SiStrip::QualityHistosMap HistoMap

Public Member Functions

void extractBadStrips (SiStripQuality *, HistoMap &)
void setMinNumEntries (unsigned short m)
void setMinNumEntriesPerStrip (unsigned short m)
void setProbabilityThreshold (long double prob)
 SiStripHotStripAlgorithmFromClusterOccupancy ()
virtual ~SiStripHotStripAlgorithmFromClusterOccupancy ()

Private Member Functions

void evaluatePoissonian (std::vector< long double > &, float &meanVal)
void iterativeSearch (pHisto &, std::vector< unsigned int > &)

Private Attributes

unsigned short MinNumEntries_
unsigned short MinNumEntriesPerStrip_
SiStripQualitypQuality
long double prob_
std::stringstream ss

Classes

struct  pHisto


Detailed Description

Description: <one line="" class="" summary>="">.

Implementation: <Notes on="" implementation>="">

Definition at line 34 of file SiStripHotStripAlgorithmFromClusterOccupancy.h.


Member Typedef Documentation

typedef SiStrip::QualityHistosMap SiStripHotStripAlgorithmFromClusterOccupancy::HistoMap

Definition at line 37 of file SiStripHotStripAlgorithmFromClusterOccupancy.h.


Constructor & Destructor Documentation

SiStripHotStripAlgorithmFromClusterOccupancy::SiStripHotStripAlgorithmFromClusterOccupancy (  )  [inline]

Definition at line 40 of file SiStripHotStripAlgorithmFromClusterOccupancy.h.

SiStripHotStripAlgorithmFromClusterOccupancy::~SiStripHotStripAlgorithmFromClusterOccupancy (  )  [virtual]

Definition at line 9 of file SiStripHotStripAlgorithmFromClusterOccupancy.cc.

References lat::endl(), and LogTrace.

00009                                                                                            {
00010   LogTrace("SiStripHotStripAlgorithmFromClusterOccupancy")<<"[SiStripHotStripAlgorithmFromClusterOccupancy::~SiStripHotStripAlgorithmFromClusterOccupancy] "<<std::endl;
00011 }


Member Function Documentation

void SiStripHotStripAlgorithmFromClusterOccupancy::evaluatePoissonian ( std::vector< long double > &  vPoissonProbs,
float &  meanVal 
) [private]

Definition at line 83 of file SiStripHotStripAlgorithmFromClusterOccupancy.cc.

References i.

Referenced by iterativeSearch().

00083                                                                                                                           {
00084   for(size_t i=0;i<vPoissonProbs.size();++i){
00085     vPoissonProbs[i]= (i==0)?TMath::Poisson(i,meanVal):vPoissonProbs[i-1]+TMath::Poisson(i,meanVal);
00086   }
00087 }

void SiStripHotStripAlgorithmFromClusterOccupancy::extractBadStrips ( SiStripQuality siStripQuality,
HistoMap DM 
)

Definition at line 13 of file SiStripHotStripAlgorithmFromClusterOccupancy.cc.

References SiStripHotStripAlgorithmFromClusterOccupancy::pHisto::_NEntries, SiStripHotStripAlgorithmFromClusterOccupancy::pHisto::_th1f, SiStripQuality::clear(), SiStripQuality::compact(), lat::endl(), SiStripQuality::fillBadComponents(), it, iterativeSearch(), LogTrace, pQuality, SiStripBadStrip::put(), range, and ss.

Referenced by SiStripQualityHotStripIdentifierRoot::getNewObject(), and SiStripQualityHotStripIdentifier::getNewObject().

00013                                                                                                               {
00014 
00015   LogTrace("SiStripHotStripAlgorithmFromClusterOccupancy")<<"[SiStripHotStripAlgorithmFromClusterOccupancy::extractBadStrips] "<<std::endl;
00016 
00017   HistoMap::iterator it=DM.begin();
00018   HistoMap::iterator itEnd=DM.end();
00019   std::vector<unsigned int> badStripList;
00020   uint32_t detid;
00021   for (;it!=itEnd;++it){
00022     pHisto phisto;
00023     phisto._th1f=it->second.get();
00024     phisto._NEntries=phisto._th1f->GetEntries();
00025     detid=it->first;
00026     
00027     pQuality=siStripQuality;
00028     badStripList.clear();
00029     iterativeSearch(phisto,badStripList);
00030     
00031     if (badStripList.begin()==badStripList.end())
00032       continue;
00033 
00034     siStripQuality->compact(detid,badStripList);
00035 
00036 
00037     SiStripQuality::Range range(badStripList.begin(),badStripList.end());
00038     if ( ! siStripQuality->put(detid,range) )
00039       edm::LogError("SiStripHotStripAlgorithmFromClusterOccupancy")<<"[SiStripHotStripAlgorithmFromClusterOccupancy::extractBadStrips] detid already exists"<<std::endl;
00040   }
00041   siStripQuality->fillBadComponents();
00042   LogTrace("SiStripHotStripAlgorithmFromClusterOccupancy") << ss.str() << std::endl;
00043 }

void SiStripHotStripAlgorithmFromClusterOccupancy::iterativeSearch ( pHisto histo,
std::vector< unsigned int > &  vect 
) [private]

Definition at line 46 of file SiStripHotStripAlgorithmFromClusterOccupancy.cc.

References SiStripHotStripAlgorithmFromClusterOccupancy::pHisto::_NEmptyBins, SiStripHotStripAlgorithmFromClusterOccupancy::pHisto::_NEntries, SiStripHotStripAlgorithmFromClusterOccupancy::pHisto::_th1f, diff, SiStripBadStrip::encode(), lat::endl(), python::tagInventory::entries, evaluatePoissonian(), i, int, edm::isDebugEnabled(), MinNumEntries_, MinNumEntriesPerStrip_, pQuality, prob_, and ss.

Referenced by extractBadStrips().

00046                                                                                                              {
00047   if (!histo._NEntries || histo._NEntries <MinNumEntries_)
00048     return;
00049   
00050   size_t startingSize=vect.size();
00051   long double diff=1.-prob_; 
00052   
00053   int Nbins=histo._th1f->GetNbinsX();
00054   int ibinStart= 1; 
00055   int ibinStop= Nbins+1; 
00056   int MaxEntry=(int)histo._th1f->GetMaximum();
00057 
00058   std::vector<long double> vPoissonProbs(MaxEntry+1,0);
00059   float meanVal=histo._NEntries/(Nbins-histo._NEmptyBins); 
00060   evaluatePoissonian(vPoissonProbs,meanVal);
00061 
00062   for (Int_t i=ibinStart; i<ibinStop; ++i){
00063     unsigned int entries= (unsigned int)histo._th1f->GetBinContent(i);
00064     if (entries<MinNumEntriesPerStrip_)
00065       continue;
00066 
00067     if(diff<vPoissonProbs[entries]){
00068       histo._th1f->SetBinContent(i,0.);
00069       histo._NEntries-=entries;
00070       histo._NEmptyBins++;
00071       if (edm::isDebugEnabled())
00072         ss << " [SiStripHotStripAlgorithmFromClusterOccupancy::iterativeSearch] rejecting strip " << i-1 << std::endl;
00073       vect.push_back(pQuality->encode(i-1,1,0));
00074     }
00075   }
00076   if (edm::isDebugEnabled())
00077     ss << " [SiStripHotStripAlgorithmFromClusterOccupancy::iterativeSearch] Nbins="<< Nbins << " MaxEntry="<<MaxEntry << " meanVal=" << meanVal << " NEmptyBins="<<histo._NEmptyBins<< " NEntries=" << histo._NEntries << " " << histo._th1f->GetEntries()<< " startingSize " << startingSize << " vector.size " << vect.size() << std::endl;
00078 
00079   if (vect.size()!=startingSize)
00080     iterativeSearch(histo,vect);
00081 }

void SiStripHotStripAlgorithmFromClusterOccupancy::setMinNumEntries ( unsigned short  m  )  [inline]

Definition at line 44 of file SiStripHotStripAlgorithmFromClusterOccupancy.h.

References MinNumEntries_.

Referenced by SiStripQualityHotStripIdentifierRoot::getNewObject(), and SiStripQualityHotStripIdentifier::getNewObject().

00044 {MinNumEntries_=m;}

void SiStripHotStripAlgorithmFromClusterOccupancy::setMinNumEntriesPerStrip ( unsigned short  m  )  [inline]

Definition at line 45 of file SiStripHotStripAlgorithmFromClusterOccupancy.h.

References MinNumEntriesPerStrip_.

Referenced by SiStripQualityHotStripIdentifierRoot::getNewObject(), and SiStripQualityHotStripIdentifier::getNewObject().

void SiStripHotStripAlgorithmFromClusterOccupancy::setProbabilityThreshold ( long double  prob  )  [inline]

Definition at line 43 of file SiStripHotStripAlgorithmFromClusterOccupancy.h.

References prob_.

Referenced by SiStripQualityHotStripIdentifierRoot::getNewObject(), and SiStripQualityHotStripIdentifier::getNewObject().

00043 {prob_=prob;}


Member Data Documentation

unsigned short SiStripHotStripAlgorithmFromClusterOccupancy::MinNumEntries_ [private]

Definition at line 63 of file SiStripHotStripAlgorithmFromClusterOccupancy.h.

Referenced by iterativeSearch(), and setMinNumEntries().

unsigned short SiStripHotStripAlgorithmFromClusterOccupancy::MinNumEntriesPerStrip_ [private]

Definition at line 64 of file SiStripHotStripAlgorithmFromClusterOccupancy.h.

Referenced by iterativeSearch(), and setMinNumEntriesPerStrip().

SiStripQuality* SiStripHotStripAlgorithmFromClusterOccupancy::pQuality [private]

Definition at line 66 of file SiStripHotStripAlgorithmFromClusterOccupancy.h.

Referenced by extractBadStrips(), and iterativeSearch().

long double SiStripHotStripAlgorithmFromClusterOccupancy::prob_ [private]

Definition at line 62 of file SiStripHotStripAlgorithmFromClusterOccupancy.h.

Referenced by iterativeSearch(), and setProbabilityThreshold().

std::stringstream SiStripHotStripAlgorithmFromClusterOccupancy::ss [private]

Definition at line 67 of file SiStripHotStripAlgorithmFromClusterOccupancy.h.

Referenced by extractBadStrips(), and iterativeSearch().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:32:24 2009 for CMSSW by  doxygen 1.5.4