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 
37 
44 
50 
52 
56 
60 
61 
67 
68 // system include files
69 #include <iostream>
70 #include <memory>
71 #include <string>
72 #include <sstream>
73 #include <vector>
74 #include <map>
75 
76 //
77 // class decleration
78 //
79 
81 
82  public:
85 
86  private:
87  virtual void beginJob();
88  virtual void analyze(const edm::Event&, const edm::EventSetup&);
89  virtual void endJob();
90  bool isHit2D(const TrackingRecHit &hit) const;
92  AlgebraicVector3 displacementFromTrack(const GlobalPoint& pv, const GlobalPoint& dcaPosition_, const GlobalVector& tangent_);
93  double approximateTrackError(const GlobalPoint& refPoint, const GlobalPoint& dcaPosition,const GlobalVector& tangent, const AlgebraicMatrix33& covMatrix);
94  std::pair<Double_t,Double_t> getMedian(TH1F *histo);
95  std::pair<Double_t,Double_t> getMAD(TH1F *histo);
96  std::pair<std::pair<Double_t,Double_t>, std::pair<Double_t,Double_t> > fitResiduals(TH1 *hist);
97  void FillTrendPlot(TH1F* trendPlot, TH1F *residualsPlot[100], TString fitPar_, TString var_);
98 
99  inline double square(double x){
100  return x*x;
101  }
102 
103  // ----------member data ---------------------------
105  int Nevt_;
106 
109 
110  // setting of the number of plots
111  static const int nMaxBins_ = 100; // maximum number of bookable histograms
112 
113 
114  // Output
116  bool lightNtupleSwitch_; // switch to keep only info for daily validation
118 
119  // requirements on the probe
120  bool askFirstLayerHit_; // ask hit in the first layer of pixels
121  double ptOfProbe_;
122  double etaOfProbe_;
123  int nBins_; // actual number of histograms
124 
125  bool debug_;
127 
128  TTree* rootTree_;
129 
130  // Root-Tuple variables :
131  //=======================
132  void SetVarToZero();
133 
134  static const int nMaxtracks_ = 1000;
135  static const int cmToum = 10000;
136 
137  float phipitch_;
138  float etapitch_;
139 
140  // event-related quantities
141  int nTracks_;
143  int nClus_;
145  unsigned int RunNumber_;
146  unsigned int EventNumber_;
151  double BSx0_;
152  double BSy0_;
153  double BSz0_;
154  double Beamsigmaz_;
155  double Beamdxdz_;
156  double BeamWidthX_;
157  double BeamWidthY_;
158 
159  // track-related quantities
160  double pt_[nMaxtracks_];
161  double p_[nMaxtracks_];
172  double eta_[nMaxtracks_];
174  double phi_[nMaxtracks_];
179  double dz_[nMaxtracks_];
180  double dxy_[nMaxtracks_];
181  double dxyBs_[nMaxtracks_];
182  double dzBs_[nMaxtracks_];
194 
197 
200 
203 
207 
208  // ---- directly histograms // ===> unbiased residuals
209 
210  // absolute residuals
211 
214 
217 
218  // normalized residuals
219 
222 
225 
226  // for the maps
227 
230 
233 
234  // ---- trends as function of phi
235 
240 
245 
250 
255 
256  // ---- medians and MAD
257 
262 
267 
272 
277 
278  // 2D maps
279 
281  TH2F* a_dzMeanMap;
282 
284  TH2F* n_dzMeanMap;
285 
288 
291 
292  // ---- directly histograms =================> biased residuals
293 
294  // absolute residuals
295 
298 
301 
302  // normalized BiasResiduals
303 
306 
309 
310  // for the maps
311 
314 
317 
318  // ---- trends as function of phi
319 
324 
329 
334 
339 
340  // ---- medians and MAD
341 
346 
351 
356 
361 
362  // 2D maps
363 
366 
369 
372 
375 
376  // check probe
377 
378  TH1F* h_probePt_;
379  TH1F* h_probeEta_;
380  TH1F* h_probePhi_;
385  TH1F* h_probedz_;
386  TH1F* h_probedxy_;
387 
388  TH1F* h_probeHits_;
397 
398  // check vertex
399 
405 
410 
411 };
412 
413 #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
TH1F * n_dxyPhiBiasResiduals[nMaxBins_]
TrackClusterizerInZ * theTrackClusterizer_
double xUnbiasedVertex_[nMaxtracks_]
TH1F * a_dxyEtaBiasResiduals[nMaxBins_]
double dzFromMyVertex_[nMaxtracks_]
void FillTrendPlot(TH1F *trendPlot, TH1F *residualsPlot[100], TString fitPar_, TString var_)
TH1F * a_dxyBiasResidualsMap[nMaxBins_][nMaxBins_]
TH1F * n_dxyResidualsMap[nMaxBins_][nMaxBins_]
double dxyErrorFromMyVertex_[nMaxtracks_]
Definition: DDAxes.h:10
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