22 OutFileName_(
"Occupancy.root"),
23 UseInputDB_(iConfig.getUntrackedParameter<bool>(
"UseInputDB",
false))
29 LogTrace(
"SiStripBadAPVAlgorithmFromClusterOccupancy")<<
"[SiStripBadAPVAlgorithmFromClusterOccupancy::~SiStripBadAPVAlgorithmFromClusterOccupancy] "<<std::endl;
34 LogTrace(
"SiStripBadAPVAlgorithmFromClusterOccupancy")<<
"[SiStripBadAPVAlgorithmFromClusterOccupancy::extractBadAPVs] "<<std::endl;
40 apvtree =
new TTree(
"moduleOccupancy",
"tree");
61 HistoMap::iterator it=DM.begin();
62 HistoMap::iterator itEnd=DM.end();
63 std::vector<unsigned int> badStripList;
65 for (;it!=itEnd;++it){
69 for (
int apv=0; apv<6; apv++)
82 phisto.
_th1f = it->second.get();
109 LogTrace(
"SiStripBadAPV") <<
"Analyzing detid " << detid<< std::endl;
220 std::cout <<
"### Detector does not belong to TIB, TID, TOB or TEC !? ###" << std::endl;
286 badStripList.
clear();
336 LogTrace(
"SiStripBadAPV") <<
ss.str() << std::endl;
342 Double_t tot[7], tot2[7];
345 Double_t
Mean[7] = {0};
346 Double_t Rms[7] = {1000,1000,1000,1000,1000,1000,1000};
350 for (
int i=0;
i<number_iterations;
i++)
352 for (
int j=0;
j<7;
j++)
359 for (uint32_t it=0; it<a.size(); it++)
361 Moduleposition = (a[it].modulePosition)-1;
363 for (
int apv=0; apv<a[it].numberApvs; apv++)
367 if (a[it].apvMedian[apv]<(Mean[Moduleposition]-3*Rms[Moduleposition]) || (a[it].apvMedian[apv]>(Mean[Moduleposition]+5*Rms[Moduleposition])))
372 tot[Moduleposition] += a[it].apvMedian[apv];
373 tot2[Moduleposition] += (a[it].apvMedian[apv])*(a[it].apvMedian[apv]);
378 for (
int j=0;
j<7;
j++)
382 Mean[
j] = tot[
j]/n[
j];
383 Rms[
j] = TMath::Sqrt(TMath::Abs(tot2[
j]/n[
j] -Mean[
j]*Mean[
j]));
388 for (
int j=0;
j<7;
j++)
390 MeanRMS[
j] = std::make_pair(Mean[
j],Rms[j]);
400 for (uint32_t it=0; it<medianValues.size(); it++)
402 Moduleposition = (medianValues[it].modulePosition)-1;
403 Detid = medianValues[it].detrawId;
405 for (
int apv=0; apv<medianValues[it].numberApvs; apv++)
409 if(InSiStripQuality->IsApvBad(Detid,apv) )
419 else if (medianValues[it].apvMedian[apv]<(MeanAndRms[Moduleposition].
first-
lowoccupancy_*MeanAndRms[Moduleposition].
second) && (MeanAndRms[Moduleposition].first>2 || medianValues[it].apvabsoluteOccupancy[apv]==0))
422 std::cout <<
"Dead APV! DetId: " << medianValues[it].detrawId <<
", APV number: " << apv+1 <<
", APVMedian: " << medianValues[it].apvMedian[apv] <<
", Mean: " << MeanAndRms[Moduleposition].first <<
", RMS: " << MeanAndRms[Moduleposition].second <<
", LowThreshold: " <<
lowoccupancy_ <<
", Mean-Low*RMS: " << (MeanAndRms[Moduleposition].first-
lowoccupancy_*MeanAndRms[Moduleposition].second) << std::endl;
425 if (BadStripList.begin()!=BadStripList.end())
427 quality->
compact(Detid,BadStripList);
429 quality->
put(Detid,range);
431 BadStripList.clear();
std::vector< Apv > medianValues_TECPlus_Disc3
std::pair< double, double > MeanAndRms_TECMinus_Disc4[7]
unsigned int rodNumber() const
unsigned int petalNumber() const
std::vector< Apv > medianValues_TECPlus_Disc8
unsigned int stringNumber() const
std::vector< Apv > medianValues_TECMinus_Disc4
unsigned int layer() const
layer id
std::vector< Apv > medianValues_TIDMinus_Disc3
std::pair< double, double > MeanAndRms_TIB_Layer1[7]
std::pair< double, double > MeanAndRms_TIB_Layer4[7]
void AnalyzeOccupancy(SiStripQuality *, std::vector< Apv > &, std::pair< double, double > *, std::vector< unsigned int > &, edm::ESHandle< SiStripQuality > &)
std::pair< double, double > MeanAndRms_TECMinus_Disc8[7]
std::vector< Apv > medianValues_TIDPlus_Disc3
const TrackerGeometry * TkGeom
std::pair< double, double > MeanAndRms_TECMinus_Disc9[7]
SiStripBadAPVAlgorithmFromClusterOccupancy(const edm::ParameterSet &)
std::pair< double, double > MeanAndRms_TECMinus_Disc3[7]
std::pair< double, double > MeanAndRms_TIDPlus_Disc3[7]
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
std::pair< double, double > MeanAndRms_TIDMinus_Disc2[7]
std::pair< double, double > MeanAndRms_TIB_Layer2[7]
std::pair< double, double > MeanAndRms_TECMinus_Disc2[7]
std::pair< double, double > MeanAndRms_TIDMinus_Disc1[7]
std::vector< Apv > medianValues_TECPlus_Disc4
SiStripQuality * pQuality
U second(std::pair< T, U > const &p)
std::vector< Apv > medianValues_TECPlus_Disc1
std::pair< double, double > MeanAndRms_TOB_Layer6[7]
std::vector< Apv > medianValues_TIDMinus_Disc2
std::vector< Apv > medianValues_TECMinus_Disc1
std::vector< Apv > medianValues_TIB_Layer1
unsigned int moduleNumber() const
void compact(unsigned int &, std::vector< unsigned int > &)
std::pair< double, double > MeanAndRms_TECPlus_Disc6[7]
std::vector< Apv > medianValues_TECPlus_Disc2
unsigned int ring() const
ring id
double apvabsoluteOccupancy[6]
std::vector< Apv > medianValues_TIDPlus_Disc2
std::vector< Apv > medianValues_TOB_Layer5
std::pair< double, double > MeanAndRms_TIDMinus_Disc3[7]
std::pair< double, double > MeanAndRms_TOB_Layer5[7]
std::pair< double, double > MeanAndRms_TOB_Layer4[7]
std::vector< Apv > medianValues_TECPlus_Disc7
long double highoccupancy_
std::pair< double, double > MeanAndRms_TECPlus_Disc2[7]
std::pair< double, double > MeanAndRms_TECMinus_Disc6[7]
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::pair< double, double > MeanAndRms_TOB_Layer2[7]
std::vector< Apv > medianValues_TIDPlus_Disc1
virtual const GeomDet * idToDet(DetId) const
std::vector< Apv > medianValues_TECMinus_Disc3
std::vector< Apv > medianValues_TIDMinus_Disc1
void CalculateMeanAndRMS(std::vector< Apv >, std::pair< double, double > *, int)
std::vector< Apv > medianValues_TECMinus_Disc9
unsigned int moduleNumber() const
std::pair< double, double > MeanAndRms_TIB_Layer3[7]
Detector identifier class for the strip tracker.
std::pair< double, double > MeanAndRms_TIDPlus_Disc2[7]
std::pair< double, double > MeanAndRms_TECPlus_Disc8[7]
double stripOccupancy[6][128]
virtual ~SiStripBadAPVAlgorithmFromClusterOccupancy()
std::vector< Apv > medianValues_TECMinus_Disc8
std::pair< double, double > MeanAndRms_TECMinus_Disc7[7]
std::pair< double, double > MeanAndRms_TECPlus_Disc9[7]
std::vector< Apv > medianValues_TECPlus_Disc9
std::pair< double, double > MeanAndRms_TOB_Layer3[7]
std::vector< Apv > medianValues_TECPlus_Disc5
std::vector< Apv > medianValues_TECMinus_Disc6
std::vector< Apv > medianValues_TIB_Layer4
double apvAbsoluteOccupancy
std::pair< double, double > MeanAndRms_TECMinus_Disc5[7]
std::vector< Apv > medianValues_TOB_Layer4
std::vector< Apv > medianValues_TECPlus_Disc6
unsigned int wheel() const
wheel id
std::pair< double, double > MeanAndRms_TECPlus_Disc7[7]
unsigned int layer() const
layer id
std::pair< double, double > MeanAndRms_TIDPlus_Disc1[7]
std::vector< Apv > medianValues_TOB_Layer3
std::vector< Apv > medianValues_TOB_Layer6
std::pair< ContainerIterator, ContainerIterator > Range
unsigned int ring() const
ring id
std::vector< Apv > medianValues_TECMinus_Disc5
void extractBadAPVs(SiStripQuality *, HistoMap &, edm::ESHandle< SiStripQuality > &)
double apvMedianOccupancy
virtual LocalPoint localPosition(float strip) const =0
std::vector< Apv > medianValues_TIB_Layer3
std::pair< double, double > MeanAndRms_TOB_Layer1[7]
std::pair< double, double > MeanAndRms_TECPlus_Disc4[7]
std::vector< Apv > medianValues_TOB_Layer2
std::pair< double, double > MeanAndRms_TECPlus_Disc5[7]
bool put(const uint32_t &detID, const InputVector &vect)
std::vector< Apv > medianValues_TOB_Layer1
double stripWeight[6][128]
unsigned int moduleNumber() const
long double lowoccupancy_
std::pair< double, double > MeanAndRms_TECMinus_Disc1[7]
unsigned int encode(const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)
SiStrip::QualityHistosMap HistoMap
std::pair< double, double > MeanAndRms_TECPlus_Disc1[7]
unsigned int moduleNumber() const
std::vector< Apv > medianValues_TIB_Layer2
std::pair< double, double > MeanAndRms_TECPlus_Disc3[7]
unsigned int wheel() const
wheel id
std::vector< Apv > medianValues_TECMinus_Disc2
std::vector< Apv > medianValues_TECMinus_Disc7