CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackAnalyzer.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * \author Suchandra Dutta , Giorgia Mila
5  */
6 
13 
18 #include <string>
19 #include "TMath.h"
20 
22  : conf_( iConfig )
23  , doTrackerSpecific_ ( conf_.getParameter<bool>("doTrackerSpecific") )
24  , doAllPlots_ ( conf_.getParameter<bool>("doAllPlots") )
25  , doBSPlots_ ( conf_.getParameter<bool>("doBeamSpotPlots") )
26  , doPVPlots_ ( conf_.getParameter<bool>("doPrimaryVertexPlots") )
27  , doDCAPlots_ ( conf_.getParameter<bool>("doDCAPlots") )
28  , doGeneralPropertiesPlots_ ( conf_.getParameter<bool>("doGeneralPropertiesPlots") )
29  , doMeasurementStatePlots_ ( conf_.getParameter<bool>("doMeasurementStatePlots") )
30  , doHitPropertiesPlots_ ( conf_.getParameter<bool>("doHitPropertiesPlots") )
31  , doRecHitVsPhiVsEtaPerTrack_ ( conf_.getParameter<bool>("doRecHitVsPhiVsEtaPerTrack") )
32  , doLayersVsPhiVsEtaPerTrack_ ( conf_.getParameter<bool>("doLayersVsPhiVsEtaPerTrack") )
33  , doRecHitsPerTrackProfile_ ( conf_.getParameter<bool>("doRecHitsPerTrackProfile") )
34  , doThetaPlots_ ( conf_.getParameter<bool>("doThetaPlots") )
35  , doTrackPxPyPlots_ ( conf_.getParameter<bool>("doTrackPxPyPlots") )
36  , doDCAwrtPVPlots_ ( conf_.getParameter<bool>("doDCAwrtPVPlots") )
37  , doDCAwrt000Plots_ ( conf_.getParameter<bool>("doDCAwrt000Plots") )
38  , doLumiAnalysis_ ( conf_.getParameter<bool>("doLumiAnalysis") )
39  , doTestPlots_ ( conf_.getParameter<bool>("doTestPlots") )
40  , doHIPlots_ ( conf_.getParameter<bool>("doHIPlots") )
41 {
42  initHistos();
43  TopFolder_ = conf_.getParameter<std::string>("FolderName");
44 
45 }
46 
48  : TrackAnalyzer(iConfig)
49 {
50  edm::InputTag bsSrc = conf_.getParameter<edm::InputTag>("beamSpot");
51  edm::InputTag primaryVertexInputTag = conf_.getParameter<edm::InputTag>("primaryVertex");
53  pvToken_ = iC.consumes<reco::VertexCollection>(primaryVertexInputTag);
54 }
55 
57 {
58  Chi2 = NULL;
59  Chi2Prob = NULL;
62  Chi2oNDF = NULL;
69 
73 
77 
79 
82 
85 
100  algorithm = NULL;
101  // TESTING
104 
105 // by Mia in order to deal w/ LS transitions
108 
110  //special Plots for HI DQM //SHOULD I ADD THE BOOL HERE??
112  LongDCASig = NULL;
113  TransDCASig = NULL;
114 
115 
116 
117 }
118 
120 {
121 }
122 
124 {
125 
127  bookHistosForBeamSpot(ibooker);
129 
130  // book tracker specific related histograms
131  // ---------------------------------------------------------------------------------//
133 
134  // book state related histograms
135  // ---------------------------------------------------------------------------------//
137 
138  std::string StateName = conf_.getParameter<std::string>("MeasurementState");
139 
140  if (StateName == "All") {
141  bookHistosForState("OuterSurface", ibooker);
142  bookHistosForState("InnerSurface", ibooker);
143  bookHistosForState("ImpactPoint" , ibooker);
144  } else if (
145  StateName != "OuterSurface" &&
146  StateName != "InnerSurface" &&
147  StateName != "ImpactPoint" &&
148  StateName != "default"
149  ) {
150  bookHistosForState("default", ibooker);
151 
152  } else {
153  bookHistosForState(StateName, ibooker);
154  }
155 
156  }
157 }
158 
160 
161  // parameters from the configuration
162  std::string QualName = conf_.getParameter<std::string>("Quality");
164  std::string MEBSFolderName = conf_.getParameter<std::string>("BSFolderName");
165 
166  // use the AlgoName and Quality Name
167  std::string CategoryName = QualName != "" ? AlgoName + "_" + QualName : AlgoName;
168 
169  // get binning from the configuration
170  int TKHitBin = conf_.getParameter<int>( "RecHitBin");
171  double TKHitMin = conf_.getParameter<double>("RecHitMin");
172  double TKHitMax = conf_.getParameter<double>("RecHitMax");
173 
174  int TKLostBin = conf_.getParameter<int>( "RecLostBin");
175  double TKLostMin = conf_.getParameter<double>("RecLostMin");
176  double TKLostMax = conf_.getParameter<double>("RecLostMax");
177 
178  int TKLayBin = conf_.getParameter<int>( "RecLayBin");
179  double TKLayMin = conf_.getParameter<double>("RecLayMin");
180  double TKLayMax = conf_.getParameter<double>("RecLayMax");
181 
182  int PhiBin = conf_.getParameter<int>( "PhiBin");
183  double PhiMin = conf_.getParameter<double>("PhiMin");
184  double PhiMax = conf_.getParameter<double>("PhiMax");
185 
186  int EtaBin = conf_.getParameter<int>( "EtaBin");
187  double EtaMin = conf_.getParameter<double>("EtaMin");
188  double EtaMax = conf_.getParameter<double>("EtaMax");
189 
190  int VXBin = conf_.getParameter<int>( "VXBin");
191  double VXMin = conf_.getParameter<double>("VXMin");
192  double VXMax = conf_.getParameter<double>("VXMax");
193 
194  int VYBin = conf_.getParameter<int>( "VYBin");
195  double VYMin = conf_.getParameter<double>("VYMin");
196  double VYMax = conf_.getParameter<double>("VYMax");
197 
198  int VZBin = conf_.getParameter<int>( "VZBin");
199  double VZMin = conf_.getParameter<double>("VZMin");
200  double VZMax = conf_.getParameter<double>("VZMax");
201 
202  ibooker.setCurrentFolder(TopFolder_);
203 
204  // book the Hit Property histograms
205  // ---------------------------------------------------------------------------------//
206 
207  TkParameterMEs tkmes;
209 
210  ibooker.setCurrentFolder(TopFolder_+"/HitProperties");
211 
212  histname = "NumberOfRecHitsPerTrack_";
213  NumberOfRecHitsPerTrack = ibooker.book1D(histname+CategoryName, histname+CategoryName, TKHitBin, TKHitMin, TKHitMax);
214  NumberOfRecHitsPerTrack->setAxisTitle("Number of all RecHits of each Track");
215  NumberOfRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
216 
217  histname = "NumberOfValidRecHitsPerTrack_";
218  NumberOfValidRecHitsPerTrack = ibooker.book1D(histname+CategoryName, histname+CategoryName, TKHitBin, TKHitMin, TKHitMax);
219  NumberOfValidRecHitsPerTrack->setAxisTitle("Number of valid RecHits for each Track");
220  NumberOfValidRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
221 
222  histname = "NumberOfLostRecHitsPerTrack_";
223  NumberOfLostRecHitsPerTrack = ibooker.book1D(histname+CategoryName, histname+CategoryName, TKLostBin, TKLostMin, TKLostMax);
224  NumberOfLostRecHitsPerTrack->setAxisTitle("Number of lost RecHits for each Track");
225  NumberOfLostRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
226 
227  histname = "NumberOfLayersPerTrack_";
228  NumberOfLayersPerTrack = ibooker.book1D(histname+CategoryName, histname+CategoryName, TKLayBin, TKLayMin, TKLayMax);
229  NumberOfLayersPerTrack->setAxisTitle("Number of Layers of each Track", 1);
230  NumberOfLayersPerTrack->setAxisTitle("Number of Tracks", 2);
231 
232 
234 
235  histname = "NumberOfRecHitVsPhiVsEtaPerTrack_";
236  NumberOfRecHitVsPhiVsEtaPerTrack = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
237  EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax, 0, 40., "");
240  }
241 
243 
244  histname = "NumberOfLayersVsPhiVsEtaPerTrack_";
245  NumberOfLayersVsPhiVsEtaPerTrack = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
246  EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax, 0, 40., "");
249  }
250  }
251 
252  // book the General Property histograms
253  // ---------------------------------------------------------------------------------//
254 
256 
257  int Chi2Bin = conf_.getParameter<int>( "Chi2Bin");
258  double Chi2Min = conf_.getParameter<double>("Chi2Min");
259  double Chi2Max = conf_.getParameter<double>("Chi2Max");
260 
261  int Chi2NDFBin = conf_.getParameter<int>( "Chi2NDFBin");
262  double Chi2NDFMin = conf_.getParameter<double>("Chi2NDFMin");
263  double Chi2NDFMax = conf_.getParameter<double>("Chi2NDFMax");
264 
265  int Chi2ProbBin = conf_.getParameter<int>( "Chi2ProbBin");
266  double Chi2ProbMin = conf_.getParameter<double>("Chi2ProbMin");
267  double Chi2ProbMax = conf_.getParameter<double>("Chi2ProbMax");
268 
269 
270  //HI PLOTS////
271  int TransDCABins = conf_.getParameter<int>("TransDCABins");
272  double TransDCAMin = conf_.getParameter<double>("TransDCAMin");
273  double TransDCAMax = conf_.getParameter<double>("TransDCAMax");
274 
275  int LongDCABins = conf_.getParameter<int>("LongDCABins");
276  double LongDCAMin = conf_.getParameter<double>("LongDCAMin");
277  double LongDCAMax = conf_.getParameter<double>("LongDCAMax");
279 
280 
281  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
282 
283  histname = "Chi2_";
284  Chi2 = ibooker.book1D(histname+CategoryName, histname+CategoryName, Chi2Bin, Chi2Min, Chi2Max);
285  Chi2->setAxisTitle("Track #chi^{2}" ,1);
286  Chi2->setAxisTitle("Number of Tracks",2);
287 
288  histname = "Chi2Prob_";
289  Chi2Prob = ibooker.book1D(histname+CategoryName, histname+CategoryName, Chi2ProbBin, Chi2ProbMin, Chi2ProbMax);
290  Chi2Prob->setAxisTitle("Track #chi^{2} probability",1);
291  Chi2Prob->setAxisTitle("Number of Tracks" ,2);
292 
293  histname = "Chi2oNDF_";
294  Chi2oNDF = ibooker.book1D(histname+CategoryName, histname+CategoryName, Chi2NDFBin, Chi2NDFMin, Chi2NDFMax);
295  Chi2oNDF->setAxisTitle("Track #chi^{2}/ndf",1);
296  Chi2oNDF->setAxisTitle("Number of Tracks" ,2);
297 
298 
300  //HI PLOTS///
302  if (doHIPlots_)
303  {
304  histname = "LongDCASig_";
305  LongDCASig = ibooker.book1D(histname+CategoryName, histname+CategoryName,LongDCABins,LongDCAMin,LongDCAMax);
306  LongDCASig->setAxisTitle("dz/#sigma_{dz}",1);
307 
308  histname = "TransDCASig_";
309  TransDCASig = ibooker.book1D(histname+CategoryName,histname+CategoryName,TransDCABins,TransDCAMin,TransDCAMax);
310  TransDCASig->setAxisTitle("dxy/#sigma_{dxy}",1);
311  }
312 
313 
314 
315  if (doDCAPlots_) {
316  histname = "xPointOfClosestApproach_";
317  xPointOfClosestApproach = ibooker.book1D(histname+CategoryName, histname+CategoryName, VXBin, VXMin, VXMax);
318  xPointOfClosestApproach->setAxisTitle("x component of Track PCA to beam line (cm)",1);
319  xPointOfClosestApproach->setAxisTitle("Number of Tracks",2);
320 
321  histname = "yPointOfClosestApproach_";
322  yPointOfClosestApproach = ibooker.book1D(histname+CategoryName, histname+CategoryName, VYBin, VYMin, VYMax);
323  yPointOfClosestApproach->setAxisTitle("y component of Track PCA to beam line (cm)",1);
324  yPointOfClosestApproach->setAxisTitle("Number of Tracks",2);
325 
326  histname = "zPointOfClosestApproach_";
327  zPointOfClosestApproach = ibooker.book1D(histname+CategoryName, histname+CategoryName, VZBin, VZMin, VZMax);
328  zPointOfClosestApproach->setAxisTitle("z component of Track PCA to beam line (cm)",1);
329  zPointOfClosestApproach->setAxisTitle("Number of Tracks",2);
330 
331  histname = "xPointOfClosestApproachToPV_";
332  xPointOfClosestApproachToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, VXBin, VXMin, VXMax);
333  xPointOfClosestApproachToPV->setAxisTitle("x component of Track PCA to pv (cm)",1);
334  xPointOfClosestApproachToPV->setAxisTitle("Number of Tracks",2);
335 
336  histname = "yPointOfClosestApproachToPV_";
337  yPointOfClosestApproachToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, VYBin, VYMin, VYMax);
338  yPointOfClosestApproachToPV->setAxisTitle("y component of Track PCA to pv line (cm)",1);
339  yPointOfClosestApproachToPV->setAxisTitle("Number of Tracks",2);
340 
341  histname = "zPointOfClosestApproachToPV_";
342  zPointOfClosestApproachToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, VZBin, VZMin, VZMax);
343  zPointOfClosestApproachToPV->setAxisTitle("z component of Track PCA to pv line (cm)",1);
344  zPointOfClosestApproachToPV->setAxisTitle("Number of Tracks",2);
345  }
346 
347  // See DataFormats/TrackReco/interface/TrackBase.h for track algorithm enum definition
348  // http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/DataFormats/TrackReco/interface/TrackBase.h?view=log
349  histname = "algorithm_";
350  algorithm = ibooker.book1D(histname+CategoryName, histname+CategoryName, reco::TrackBase::algoSize, 0., double(reco::TrackBase::algoSize));
351  algorithm->setAxisTitle("Tracking algorithm",1);
352  algorithm->setAxisTitle("Number of Tracks",2);
353  for (size_t ibin=0; ibin<reco::TrackBase::algoSize-1; ibin++)
355  }
356 
357 }
358 
360 
361  // parameters from the configuration
362  std::string QualName = conf_.getParameter<std::string>("Quality");
364 
365  // use the AlgoName and Quality Name
366  std::string CategoryName = QualName != "" ? AlgoName + "_" + QualName : AlgoName;
367 
368 
369  // book LS analysis related histograms
370  // -----------------------------------
371  if ( doLumiAnalysis_ ) {
372 
373  // get binning from the configuration
374  int TKHitBin = conf_.getParameter<int>( "RecHitBin");
375  double TKHitMin = conf_.getParameter<double>("RecHitMin");
376  double TKHitMax = conf_.getParameter<double>("RecHitMax");
377 
378  int Chi2NDFBin = conf_.getParameter<int>( "Chi2NDFBin");
379  double Chi2NDFMin = conf_.getParameter<double>("Chi2NDFMin");
380  double Chi2NDFMax = conf_.getParameter<double>("Chi2NDFMax");
381 
382  // add by Mia in order to deal w/ LS transitions
383  ibooker.setCurrentFolder(TopFolder_+"/LSanalysis");
384 
385  histname = "NumberOfRecHitsPerTrack_lumiFlag_";
386  NumberOfRecHitsPerTrack_lumiFlag = ibooker.book1D(histname+CategoryName, histname+CategoryName, TKHitBin, TKHitMin, TKHitMax);
387  NumberOfRecHitsPerTrack_lumiFlag->setAxisTitle("Number of all RecHits of each Track");
388  NumberOfRecHitsPerTrack_lumiFlag->setAxisTitle("Number of Tracks", 2);
389 
390  histname = "Chi2oNDF_lumiFlag_";
391  Chi2oNDF_lumiFlag = ibooker.book1D(histname+CategoryName, histname+CategoryName, Chi2NDFBin, Chi2NDFMin, Chi2NDFMax);
392  Chi2oNDF_lumiFlag->setAxisTitle("Track #chi^{2}/ndf",1);
393  Chi2oNDF_lumiFlag->setAxisTitle("Number of Tracks" ,2);
394 
395  }
396 }
397 
399 
400  // parameters from the configuration
401  std::string QualName = conf_.getParameter<std::string>("Quality");
403 
404  // use the AlgoName and Quality Name
405  std::string CategoryName = QualName != "" ? AlgoName + "_" + QualName : AlgoName;
406 
407  // book the Beam Spot related histograms
408  // ---------------------------------------------------------------------------------//
409 
411 
412  int DxyBin = conf_.getParameter<int>( "DxyBin");
413  double DxyMin = conf_.getParameter<double>("DxyMin");
414  double DxyMax = conf_.getParameter<double>("DxyMax");
415 
416  int PhiBin = conf_.getParameter<int>( "PhiBin");
417  double PhiMin = conf_.getParameter<double>("PhiMin");
418  double PhiMax = conf_.getParameter<double>("PhiMax");
419 
420  int X0Bin = conf_.getParameter<int>( "X0Bin");
421  double X0Min = conf_.getParameter<double>("X0Min");
422  double X0Max = conf_.getParameter<double>("X0Max");
423 
424  int Y0Bin = conf_.getParameter<int>( "Y0Bin");
425  double Y0Min = conf_.getParameter<double>("Y0Min");
426  double Y0Max = conf_.getParameter<double>("Y0Max");
427 
428  int Z0Bin = conf_.getParameter<int>( "Z0Bin");
429  double Z0Min = conf_.getParameter<double>("Z0Min");
430  double Z0Max = conf_.getParameter<double>("Z0Max");
431 
432  int VZBinProf = conf_.getParameter<int>( "VZBinProf");
433  double VZMinProf = conf_.getParameter<double>("VZMinProf");
434  double VZMaxProf = conf_.getParameter<double>("VZMaxProf");
435 
436 
437  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
438 
439  histname = "DistanceOfClosestApproachToBS_";
440  DistanceOfClosestApproachToBS = ibooker.book1D(histname+CategoryName,histname+CategoryName,DxyBin,DxyMin,DxyMax);
441  DistanceOfClosestApproachToBS->setAxisTitle("Track d_{xy} wrt beam spot (cm)",1);
442  DistanceOfClosestApproachToBS->setAxisTitle("Number of Tracks",2);
443 
444  histname = "DistanceOfClosestApproachToBSVsPhi_";
445  DistanceOfClosestApproachToBSVsPhi = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, PhiBin, PhiMin, PhiMax, DxyBin, DxyMin, DxyMax,"");
446  DistanceOfClosestApproachToBSVsPhi->getTH1()->SetBit(TH1::kCanRebin);
448  DistanceOfClosestApproachToBSVsPhi->setAxisTitle("Track d_{xy} wrt beam spot (cm)",2);
449 
450  histname = "xPointOfClosestApproachVsZ0wrt000_";
451  xPointOfClosestApproachVsZ0wrt000 = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, X0Bin, X0Min, X0Max,"");
453  xPointOfClosestApproachVsZ0wrt000->setAxisTitle("x component of Track PCA to beam line (cm)",2);
454 
455  histname = "yPointOfClosestApproachVsZ0wrt000_";
456  yPointOfClosestApproachVsZ0wrt000 = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, Y0Bin, Y0Min, Y0Max,"");
458  yPointOfClosestApproachVsZ0wrt000->setAxisTitle("y component of Track PCA to beam line (cm)",2);
459 
460  histname = "xPointOfClosestApproachVsZ0wrtBS_";
461  xPointOfClosestApproachVsZ0wrtBS = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, X0Bin, X0Min, X0Max,"");
462  xPointOfClosestApproachVsZ0wrtBS->setAxisTitle("d_{z} w.r.t. Beam Spot (cm)",1);
463  xPointOfClosestApproachVsZ0wrtBS->setAxisTitle("x component of Track PCA to BS (cm)",2);
464 
465  histname = "yPointOfClosestApproachVsZ0wrtBS_";
466  yPointOfClosestApproachVsZ0wrtBS = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, Y0Bin, Y0Min, Y0Max,"");
467  yPointOfClosestApproachVsZ0wrtBS->setAxisTitle("d_{z} w.r.t. Beam Spot (cm)",1);
468  yPointOfClosestApproachVsZ0wrtBS->setAxisTitle("y component of Track PCA to BS (cm)",2);
469 
470  histname = "zPointOfClosestApproachVsPhi_";
471  zPointOfClosestApproachVsPhi = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, PhiBin, PhiMin, PhiMax, VZBinProf, VZMinProf, VZMaxProf, "");
473  zPointOfClosestApproachVsPhi->setAxisTitle("y component of Track PCA to beam line (cm)",2);
474  }
475 
477 
478  int DxyBin = conf_.getParameter<int>( "DxyBin");
479  double DxyMin = conf_.getParameter<double>("DxyMin");
480  double DxyMax = conf_.getParameter<double>("DxyMax");
481 
482  int PhiBin = conf_.getParameter<int>( "PhiBin");
483  double PhiMin = conf_.getParameter<double>("PhiMin");
484  double PhiMax = conf_.getParameter<double>("PhiMax");
485 
486  int X0Bin = conf_.getParameter<int>( "X0Bin");
487  double X0Min = conf_.getParameter<double>("X0Min");
488  double X0Max = conf_.getParameter<double>("X0Max");
489 
490  int Y0Bin = conf_.getParameter<int>( "Y0Bin");
491  double Y0Min = conf_.getParameter<double>("Y0Min");
492  double Y0Max = conf_.getParameter<double>("Y0Max");
493 
494  int Z0Bin = conf_.getParameter<int>( "Z0Bin");
495  double Z0Min = conf_.getParameter<double>("Z0Min");
496  double Z0Max = conf_.getParameter<double>("Z0Max");
497 
498  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
499 
500  histname = "DistanceOfClosestApproachToPV_";
501  DistanceOfClosestApproachToPV = ibooker.book1D(histname+CategoryName,histname+CategoryName,DxyBin,DxyMin,DxyMax);
502  DistanceOfClosestApproachToPV->setAxisTitle("Track d_{xy} wrt beam spot (cm)",1);
503  DistanceOfClosestApproachToPV->setAxisTitle("Number of Tracks",2);
504 
505  histname = "DistanceOfClosestApproachToPVVsPhi_";
506  DistanceOfClosestApproachToPVVsPhi = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, PhiBin, PhiMin, PhiMax, DxyBin, DxyMin, DxyMax,"");
507  DistanceOfClosestApproachToPVVsPhi->getTH1()->SetBit(TH1::kCanRebin);
509  DistanceOfClosestApproachToPVVsPhi->setAxisTitle("Track d_{xy} wrt beam spot (cm)",2);
510 
511  histname = "xPointOfClosestApproachVsZ0wrtPV_";
512  xPointOfClosestApproachVsZ0wrtPV = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, X0Bin, X0Min, X0Max,"");
513  xPointOfClosestApproachVsZ0wrtPV->setAxisTitle("d_{z} w.r.t. Beam Spot (cm)",1);
514  xPointOfClosestApproachVsZ0wrtPV->setAxisTitle("x component of Track PCA to PV (cm)",2);
515 
516  histname = "yPointOfClosestApproachVsZ0wrtPV_";
517  yPointOfClosestApproachVsZ0wrtPV = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, Y0Bin, Y0Min, Y0Max,"");
518  yPointOfClosestApproachVsZ0wrtPV->setAxisTitle("d_{z} w.r.t. Beam Spot (cm)",1);
519  yPointOfClosestApproachVsZ0wrtPV->setAxisTitle("y component of Track PCA to PV (cm)",2);
520 
521  }
522 
523  if (doBSPlots_ || doAllPlots_) {
524  if (doTestPlots_) {
525 
526  int DxyBin = conf_.getParameter<int>( "DxyBin");
527  double DxyMin = conf_.getParameter<double>("DxyMin");
528  double DxyMax = conf_.getParameter<double>("DxyMax");
529 
530  int PhiBin = conf_.getParameter<int>( "PhiBin");
531  double PhiMin = conf_.getParameter<double>("PhiMin");
532  double PhiMax = conf_.getParameter<double>("PhiMax");
533 
534  histname = "TESTDistanceOfClosestApproachToBS_";
535  TESTDistanceOfClosestApproachToBS = ibooker.book1D(histname+CategoryName,histname+CategoryName,DxyBin,DxyMin,DxyMax);
536  TESTDistanceOfClosestApproachToBS->setAxisTitle("Track d_{xy} wrt beam spot (cm)",1);
537  TESTDistanceOfClosestApproachToBS->setAxisTitle("Number of Tracks",2);
538 
539  histname = "TESTDistanceOfClosestApproachToBSVsPhi_";
540  TESTDistanceOfClosestApproachToBSVsPhi = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, PhiBin, PhiMin, PhiMax, DxyBin, DxyMin, DxyMax,"");
541  TESTDistanceOfClosestApproachToBSVsPhi->getTH1()->SetBit(TH1::kCanRebin);
543  TESTDistanceOfClosestApproachToBSVsPhi->setAxisTitle("Track d_{xy} wrt beam spot (cm)",2);
544 
545  }
546 
547  }
548 
549  // book the Profile plots for DCA related histograms
550  // ---------------------------------------------------------------------------------//
551  if(doDCAPlots_ || doAllPlots_) {
552 
553  if (doDCAwrt000Plots_) {
554 
555  int EtaBin = conf_.getParameter<int>( "EtaBin");
556  double EtaMin = conf_.getParameter<double>("EtaMin");
557  double EtaMax = conf_.getParameter<double>("EtaMax");
558 
559  int PhiBin = conf_.getParameter<int>( "PhiBin");
560  double PhiMin = conf_.getParameter<double>("PhiMin");
561  double PhiMax = conf_.getParameter<double>("PhiMax");
562 
563  int DxyBin = conf_.getParameter<int>( "DxyBin");
564  double DxyMin = conf_.getParameter<double>("DxyMin");
565  double DxyMax = conf_.getParameter<double>("DxyMax");
566 
567  if (doThetaPlots_) {
568  int ThetaBin = conf_.getParameter<int>( "ThetaBin");
569  double ThetaMin = conf_.getParameter<double>("ThetaMin");
570  double ThetaMax = conf_.getParameter<double>("ThetaMax");
571 
572  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
573  histname = "DistanceOfClosestApproachVsTheta_";
574  DistanceOfClosestApproachVsTheta = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, ThetaBin, ThetaMin, ThetaMax, DxyMin,DxyMax,"");
576  DistanceOfClosestApproachVsTheta->setAxisTitle("Track d_{xy} wrt (0,0,0) (cm)",2);
577  }
578 
579  histname = "DistanceOfClosestApproachVsEta_";
580  DistanceOfClosestApproachVsEta = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, EtaBin, EtaMin, EtaMax, DxyMin, DxyMax,"");
582  DistanceOfClosestApproachVsEta->setAxisTitle("Track d_{xy} wrt (0,0,0) (cm)",2);
583  // temporary patch in order to put back those MEs in Muon Workspace
584 
585  histname = "DistanceOfClosestApproach_";
586  DistanceOfClosestApproach = ibooker.book1D(histname+CategoryName,histname+CategoryName,DxyBin,DxyMin,DxyMax);
587  DistanceOfClosestApproach->setAxisTitle("Track d_{xy} wrt (0,0,0) (cm)",1);
588  DistanceOfClosestApproach->setAxisTitle("Number of Tracks",2);
589 
590  histname = "DistanceOfClosestApproachVsPhi_";
591  DistanceOfClosestApproachVsPhi = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, PhiBin, PhiMin, PhiMax, DxyMin,DxyMax,"");
592  DistanceOfClosestApproachVsPhi->getTH1()->SetBit(TH1::kCanRebin);
594  DistanceOfClosestApproachVsPhi->setAxisTitle("Track d_{xy} wrt (0,0,0) (cm)",2);
595  }
596  }
597 
598 }
599 
600 // -- Analyse
601 // ---------------------------------------------------------------------------------//
602 void TrackAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup, const reco::Track& track)
603 {
604  double phi = track.phi();
605  double eta = track.eta();
606 
607  int nRecHits = track.hitPattern().numberOfHits(reco::HitPattern::TRACK_HITS);
608  int nValidRecHits = track.numberOfValidHits();
609  int nLostRecHits = track.numberOfLostHits();
610 
611  double chi2 = track.chi2();
612  double chi2prob = TMath::Prob(track.chi2(),(int)track.ndof());
613  double chi2oNDF = track.normalizedChi2();
614 
616  // rec hits
617  NumberOfRecHitsPerTrack -> Fill(nRecHits);
618  NumberOfValidRecHitsPerTrack-> Fill(nValidRecHits);
619  NumberOfLostRecHitsPerTrack -> Fill(nLostRecHits);
620 
621  // 2D plots
623  NumberOfRecHitVsPhiVsEtaPerTrack->Fill(eta,phi,nRecHits);
624 
625  int nLayers = track.hitPattern().trackerLayersWithMeasurement();
626  // layers
627  NumberOfLayersPerTrack->Fill(nLayers);
628 
629  // 2D plots
631  NumberOfLayersVsPhiVsEtaPerTrack->Fill(eta,phi,nLayers);
632  }
633 
635  // fitting
636  Chi2 -> Fill(chi2);
637  Chi2Prob -> Fill(chi2prob);
638  Chi2oNDF -> Fill(chi2oNDF);
639 
640  // DCA
641  // temporary patch in order to put back those MEs in Muon Workspace
642  if (doDCAPlots_) {
643  if (doDCAwrt000Plots_) {
645  DistanceOfClosestApproachVsPhi->Fill(phi, track.dxy());
646  }
647 
648  // PCA
652  }
653 
654  // algorithm
655  algorithm->Fill(static_cast<double>(track.algo()));
656  }
657 
658  if ( doLumiAnalysis_ ) {
660  Chi2oNDF_lumiFlag -> Fill(chi2oNDF);
661  }
662 
664 
665  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
666  iEvent.getByToken(beamSpotToken_,recoBeamSpotHandle);
667  reco::BeamSpot bs = *recoBeamSpotHandle;
668 
670  DistanceOfClosestApproachToBSVsPhi -> Fill(track.phi(), track.dxy(bs.position()));
671  zPointOfClosestApproachVsPhi -> Fill(track.phi(), track.vz());
672  xPointOfClosestApproachVsZ0wrt000 -> Fill(track.dz(), track.vx());
673  yPointOfClosestApproachVsZ0wrt000 -> Fill(track.dz(), track.vy());
674  xPointOfClosestApproachVsZ0wrtBS -> Fill(track.dz(bs.position()),(track.vx()-bs.position(track.vz()).x()));
675  yPointOfClosestApproachVsZ0wrtBS -> Fill(track.dz(bs.position()),(track.vy()-bs.position(track.vz()).y()));
676  if (doTestPlots_) {
677  TESTDistanceOfClosestApproachToBS -> Fill(track.dxy(bs.position(track.vz())));
678  TESTDistanceOfClosestApproachToBSVsPhi -> Fill(track.phi(), track.dxy(bs.position(track.vz())));
679  }
680  }
681 
683  edm::Handle<reco::VertexCollection> recoPrimaryVerticesHandle;
684  iEvent.getByToken(pvToken_,recoPrimaryVerticesHandle);
685  if (recoPrimaryVerticesHandle->size() > 0) {
686  reco::Vertex pv = recoPrimaryVerticesHandle->at(0);
687 
688 
690  //HI PLOTS///////
692 
693  if(doHIPlots_)
694  {
695  double longDCAsig = 0, transDCAsig = 0;
696  double zerr2 = track.dzError()*track.dzError()+pv.zError()*pv.zError();
697  double xyerr2 = track.d0Error()*track.d0Error()+pv.xError()*pv.yError();
698  if(zerr2 > 0) longDCAsig = track.dz(pv.position())/zerr2;
699  if(xyerr2 > 0) transDCAsig = track.dxy(pv.position())/xyerr2;
700  LongDCASig->Fill(longDCAsig);
701  TransDCASig->Fill(transDCAsig);
702  }
703 
704 
705 
707  DistanceOfClosestApproachToPVVsPhi -> Fill(track.phi(), track.dxy(pv.position()));
708  xPointOfClosestApproachVsZ0wrtPV -> Fill(track.dz(pv.position()),(track.vx()-pv.position().x()));
709  yPointOfClosestApproachVsZ0wrtPV -> Fill(track.dz(pv.position()),(track.vy()-pv.position().y()));
710  }
711  }
712 
713  if(doDCAPlots_ || doAllPlots_) {
714  if (doDCAwrt000Plots_) {
715  if (doThetaPlots_) {
716  DistanceOfClosestApproachVsTheta->Fill(track.theta(), track.d0());
717  }
718  DistanceOfClosestApproachVsEta->Fill(track.eta(), track.d0());
719  }
720 
721  }
722 
723  //Tracker Specific Histograms
726  }
727 
729  std::string StateName = conf_.getParameter<std::string>("MeasurementState");
730 
731  if (StateName == "All") {
732  fillHistosForState(iSetup, track, std::string("OuterSurface"));
733  fillHistosForState(iSetup, track, std::string("InnerSurface"));
734  fillHistosForState(iSetup, track, std::string("ImpactPoint"));
735  } else if (
736  StateName != "OuterSurface" &&
737  StateName != "InnerSurface" &&
738  StateName != "ImpactPoint" &&
739  StateName != "default"
740  ) {
741  fillHistosForState(iSetup, track, std::string("default"));
742  } else {
743  fillHistosForState(iSetup, track, StateName);
744  }
745  }
746 
747  if ( doAllPlots_ ) {
748  }
749 
750 }
751 
752 // book histograms at differnt measurement points
753 // ---------------------------------------------------------------------------------//
755 {
756 
757  // parameters from the configuration
758  std::string QualName = conf_.getParameter<std::string>("Quality");
760 
761  // use the AlgoName and Quality Name
762  std::string CategoryName = QualName != "" ? AlgoName + "_" + QualName : AlgoName;
763 
764  // get binning from the configuration
765  double Chi2NDFMin = conf_.getParameter<double>("Chi2NDFMin");
766  double Chi2NDFMax = conf_.getParameter<double>("Chi2NDFMax");
767 
768  int RecHitBin = conf_.getParameter<int>( "RecHitBin");
769  double RecHitMin = conf_.getParameter<double>("RecHitMin");
770  double RecHitMax = conf_.getParameter<double>("RecHitMax");
771 
772  int RecLayBin = conf_.getParameter<int>( "RecHitBin");
773  double RecLayMin = conf_.getParameter<double>("RecHitMin");
774  double RecLayMax = conf_.getParameter<double>("RecHitMax");
775 
776 
777  int PhiBin = conf_.getParameter<int>( "PhiBin");
778  double PhiMin = conf_.getParameter<double>("PhiMin");
779  double PhiMax = conf_.getParameter<double>("PhiMax");
780 
781  int EtaBin = conf_.getParameter<int>( "EtaBin");
782  double EtaMin = conf_.getParameter<double>("EtaMin");
783  double EtaMax = conf_.getParameter<double>("EtaMax");
784 
785  int ThetaBin = conf_.getParameter<int>( "ThetaBin");
786  double ThetaMin = conf_.getParameter<double>("ThetaMin");
787  double ThetaMax = conf_.getParameter<double>("ThetaMax");
788 
789  int TrackQBin = conf_.getParameter<int>( "TrackQBin");
790  double TrackQMin = conf_.getParameter<double>("TrackQMin");
791  double TrackQMax = conf_.getParameter<double>("TrackQMax");
792 
793  int TrackPtBin = conf_.getParameter<int>( "TrackPtBin");
794  double TrackPtMin = conf_.getParameter<double>("TrackPtMin");
795  double TrackPtMax = conf_.getParameter<double>("TrackPtMax");
796 
797  int TrackPBin = conf_.getParameter<int>( "TrackPBin");
798  double TrackPMin = conf_.getParameter<double>("TrackPMin");
799  double TrackPMax = conf_.getParameter<double>("TrackPMax");
800 
801  int TrackPxBin = conf_.getParameter<int>( "TrackPxBin");
802  double TrackPxMin = conf_.getParameter<double>("TrackPxMin");
803  double TrackPxMax = conf_.getParameter<double>("TrackPxMax");
804 
805  int TrackPyBin = conf_.getParameter<int>( "TrackPyBin");
806  double TrackPyMin = conf_.getParameter<double>("TrackPyMin");
807  double TrackPyMax = conf_.getParameter<double>("TrackPyMax");
808 
809  int TrackPzBin = conf_.getParameter<int>( "TrackPzBin");
810  double TrackPzMin = conf_.getParameter<double>("TrackPzMin");
811  double TrackPzMax = conf_.getParameter<double>("TrackPzMax");
812 
813  int ptErrBin = conf_.getParameter<int>( "ptErrBin");
814  double ptErrMin = conf_.getParameter<double>("ptErrMin");
815  double ptErrMax = conf_.getParameter<double>("ptErrMax");
816 
817  int pxErrBin = conf_.getParameter<int>( "pxErrBin");
818  double pxErrMin = conf_.getParameter<double>("pxErrMin");
819  double pxErrMax = conf_.getParameter<double>("pxErrMax");
820 
821  int pyErrBin = conf_.getParameter<int>( "pyErrBin");
822  double pyErrMin = conf_.getParameter<double>("pyErrMin");
823  double pyErrMax = conf_.getParameter<double>("pyErrMax");
824 
825  int pzErrBin = conf_.getParameter<int>( "pzErrBin");
826  double pzErrMin = conf_.getParameter<double>("pzErrMin");
827  double pzErrMax = conf_.getParameter<double>("pzErrMax");
828 
829  int pErrBin = conf_.getParameter<int>( "pErrBin");
830  double pErrMin = conf_.getParameter<double>("pErrMin");
831  double pErrMax = conf_.getParameter<double>("pErrMax");
832 
833  int phiErrBin = conf_.getParameter<int>( "phiErrBin");
834  double phiErrMin = conf_.getParameter<double>("phiErrMin");
835  double phiErrMax = conf_.getParameter<double>("phiErrMax");
836 
837  int etaErrBin = conf_.getParameter<int>( "etaErrBin");
838  double etaErrMin = conf_.getParameter<double>("etaErrMin");
839  double etaErrMax = conf_.getParameter<double>("etaErrMax");
840 
841 
842  double Chi2ProbMin = conf_.getParameter<double>("Chi2ProbMin");
843  double Chi2ProbMax = conf_.getParameter<double>("Chi2ProbMax");
844 
845  ibooker.setCurrentFolder(TopFolder_);
846 
847  TkParameterMEs tkmes;
848 
849  std::string histTag = (sname == "default") ? CategoryName : sname + "_" + CategoryName;
850 
851  if(doAllPlots_) {
852 
853  // general properties
854  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
855 
856  if (doThetaPlots_) {
857  histname = "Chi2oNDFVsTheta_" + histTag;
858  tkmes.Chi2oNDFVsTheta = ibooker.bookProfile(histname, histname, ThetaBin, ThetaMin, ThetaMax, Chi2NDFMin, Chi2NDFMax,"");
859  tkmes.Chi2oNDFVsTheta->setAxisTitle("Track #theta",1);
860  tkmes.Chi2oNDFVsTheta->setAxisTitle("Track #chi^{2}/ndf",2);
861  }
862  histname = "Chi2oNDFVsPhi_" + histTag;
863  tkmes.Chi2oNDFVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, Chi2NDFMin, Chi2NDFMax,"");
864  tkmes.Chi2oNDFVsPhi->setAxisTitle("Track #phi",1);
865  tkmes.Chi2oNDFVsPhi->setAxisTitle("Track #chi^{2}/ndf",2);
866 
867  histname = "Chi2oNDFVsEta_" + histTag;
868  tkmes.Chi2oNDFVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, Chi2NDFMin, Chi2NDFMax,"");
869  tkmes.Chi2oNDFVsEta->setAxisTitle("Track #eta",1);
870  tkmes.Chi2oNDFVsEta->setAxisTitle("Track #chi^{2}/ndf",2);
871 
872  histname = "Chi2ProbVsPhi_" + histTag;
873  tkmes.Chi2ProbVsPhi = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, PhiBin, PhiMin, PhiMax, Chi2ProbMin, Chi2ProbMax);
874  tkmes.Chi2ProbVsPhi->setAxisTitle("Tracks #phi" ,1);
875  tkmes.Chi2ProbVsPhi->setAxisTitle("Track #chi^{2} probability",2);
876 
877  histname = "Chi2ProbVsEta_" + histTag;
878  tkmes.Chi2ProbVsEta = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, EtaBin, EtaMin, EtaMax, Chi2ProbMin, Chi2ProbMax);
879  tkmes.Chi2ProbVsEta->setAxisTitle("Tracks #eta" ,1);
880  tkmes.Chi2ProbVsEta->setAxisTitle("Track #chi^{2} probability",2);
881 
882  }
883 
884  // general properties
885  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
886 
887  histname = "TrackP_" + histTag;
888  tkmes.TrackP = ibooker.book1D(histname, histname, TrackPBin, TrackPMin, TrackPMax);
889  tkmes.TrackP->setAxisTitle("Track |p| (GeV/c)", 1);
890  tkmes.TrackP->setAxisTitle("Number of Tracks",2);
891 
892  histname = "TrackPt_" + histTag;
893  tkmes.TrackPt = ibooker.book1D(histname, histname, TrackPtBin, TrackPtMin, TrackPtMax);
894  tkmes.TrackPt->setAxisTitle("Track p_{T} (GeV/c)", 1);
895  tkmes.TrackPt->setAxisTitle("Number of Tracks",2);
896 
897  if (doTrackPxPyPlots_) {
898  histname = "TrackPx_" + histTag;
899  tkmes.TrackPx = ibooker.book1D(histname, histname, TrackPxBin, TrackPxMin, TrackPxMax);
900  tkmes.TrackPx->setAxisTitle("Track p_{x} (GeV/c)", 1);
901  tkmes.TrackPx->setAxisTitle("Number of Tracks",2);
902 
903  histname = "TrackPy_" + histTag;
904  tkmes.TrackPy = ibooker.book1D(histname, histname, TrackPyBin, TrackPyMin, TrackPyMax);
905  tkmes.TrackPy->setAxisTitle("Track p_{y} (GeV/c)", 1);
906  tkmes.TrackPy->setAxisTitle("Number of Tracks",2);
907  }
908  histname = "TrackPz_" + histTag;
909  tkmes.TrackPz = ibooker.book1D(histname, histname, TrackPzBin, TrackPzMin, TrackPzMax);
910  tkmes.TrackPz->setAxisTitle("Track p_{z} (GeV/c)", 1);
911  tkmes.TrackPz->setAxisTitle("Number of Tracks",2);
912 
913  histname = "TrackPhi_" + histTag;
914  tkmes.TrackPhi = ibooker.book1D(histname, histname, PhiBin, PhiMin, PhiMax);
915  tkmes.TrackPhi->setAxisTitle("Track #phi", 1);
916  tkmes.TrackPhi->setAxisTitle("Number of Tracks",2);
917 
918  histname = "TrackEta_" + histTag;
919  tkmes.TrackEta = ibooker.book1D(histname, histname, EtaBin, EtaMin, EtaMax);
920  tkmes.TrackEta->setAxisTitle("Track #eta", 1);
921  tkmes.TrackEta->setAxisTitle("Number of Tracks",2);
922 
923  if (doThetaPlots_) {
924  histname = "TrackTheta_" + histTag;
925  tkmes.TrackTheta = ibooker.book1D(histname, histname, ThetaBin, ThetaMin, ThetaMax);
926  tkmes.TrackTheta->setAxisTitle("Track #theta", 1);
927  tkmes.TrackTheta->setAxisTitle("Number of Tracks",2);
928  }
929  histname = "TrackQ_" + histTag;
930  tkmes.TrackQ = ibooker.book1D(histname, histname, TrackQBin, TrackQMin, TrackQMax);
931  tkmes.TrackQ->setAxisTitle("Track Charge", 1);
932  tkmes.TrackQ->setAxisTitle("Number of Tracks",2);
933 
934  histname = "TrackPErrOverP_" + histTag;
935  tkmes.TrackPErr = ibooker.book1D(histname, histname, pErrBin, pErrMin, pErrMax);
936  tkmes.TrackPErr->setAxisTitle("track error(p)/p", 1);
937  tkmes.TrackPErr->setAxisTitle("Number of Tracks",2);
938 
939  histname = "TrackPtErrOverPt_" + histTag;
940  tkmes.TrackPtErr = ibooker.book1D(histname, histname, ptErrBin, ptErrMin, ptErrMax);
941  tkmes.TrackPtErr->setAxisTitle("track error(p_{T})/p_{T}", 1);
942  tkmes.TrackPtErr->setAxisTitle("Number of Tracks",2);
943 
944  histname = "TrackPtErrOverPtVsEta_" + histTag;
945  tkmes.TrackPtErrVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, ptErrMin, ptErrMax);
946  tkmes.TrackPtErrVsEta->setAxisTitle("Track #eta",1);
947  tkmes.TrackPtErrVsEta->setAxisTitle("track error(p_{T})/p_{T}", 2);
948 
949  if (doTrackPxPyPlots_) {
950  histname = "TrackPxErrOverPx_" + histTag;
951  tkmes.TrackPxErr = ibooker.book1D(histname, histname, pxErrBin, pxErrMin, pxErrMax);
952  tkmes.TrackPxErr->setAxisTitle("track error(p_{x})/p_{x}", 1);
953  tkmes.TrackPxErr->setAxisTitle("Number of Tracks",2);
954 
955  histname = "TrackPyErrOverPy_" + histTag;
956  tkmes.TrackPyErr = ibooker.book1D(histname, histname, pyErrBin, pyErrMin, pyErrMax);
957  tkmes.TrackPyErr->setAxisTitle("track error(p_{y})/p_{y}", 1);
958  tkmes.TrackPyErr->setAxisTitle("Number of Tracks",2);
959  }
960  histname = "TrackPzErrOverPz_" + histTag;
961  tkmes.TrackPzErr = ibooker.book1D(histname, histname, pzErrBin, pzErrMin, pzErrMax);
962  tkmes.TrackPzErr->setAxisTitle("track error(p_{z})/p_{z}", 1);
963  tkmes.TrackPzErr->setAxisTitle("Number of Tracks",2);
964 
965  histname = "TrackPhiErr_" + histTag;
966  tkmes.TrackPhiErr = ibooker.book1D(histname, histname, phiErrBin, phiErrMin, phiErrMax);
967  tkmes.TrackPhiErr->setAxisTitle("track error(#phi)");
968  tkmes.TrackPhiErr->setAxisTitle("Number of Tracks",2);
969 
970  histname = "TrackEtaErr_" + histTag;
971  tkmes.TrackEtaErr = ibooker.book1D(histname, histname, etaErrBin, etaErrMin, etaErrMax);
972  tkmes.TrackEtaErr->setAxisTitle("track error(#eta)");
973  tkmes.TrackEtaErr->setAxisTitle("Number of Tracks",2);
974 
975  // rec hit profiles
976  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
977  histname = "NumberOfRecHitsPerTrackVsPhi_" + histTag;
978  tkmes.NumberOfRecHitsPerTrackVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, RecHitBin, RecHitMin, RecHitMax,"");
979  tkmes.NumberOfRecHitsPerTrackVsPhi->setAxisTitle("Track #phi",1);
980  tkmes.NumberOfRecHitsPerTrackVsPhi->setAxisTitle("Number of RecHits in each Track",2);
981 
982  if (doThetaPlots_) {
983  histname = "NumberOfRecHitsPerTrackVsTheta_" + histTag;
984  tkmes.NumberOfRecHitsPerTrackVsTheta = ibooker.bookProfile(histname, histname, ThetaBin, ThetaMin, ThetaMax, RecHitBin, RecHitMin, RecHitMax,"");
985  tkmes.NumberOfRecHitsPerTrackVsTheta->setAxisTitle("Track #phi",1);
986  tkmes.NumberOfRecHitsPerTrackVsTheta->setAxisTitle("Number of RecHits in each Track",2);
987  }
988  histname = "NumberOfRecHitsPerTrackVsEta_" + histTag;
989  tkmes.NumberOfRecHitsPerTrackVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, RecHitBin, RecHitMin, RecHitMax,"");
990  tkmes.NumberOfRecHitsPerTrackVsEta->setAxisTitle("Track #eta",1);
991  tkmes.NumberOfRecHitsPerTrackVsEta->setAxisTitle("Number of RecHits in each Track",2);
992 
993  histname = "NumberOfValidRecHitsPerTrackVsPhi_" + histTag;
994  tkmes.NumberOfValidRecHitsPerTrackVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, RecHitMin, RecHitMax,"");
995  tkmes.NumberOfValidRecHitsPerTrackVsPhi->setAxisTitle("Track #phi",1);
996  tkmes.NumberOfValidRecHitsPerTrackVsPhi->setAxisTitle("Number of valid RecHits in each Track",2);
997 
998  // std::cout << "[TrackAnalyzer::bookHistosForState] histTag: " << histTag << std::endl;
999  histname = "NumberOfValidRecHitsPerTrackVsEta_" + histTag;
1000  tkmes.NumberOfValidRecHitsPerTrackVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, RecHitMin, RecHitMax,"");
1001  tkmes.NumberOfValidRecHitsPerTrackVsEta->setAxisTitle("Track #eta",1);
1002  tkmes.NumberOfValidRecHitsPerTrackVsEta->setAxisTitle("Number of valid RecHits in each Track",2);
1003 
1005  histname = "NumberOfLayersPerTrackVsPhi_" + histTag;
1006  tkmes.NumberOfLayersPerTrackVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, RecLayBin, RecLayMin, RecLayMax,"");
1007  tkmes.NumberOfLayersPerTrackVsPhi->setAxisTitle("Track #phi",1);
1008  tkmes.NumberOfLayersPerTrackVsPhi->setAxisTitle("Number of Layers in each Track",2);
1009 
1010  if (doThetaPlots_) {
1011  histname = "NumberOfLayersPerTrackVsTheta_" + histTag;
1012  tkmes.NumberOfLayersPerTrackVsTheta = ibooker.bookProfile(histname, histname, ThetaBin, ThetaMin, ThetaMax, RecLayBin, RecLayMin, RecLayMax,"");
1013  tkmes.NumberOfLayersPerTrackVsTheta->setAxisTitle("Track #phi",1);
1014  tkmes.NumberOfLayersPerTrackVsTheta->setAxisTitle("Number of Layers in each Track",2);
1015  }
1016  histname = "NumberOfLayersPerTrackVsEta_" + histTag;
1017  tkmes.NumberOfLayersPerTrackVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, RecLayBin, RecLayMin, RecLayMax,"");
1018  tkmes.NumberOfLayersPerTrackVsEta->setAxisTitle("Track #eta",1);
1019  tkmes.NumberOfLayersPerTrackVsEta->setAxisTitle("Number of Layers in each Track",2);
1020 
1021  if (doThetaPlots_) {
1022  histname = "Chi2oNDFVsTheta_" + histTag;
1023  tkmes.Chi2oNDFVsTheta = ibooker.bookProfile(histname, histname, ThetaBin, ThetaMin, ThetaMax, Chi2NDFMin, Chi2NDFMax,"");
1024  tkmes.Chi2oNDFVsTheta->setAxisTitle("Track #theta",1);
1025  tkmes.Chi2oNDFVsTheta->setAxisTitle("Track #chi^{2}/ndf",2);
1026  }
1027  if (doAllPlots_) {
1028  histname = "Chi2oNDFVsPhi_" + histTag;
1029  tkmes.Chi2oNDFVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, Chi2NDFMin, Chi2NDFMax,"");
1030  tkmes.Chi2oNDFVsPhi->setAxisTitle("Track #phi",1);
1031  tkmes.Chi2oNDFVsPhi->setAxisTitle("Track #chi^{2}/ndf",2);
1032 
1033  histname = "Chi2oNDFVsEta_" + histTag;
1034  tkmes.Chi2oNDFVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, Chi2NDFMin, Chi2NDFMax,"");
1035  tkmes.Chi2oNDFVsEta->setAxisTitle("Track #eta",1);
1036  tkmes.Chi2oNDFVsEta->setAxisTitle("Track #chi^{2}/ndf",2);
1037 
1038  histname = "Chi2ProbVsPhi_" + histTag;
1039  tkmes.Chi2ProbVsPhi = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, PhiBin, PhiMin, PhiMax, Chi2ProbMin, Chi2ProbMax);
1040  tkmes.Chi2ProbVsPhi->setAxisTitle("Tracks #phi" ,1);
1041  tkmes.Chi2ProbVsPhi->setAxisTitle("Track #chi^{2} probability",2);
1042 
1043  histname = "Chi2ProbVsEta_" + histTag;
1044  tkmes.Chi2ProbVsEta = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, EtaBin, EtaMin, EtaMax, Chi2ProbMin, Chi2ProbMax);
1045  tkmes.Chi2ProbVsEta->setAxisTitle("Tracks #eta" ,1);
1046  tkmes.Chi2ProbVsEta->setAxisTitle("Track #chi^{2} probability",2);
1047  }
1048 
1049  // now put the MEs in the map
1050  TkParameterMEMap.insert( std::make_pair(sname, tkmes) );
1051 
1052 }
1053 
1054 
1055 // fill histograms at differnt measurement points
1056 // ---------------------------------------------------------------------------------//
1058 {
1059  //get the kinematic parameters
1060  double p, px, py, pz, pt, theta, phi, eta, q;
1061  double pxerror, pyerror, pzerror, pterror, perror, phierror, etaerror;
1062 
1063  if (sname == "default") {
1064 
1065  p = track.p();
1066  px = track.px();
1067  py = track.py();
1068  pz = track.pz();
1069  pt = track.pt();
1070  phi = track.phi();
1071  theta = track.theta();
1072  eta = track.eta();
1073  q = track.charge();
1074 
1075  pterror = (pt) ? track.ptError()/(pt*pt) : 0.0;
1076  pxerror = -1.0;
1077  pyerror = -1.0;
1078  pzerror = -1.0;
1079  perror = -1.0;
1080  phierror = track.phiError();
1081  etaerror = track.etaError();
1082 
1083  } else {
1084 
1086  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",theB);
1087  reco::TransientTrack TransTrack = theB->build(track);
1088 
1090 
1091  if (sname == "OuterSurface") TSOS = TransTrack.outermostMeasurementState();
1092  else if (sname == "InnerSurface") TSOS = TransTrack.innermostMeasurementState();
1093  else if (sname == "ImpactPoint") TSOS = TransTrack.impactPointState();
1094 
1095  p = TSOS.globalMomentum().mag();
1096  px = TSOS.globalMomentum().x();
1097  py = TSOS.globalMomentum().y();
1098  pz = TSOS.globalMomentum().z();
1099  pt = TSOS.globalMomentum().perp();
1100  phi = TSOS.globalMomentum().phi();
1101  theta = TSOS.globalMomentum().theta();
1102  eta = TSOS.globalMomentum().eta();
1103  q = TSOS.charge();
1104 
1105  //get the error of the kinimatic parameters
1107  double partialPterror = errors(3,3)*pow(TSOS.globalMomentum().x(),2) + errors(4,4)*pow(TSOS.globalMomentum().y(),2);
1108  pterror = sqrt(partialPterror)/TSOS.globalMomentum().perp();
1109  pxerror = sqrt(errors(3,3))/TSOS.globalMomentum().x();
1110  pyerror = sqrt(errors(4,4))/TSOS.globalMomentum().y();
1111  pzerror = sqrt(errors(5,5))/TSOS.globalMomentum().z();
1112  perror = sqrt(partialPterror+errors(5,5)*pow(TSOS.globalMomentum().z(),2))/TSOS.globalMomentum().mag();
1113  phierror = sqrt(TSOS.curvilinearError().matrix()(2,2));
1114  etaerror = sqrt(TSOS.curvilinearError().matrix()(1,1))*fabs(sin(TSOS.globalMomentum().theta()));
1115 
1116  }
1117 
1118  std::map<std::string, TkParameterMEs>::iterator iPos = TkParameterMEMap.find(sname);
1119  if (iPos != TkParameterMEMap.end()) {
1120 
1121  TkParameterMEs tkmes = iPos->second;
1122 
1123  // momentum
1124  tkmes.TrackP->Fill(p);
1125  if (doTrackPxPyPlots_) {
1126  tkmes.TrackPx->Fill(px);
1127  tkmes.TrackPy->Fill(py);
1128  }
1129  tkmes.TrackPz->Fill(pz);
1130  tkmes.TrackPt->Fill(pt);
1131 
1132  // angles
1133  tkmes.TrackPhi->Fill(phi);
1134  tkmes.TrackEta->Fill(eta);
1135  if (doThetaPlots_) {
1136  tkmes.TrackTheta->Fill(theta);
1137  }
1138  tkmes.TrackQ->Fill(q);
1139 
1140  // errors
1141  tkmes.TrackPtErr->Fill(pterror);
1142  tkmes.TrackPtErrVsEta->Fill(eta,pterror);
1143  if (doTrackPxPyPlots_) {
1144  tkmes.TrackPxErr->Fill(pxerror);
1145  tkmes.TrackPyErr->Fill(pyerror);
1146  }
1147  tkmes.TrackPzErr->Fill(pzerror);
1148  tkmes.TrackPErr->Fill(perror);
1149  tkmes.TrackPhiErr->Fill(phierror);
1150  tkmes.TrackEtaErr->Fill(etaerror);
1151 
1152  int nRecHits = track.hitPattern().numberOfHits(reco::HitPattern::TRACK_HITS);
1153  int nValidRecHits = track.numberOfValidHits();
1154  // rec hits
1155  tkmes.NumberOfRecHitsPerTrackVsPhi->Fill(phi, nRecHits);
1156  if (doThetaPlots_) {
1157  tkmes.NumberOfRecHitsPerTrackVsTheta->Fill(theta,nRecHits);
1158  }
1159  tkmes.NumberOfRecHitsPerTrackVsEta->Fill(eta, nRecHits);
1160 
1161  tkmes.NumberOfValidRecHitsPerTrackVsPhi->Fill(phi, nValidRecHits);
1162  tkmes.NumberOfValidRecHitsPerTrackVsEta->Fill(eta, nValidRecHits);
1163 
1164  int nLayers = track.hitPattern().stripLayersWithMeasurement();
1165  // rec layers
1166  tkmes.NumberOfLayersPerTrackVsPhi->Fill(phi, nLayers);
1167  if (doThetaPlots_) {
1168  tkmes.NumberOfLayersPerTrackVsTheta->Fill(theta, nLayers);
1169  }
1170  tkmes.NumberOfLayersPerTrackVsEta->Fill(eta, nLayers);
1171 
1172  double chi2prob = TMath::Prob(track.chi2(),(int)track.ndof());
1173  double chi2oNDF = track.normalizedChi2();
1174 
1175  if(doAllPlots_) {
1176 
1177  // general properties
1178  if (doThetaPlots_) {
1179  tkmes.Chi2oNDFVsTheta->Fill(theta, chi2oNDF);
1180  }
1181  tkmes.Chi2oNDFVsPhi->Fill(phi, chi2oNDF);
1182  tkmes.Chi2oNDFVsEta->Fill(eta, chi2oNDF);
1183  tkmes.Chi2ProbVsPhi->Fill(phi, chi2prob);
1184  tkmes.Chi2ProbVsEta->Fill(eta, chi2prob);
1185  }
1186 
1187  }
1188 
1189 }
1190 
1191 
1193 {
1194 
1195  // parameters from the configuration
1196  std::string QualName = conf_.getParameter<std::string>("Quality");
1198 
1199  // use the AlgoName and Quality Name
1200  std::string CategoryName = QualName != "" ? AlgoName + "_" + QualName : AlgoName;
1201 
1202  int PhiBin = conf_.getParameter<int>( "PhiBin");
1203  double PhiMin = conf_.getParameter<double>("PhiMin");
1204  double PhiMax = conf_.getParameter<double>("PhiMax");
1205 
1206  int EtaBin = conf_.getParameter<int>( "EtaBin");
1207  double EtaMin = conf_.getParameter<double>("EtaMin");
1208  double EtaMax = conf_.getParameter<double>("EtaMax");
1209 
1210  // book hit property histograms
1211  // ---------------------------------------------------------------------------------//
1212  ibooker.setCurrentFolder(TopFolder_+"/HitProperties");
1213 
1214 
1215 
1216  std::vector<std::string> subdetectors = conf_.getParameter<std::vector<std::string> >("subdetectors");
1217  int detBin = conf_.getParameter<int>("subdetectorBin");
1218 
1219  for ( auto det : subdetectors ) {
1220 
1221  // hits properties
1222  ibooker.setCurrentFolder(TopFolder_+"/HitProperties/"+det);
1223 
1224  TkRecHitsPerSubDetMEs recHitsPerSubDet_mes;
1225 
1226  recHitsPerSubDet_mes.detectorTag = det;
1227  int detID = -1;
1228  if ( det == "TIB" ) detID = StripSubdetector::TIB;
1229  if ( det == "TOB" ) detID = StripSubdetector::TOB;
1230  if ( det == "TID" ) detID = StripSubdetector::TID;
1231  if ( det == "TEC" ) detID = StripSubdetector::TEC;
1232  if ( det == "PixBarrel" ) detID = PixelSubdetector::PixelBarrel;
1233  if ( det == "PixEndcap" ) detID = PixelSubdetector::PixelEndcap;
1234  recHitsPerSubDet_mes.detectorId = detID;
1235 
1236  histname = "NumberOfRecHitsPerTrack_" + det + "_" + CategoryName;
1237  recHitsPerSubDet_mes.NumberOfRecHitsPerTrack = ibooker.book1D(histname, histname, detBin, -0.5, double(detBin)-0.5);
1238  recHitsPerSubDet_mes.NumberOfRecHitsPerTrack->setAxisTitle("Number of " + det + " valid RecHits in each Track",1);
1239  recHitsPerSubDet_mes.NumberOfRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
1240 
1241  histname = "NumberOfRecHitsPerTrackVsPhi_" + det + "_" + CategoryName;
1242  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, detBin, -0.5, double(detBin)-0.5,"");
1243  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPhi->setAxisTitle("Track #phi",1);
1244  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPhi->setAxisTitle("Number of " + det + " valid RecHits in each Track",2);
1245 
1246  histname = "NumberOfRecHitsPerTrackVsEta_" + det + "_" + CategoryName;
1247  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, detBin, -0.5, double(detBin)-0.5,"");
1248  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsEta->setAxisTitle("Track #eta",1);
1249  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsEta->setAxisTitle("Number of " + det + " valid RecHits in each Track",2);
1250 
1251  histname = "NumberOfLayersPerTrack_" + det + "_" + CategoryName;
1252  recHitsPerSubDet_mes.NumberOfLayersPerTrack = ibooker.book1D(histname, histname, detBin, -0.5, double(detBin)-0.5);
1253  recHitsPerSubDet_mes.NumberOfLayersPerTrack->setAxisTitle("Number of " + det + " valid Layers in each Track",1);
1254  recHitsPerSubDet_mes.NumberOfLayersPerTrack->setAxisTitle("Number of Tracks", 2);
1255 
1256  histname = "NumberOfLayersPerTrackVsPhi_" + det + "_" + CategoryName;
1257  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, detBin, -0.5, double(detBin)-0.5,"");
1258  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPhi->setAxisTitle("Track #phi",1);
1259  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPhi->setAxisTitle("Number of " + det + " valid Layers in each Track",2);
1260 
1261  histname = "NumberOfLayersPerTrackVsEta_" + det + "_" + CategoryName;
1262  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, detBin, -0.5, double(detBin)-0.5,"");
1263  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsEta->setAxisTitle("Track #eta",1);
1264  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsEta->setAxisTitle("Number of " + det + " valid Layers in each Track",2);
1265 
1266  TkRecHitsPerSubDetMEMap.insert(std::pair<std::string,TkRecHitsPerSubDetMEs>(det,recHitsPerSubDet_mes));
1267 
1268 
1269  }
1270 
1271 
1272 }
1273 
1274 
1276 {
1277 
1278  double phi = track.phi();
1279  double eta = track.eta();
1280 
1281  for ( std::map<std::string,TkRecHitsPerSubDetMEs>::iterator it = TkRecHitsPerSubDetMEMap.begin();
1282  it != TkRecHitsPerSubDetMEMap.end(); it++ ) {
1283 
1284  int nValidLayers = 0;
1285  int nValidRecHits = 0;
1286  int substr = it->second.detectorId;
1287  switch(substr) {
1288  case StripSubdetector::TIB :
1289  nValidLayers = track.hitPattern().stripTIBLayersWithMeasurement(); // case 0: strip TIB
1290  nValidRecHits = track.hitPattern().numberOfValidStripTIBHits(); // case 0: strip TIB
1291  break;
1292  case StripSubdetector::TID :
1293  nValidLayers = track.hitPattern().stripTIDLayersWithMeasurement(); // case 0: strip TID
1294  nValidRecHits = track.hitPattern().numberOfValidStripTIDHits(); // case 0: strip TID
1295  break;
1296  case StripSubdetector::TOB :
1297  nValidLayers = track.hitPattern().stripTOBLayersWithMeasurement(); // case 0: strip TOB
1298  nValidRecHits = track.hitPattern().numberOfValidStripTOBHits(); // case 0: strip TOB
1299  break;
1300  case StripSubdetector::TEC :
1301  nValidLayers = track.hitPattern().stripTECLayersWithMeasurement(); // case 0: strip TEC
1302  nValidRecHits = track.hitPattern().numberOfValidStripTECHits(); // case 0: strip TEC
1303  break;
1305  nValidLayers = track.hitPattern().pixelBarrelLayersWithMeasurement(); // case 0: pixel PXB
1306  nValidRecHits = track.hitPattern().numberOfValidPixelBarrelHits(); // case 0: pixel PXB
1307  break;
1309  nValidLayers = track.hitPattern().pixelEndcapLayersWithMeasurement(); // case 0: pixel PXF
1310  nValidRecHits = track.hitPattern().numberOfValidPixelEndcapHits(); // case 0: pixel PXF
1311  break;
1312  default :
1313  break;
1314  }
1315 
1316  //Fill Layers and RecHits
1317  it->second.NumberOfRecHitsPerTrack -> Fill(nValidRecHits);
1318  it->second.NumberOfRecHitsPerTrackVsPhi -> Fill(phi, nValidRecHits);
1319  it->second.NumberOfRecHitsPerTrackVsEta -> Fill(eta, nValidRecHits);
1320 
1321  it->second.NumberOfLayersPerTrack -> Fill(nValidLayers);
1322  it->second.NumberOfLayersPerTrackVsPhi -> Fill(phi, nValidLayers);
1323  it->second.NumberOfLayersPerTrackVsEta -> Fill(eta, nValidLayers);
1324  }
1325 
1326 }
1327 //
1328 // -- Set Lumi Flag
1329 //
1331 
1332  TkParameterMEs tkmes;
1335 }
1336 //
1337 // -- Apply SoftReset
1338 //
1340  TkParameterMEs tkmes;
1341  dqmStore_->softReset(Chi2oNDF);
1342  dqmStore_->softReset(NumberOfRecHitsPerTrack);
1343 }
1344 //
1345 // -- Apply Reset
1346 //
1348  TkParameterMEs tkmes;
1351 }
1352 //
1353 // -- Remove SoftReset
1354 //
1356  TkParameterMEs tkmes;
1357  dqmStore_->disableSoftReset(Chi2oNDF);
1359 }
1360 
1361 
MonitorElement * NumberOfRecHitsPerTrackVsPhi
MonitorElement * NumberOfValidRecHitsPerTrackVsPhi
MonitorElement * Chi2ProbVsPhi
double p() const
momentum vector magnitude
Definition: TrackBase.h:663
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
MonitorElement * NumberOfLayersPerTrackVsPhi
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:563
T getParameter(std::string const &) const
MonitorElement * DistanceOfClosestApproachToPVVsPhi
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:729
MonitorElement * NumberOfRecHitVsPhiVsEtaPerTrack
bool doTrackerSpecific_
Definition: TrackAnalyzer.h:66
double d0Error() const
error on d0
Definition: TrackBase.h:850
void fillHistosForTrackerSpecific(const reco::Track &track)
MonitorElement * NumberOfRecHitsPerTrackVsEta
void bookHistosForLScertification(DQMStore::IBooker &ibooker)
T perp() const
Definition: PV3DBase.h:72
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
Definition: TrackBase.h:645
MonitorElement * NumberOfValidRecHitsPerTrack
int stripTIBLayersWithMeasurement() const
Definition: HitPattern.cc:541
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:609
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
double zError() const
error on z
Definition: Vertex.h:118
MonitorElement * Chi2oNDF_lumiFlag
double theta() const
polar angle
Definition: TrackBase.h:627
MonitorElement * xPointOfClosestApproachToPV
const CurvilinearTrajectoryError & curvilinearError() const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
MonitorElement * NumberOfLostRecHitsPerTrack
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
edm::ParameterSet conf_
Definition: TrackAnalyzer.h:64
const CartesianTrajectoryError cartesianError() const
Geom::Theta< T > theta() const
bool doGeneralPropertiesPlots_
Definition: TrackAnalyzer.h:71
T y() const
Definition: PV3DBase.h:63
double etaError() const
error on eta
Definition: TrackBase.h:832
MonitorElement * Chi2oNDFVsPhi
MonitorElement * Chi2ProbVsPhi
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * DistanceOfClosestApproachVsPhi
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:693
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
Definition: TrackBase.h:874
#define NULL
Definition: scimark2.h:8
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::map< std::string, TkParameterMEs > TkParameterMEMap
MonitorElement * NumberOfRecHitsPerTrackVsTheta
MonitorElement * algorithm
const double EtaMax[kNumberCalorimeter]
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:675
T eta() const
bool doHitPropertiesPlots_
Definition: TrackAnalyzer.h:73
MonitorElement * DistanceOfClosestApproach
bool doRecHitVsPhiVsEtaPerTrack_
Definition: TrackAnalyzer.h:74
MonitorElement * NumberOfLayersPerTrackVsTheta
MonitorElement * NumberOfRecHitsPerTrack_lumiFlag
std::map< std::string, TkRecHitsPerSubDetMEs > TkRecHitsPerSubDetMEMap
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:477
const Point & position() const
position
Definition: Vertex.h:106
int pixelEndcapLayersWithMeasurement() const
Definition: HitPattern.cc:529
int numberOfValidStripTOBHits() const
Definition: HitPattern.h:779
bool doMeasurementStatePlots_
Definition: TrackAnalyzer.h:72
TrajectoryStateOnSurface innermostMeasurementState() const
MonitorElement * NumberOfRecHitsPerTrack
void Fill(long long x)
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
TrackAlgorithm algo() const
Definition: TrackBase.h:423
void disableSoftReset(MonitorElement *me)
Definition: DQMStore.cc:3340
MonitorElement * TESTDistanceOfClosestApproachToBSVsPhi
MonitorElement * NumberOfValidRecHitsPerTrackVsEta
MonitorElement * Chi2oNDFVsEta
MonitorElement * TransDCASig
int iEvent
Definition: GenABIO.cc:230
MonitorElement * NumberOfRecHitsPerTrackVsPhi
MonitorElement * xPointOfClosestApproachVsZ0wrt000
T mag() const
Definition: PV3DBase.h:67
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:699
int numberOfValidPixelBarrelHits() const
Definition: HitPattern.h:754
bool doDCAwrt000Plots_
Definition: TrackAnalyzer.h:88
MonitorElement * NumberOfRecHitsPerTrackVsTheta
MonitorElement * xPointOfClosestApproach
MonitorElement * Chi2oNDFVsTheta
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:597
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:163
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
double ndof() const
number of degrees of freedom of the fit
Definition: TrackBase.h:603
int stripTIDLayersWithMeasurement() const
Definition: HitPattern.cc:552
MonitorElement * NumberOfValidRecHitsPerTrackVsEta
T sqrt(T t)
Definition: SSEVec.h:48
MonitorElement * NumberOfRecHitsPerTrackVsPhi
double pt() const
track transverse momentum
Definition: TrackBase.h:669
T z() const
Definition: PV3DBase.h:64
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Definition: TrackBase.h:811
std::string TopFolder_
Definition: TrackAnalyzer.h:59
MonitorElement * xPointOfClosestApproachVsZ0wrtBS
double phiError() const
error on phi
Definition: TrackBase.h:838
MonitorElement * NumberOfValidRecHitsPerTrackVsPhi
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
int numberOfValidStripTIDHits() const
Definition: HitPattern.h:774
TH1 * getTH1(void) const
MonitorElement * yPointOfClosestApproachToPV
const double EtaMin[kNumberCalorimeter]
MonitorElement * NumberOfRecHitsPerTrackVsEta
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:868
int numberOfValidStripTECHits() const
Definition: HitPattern.h:784
void softReset(MonitorElement *me)
Definition: DQMStore.cc:3332
MonitorElement * Chi2oNDFVsTheta
TrajectoryStateOnSurface outermostMeasurementState() const
void bookHistosForHitProperties(DQMStore::IBooker &ibooker)
MonitorElement * DistanceOfClosestApproachVsEta
MonitorElement * zPointOfClosestApproachVsPhi
const AlgebraicSymMatrix66 & matrix() const
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:687
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:657
MonitorElement * NumberOfLayersPerTrackVsEta
double dzError() const
error on dz
Definition: TrackBase.h:862
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:717
void bookHistosForTrackerSpecific(DQMStore::IBooker &ibooker)
void fillHistosForState(const edm::EventSetup &iSetup, const reco::Track &track, std::string sname)
TrajectoryStateOnSurface TSOS
Definition: TestHits.cc:19
virtual ~TrackAnalyzer()
bool doLumiAnalysis_
Definition: TrackAnalyzer.h:90
double xError() const
error on x
Definition: Vertex.h:114
MonitorElement * NumberOfLayersPerTrackVsEta
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Definition: TrackAnalyzer.h:61
virtual void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::Track &track)
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:384
MonitorElement * xPointOfClosestApproachVsZ0wrtPV
MonitorElement * yPointOfClosestApproachVsZ0wrtBS
MonitorElement * NumberOfLayersPerTrack
const T & get() const
Definition: EventSetup.h:55
int stripLayersWithMeasurement() const
Definition: HitPattern.h:919
int pixelBarrelLayersWithMeasurement() const
Definition: HitPattern.cc:517
MonitorElement * DistanceOfClosestApproachVsTheta
void bookHistosForBeamSpot(DQMStore::IBooker &ibooker)
virtual void initHisto(DQMStore::IBooker &ibooker)
MonitorElement * Chi2ProbVsEta
int numberOfValidStripTIBHits() const
Definition: HitPattern.h:769
static const std::string algoNames[]
Definition: TrackBase.h:130
int numberOfValidPixelEndcapHits() const
Definition: HitPattern.h:759
MonitorElement * zPointOfClosestApproachToPV
T eta() const
Definition: PV3DBase.h:76
MonitorElement * DistanceOfClosestApproachToPV
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:711
const AlgebraicSymMatrix55 & matrix() const
bool doTrackPxPyPlots_
Definition: TrackAnalyzer.h:84
GlobalVector globalMomentum() const
MonitorElement * DistanceOfClosestApproachToBSVsPhi
bool doLayersVsPhiVsEtaPerTrack_
Definition: TrackAnalyzer.h:76
void doSoftReset(DQMStore *dqmStore_)
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:574
MonitorElement * yPointOfClosestApproachVsZ0wrt000
MonitorElement * TrackPtErrVsEta
MonitorElement * TESTDistanceOfClosestApproachToBS
MonitorElement * NumberOfRecHitsPerTrackVsEta
int charge() const
track electric charge
Definition: TrackBase.h:615
const Point & position() const
position
Definition: BeamSpot.h:62
TrajectoryStateOnSurface impactPointState() const
void bookHistosForState(std::string sname, DQMStore::IBooker &ibooker)
MonitorElement * yPointOfClosestApproach
void Reset(std::vector< TH2F > &depth)
MonitorElement * NumberOfLayersVsPhiVsEtaPerTrack
Definition: DDAxes.h:10
MonitorElement * Chi2Prob
Definition: Chi2.h:17
MonitorElement * yPointOfClosestApproachVsZ0wrtPV
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:639
MonitorElement * zPointOfClosestApproach
TrackAnalyzer(const edm::ParameterSet &)
T x() const
Definition: PV3DBase.h:62
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * Chi2ProbVsEta
MonitorElement * DistanceOfClosestApproachToBS
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
MonitorElement * Chi2oNDF
double yError() const
error on y
Definition: Vertex.h:116
std::string histname
MonitorElement * Chi2oNDFVsEta
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:681
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:705
void undoSoftReset(DQMStore *dqmStore_)
int numberOfHits(HitCategory category) const
Definition: HitPattern.h:718
MonitorElement * NumberOfLayersPerTrackVsPhi
MonitorElement * LongDCASig
edm::EDGetTokenT< reco::VertexCollection > pvToken_
Definition: TrackAnalyzer.h:62
Definition: DDAxes.h:10
MonitorElement * Chi2oNDFVsPhi