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 
54 
58 
59 
65 
66 // system include files
67 #include <iostream>
68 #include <memory>
69 #include <string>
70 #include <sstream>
71 #include <vector>
72 #include <map>
73 
74 //
75 // class decleration
76 //
77 
79 
80  public:
83 
84  private:
85  virtual void beginJob();
86  virtual void analyze(const edm::Event&, const edm::EventSetup&);
87  virtual void endJob();
88  bool isHit2D(const TrackingRecHit &hit) const;
90  AlgebraicVector3 displacementFromTrack(const GlobalPoint& pv, const GlobalPoint& dcaPosition_, const GlobalVector& tangent_);
91  double approximateTrackError(const GlobalPoint& refPoint, const GlobalPoint& dcaPosition,const GlobalVector& tangent, const AlgebraicMatrix33& covMatrix);
92  std::pair<Double_t,Double_t> getMedian(TH1F *histo);
93  std::pair<Double_t,Double_t> getMAD(TH1F *histo);
94  std::pair<std::pair<Double_t,Double_t>, std::pair<Double_t,Double_t> > fitResiduals(TH1 *hist);
95  void FillTrendPlot(TH1F* trendPlot, TH1F *residualsPlot[100], const TString& fitPar_, const TString& var_);
96 
97  inline double square(double x){
98  return x*x;
99  }
100 
101  // ----------member data ---------------------------
103  int Nevt_;
104 
107 
108  // setting of the number of plots
109  static const int nMaxBins_ = 100; // maximum number of bookable histograms
110 
111 
112  // Output
114  bool lightNtupleSwitch_; // switch to keep only info for daily validation
116 
117  // requirements on the probe
118  bool askFirstLayerHit_; // ask hit in the first layer of pixels
119  double ptOfProbe_;
120  double etaOfProbe_;
121  int nBins_; // actual number of histograms
122 
123  bool debug_;
125 
126  TTree* rootTree_;
127 
128  // Root-Tuple variables :
129  //=======================
130  void SetVarToZero();
131 
132  static const int nMaxtracks_ = 1000;
133  static const int cmToum = 10000;
134 
135  float phipitch_;
136  float etapitch_;
137 
138  // event-related quantities
139  int nTracks_;
141  int nClus_;
143  unsigned int RunNumber_;
144  unsigned int EventNumber_;
149  double BSx0_;
150  double BSy0_;
151  double BSz0_;
152  double Beamsigmaz_;
153  double Beamdxdz_;
154  double BeamWidthX_;
155  double BeamWidthY_;
156 
157  // track-related quantities
158  double pt_[nMaxtracks_];
159  double p_[nMaxtracks_];
170  double eta_[nMaxtracks_];
172  double phi_[nMaxtracks_];
177  double dz_[nMaxtracks_];
178  double dxy_[nMaxtracks_];
179  double dxyBs_[nMaxtracks_];
180  double dzBs_[nMaxtracks_];
192 
195 
198 
201 
205 
206  // ---- directly histograms // ===> unbiased residuals
207 
208  // absolute residuals
209 
212 
215 
216  // normalized residuals
217 
220 
223 
224  // for the maps
225 
228 
231 
232  // ---- trends as function of phi
233 
238 
243 
248 
253 
254  // ---- medians and MAD
255 
260 
265 
270 
275 
276  // 2D maps
277 
279  TH2F* a_dzMeanMap;
280 
282  TH2F* n_dzMeanMap;
283 
286 
289 
290  // ---- directly histograms =================> biased residuals
291 
292  // absolute residuals
293 
296 
299 
300  // normalized BiasResiduals
301 
304 
307 
308  // for the maps
309 
312 
315 
316  // ---- trends as function of phi
317 
322 
327 
332 
337 
338  // ---- medians and MAD
339 
344 
349 
354 
359 
360  // 2D maps
361 
364 
367 
370 
373 
374  // check probe
375 
376  TH1F* h_probePt_;
377  TH1F* h_probeEta_;
378  TH1F* h_probePhi_;
383  TH1F* h_probedz_;
384  TH1F* h_probedxy_;
385 
386  TH1F* h_probeHits_;
395 
396  // check vertex
397 
403 
408 
409 };
410 
411 #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_]
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