CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PrimaryVertexValidation.h
Go to the documentation of this file.
1 #ifndef PrimaryVertexValidation_h
2 #define PrimaryVertexValidation_h
3 
11 
12 #include "TFile.h"
13 #include "TH1D.h"
14 #include "TH1I.h"
15 #include "TH2D.h"
16 #include "TTree.h"
17 
19 
33 
40 
46 
50 
54 
55 
61 
62 // system include files
63 #include <iostream>
64 #include <memory>
65 #include <string>
66 #include <sstream>
67 #include <vector>
68 #include <map>
69 
70 //
71 // class decleration
72 //
73 
75 
76  public:
79 
80  private:
81  virtual void beginJob();
82  virtual void analyze(const edm::Event&, const edm::EventSetup&);
83  virtual void endJob();
84  bool isHit2D(const TrackingRecHit &hit) const;
86  AlgebraicVector3 displacementFromTrack(const GlobalPoint& pv, const GlobalPoint& dcaPosition_, const GlobalVector& tangent_);
87  double approximateTrackError(const GlobalPoint& refPoint, const GlobalPoint& dcaPosition,const GlobalVector& tangent, const AlgebraicMatrix33& covMatrix);
88  std::pair<Double_t,Double_t> getMedian(TH1F *histo);
89  std::pair<Double_t,Double_t> getMAD(TH1F *histo);
90  std::pair<std::pair<Double_t,Double_t>, std::pair<Double_t,Double_t> > fitResiduals(TH1 *hist);
91  void FillTrendPlot(TH1F* trendPlot, TH1F *residualsPlot[100], const TString& fitPar_, const TString& var_);
92 
93  inline double square(double x){
94  return x*x;
95  }
96 
97  // ----------member data ---------------------------
99  int Nevt_;
100 
103 
104  // setting of the number of plots
105  static const int nMaxBins_ = 100; // maximum number of bookable histograms
106 
107 
108  // Output
110  bool lightNtupleSwitch_; // switch to keep only info for daily validation
112 
113  // requirements on the probe
114  bool askFirstLayerHit_; // ask hit in the first layer of pixels
115  double ptOfProbe_;
116  double etaOfProbe_;
117  int nBins_; // actual number of histograms
118 
119  bool debug_;
121 
122  TTree* rootTree_;
123 
124  // Root-Tuple variables :
125  //=======================
126  void SetVarToZero();
127 
128  static const int nMaxtracks_ = 1000;
129  static const int cmToum = 10000;
130 
131  float phipitch_;
132  float etapitch_;
133 
134  // event-related quantities
135  int nTracks_;
137  int nClus_;
139  unsigned int RunNumber_;
140  unsigned int EventNumber_;
145  double BSx0_;
146  double BSy0_;
147  double BSz0_;
148  double Beamsigmaz_;
149  double Beamdxdz_;
150  double BeamWidthX_;
151  double BeamWidthY_;
152 
153  // track-related quantities
154  double pt_[nMaxtracks_];
155  double p_[nMaxtracks_];
166  double eta_[nMaxtracks_];
168  double phi_[nMaxtracks_];
173  double dz_[nMaxtracks_];
174  double dxy_[nMaxtracks_];
175  double dxyBs_[nMaxtracks_];
176  double dzBs_[nMaxtracks_];
188 
191 
194 
197 
201 
202  // ---- directly histograms // ===> unbiased residuals
203 
204  // absolute residuals
205 
208 
211 
212  // normalized residuals
213 
216 
219 
220  // for the maps
221 
224 
227 
228  // ---- trends as function of phi
229 
234 
239 
244 
249 
250  // ---- medians and MAD
251 
256 
261 
266 
271 
272  // 2D maps
273 
275  TH2F* a_dzMeanMap;
276 
278  TH2F* n_dzMeanMap;
279 
282 
285 
286  // ---- directly histograms =================> biased residuals
287 
288  // absolute residuals
289 
292 
295 
296  // normalized BiasResiduals
297 
300 
303 
304  // for the maps
305 
308 
311 
312  // ---- trends as function of phi
313 
318 
323 
328 
333 
334  // ---- medians and MAD
335 
340 
345 
350 
355 
356  // 2D maps
357 
360 
363 
366 
369 
370  // check probe
371 
372  TH1F* h_probePt_;
373  TH1F* h_probeEta_;
374  TH1F* h_probePhi_;
379  TH1F* h_probedz_;
380  TH1F* h_probedxy_;
381 
382  TH1F* h_probeHits_;
391 
392  // check vertex
393 
399 
404 
405 };
406 
407 #endif
TH1F * n_dzResidualsMap[nMaxBins_][nMaxBins_]
TrackFilterForPVFindingBase * theTrackFilter_
TH1F * a_dxyResidualsMap[nMaxBins_][nMaxBins_]
TH1F * n_dxyEtaBiasResiduals[nMaxBins_]
PrimaryVertexValidation(const edm::ParameterSet &)
std::pair< Double_t, Double_t > getMAD(TH1F *histo)
TH1F * n_dxyBiasResidualsMap[nMaxBins_][nMaxBins_]
float DOFUnbiasedVertex_[nMaxtracks_]
TH1F * a_dzPhiBiasResiduals[nMaxBins_]
TH1F * n_dzEtaBiasResiduals[nMaxBins_]
virtual void analyze(const edm::Event &, const edm::EventSetup &)
double dszFromMyVertex_[nMaxtracks_]
double dxyFromMyVertex_[nMaxtracks_]
double dzErrorFromMyVertex_[nMaxtracks_]
TH1F * a_dxyPhiBiasResiduals[nMaxBins_]
double IPTsigFromMyVertex_[nMaxtracks_]
std::pair< Double_t, Double_t > getMedian(TH1F *histo)
int tracksUsedForVertexing_[nMaxtracks_]
double approximateTrackError(const GlobalPoint &refPoint, const GlobalPoint &dcaPosition, const GlobalVector &tangent, const AlgebraicMatrix33 &covMatrix)
bool hasFirstLayerPixelHits(const reco::TransientTrack track)
TH1F * n_dzPhiBiasResiduals[nMaxBins_]
double yUnbiasedVertex_[nMaxtracks_]
std::pair< std::pair< Double_t, Double_t >, std::pair< Double_t, Double_t > > fitResiduals(TH1 *hist)
ROOT::Math::SVector< double, 3 > AlgebraicVector3
double zUnbiasedVertex_[nMaxtracks_]
float chi2normUnbiasedVertex_[nMaxtracks_]
double IPLsigFromMyVertex_[nMaxtracks_]
bool isHit2D(const TrackingRecHit &hit) const
void FillTrendPlot(TH1F *trendPlot, TH1F *residualsPlot[100], const TString &fitPar_, const TString &var_)
TH1F * n_dxyPhiBiasResiduals[nMaxBins_]
TrackClusterizerInZ * theTrackClusterizer_
double xUnbiasedVertex_[nMaxtracks_]
TH1F * a_dxyEtaBiasResiduals[nMaxBins_]
double dzFromMyVertex_[nMaxtracks_]
TH1F * a_dxyBiasResidualsMap[nMaxBins_][nMaxBins_]
TH1F * n_dxyResidualsMap[nMaxBins_][nMaxBins_]
double dxyErrorFromMyVertex_[nMaxtracks_]
AlgebraicVector3 displacementFromTrack(const GlobalPoint &pv, const GlobalPoint &dcaPosition_, const GlobalVector &tangent_)
float sumOfWeightsUnbiasedVertex_[nMaxtracks_]
TH1F * n_dzBiasResidualsMap[nMaxBins_][nMaxBins_]
TH1F * a_dzBiasResidualsMap[nMaxBins_][nMaxBins_]
TH1F * a_dzEtaBiasResiduals[nMaxBins_]
TH1F * a_dzResidualsMap[nMaxBins_][nMaxBins_]
float chi2UnbiasedVertex_[nMaxtracks_]
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33