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