CMS 3D CMS Logo

SiStripBadAPVAlgorithmFromClusterOccupancy.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiStripQuality
4 // Class: SiStripBadAPVAlgorithmFromClusterOccupancy
5 //
13 //
14 // Original Author: Gordon KAUSSEN
15 // Created: Wed Jan 28 09:11:10 CEST 2009
16 //
17 //
18 
19 #ifndef CalibTracker_SiStripQuality_SiStripBadAPVAlgorithmFromClusterOccupancy_H
20 #define CalibTracker_SiStripQuality_SiStripBadAPVAlgorithmFromClusterOccupancy_H
21 
22 // system include files
23 #include <memory>
24 #include <vector>
25 #include <map>
26 #include <sstream>
27 #include <iostream>
28 
29 #include "TMath.h"
30 #include "TTree.h"
31 #include "TFile.h"
32 
37 
38 class SiStripQuality;
39 class TrackerTopology;
40 
42 
43 public:
45 
47 
49 
50  void setLowOccupancyThreshold(long double low_occupancy){lowoccupancy_=low_occupancy;}
51  void setHighOccupancyThreshold(long double high_occupancy){highoccupancy_=high_occupancy;}
52  void setAbsoluteLowThreshold(long double absolute_low){absolutelow_=absolute_low;}
53  void setNumberIterations(int number_iterations){numberiterations_=number_iterations;}
54  void setAbsoluteOccupancyThreshold(long double occupancy){occupancy_=occupancy;}
55  void setNumberOfEvents(double Nevents){Nevents_=Nevents;}
56  void setMinNumOfEvents();
58  void setTrackerGeometry(const TrackerGeometry* tkgeom){TkGeom = tkgeom;}
60 
61  private:
62 
63  struct Apv{
64 
65  uint32_t detrawId;
68  double apvMedian[6];
70  };
71 
72  void CalculateMeanAndRMS(const std::vector<Apv>&, std::pair<double,double>*, int);
73 
74  void AnalyzeOccupancy(SiStripQuality*, std::vector<Apv>&, std::pair<double,double>*, std::vector<unsigned int>&, edm::ESHandle<SiStripQuality>&);
75 
76  struct pHisto{
77 
78  pHisto():_NEntries(0),_NBins(0){};
79  TH1F* _th1f;
80  int _NEntries;
81  int _NBins;
82  };
83 
84  long double lowoccupancy_;
85  long double highoccupancy_;
86  long double absolutelow_;
88  double Nevents_;
89  long double occupancy_;
90  double minNevents_;
96 
98 
99  double stripOccupancy[6][128];
100  double stripWeight[6][128];
101 
102  std::vector<Apv> medianValues_TIB_Layer1; std::pair<double,double> MeanAndRms_TIB_Layer1[7];
103  std::vector<Apv> medianValues_TIB_Layer2; std::pair<double,double> MeanAndRms_TIB_Layer2[7];
104  std::vector<Apv> medianValues_TIB_Layer3; std::pair<double,double> MeanAndRms_TIB_Layer3[7];
105  std::vector<Apv> medianValues_TIB_Layer4; std::pair<double,double> MeanAndRms_TIB_Layer4[7];
106 
107  std::vector<Apv> medianValues_TOB_Layer1; std::pair<double,double> MeanAndRms_TOB_Layer1[7];
108  std::vector<Apv> medianValues_TOB_Layer2; std::pair<double,double> MeanAndRms_TOB_Layer2[7];
109  std::vector<Apv> medianValues_TOB_Layer3; std::pair<double,double> MeanAndRms_TOB_Layer3[7];
110  std::vector<Apv> medianValues_TOB_Layer4; std::pair<double,double> MeanAndRms_TOB_Layer4[7];
111  std::vector<Apv> medianValues_TOB_Layer5; std::pair<double,double> MeanAndRms_TOB_Layer5[7];
112  std::vector<Apv> medianValues_TOB_Layer6; std::pair<double,double> MeanAndRms_TOB_Layer6[7];
113 
114  std::vector<Apv> medianValues_TIDPlus_Disc1; std::pair<double,double> MeanAndRms_TIDPlus_Disc1[7];
115  std::vector<Apv> medianValues_TIDPlus_Disc2; std::pair<double,double> MeanAndRms_TIDPlus_Disc2[7];
116  std::vector<Apv> medianValues_TIDPlus_Disc3; std::pair<double,double> MeanAndRms_TIDPlus_Disc3[7];
117 
118  std::vector<Apv> medianValues_TIDMinus_Disc1; std::pair<double,double> MeanAndRms_TIDMinus_Disc1[7];
119  std::vector<Apv> medianValues_TIDMinus_Disc2; std::pair<double,double> MeanAndRms_TIDMinus_Disc2[7];
120  std::vector<Apv> medianValues_TIDMinus_Disc3; std::pair<double,double> MeanAndRms_TIDMinus_Disc3[7];
121 
122  std::vector<Apv> medianValues_TECPlus_Disc1; std::pair<double,double> MeanAndRms_TECPlus_Disc1[7];
123  std::vector<Apv> medianValues_TECPlus_Disc2; std::pair<double,double> MeanAndRms_TECPlus_Disc2[7];
124  std::vector<Apv> medianValues_TECPlus_Disc3; std::pair<double,double> MeanAndRms_TECPlus_Disc3[7];
125  std::vector<Apv> medianValues_TECPlus_Disc4; std::pair<double,double> MeanAndRms_TECPlus_Disc4[7];
126  std::vector<Apv> medianValues_TECPlus_Disc5; std::pair<double,double> MeanAndRms_TECPlus_Disc5[7];
127  std::vector<Apv> medianValues_TECPlus_Disc6; std::pair<double,double> MeanAndRms_TECPlus_Disc6[7];
128  std::vector<Apv> medianValues_TECPlus_Disc7; std::pair<double,double> MeanAndRms_TECPlus_Disc7[7];
129  std::vector<Apv> medianValues_TECPlus_Disc8; std::pair<double,double> MeanAndRms_TECPlus_Disc8[7];
130  std::vector<Apv> medianValues_TECPlus_Disc9; std::pair<double,double> MeanAndRms_TECPlus_Disc9[7];
131 
132  std::vector<Apv> medianValues_TECMinus_Disc1; std::pair<double,double> MeanAndRms_TECMinus_Disc1[7];
133  std::vector<Apv> medianValues_TECMinus_Disc2; std::pair<double,double> MeanAndRms_TECMinus_Disc2[7];
134  std::vector<Apv> medianValues_TECMinus_Disc3; std::pair<double,double> MeanAndRms_TECMinus_Disc3[7];
135  std::vector<Apv> medianValues_TECMinus_Disc4; std::pair<double,double> MeanAndRms_TECMinus_Disc4[7];
136  std::vector<Apv> medianValues_TECMinus_Disc5; std::pair<double,double> MeanAndRms_TECMinus_Disc5[7];
137  std::vector<Apv> medianValues_TECMinus_Disc6; std::pair<double,double> MeanAndRms_TECMinus_Disc6[7];
138  std::vector<Apv> medianValues_TECMinus_Disc7; std::pair<double,double> MeanAndRms_TECMinus_Disc7[7];
139  std::vector<Apv> medianValues_TECMinus_Disc8; std::pair<double,double> MeanAndRms_TECMinus_Disc8[7];
140  std::vector<Apv> medianValues_TECMinus_Disc9; std::pair<double,double> MeanAndRms_TECMinus_Disc9[7];
141 
142 
143  TFile* f;
144  TTree* apvtree;
145 
146  uint32_t detrawid;
147  int subdetid;
149  int disc;
150  int isback;
154  int isstereo;
159 
163 
166 
167  std::stringstream ss;
168 };
169 #endif
170 
string OutputFileName
void AnalyzeOccupancy(SiStripQuality *, std::vector< Apv > &, std::pair< double, double > *, std::vector< unsigned int > &, edm::ESHandle< SiStripQuality > &)
void CalculateMeanAndRMS(const std::vector< Apv > &, std::pair< double, double > *, int)
__gnu_cxx::hash_map< unsigned int, boost::shared_ptr< TH1F > > QualityHistosMap
SiStripBadAPVAlgorithmFromClusterOccupancy(const edm::ParameterSet &, const TrackerTopology *)
void setOutputFileName(std::string OutputFileName, bool WriteOutputFile)
void extractBadAPVs(SiStripQuality *, HistoMap &, edm::ESHandle< SiStripQuality > &)