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 public:
44 
46 
48 
49  void setLowOccupancyThreshold(long double low_occupancy) { lowoccupancy_ = low_occupancy; }
50  void setHighOccupancyThreshold(long double high_occupancy) { highoccupancy_ = high_occupancy; }
51  void setAbsoluteLowThreshold(long double absolute_low) { absolutelow_ = absolute_low; }
52  void setNumberIterations(int number_iterations) { numberiterations_ = number_iterations; }
53  void setAbsoluteOccupancyThreshold(long double occupancy) { occupancy_ = occupancy; }
54  void setNumberOfEvents(double Nevents) { Nevents_ = Nevents; }
55  void setMinNumOfEvents();
59  }
60  void setTrackerGeometry(const TrackerGeometry* tkgeom) { TkGeom = tkgeom; }
62 
63 private:
64  struct Apv {
65  uint32_t detrawId;
68  double apvMedian[6];
70  };
71 
72  void CalculateMeanAndRMS(const std::vector<Apv>&, std::pair<double, double>*, int);
73 
75  std::vector<Apv>&,
76  std::pair<double, double>*,
77  std::vector<unsigned int>&,
79 
80  struct pHisto {
81  pHisto() : _NEntries(0), _NBins(0){};
82  TH1F* _th1f;
83  int _NEntries;
84  int _NBins;
85  };
86 
87  long double lowoccupancy_;
88  long double highoccupancy_;
89  long double absolutelow_;
91  double Nevents_;
92  long double occupancy_;
93  double minNevents_;
99 
101 
102  double stripOccupancy[6][128];
103  double stripWeight[6][128];
104 
105  std::vector<Apv> medianValues_TIB_Layer1;
106  std::pair<double, double> MeanAndRms_TIB_Layer1[7];
107  std::vector<Apv> medianValues_TIB_Layer2;
108  std::pair<double, double> MeanAndRms_TIB_Layer2[7];
109  std::vector<Apv> medianValues_TIB_Layer3;
110  std::pair<double, double> MeanAndRms_TIB_Layer3[7];
111  std::vector<Apv> medianValues_TIB_Layer4;
112  std::pair<double, double> MeanAndRms_TIB_Layer4[7];
113 
114  std::vector<Apv> medianValues_TOB_Layer1;
115  std::pair<double, double> MeanAndRms_TOB_Layer1[7];
116  std::vector<Apv> medianValues_TOB_Layer2;
117  std::pair<double, double> MeanAndRms_TOB_Layer2[7];
118  std::vector<Apv> medianValues_TOB_Layer3;
119  std::pair<double, double> MeanAndRms_TOB_Layer3[7];
120  std::vector<Apv> medianValues_TOB_Layer4;
121  std::pair<double, double> MeanAndRms_TOB_Layer4[7];
122  std::vector<Apv> medianValues_TOB_Layer5;
123  std::pair<double, double> MeanAndRms_TOB_Layer5[7];
124  std::vector<Apv> medianValues_TOB_Layer6;
125  std::pair<double, double> MeanAndRms_TOB_Layer6[7];
126 
127  std::vector<Apv> medianValues_TIDPlus_Disc1;
128  std::pair<double, double> MeanAndRms_TIDPlus_Disc1[7];
129  std::vector<Apv> medianValues_TIDPlus_Disc2;
130  std::pair<double, double> MeanAndRms_TIDPlus_Disc2[7];
131  std::vector<Apv> medianValues_TIDPlus_Disc3;
132  std::pair<double, double> MeanAndRms_TIDPlus_Disc3[7];
133 
134  std::vector<Apv> medianValues_TIDMinus_Disc1;
135  std::pair<double, double> MeanAndRms_TIDMinus_Disc1[7];
136  std::vector<Apv> medianValues_TIDMinus_Disc2;
137  std::pair<double, double> MeanAndRms_TIDMinus_Disc2[7];
138  std::vector<Apv> medianValues_TIDMinus_Disc3;
139  std::pair<double, double> MeanAndRms_TIDMinus_Disc3[7];
140 
141  std::vector<Apv> medianValues_TECPlus_Disc1;
142  std::pair<double, double> MeanAndRms_TECPlus_Disc1[7];
143  std::vector<Apv> medianValues_TECPlus_Disc2;
144  std::pair<double, double> MeanAndRms_TECPlus_Disc2[7];
145  std::vector<Apv> medianValues_TECPlus_Disc3;
146  std::pair<double, double> MeanAndRms_TECPlus_Disc3[7];
147  std::vector<Apv> medianValues_TECPlus_Disc4;
148  std::pair<double, double> MeanAndRms_TECPlus_Disc4[7];
149  std::vector<Apv> medianValues_TECPlus_Disc5;
150  std::pair<double, double> MeanAndRms_TECPlus_Disc5[7];
151  std::vector<Apv> medianValues_TECPlus_Disc6;
152  std::pair<double, double> MeanAndRms_TECPlus_Disc6[7];
153  std::vector<Apv> medianValues_TECPlus_Disc7;
154  std::pair<double, double> MeanAndRms_TECPlus_Disc7[7];
155  std::vector<Apv> medianValues_TECPlus_Disc8;
156  std::pair<double, double> MeanAndRms_TECPlus_Disc8[7];
157  std::vector<Apv> medianValues_TECPlus_Disc9;
158  std::pair<double, double> MeanAndRms_TECPlus_Disc9[7];
159 
160  std::vector<Apv> medianValues_TECMinus_Disc1;
161  std::pair<double, double> MeanAndRms_TECMinus_Disc1[7];
162  std::vector<Apv> medianValues_TECMinus_Disc2;
163  std::pair<double, double> MeanAndRms_TECMinus_Disc2[7];
164  std::vector<Apv> medianValues_TECMinus_Disc3;
165  std::pair<double, double> MeanAndRms_TECMinus_Disc3[7];
166  std::vector<Apv> medianValues_TECMinus_Disc4;
167  std::pair<double, double> MeanAndRms_TECMinus_Disc4[7];
168  std::vector<Apv> medianValues_TECMinus_Disc5;
169  std::pair<double, double> MeanAndRms_TECMinus_Disc5[7];
170  std::vector<Apv> medianValues_TECMinus_Disc6;
171  std::pair<double, double> MeanAndRms_TECMinus_Disc6[7];
172  std::vector<Apv> medianValues_TECMinus_Disc7;
173  std::pair<double, double> MeanAndRms_TECMinus_Disc7[7];
174  std::vector<Apv> medianValues_TECMinus_Disc8;
175  std::pair<double, double> MeanAndRms_TECMinus_Disc8[7];
176  std::vector<Apv> medianValues_TECMinus_Disc9;
177  std::pair<double, double> MeanAndRms_TECMinus_Disc9[7];
178 
179  TFile* f;
180  TTree* apvtree;
181 
182  uint32_t detrawid;
183  int subdetid;
185  int disc;
186  int isback;
190  int isstereo;
195 
199 
202 
203  std::stringstream ss;
204 };
205 #endif
string OutputFileName
void AnalyzeOccupancy(SiStripQuality *, std::vector< Apv > &, std::pair< double, double > *, std::vector< unsigned int > &, edm::ESHandle< SiStripQuality > &)
WriteOutputFile
Name of root file for histograms.
void CalculateMeanAndRMS(const std::vector< Apv > &, std::pair< double, double > *, int)
SiStripBadAPVAlgorithmFromClusterOccupancy(const edm::ParameterSet &, const TrackerTopology *)
__gnu_cxx::hash_map< unsigned int, std::shared_ptr< TH1F > > QualityHistosMap
void setOutputFileName(std::string OutputFileName, bool WriteOutputFile)
void extractBadAPVs(SiStripQuality *, HistoMap &, edm::ESHandle< SiStripQuality > &)