CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // $Id: SiStripBadAPVAlgorithmFromClusterOccupancy.h,v 1.7 2013/01/11 04:57:47 wmtan Exp $
17 //
18 //
19 
20 #ifndef CalibTracker_SiStripQuality_SiStripBadAPVAlgorithmFromClusterOccupancy_H
21 #define CalibTracker_SiStripQuality_SiStripBadAPVAlgorithmFromClusterOccupancy_H
22 
23 // system include files
24 #include <memory>
25 #include <vector>
26 #include <map>
27 #include <sstream>
28 #include <iostream>
29 
30 #include "TMath.h"
31 #include "TTree.h"
32 #include "TFile.h"
33 
38 
39 class SiStripQuality;
40 class TrackerTopology;
41 
43 
44 public:
46 
48 
50 
51  void setLowOccupancyThreshold(long double low_occupancy){lowoccupancy_=low_occupancy;}
52  void setHighOccupancyThreshold(long double high_occupancy){highoccupancy_=high_occupancy;}
53  void setAbsoluteLowThreshold(long double absolute_low){absolutelow_=absolute_low;}
54  void setNumberIterations(int number_iterations){numberiterations_=number_iterations;}
55  void setAbsoluteOccupancyThreshold(long double occupancy){occupancy_=occupancy;}
56  void setNumberOfEvents(double Nevents){Nevents_=Nevents;}
57  void setMinNumOfEvents();
59  void setTrackerGeometry(const TrackerGeometry* tkgeom){TkGeom = tkgeom;}
61 
62  private:
63 
64  struct Apv{
65 
66  uint32_t detrawId;
69  double apvMedian[6];
71  };
72 
73  void CalculateMeanAndRMS(std::vector<Apv>, std::pair<double,double>*, int);
74 
75  void AnalyzeOccupancy(SiStripQuality*, std::vector<Apv>&, std::pair<double,double>*, std::vector<unsigned int>&, edm::ESHandle<SiStripQuality>&);
76 
77  struct pHisto{
78 
79  pHisto():_NEntries(0),_NBins(0){};
80  TH1F* _th1f;
81  int _NEntries;
82  int _NBins;
83  };
84 
85  long double lowoccupancy_;
86  long double highoccupancy_;
87  long double absolutelow_;
89  double Nevents_;
90  long double occupancy_;
91  double minNevents_;
97 
99 
100  double stripOccupancy[6][128];
101  double stripWeight[6][128];
102 
103  std::vector<Apv> medianValues_TIB_Layer1; std::pair<double,double> MeanAndRms_TIB_Layer1[7];
104  std::vector<Apv> medianValues_TIB_Layer2; std::pair<double,double> MeanAndRms_TIB_Layer2[7];
105  std::vector<Apv> medianValues_TIB_Layer3; std::pair<double,double> MeanAndRms_TIB_Layer3[7];
106  std::vector<Apv> medianValues_TIB_Layer4; std::pair<double,double> MeanAndRms_TIB_Layer4[7];
107 
108  std::vector<Apv> medianValues_TOB_Layer1; std::pair<double,double> MeanAndRms_TOB_Layer1[7];
109  std::vector<Apv> medianValues_TOB_Layer2; std::pair<double,double> MeanAndRms_TOB_Layer2[7];
110  std::vector<Apv> medianValues_TOB_Layer3; std::pair<double,double> MeanAndRms_TOB_Layer3[7];
111  std::vector<Apv> medianValues_TOB_Layer4; std::pair<double,double> MeanAndRms_TOB_Layer4[7];
112  std::vector<Apv> medianValues_TOB_Layer5; std::pair<double,double> MeanAndRms_TOB_Layer5[7];
113  std::vector<Apv> medianValues_TOB_Layer6; std::pair<double,double> MeanAndRms_TOB_Layer6[7];
114 
115  std::vector<Apv> medianValues_TIDPlus_Disc1; std::pair<double,double> MeanAndRms_TIDPlus_Disc1[7];
116  std::vector<Apv> medianValues_TIDPlus_Disc2; std::pair<double,double> MeanAndRms_TIDPlus_Disc2[7];
117  std::vector<Apv> medianValues_TIDPlus_Disc3; std::pair<double,double> MeanAndRms_TIDPlus_Disc3[7];
118 
119  std::vector<Apv> medianValues_TIDMinus_Disc1; std::pair<double,double> MeanAndRms_TIDMinus_Disc1[7];
120  std::vector<Apv> medianValues_TIDMinus_Disc2; std::pair<double,double> MeanAndRms_TIDMinus_Disc2[7];
121  std::vector<Apv> medianValues_TIDMinus_Disc3; std::pair<double,double> MeanAndRms_TIDMinus_Disc3[7];
122 
123  std::vector<Apv> medianValues_TECPlus_Disc1; std::pair<double,double> MeanAndRms_TECPlus_Disc1[7];
124  std::vector<Apv> medianValues_TECPlus_Disc2; std::pair<double,double> MeanAndRms_TECPlus_Disc2[7];
125  std::vector<Apv> medianValues_TECPlus_Disc3; std::pair<double,double> MeanAndRms_TECPlus_Disc3[7];
126  std::vector<Apv> medianValues_TECPlus_Disc4; std::pair<double,double> MeanAndRms_TECPlus_Disc4[7];
127  std::vector<Apv> medianValues_TECPlus_Disc5; std::pair<double,double> MeanAndRms_TECPlus_Disc5[7];
128  std::vector<Apv> medianValues_TECPlus_Disc6; std::pair<double,double> MeanAndRms_TECPlus_Disc6[7];
129  std::vector<Apv> medianValues_TECPlus_Disc7; std::pair<double,double> MeanAndRms_TECPlus_Disc7[7];
130  std::vector<Apv> medianValues_TECPlus_Disc8; std::pair<double,double> MeanAndRms_TECPlus_Disc8[7];
131  std::vector<Apv> medianValues_TECPlus_Disc9; std::pair<double,double> MeanAndRms_TECPlus_Disc9[7];
132 
133  std::vector<Apv> medianValues_TECMinus_Disc1; std::pair<double,double> MeanAndRms_TECMinus_Disc1[7];
134  std::vector<Apv> medianValues_TECMinus_Disc2; std::pair<double,double> MeanAndRms_TECMinus_Disc2[7];
135  std::vector<Apv> medianValues_TECMinus_Disc3; std::pair<double,double> MeanAndRms_TECMinus_Disc3[7];
136  std::vector<Apv> medianValues_TECMinus_Disc4; std::pair<double,double> MeanAndRms_TECMinus_Disc4[7];
137  std::vector<Apv> medianValues_TECMinus_Disc5; std::pair<double,double> MeanAndRms_TECMinus_Disc5[7];
138  std::vector<Apv> medianValues_TECMinus_Disc6; std::pair<double,double> MeanAndRms_TECMinus_Disc6[7];
139  std::vector<Apv> medianValues_TECMinus_Disc7; std::pair<double,double> MeanAndRms_TECMinus_Disc7[7];
140  std::vector<Apv> medianValues_TECMinus_Disc8; std::pair<double,double> MeanAndRms_TECMinus_Disc8[7];
141  std::vector<Apv> medianValues_TECMinus_Disc9; std::pair<double,double> MeanAndRms_TECMinus_Disc9[7];
142 
143 
144  TFile* f;
145  TTree* apvtree;
146 
147  uint32_t detrawid;
148  int subdetid;
150  int disc;
151  int isback;
155  int isstereo;
160 
164 
167 
168  std::stringstream ss;
169 };
170 #endif
171 
string OutputFileName
void AnalyzeOccupancy(SiStripQuality *, std::vector< Apv > &, std::pair< double, double > *, std::vector< unsigned int > &, edm::ESHandle< SiStripQuality > &)
__gnu_cxx::hash_map< unsigned int, boost::shared_ptr< TH1F > > QualityHistosMap
SiStripBadAPVAlgorithmFromClusterOccupancy(const edm::ParameterSet &, const TrackerTopology *)
void CalculateMeanAndRMS(std::vector< Apv >, std::pair< double, double > *, int)
void setOutputFileName(std::string OutputFileName, bool WriteOutputFile)
void extractBadAPVs(SiStripQuality *, HistoMap &, edm::ESHandle< SiStripQuality > &)