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 
15 
20 #include <string>
21 #include "TMath.h"
22 
24  : conf_( iConfig )
25  , doTrackerSpecific_ ( conf_.getParameter<bool>("doTrackerSpecific") )
26  , doAllPlots_ ( conf_.getParameter<bool>("doAllPlots") )
27  , doBSPlots_ ( conf_.getParameter<bool>("doBeamSpotPlots") )
28  , doPVPlots_ ( conf_.getParameter<bool>("doPrimaryVertexPlots") )
29  , doDCAPlots_ ( conf_.getParameter<bool>("doDCAPlots") )
30  , doGeneralPropertiesPlots_ ( conf_.getParameter<bool>("doGeneralPropertiesPlots") )
31  , doMeasurementStatePlots_ ( conf_.getParameter<bool>("doMeasurementStatePlots") )
32  , doHitPropertiesPlots_ ( conf_.getParameter<bool>("doHitPropertiesPlots") )
33  , doRecHitVsPhiVsEtaPerTrack_ ( conf_.getParameter<bool>("doRecHitVsPhiVsEtaPerTrack") )
34  , doLayersVsPhiVsEtaPerTrack_ ( conf_.getParameter<bool>("doLayersVsPhiVsEtaPerTrack") )
35  , doRecHitsPerTrackProfile_ ( conf_.getParameter<bool>("doRecHitsPerTrackProfile") )
36  , doThetaPlots_ ( conf_.getParameter<bool>("doThetaPlots") )
37  , doTrackPxPyPlots_ ( conf_.getParameter<bool>("doTrackPxPyPlots") )
38  , doDCAwrtPVPlots_ ( conf_.getParameter<bool>("doDCAwrtPVPlots") )
39  , doDCAwrt000Plots_ ( conf_.getParameter<bool>("doDCAwrt000Plots") )
40  , doLumiAnalysis_ ( conf_.getParameter<bool>("doLumiAnalysis") )
41  , doTestPlots_ ( conf_.getParameter<bool>("doTestPlots") )
42  , doHIPlots_ ( conf_.getParameter<bool>("doHIPlots") )
43  , doSIPPlots_ ( conf_.getParameter<bool>("doSIPPlots") )
44  , doEffFromHitPattern_ ( conf_.getParameter<bool>("doEffFromHitPattern") )
45  , pvNDOF_ ( conf_.getParameter<int> ("pvNDOF") )
46  , qualityString_ ( conf_.getParameter<std::string>("qualityString"))
47  , good_vertices_(0)
48 {
49  initHistos();
50  TopFolder_ = conf_.getParameter<std::string>("FolderName");
51 }
52 
54  : TrackAnalyzer(iConfig)
55 {
56  edm::InputTag bsSrc = conf_.getParameter<edm::InputTag>("beamSpot");
57  edm::InputTag primaryVertexInputTag = conf_.getParameter<edm::InputTag>("primaryVertex");
59  pvToken_ = iC.consumes<reco::VertexCollection>(primaryVertexInputTag);
60 }
61 
63 {
64  Chi2 = nullptr;
65  Chi2Prob = nullptr;
66  Chi2ProbVsPhi = nullptr;
67  Chi2ProbVsEta = nullptr;
68  Chi2oNDF = nullptr;
69  Chi2oNDFVsEta = nullptr;
70  Chi2oNDFVsPhi = nullptr;
71  Chi2oNDFVsTheta = nullptr;
72  Chi2oNDFVsTheta = nullptr;
73  Chi2oNDFVsPhi = nullptr;
74  Chi2oNDFVsEta = nullptr;
75 
76  NumberOfRecHitsPerTrack = nullptr;
79 
83 
85 
88 
89 
90  DistanceOfClosestApproach = nullptr;
96  xPointOfClosestApproach = nullptr;
99  yPointOfClosestApproach = nullptr;
102  zPointOfClosestApproach = nullptr;
104  algorithm = nullptr;
105  oriAlgo = nullptr;
106  // TESTING
109 
110 // by Mia in order to deal w/ LS transitions
111  Chi2oNDF_lumiFlag = nullptr;
113 
115  //special Plots for HI DQM //SHOULD I ADD THE BOOL HERE??
117  LongDCASig = nullptr;
118  TransDCASig = nullptr;
119  dNdPhi_HighPurity = nullptr;
120  dNdEta_HighPurity = nullptr;
121  dNdPt_HighPurity = nullptr;
122  NhitVsEta_HighPurity = nullptr;
123  NhitVsPhi_HighPurity = nullptr;
124 
125  // IP significance
126  sipDxyToBS = nullptr;
127  sipDzToBS = nullptr;
128  sip3dToPV = nullptr;
129  sip2dToPV = nullptr;
130  sipDxyToPV = nullptr;
131  sipDzToPV = nullptr;
132 
133 }
134 
136 {
137 }
138 
140 {
141 
143  bookHistosForBeamSpot(ibooker);
145  bookHistosForEfficiencyFromHitPatter(ibooker, iSetup);
146 
147  // book tracker specific related histograms
148  // ---------------------------------------------------------------------------------//
150 
151  // book state related histograms
152  // ---------------------------------------------------------------------------------//
154 
155  std::string StateName = conf_.getParameter<std::string>("MeasurementState");
156 
157  if (StateName == "All") {
158  bookHistosForState("OuterSurface", ibooker);
159  bookHistosForState("InnerSurface", ibooker);
160  bookHistosForState("ImpactPoint" , ibooker);
161  } else if (
162  StateName != "OuterSurface" &&
163  StateName != "InnerSurface" &&
164  StateName != "ImpactPoint" &&
165  StateName != "default"
166  ) {
167  bookHistosForState("default", ibooker);
168 
169  } else {
170  bookHistosForState(StateName, ibooker);
171  }
172 
173  }
174 }
175 
177  const edm::EventSetup & iSetup)
178 {
180  ibooker.setCurrentFolder(TopFolder_ + "/HitEffFromHitPattern");
181 
182  edm::ESHandle<TrackerGeometry> trackerGeometry;
183  iSetup.get<TrackerDigiGeometryRecord>().get(trackerGeometry);
184 
185  // Values are not ordered randomly, but the order is taken from
186  // http://cmslxr.fnal.gov/dxr/CMSSW/source/Geometry/CommonDetUnit/interface/GeomDetEnumerators.h#15
187  const char * dets[] = { "None", "PXB", "PXF", "TIB", "TID", "TOB", "TEC"};
188 
189  // Also in this case, ordering is not random but extracted from
190  // http://cmslxr.fnal.gov/dxr/CMSSW/source/DataFormats/TrackReco/interface/HitPattern.h
191  // The category "total" is an addition to ease the computation of
192  // the efficiencies and is not part of the original HitPattern.
193  const char * hit_category[] = { "valid", "missing", "inactive", "bad", "total"};
194 
195  // We set sub_det to be a 1-based index since to it is the sub-sub-structure in the HitPattern
196  char title[50];
197  for (unsigned int det = 1; det < sizeof(dets)/sizeof(char*); ++det ) {
198  for (unsigned int sub_det = 1;
199  sub_det <= trackerGeometry->numberOfLayers(det); ++sub_det) {
200  for (unsigned int cat = 0;
201  cat < sizeof(hit_category)/sizeof(char *); ++cat) {
202  memset(title, 0, sizeof(title));
203  snprintf(title, sizeof(title), "Hits_%s_%s_Subdet%d", hit_category[cat], dets[det], sub_det);
204  switch(cat) {
205  case 0:
206  hits_valid_.insert(std::make_pair(
207  Key(det, sub_det),
208  ibooker.book1D(title, title, 50, 0.5, 50.5)));
209  break;
210  case 1:
211  hits_missing_.insert(std::make_pair(
212  Key(det, sub_det),
213  ibooker.book1D(title, title, 50, 0.5, 50.5)));
214  break;
215  case 2:
216  hits_inactive_.insert(std::make_pair(
217  Key(det, sub_det),
218  ibooker.book1D(title, title, 50, 0.5, 50.5)));
219  break;
220  case 3:
221  hits_bad_.insert(std::make_pair(
222  Key(det, sub_det),
223  ibooker.book1D(title, title, 50, 0.5, 50.5)));
224  break;
225  case 4:
226  hits_total_.insert(std::make_pair(
227  Key(det, sub_det),
228  ibooker.book1D(title, title, 50, 0.5, 50.5)));
229  break;
230  default:
231  LogDebug("TrackAnalyzer") << "Invalid hit category used " << cat << " ignored\n";
232  }
233  }
234  }
235  }
236  }
237 }
238 
240 
241  // parameters from the configuration
242  std::string QualName = conf_.getParameter<std::string>("Quality");
244  std::string MEBSFolderName = conf_.getParameter<std::string>("BSFolderName");
245 
246  // use the AlgoName and Quality Name
247  std::string CategoryName = QualName != "" ? AlgoName + "_" + QualName : AlgoName;
248 
249  // get binning from the configuration
250  int TKHitBin = conf_.getParameter<int>( "RecHitBin");
251  double TKHitMin = conf_.getParameter<double>("RecHitMin");
252  double TKHitMax = conf_.getParameter<double>("RecHitMax");
253 
254  int TKLostBin = conf_.getParameter<int>( "RecLostBin");
255  double TKLostMin = conf_.getParameter<double>("RecLostMin");
256  double TKLostMax = conf_.getParameter<double>("RecLostMax");
257 
258  int TKLayBin = conf_.getParameter<int>( "RecLayBin");
259  double TKLayMin = conf_.getParameter<double>("RecLayMin");
260  double TKLayMax = conf_.getParameter<double>("RecLayMax");
261 
262  int PhiBin = conf_.getParameter<int>( "PhiBin");
263  double PhiMin = conf_.getParameter<double>("PhiMin");
264  double PhiMax = conf_.getParameter<double>("PhiMax");
265 
266  int EtaBin = conf_.getParameter<int>( "EtaBin");
267  double EtaMin = conf_.getParameter<double>("EtaMin");
268  double EtaMax = conf_.getParameter<double>("EtaMax");
269 
270  int VXBin = conf_.getParameter<int>( "VXBin");
271  double VXMin = conf_.getParameter<double>("VXMin");
272  double VXMax = conf_.getParameter<double>("VXMax");
273 
274  int VYBin = conf_.getParameter<int>( "VYBin");
275  double VYMin = conf_.getParameter<double>("VYMin");
276  double VYMax = conf_.getParameter<double>("VYMax");
277 
278  int VZBin = conf_.getParameter<int>( "VZBin");
279  double VZMin = conf_.getParameter<double>("VZMin");
280  double VZMax = conf_.getParameter<double>("VZMax");
281 
282  ibooker.setCurrentFolder(TopFolder_);
283 
284  // book the Hit Property histograms
285  // ---------------------------------------------------------------------------------//
286 
287  TkParameterMEs tkmes;
289 
290  ibooker.setCurrentFolder(TopFolder_+"/HitProperties");
291 
292  histname = "NumberOfRecHitsPerTrack_";
293  NumberOfRecHitsPerTrack = ibooker.book1D(histname+CategoryName, histname+CategoryName, TKHitBin, TKHitMin, TKHitMax);
294  NumberOfRecHitsPerTrack->setAxisTitle("Number of all RecHits of each Track");
295  NumberOfRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
296 
297  histname = "NumberOfValidRecHitsPerTrack_";
298  NumberOfValidRecHitsPerTrack = ibooker.book1D(histname+CategoryName, histname+CategoryName, TKHitBin, TKHitMin, TKHitMax);
299  NumberOfValidRecHitsPerTrack->setAxisTitle("Number of valid RecHits for each Track");
300  NumberOfValidRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
301 
302  histname = "NumberOfLostRecHitsPerTrack_";
303  NumberOfLostRecHitsPerTrack = ibooker.book1D(histname+CategoryName, histname+CategoryName, TKLostBin, TKLostMin, TKLostMax);
304  NumberOfLostRecHitsPerTrack->setAxisTitle("Number of lost RecHits for each Track");
305  NumberOfLostRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
306 
307  histname = "NumberOfMissingInnerRecHitsPerTrack_";
308  NumberOfMIRecHitsPerTrack = ibooker.book1D(histname+CategoryName, histname+CategoryName, 10, -0.5, 9.5);
309  NumberOfMIRecHitsPerTrack->setAxisTitle("Number of missing-inner RecHits for each Track");
310  NumberOfMIRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
311 
312  histname = "NumberOfMissingOuterRecHitsPerTrack_";
313  NumberOfMORecHitsPerTrack = ibooker.book1D(histname+CategoryName, histname+CategoryName, 10, -0.5, 9.5);
314  NumberOfMORecHitsPerTrack->setAxisTitle("Number of missing-outer RecHits for each Track");
315  NumberOfMORecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
316 
317  histname = "ValidFractionPerTrack_";
318  ValidFractionPerTrack = ibooker.book1D(histname+CategoryName, histname+CategoryName, 101, 0., 1.01);
319  ValidFractionPerTrack->setAxisTitle("ValidFraction of RecHits for each Track");
320  ValidFractionPerTrack->setAxisTitle("Number of Tracks", 2);
321 
322 
323 
325 
326  histname = "NumberOfValidRecHitVsPhiVsEtaPerTrack_";
327  NumberOfValidRecHitVsPhiVsEtaPerTrack = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
328  EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax, 0, 40., "");
331 
332  histname = "NumberOfLostRecHitVsPhiVsEtaPerTrack_";
333  NumberOfLostRecHitVsPhiVsEtaPerTrack = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
334  EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax, 0, 5., "");
337 
338 
339  histname = "NumberMIRecHitVsPhiVsEtaPerTrack_";
340  NumberOfMIRecHitVsPhiVsEtaPerTrack = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
341  EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax, 0, 15., "");
344 
345  histname = "NumberMORecHitVsPhiVsEtaPerTrack_";
346  NumberOfMORecHitVsPhiVsEtaPerTrack = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
347  EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax, 0, 15., "");
350 
351  histname = "ValidFractionVsPhiVsEtaPerTrack_";
352  ValidFractionVsPhiVsEtaPerTrack = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
353  EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax, 0, 2., "");
356 
357 
358  }
359 
360  std::string layerTypeName[4] = {"","Off","3D","Missing"};
361  for (int i=0; i<4; ++i) {
362  histname = "NumberOf"+ layerTypeName[i] + "LayersPerTrack_";
363  NumberOfLayersPerTrack[i] = ibooker.book1D(histname+CategoryName, histname+CategoryName, TKLayBin, TKLayMin, TKLayMax);
364  NumberOfLayersPerTrack[i]->setAxisTitle("Number of " + layerTypeName[i] + " Layers of each Track", 1);
365  NumberOfLayersPerTrack[i]->setAxisTitle("Number of Tracks", 2);
366  }
368  for (int i=0; i<4; ++i) {
369  histname = "NumberOf"+ layerTypeName[i] + "LayersVsPhiVsEtaPerTrack_";
370  NumberOfLayersVsPhiVsEtaPerTrack[i] = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
371  EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax, 0, 40., "");
372  NumberOfLayersVsPhiVsEtaPerTrack[i]->setAxisTitle("Track #eta ", 1);
373  NumberOfLayersVsPhiVsEtaPerTrack[i]->setAxisTitle("Track #phi ", 2);
374  }
375  }
376 
377  // book the General Property histograms
378  // ---------------------------------------------------------------------------------//
379 
381 
382  int Chi2Bin = conf_.getParameter<int>( "Chi2Bin");
383  double Chi2Min = conf_.getParameter<double>("Chi2Min");
384  double Chi2Max = conf_.getParameter<double>("Chi2Max");
385 
386  int Chi2NDFBin = conf_.getParameter<int>( "Chi2NDFBin");
387  double Chi2NDFMin = conf_.getParameter<double>("Chi2NDFMin");
388  double Chi2NDFMax = conf_.getParameter<double>("Chi2NDFMax");
389 
390  int Chi2ProbBin = conf_.getParameter<int>( "Chi2ProbBin");
391  double Chi2ProbMin = conf_.getParameter<double>("Chi2ProbMin");
392  double Chi2ProbMax = conf_.getParameter<double>("Chi2ProbMax");
393 
394 
395  //HI PLOTS////
396  int TransDCABins = conf_.getParameter<int>("TransDCABins");
397  double TransDCAMin = conf_.getParameter<double>("TransDCAMin");
398  double TransDCAMax = conf_.getParameter<double>("TransDCAMax");
399 
400  int LongDCABins = conf_.getParameter<int>("LongDCABins");
401  double LongDCAMin = conf_.getParameter<double>("LongDCAMin");
402  double LongDCAMax = conf_.getParameter<double>("LongDCAMax");
404 
405 
406  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
407 
408  histname = "Chi2_";
409  Chi2 = ibooker.book1D(histname+CategoryName, histname+CategoryName, Chi2Bin, Chi2Min, Chi2Max);
410  Chi2->setAxisTitle("Track #chi^{2}" ,1);
411  Chi2->setAxisTitle("Number of Tracks",2);
412 
413  histname = "Chi2Prob_";
414  Chi2Prob = ibooker.book1D(histname+CategoryName, histname+CategoryName, Chi2ProbBin, Chi2ProbMin, Chi2ProbMax);
415  Chi2Prob->setAxisTitle("Track #chi^{2} probability",1);
416  Chi2Prob->setAxisTitle("Number of Tracks" ,2);
417 
418  histname = "Chi2oNDF_";
419  Chi2oNDF = ibooker.book1D(histname+CategoryName, histname+CategoryName, Chi2NDFBin, Chi2NDFMin, Chi2NDFMax);
420  Chi2oNDF->setAxisTitle("Track #chi^{2}/ndf",1);
421  Chi2oNDF->setAxisTitle("Number of Tracks" ,2);
422 
423 
425  //HI PLOTS///
427  if (doHIPlots_)
428  {
429  histname = "LongDCASig_";
430  LongDCASig = ibooker.book1D(histname+CategoryName, histname+CategoryName,LongDCABins,LongDCAMin,LongDCAMax);
431  LongDCASig->setAxisTitle("dz/#sigma_{dz}",1);
432 
433  histname = "TransDCASig_";
434  TransDCASig = ibooker.book1D(histname+CategoryName,histname+CategoryName,TransDCABins,TransDCAMin,TransDCAMax);
435  TransDCASig->setAxisTitle("dxy/#sigma_{dxy}",1);
436 
437  histname = "dNdPhi_HighPurity_";
438  dNdPhi_HighPurity = ibooker.book1D(histname+CategoryName,histname+CategoryName,PhiBin,PhiMin,PhiMax);
439  dNdPhi_HighPurity->setAxisTitle("#phi",1);
440 
441  histname = "dNdEta_HighPurity_";
442  dNdEta_HighPurity = ibooker.book1D(histname+CategoryName,histname+CategoryName,EtaBin,EtaMin,EtaMax);
443  dNdEta_HighPurity->setAxisTitle("#eta",1);
444 
445  histname = "dNdPt_HighPurity_";
446  dNdPt_HighPurity = ibooker.book1D(histname+CategoryName,histname+CategoryName,150,0,0.3);
447  dNdPt_HighPurity->setAxisTitle("#sigma_{p_{T}}/p_{T}",1);
448 
449  histname = "NhitVsEta_HighPurity_";
450  NhitVsEta_HighPurity = ibooker.bookProfile(histname+CategoryName,histname+CategoryName,EtaBin,EtaMin,EtaMax,-0.5,39.5,"");
451  NhitVsEta_HighPurity->setAxisTitle("Track #eta",1);
452  NhitVsEta_HighPurity->setAxisTitle("Number of Valid RecHits in each Track",2);
453 
454  histname = "NhitVsPhi_HighPurity_";
455  NhitVsPhi_HighPurity = ibooker.bookProfile(histname+CategoryName,histname+CategoryName,PhiBin,PhiMin,PhiMax,-0.5,39.5,"");
456  NhitVsPhi_HighPurity->setAxisTitle("Track #phi",1);
457  NhitVsPhi_HighPurity->setAxisTitle("Number of Valid RecHits in each Track",2);
458 
459  histname = "Ptdist_HighPurity_";
460  Ptdist_HighPurity = ibooker.book1D(histname+CategoryName,histname+CategoryName,150,0,50.);
461  Ptdist_HighPurity->setAxisTitle("p_{T} (GeV/c)",1);
462  Ptdist_HighPurity->setAxisTitle("Number of Tracks",2);
463 
464  histname = "dNhitdPt_HighPurity_";
465  dNhitdPt_HighPurity = ibooker.bookProfile(histname+CategoryName,histname+CategoryName,150,0,25.,-0.5,39.5,"");
466  dNhitdPt_HighPurity->setAxisTitle("p_{T} (GeV/c)",1);
467  dNhitdPt_HighPurity->setAxisTitle("N_{hit}",2);
468 
469  }
470 
471 
472 
474  histname = "xPointOfClosestApproach_";
475  xPointOfClosestApproach = ibooker.book1D(histname+CategoryName, histname+CategoryName, VXBin, VXMin, VXMax);
476  xPointOfClosestApproach->setAxisTitle("x component of Track PCA to beam line (cm)",1);
477  xPointOfClosestApproach->setAxisTitle("Number of Tracks",2);
478 
479  histname = "yPointOfClosestApproach_";
480  yPointOfClosestApproach = ibooker.book1D(histname+CategoryName, histname+CategoryName, VYBin, VYMin, VYMax);
481  yPointOfClosestApproach->setAxisTitle("y component of Track PCA to beam line (cm)",1);
482  yPointOfClosestApproach->setAxisTitle("Number of Tracks",2);
483 
484  histname = "zPointOfClosestApproach_";
485  zPointOfClosestApproach = ibooker.book1D(histname+CategoryName, histname+CategoryName, VZBin, VZMin, VZMax);
486  zPointOfClosestApproach->setAxisTitle("z component of Track PCA to beam line (cm)",1);
487  zPointOfClosestApproach->setAxisTitle("Number of Tracks",2);
488 
489  histname = "xPointOfClosestApproachToPV_";
490  xPointOfClosestApproachToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, VXBin, VXMin, VXMax);
491  xPointOfClosestApproachToPV->setAxisTitle("x component of Track PCA to pv (cm)",1);
492  xPointOfClosestApproachToPV->setAxisTitle("Number of Tracks",2);
493 
494  histname = "yPointOfClosestApproachToPV_";
495  yPointOfClosestApproachToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, VYBin, VYMin, VYMax);
496  yPointOfClosestApproachToPV->setAxisTitle("y component of Track PCA to pv line (cm)",1);
497  yPointOfClosestApproachToPV->setAxisTitle("Number of Tracks",2);
498 
499  histname = "zPointOfClosestApproachToPV_";
500  zPointOfClosestApproachToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, VZBin, VZMin, VZMax);
501  zPointOfClosestApproachToPV->setAxisTitle("z component of Track PCA to pv line (cm)",1);
502  zPointOfClosestApproachToPV->setAxisTitle("Number of Tracks",2);
503  }
504 
505  // See DataFormats/TrackReco/interface/TrackBase.h for track algorithm enum definition
506  // http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/DataFormats/TrackReco/interface/TrackBase.h?view=log
507  histname = "algorithm_";
508  algorithm = ibooker.book1D(histname+CategoryName, histname+CategoryName, reco::TrackBase::algoSize, 0., double(reco::TrackBase::algoSize));
509  algorithm->setAxisTitle("Tracking algorithm",1);
510  algorithm->setAxisTitle("Number of Tracks",2);
511  histname = "originalAlgorithm_";
512  oriAlgo = ibooker.book1D(histname+CategoryName, histname+CategoryName, reco::TrackBase::algoSize, 0., double(reco::TrackBase::algoSize));
513  oriAlgo->setAxisTitle("Tracking algorithm",1);
514  oriAlgo->setAxisTitle("Number of Tracks",2);
515 
516  for (size_t ibin=0; ibin<reco::TrackBase::algoSize-1; ibin++) {
519  }
520  }
521 
522 }
523 
525 
526  // parameters from the configuration
527  std::string QualName = conf_.getParameter<std::string>("Quality");
529 
530  // use the AlgoName and Quality Name
531  std::string CategoryName = QualName != "" ? AlgoName + "_" + QualName : AlgoName;
532 
533 
534  // book LS analysis related histograms
535  // -----------------------------------
536  if ( doLumiAnalysis_ ) {
537 
538  // get binning from the configuration
539  int TKHitBin = conf_.getParameter<int>( "RecHitBin");
540  double TKHitMin = conf_.getParameter<double>("RecHitMin");
541  double TKHitMax = conf_.getParameter<double>("RecHitMax");
542 
543  int Chi2NDFBin = conf_.getParameter<int>( "Chi2NDFBin");
544  double Chi2NDFMin = conf_.getParameter<double>("Chi2NDFMin");
545  double Chi2NDFMax = conf_.getParameter<double>("Chi2NDFMax");
546 
547  // add by Mia in order to deal w/ LS transitions
548  ibooker.setCurrentFolder(TopFolder_+"/LSanalysis");
549 
550  histname = "NumberOfRecHitsPerTrack_lumiFlag_";
551  NumberOfRecHitsPerTrack_lumiFlag = ibooker.book1D(histname+CategoryName, histname+CategoryName, TKHitBin, TKHitMin, TKHitMax);
552  NumberOfRecHitsPerTrack_lumiFlag->setAxisTitle("Number of all RecHits of each Track");
553  NumberOfRecHitsPerTrack_lumiFlag->setAxisTitle("Number of Tracks", 2);
554 
555  histname = "Chi2oNDF_lumiFlag_";
556  Chi2oNDF_lumiFlag = ibooker.book1D(histname+CategoryName, histname+CategoryName, Chi2NDFBin, Chi2NDFMin, Chi2NDFMax);
557  Chi2oNDF_lumiFlag->setAxisTitle("Track #chi^{2}/ndf",1);
558  Chi2oNDF_lumiFlag->setAxisTitle("Number of Tracks" ,2);
559 
560  }
561 }
562 
564 
565  // parameters from the configuration
566  std::string QualName = conf_.getParameter<std::string>("Quality");
568 
569  // use the AlgoName and Quality Name
570  std::string CategoryName = QualName != "" ? AlgoName + "_" + QualName : AlgoName;
571 
572  // book the Beam Spot related histograms
573  // ---------------------------------------------------------------------------------//
574 
576 
577  int DxyBin = conf_.getParameter<int>( "DxyBin");
578  double DxyMin = conf_.getParameter<double>("DxyMin");
579  double DxyMax = conf_.getParameter<double>("DxyMax");
580 
581  int PhiBin = conf_.getParameter<int>( "PhiBin");
582  double PhiMin = conf_.getParameter<double>("PhiMin");
583  double PhiMax = conf_.getParameter<double>("PhiMax");
584 
585  int X0Bin = conf_.getParameter<int>( "X0Bin");
586  double X0Min = conf_.getParameter<double>("X0Min");
587  double X0Max = conf_.getParameter<double>("X0Max");
588 
589  int Y0Bin = conf_.getParameter<int>( "Y0Bin");
590  double Y0Min = conf_.getParameter<double>("Y0Min");
591  double Y0Max = conf_.getParameter<double>("Y0Max");
592 
593  int Z0Bin = conf_.getParameter<int>( "Z0Bin");
594  double Z0Min = conf_.getParameter<double>("Z0Min");
595  double Z0Max = conf_.getParameter<double>("Z0Max");
596 
597  int VZBinProf = conf_.getParameter<int>( "VZBinProf");
598  double VZMinProf = conf_.getParameter<double>("VZMinProf");
599  double VZMaxProf = conf_.getParameter<double>("VZMaxProf");
600 
601 
602  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
603 
604  histname = "DistanceOfClosestApproachToBS_";
605  DistanceOfClosestApproachToBS = ibooker.book1D(histname+CategoryName,histname+CategoryName,DxyBin,DxyMin,DxyMax);
606  DistanceOfClosestApproachToBS->setAxisTitle("Track d_{xy} wrt beam spot (cm)",1);
607  DistanceOfClosestApproachToBS->setAxisTitle("Number of Tracks",2);
608 
609  histname = "DistanceOfClosestApproachToBSVsPhi_";
610  DistanceOfClosestApproachToBSVsPhi = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, PhiBin, PhiMin, PhiMax, DxyBin, DxyMin, DxyMax,"");
611  DistanceOfClosestApproachToBSVsPhi->getTH1()->SetCanExtend(TH1::kAllAxes);
613  DistanceOfClosestApproachToBSVsPhi->setAxisTitle("Track d_{xy} wrt beam spot (cm)",2);
614 
615  histname = "xPointOfClosestApproachVsZ0wrt000_";
616  xPointOfClosestApproachVsZ0wrt000 = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, X0Bin, X0Min, X0Max,"");
618  xPointOfClosestApproachVsZ0wrt000->setAxisTitle("x component of Track PCA to beam line (cm)",2);
619 
620  histname = "yPointOfClosestApproachVsZ0wrt000_";
621  yPointOfClosestApproachVsZ0wrt000 = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, Y0Bin, Y0Min, Y0Max,"");
623  yPointOfClosestApproachVsZ0wrt000->setAxisTitle("y component of Track PCA to beam line (cm)",2);
624 
625  histname = "xPointOfClosestApproachVsZ0wrtBS_";
626  xPointOfClosestApproachVsZ0wrtBS = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, X0Bin, X0Min, X0Max,"");
627  xPointOfClosestApproachVsZ0wrtBS->setAxisTitle("d_{z} w.r.t. Beam Spot (cm)",1);
628  xPointOfClosestApproachVsZ0wrtBS->setAxisTitle("x component of Track PCA to BS (cm)",2);
629 
630  histname = "yPointOfClosestApproachVsZ0wrtBS_";
631  yPointOfClosestApproachVsZ0wrtBS = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, Y0Bin, Y0Min, Y0Max,"");
632  yPointOfClosestApproachVsZ0wrtBS->setAxisTitle("d_{z} w.r.t. Beam Spot (cm)",1);
633  yPointOfClosestApproachVsZ0wrtBS->setAxisTitle("y component of Track PCA to BS (cm)",2);
634 
635  histname = "zPointOfClosestApproachVsPhi_";
636  zPointOfClosestApproachVsPhi = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, PhiBin, PhiMin, PhiMax, VZBinProf, VZMinProf, VZMaxProf, "");
638  zPointOfClosestApproachVsPhi->setAxisTitle("y component of Track PCA to beam line (cm)",2);
639  }
640 
642 
643  int DxyBin = conf_.getParameter<int>( "DxyBin");
644  double DxyMin = conf_.getParameter<double>("DxyMin");
645  double DxyMax = conf_.getParameter<double>("DxyMax");
646 
647  int PhiBin = conf_.getParameter<int>( "PhiBin");
648  double PhiMin = conf_.getParameter<double>("PhiMin");
649  double PhiMax = conf_.getParameter<double>("PhiMax");
650 
651  int X0Bin = conf_.getParameter<int>( "X0Bin");
652  double X0Min = conf_.getParameter<double>("X0Min");
653  double X0Max = conf_.getParameter<double>("X0Max");
654 
655  int Y0Bin = conf_.getParameter<int>( "Y0Bin");
656  double Y0Min = conf_.getParameter<double>("Y0Min");
657  double Y0Max = conf_.getParameter<double>("Y0Max");
658 
659  int Z0Bin = conf_.getParameter<int>( "Z0Bin");
660  double Z0Min = conf_.getParameter<double>("Z0Min");
661  double Z0Max = conf_.getParameter<double>("Z0Max");
662 
663  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
664 
665  histname = "DistanceOfClosestApproachToPV_";
666  DistanceOfClosestApproachToPV = ibooker.book1D(histname+CategoryName,histname+CategoryName,DxyBin,DxyMin,DxyMax);
667  DistanceOfClosestApproachToPV->setAxisTitle("Track d_{xy} wrt beam spot (cm)",1);
668  DistanceOfClosestApproachToPV->setAxisTitle("Number of Tracks",2);
669 
670  histname = "DistanceOfClosestApproachToPVVsPhi_";
671  DistanceOfClosestApproachToPVVsPhi = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, PhiBin, PhiMin, PhiMax, DxyBin, DxyMin, DxyMax,"");
672  DistanceOfClosestApproachToPVVsPhi->getTH1()->SetCanExtend(TH1::kAllAxes);
674  DistanceOfClosestApproachToPVVsPhi->setAxisTitle("Track d_{xy} wrt beam spot (cm)",2);
675 
676  histname = "xPointOfClosestApproachVsZ0wrtPV_";
677  xPointOfClosestApproachVsZ0wrtPV = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, X0Bin, X0Min, X0Max,"");
678  xPointOfClosestApproachVsZ0wrtPV->setAxisTitle("d_{z} w.r.t. Beam Spot (cm)",1);
679  xPointOfClosestApproachVsZ0wrtPV->setAxisTitle("x component of Track PCA to PV (cm)",2);
680 
681  histname = "yPointOfClosestApproachVsZ0wrtPV_";
682  yPointOfClosestApproachVsZ0wrtPV = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, Y0Bin, Y0Min, Y0Max,"");
683  yPointOfClosestApproachVsZ0wrtPV->setAxisTitle("d_{z} w.r.t. Beam Spot (cm)",1);
684  yPointOfClosestApproachVsZ0wrtPV->setAxisTitle("y component of Track PCA to PV (cm)",2);
685 
686  }
687 
688  if (doBSPlots_ || doAllPlots_) {
689  if (doTestPlots_) {
690 
691  int DxyBin = conf_.getParameter<int>( "DxyBin");
692  double DxyMin = conf_.getParameter<double>("DxyMin");
693  double DxyMax = conf_.getParameter<double>("DxyMax");
694 
695  int PhiBin = conf_.getParameter<int>( "PhiBin");
696  double PhiMin = conf_.getParameter<double>("PhiMin");
697  double PhiMax = conf_.getParameter<double>("PhiMax");
698 
699  histname = "TESTDistanceOfClosestApproachToBS_";
700  TESTDistanceOfClosestApproachToBS = ibooker.book1D(histname+CategoryName,histname+CategoryName,DxyBin,DxyMin,DxyMax);
701  TESTDistanceOfClosestApproachToBS->setAxisTitle("Track d_{xy} wrt beam spot (cm)",1);
702  TESTDistanceOfClosestApproachToBS->setAxisTitle("Number of Tracks",2);
703 
704  histname = "TESTDistanceOfClosestApproachToBSVsPhi_";
705  TESTDistanceOfClosestApproachToBSVsPhi = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, PhiBin, PhiMin, PhiMax, DxyBin, DxyMin, DxyMax,"");
706  TESTDistanceOfClosestApproachToBSVsPhi->getTH1()->SetCanExtend(TH1::kAllAxes);
708  TESTDistanceOfClosestApproachToBSVsPhi->setAxisTitle("Track d_{xy} wrt beam spot (cm)",2);
709 
710  }
711 
712  }
713 
714  // book the Profile plots for DCA related histograms
715  // ---------------------------------------------------------------------------------//
716  if(doDCAPlots_ || doAllPlots_) {
717 
718  if (doDCAwrt000Plots_) {
719 
720  int EtaBin = conf_.getParameter<int>( "EtaBin");
721  double EtaMin = conf_.getParameter<double>("EtaMin");
722  double EtaMax = conf_.getParameter<double>("EtaMax");
723 
724  int PhiBin = conf_.getParameter<int>( "PhiBin");
725  double PhiMin = conf_.getParameter<double>("PhiMin");
726  double PhiMax = conf_.getParameter<double>("PhiMax");
727 
728  int DxyBin = conf_.getParameter<int>( "DxyBin");
729  double DxyMin = conf_.getParameter<double>("DxyMin");
730  double DxyMax = conf_.getParameter<double>("DxyMax");
731 
732  if (doThetaPlots_) {
733  int ThetaBin = conf_.getParameter<int>( "ThetaBin");
734  double ThetaMin = conf_.getParameter<double>("ThetaMin");
735  double ThetaMax = conf_.getParameter<double>("ThetaMax");
736 
737  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
738  histname = "DistanceOfClosestApproachVsTheta_";
739  DistanceOfClosestApproachVsTheta = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, ThetaBin, ThetaMin, ThetaMax, DxyMin,DxyMax,"");
741  DistanceOfClosestApproachVsTheta->setAxisTitle("Track d_{xy} wrt (0,0,0) (cm)",2);
742  }
743 
744  histname = "DistanceOfClosestApproachVsEta_";
745  DistanceOfClosestApproachVsEta = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, EtaBin, EtaMin, EtaMax, DxyMin, DxyMax,"");
747  DistanceOfClosestApproachVsEta->setAxisTitle("Track d_{xy} wrt (0,0,0) (cm)",2);
748  // temporary patch in order to put back those MEs in Muon Workspace
749 
750  histname = "DistanceOfClosestApproach_";
751  DistanceOfClosestApproach = ibooker.book1D(histname+CategoryName,histname+CategoryName,DxyBin,DxyMin,DxyMax);
752  DistanceOfClosestApproach->setAxisTitle("Track d_{xy} wrt (0,0,0) (cm)",1);
753  DistanceOfClosestApproach->setAxisTitle("Number of Tracks",2);
754 
755  histname = "DistanceOfClosestApproachVsPhi_";
756  DistanceOfClosestApproachVsPhi = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, PhiBin, PhiMin, PhiMax, DxyMin,DxyMax,"");
757  DistanceOfClosestApproachVsPhi->getTH1()->SetCanExtend(TH1::kAllAxes);
759  DistanceOfClosestApproachVsPhi->setAxisTitle("Track d_{xy} wrt (0,0,0) (cm)",2);
760  }
761  }
762 
763 
764  if (doSIPPlots_ || doAllPlots_) {
765  const double sipBins = 200;
766  const double sipMin = -20;
767  const double sipMax = 20;
768 
769  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
770 
771  // SIP wrt. beamspot
772  histname = "SIPDxyToBS_";
773  sipDxyToBS = ibooker.book1D(histname+CategoryName, histname+CategoryName, sipBins, sipMin, sipMax);
774  sipDxyToBS->setAxisTitle("Track dxy significance wrt beam spot",1);
775  sipDxyToBS->setAxisTitle("Number of Tracks",2);
776 
777  histname = "SIPDzToBS_";
778  sipDzToBS = ibooker.book1D(histname+CategoryName, histname+CategoryName, sipBins, sipMin, sipMax);
779  sipDzToBS->setAxisTitle("Track dz significance wrt beam spot",1);
780  sipDzToBS->setAxisTitle("Number of Tracks",2);
781 
782  // SIP wrt. vertex
783  histname = "SIP3DToPV_";
784  sip3dToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, sipBins, sipMin, sipMax);
785  sip3dToPV->setAxisTitle("3D IP significance wrt primary vertex",1);
786  sip3dToPV->setAxisTitle("Number of Tracks",2);
787 
788  histname = "SIP2DToPV_";
789  sip2dToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, sipBins, sipMin, sipMax);
790  sip2dToPV->setAxisTitle("2D IP significance wrt primary vertex",1);
791  sip2dToPV->setAxisTitle("Number of Tracks",2);
792 
793  histname = "SIPDxyToPV_";
794  sipDxyToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, sipBins, sipMin, sipMax);
795  sipDxyToPV->setAxisTitle("Track dxy significance wrt primary vertex",1);
796  sipDxyToPV->setAxisTitle("Number of Tracks",2);
797 
798  histname = "SIPDzToPV_";
799  sipDzToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, sipBins, sipMin, sipMax);
800  sipDzToPV->setAxisTitle("Track dz significance wrt primary vertex",1);
801  sipDzToPV->setAxisTitle("Number of Tracks",2);
802  }
803 }
804 
805 // -- Analyse
806 // ---------------------------------------------------------------------------------//
808 
809  good_vertices_ = 0;
810 
811  edm::Handle<reco::VertexCollection> recoPrimaryVerticesHandle;
812  iEvent.getByToken(pvToken_, recoPrimaryVerticesHandle);
813  if (recoPrimaryVerticesHandle.isValid())
814  if (recoPrimaryVerticesHandle->size() > 0)
815  for (auto v : *recoPrimaryVerticesHandle)
816  if (v.ndof() >= pvNDOF_ && !v.isFake())
817  ++good_vertices_;
818 }
819 
820 void TrackAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup, const reco::Track& track)
821 {
822  double phi = track.phi();
823  // double eta = track.eta();
824  auto phiIn = track.innerPosition().phi();
825  auto etaIn = track.innerPosition().eta();
826  auto phiOut = track.outerPosition().phi();
827  auto etaOut = track.outerPosition().eta();
828 
829  int nRecHits = track.hitPattern().numberOfHits(reco::HitPattern::TRACK_HITS);
830  int nValidRecHits = track.numberOfValidHits();
831  int nLostRecHits = track.numberOfLostHits();
834 
835  double chi2 = track.chi2();
836  double chi2prob = TMath::Prob(track.chi2(),(int)track.ndof());
837  double chi2oNDF = track.normalizedChi2();
838 
840  // rec hits
841  NumberOfRecHitsPerTrack -> Fill(nRecHits);
842  NumberOfValidRecHitsPerTrack-> Fill(nValidRecHits);
843  NumberOfLostRecHitsPerTrack -> Fill(nLostRecHits);
844  NumberOfMIRecHitsPerTrack -> Fill(nLostIn);
845  NumberOfMORecHitsPerTrack -> Fill(nLostOut);
847 
848 
849  // 2D plots
851  NumberOfValidRecHitVsPhiVsEtaPerTrack->Fill(etaIn,phiIn,nValidRecHits);
852  NumberOfLostRecHitVsPhiVsEtaPerTrack->Fill(etaIn,phiIn,nLostRecHits);
853  NumberOfMIRecHitVsPhiVsEtaPerTrack->Fill(etaIn,phiIn,nLostIn);
854  NumberOfMORecHitVsPhiVsEtaPerTrack->Fill(etaOut,phiOut,nLostOut);
855  ValidFractionVsPhiVsEtaPerTrack -> Fill(etaIn,phiIn,track.validFraction());
856  }
857 
858  int nLayers[4] = { track.hitPattern().trackerLayersWithMeasurement(),
862  };
863 
864  // layers
865  for (int i=0;i<4;++i) NumberOfLayersPerTrack[i]->Fill(nLayers[i]);
866 
867  // 2D plots
869  for (int i=0;i<4;++i) NumberOfLayersVsPhiVsEtaPerTrack[i]->Fill(etaIn,phiIn,nLayers[i]);
870 
871  }
872 
874  if (track.pt() > 1.0 && track.dxy() < 0.1 and good_vertices_ > 0) {
875  auto hp = track.hitPattern();
876  // Here hit_category is meant to iterate over
877  // reco::HitPattern::HitCategory, defined here:
878  // http://cmslxr.fnal.gov/dxr/CMSSW/source/DataFormats/TrackReco/interface/HitPattern.h
879  for (unsigned int category = 0; category < 3; ++category) {
880  for (int hit = 0; hit < hp.numberOfHits((reco::HitPattern::HitCategory)(category)); ++hit) {
881  auto pattern = hp.getHitPattern((reco::HitPattern::HitCategory)(category), hit);
882  // Boolean bad is missing simply because it is inferred and the only missing case.
883  bool valid = hp.validHitFilter(pattern);
884  bool missing = hp.missingHitFilter(pattern);
885  bool inactive = hp.inactiveHitFilter(pattern);
886  int hit_type = -1;
887  hit_type = valid ? 0 :
888  ( missing ? 1 :
889  ( inactive ? 2 : 3));
890  if (hits_valid_.find(Key(hp.getSubStructure(pattern), hp.getSubSubStructure(pattern))) == hits_valid_.end()) {
891  LogDebug("TrackAnalyzer") << "Invalid combination of detector and subdetector: ("
892  << hp.getSubStructure(pattern) << ", "
893  << hp.getSubSubStructure(pattern)
894  << "): ignoring it.\n";
895  continue;
896  }
897  switch (hit_type) {
898  case 0:
899  hits_valid_[Key(hp.getSubStructure(pattern), hp.getSubSubStructure(pattern))]->Fill(good_vertices_);
900  hits_total_[Key(hp.getSubStructure(pattern), hp.getSubSubStructure(pattern))]->Fill(good_vertices_);
901  break;
902  case 1:
903  hits_missing_[Key(hp.getSubStructure(pattern), hp.getSubSubStructure(pattern))]->Fill(good_vertices_);
904  hits_total_[Key(hp.getSubStructure(pattern), hp.getSubSubStructure(pattern))]->Fill(good_vertices_);
905  break;
906  case 2:
907  hits_inactive_[Key(hp.getSubStructure(pattern), hp.getSubSubStructure(pattern))]->Fill(good_vertices_);
908  break;
909  case 3:
910  hits_bad_[Key(hp.getSubStructure(pattern), hp.getSubSubStructure(pattern))]->Fill(good_vertices_);
911  break;
912  default:
913  LogDebug("TrackAnalyzer") << "Invalid hit category used " << hit_type << " ignored\n";
914  }
915  }
916  }
917  }
918  }
919 
921  // fitting
922  Chi2 -> Fill(chi2);
923  Chi2Prob -> Fill(chi2prob);
924  Chi2oNDF -> Fill(chi2oNDF);
925 
926  // DCA
927  // temporary patch in order to put back those MEs in Muon Workspace
928  if (doDCAPlots_) {
929  if (doDCAwrt000Plots_) {
931  DistanceOfClosestApproachVsPhi->Fill(phi, track.dxy());
932  }
933 
934  // PCA
938  }
939 
940  // algorithm
941  algorithm->Fill(static_cast<double>(track.algo()));
942  oriAlgo->Fill(static_cast<double>(track.originalAlgo()));
943  }
944 
945  if ( doLumiAnalysis_ ) {
947  Chi2oNDF_lumiFlag -> Fill(chi2oNDF);
948  }
949 
951 
952  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
953  iEvent.getByToken(beamSpotToken_,recoBeamSpotHandle);
954  const reco::BeamSpot& bs = *recoBeamSpotHandle;
955 
957  DistanceOfClosestApproachToBSVsPhi -> Fill(track.phi(), track.dxy(bs.position()));
958  zPointOfClosestApproachVsPhi -> Fill(track.phi(), track.vz());
959  xPointOfClosestApproachVsZ0wrt000 -> Fill(track.dz(), track.vx());
960  yPointOfClosestApproachVsZ0wrt000 -> Fill(track.dz(), track.vy());
961  xPointOfClosestApproachVsZ0wrtBS -> Fill(track.dz(bs.position()),(track.vx()-bs.position(track.vz()).x()));
962  yPointOfClosestApproachVsZ0wrtBS -> Fill(track.dz(bs.position()),(track.vy()-bs.position(track.vz()).y()));
963  if (doTestPlots_) {
964  TESTDistanceOfClosestApproachToBS -> Fill(track.dxy(bs.position(track.vz())));
965  TESTDistanceOfClosestApproachToBSVsPhi -> Fill(track.phi(), track.dxy(bs.position(track.vz())));
966  }
967 
968  if(doSIPPlots_) {
969  sipDxyToBS->Fill(track.dxy(bs.position())/track.dxyError());
970  sipDzToBS->Fill(track.dz(bs.position())/track.dzError());
971  }
972  }
973 
975  edm::Handle<reco::VertexCollection> recoPrimaryVerticesHandle;
976  iEvent.getByToken(pvToken_,recoPrimaryVerticesHandle);
977  if (recoPrimaryVerticesHandle.isValid() && recoPrimaryVerticesHandle->size() > 0) {
978  const reco::Vertex& pv = (*recoPrimaryVerticesHandle)[0];
979 
980 
982  //HI PLOTS///////
984 
985  if(doHIPlots_)
986  {
987  double longDCAsig = 0, transDCAsig = 0;
988  double zerr2 = track.dzError()*track.dzError()+pv.zError()*pv.zError();
989  double xyerr2 = track.d0Error()*track.d0Error()+pv.xError()*pv.yError();
990  if(zerr2 > 0) longDCAsig = track.dz(pv.position())/zerr2;
991  if(xyerr2 > 0) transDCAsig = track.dxy(pv.position())/xyerr2;
992  LongDCASig->Fill(longDCAsig);
993  TransDCASig->Fill(transDCAsig);
994 
995 
996 
997 
999  {
1000  dNdEta_HighPurity->Fill(track.eta());
1001  dNdPhi_HighPurity->Fill(track.phi());
1002  dNdPt_HighPurity->Fill(track.ptError()/track.pt());
1003  NhitVsEta_HighPurity->Fill(track.eta(),track.numberOfValidHits());
1004  NhitVsPhi_HighPurity->Fill(track.phi(),track.numberOfValidHits());
1005  dNhitdPt_HighPurity->Fill(track.pt(),track.numberOfValidHits());
1006  Ptdist_HighPurity->Fill(track.pt());
1007  }//end of high quality tracks requirement
1008  }
1009 
1010 
1011  xPointOfClosestApproachToPV->Fill(track.vx()-pv.position().x());
1012  yPointOfClosestApproachToPV->Fill(track.vy()-pv.position().y());
1015  DistanceOfClosestApproachToPVVsPhi -> Fill(track.phi(), track.dxy(pv.position()));
1016  xPointOfClosestApproachVsZ0wrtPV -> Fill(track.dz(pv.position()),(track.vx()-pv.position().x()));
1017  yPointOfClosestApproachVsZ0wrtPV -> Fill(track.dz(pv.position()),(track.vy()-pv.position().y()));
1018 
1019 
1020  if(doSIPPlots_) {
1022  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",theB);
1023  reco::TransientTrack transTrack = theB->build(track);
1024 
1025  GlobalVector dir(track.px(), track.py(), track.pz());
1026  std::pair<bool, Measurement1D> ip3d = IPTools::signedImpactParameter3D(transTrack, dir, pv);
1027  std::pair<bool, Measurement1D> ip2d = IPTools::signedTransverseImpactParameter(transTrack, dir, pv);
1028  if(ip3d.first) sip3dToPV->Fill(ip3d.second.value() / ip3d.second.error());
1029  if(ip2d.first) sip2dToPV->Fill(ip2d.second.value() / ip2d.second.error());
1030  sipDxyToPV->Fill(track.dxy(pv.position())/track.dxyError());
1031  sipDzToPV->Fill(track.dz(pv.position())/track.dzError());
1032  }
1033  }
1034  }
1035 
1036  if(doDCAPlots_ || doAllPlots_) {
1037  if (doDCAwrt000Plots_) {
1038  if (doThetaPlots_) {
1039  DistanceOfClosestApproachVsTheta->Fill(track.theta(), track.d0());
1040  }
1041  DistanceOfClosestApproachVsEta->Fill(track.eta(), track.d0());
1042  }
1043 
1044  }
1045 
1046  //Tracker Specific Histograms
1049  }
1050 
1052  std::string StateName = conf_.getParameter<std::string>("MeasurementState");
1053 
1054  if (StateName == "All") {
1055  fillHistosForState(iSetup, track, std::string("OuterSurface"));
1056  fillHistosForState(iSetup, track, std::string("InnerSurface"));
1057  fillHistosForState(iSetup, track, std::string("ImpactPoint"));
1058  } else if (
1059  StateName != "OuterSurface" &&
1060  StateName != "InnerSurface" &&
1061  StateName != "ImpactPoint" &&
1062  StateName != "default"
1063  ) {
1064  fillHistosForState(iSetup, track, std::string("default"));
1065  } else {
1066  fillHistosForState(iSetup, track, StateName);
1067  }
1068  }
1069 
1070  if ( doAllPlots_ ) {
1071  }
1072 
1073 }
1074 
1075 // book histograms at differnt measurement points
1076 // ---------------------------------------------------------------------------------//
1078 {
1079 
1080  // parameters from the configuration
1081  std::string QualName = conf_.getParameter<std::string>("Quality");
1083 
1084  // use the AlgoName and Quality Name
1085  std::string CategoryName = QualName != "" ? AlgoName + "_" + QualName : AlgoName;
1086 
1087  // get binning from the configuration
1088  double Chi2NDFMin = conf_.getParameter<double>("Chi2NDFMin");
1089  double Chi2NDFMax = conf_.getParameter<double>("Chi2NDFMax");
1090 
1091  int RecHitBin = conf_.getParameter<int>( "RecHitBin");
1092  double RecHitMin = conf_.getParameter<double>("RecHitMin");
1093  double RecHitMax = conf_.getParameter<double>("RecHitMax");
1094 
1095  int RecLayBin = conf_.getParameter<int>( "RecHitBin");
1096  double RecLayMin = conf_.getParameter<double>("RecHitMin");
1097  double RecLayMax = conf_.getParameter<double>("RecHitMax");
1098 
1099 
1100  int PhiBin = conf_.getParameter<int>( "PhiBin");
1101  double PhiMin = conf_.getParameter<double>("PhiMin");
1102  double PhiMax = conf_.getParameter<double>("PhiMax");
1103 
1104  int EtaBin = conf_.getParameter<int>( "EtaBin");
1105  double EtaMin = conf_.getParameter<double>("EtaMin");
1106  double EtaMax = conf_.getParameter<double>("EtaMax");
1107 
1108  int ThetaBin = conf_.getParameter<int>( "ThetaBin");
1109  double ThetaMin = conf_.getParameter<double>("ThetaMin");
1110  double ThetaMax = conf_.getParameter<double>("ThetaMax");
1111 
1112  int TrackQBin = conf_.getParameter<int>( "TrackQBin");
1113  double TrackQMin = conf_.getParameter<double>("TrackQMin");
1114  double TrackQMax = conf_.getParameter<double>("TrackQMax");
1115 
1116  int TrackPtBin = conf_.getParameter<int>( "TrackPtBin");
1117  double TrackPtMin = conf_.getParameter<double>("TrackPtMin");
1118  double TrackPtMax = conf_.getParameter<double>("TrackPtMax");
1119 
1120  int TrackPBin = conf_.getParameter<int>( "TrackPBin");
1121  double TrackPMin = conf_.getParameter<double>("TrackPMin");
1122  double TrackPMax = conf_.getParameter<double>("TrackPMax");
1123 
1124  int TrackPxBin = conf_.getParameter<int>( "TrackPxBin");
1125  double TrackPxMin = conf_.getParameter<double>("TrackPxMin");
1126  double TrackPxMax = conf_.getParameter<double>("TrackPxMax");
1127 
1128  int TrackPyBin = conf_.getParameter<int>( "TrackPyBin");
1129  double TrackPyMin = conf_.getParameter<double>("TrackPyMin");
1130  double TrackPyMax = conf_.getParameter<double>("TrackPyMax");
1131 
1132  int TrackPzBin = conf_.getParameter<int>( "TrackPzBin");
1133  double TrackPzMin = conf_.getParameter<double>("TrackPzMin");
1134  double TrackPzMax = conf_.getParameter<double>("TrackPzMax");
1135 
1136  int ptErrBin = conf_.getParameter<int>( "ptErrBin");
1137  double ptErrMin = conf_.getParameter<double>("ptErrMin");
1138  double ptErrMax = conf_.getParameter<double>("ptErrMax");
1139 
1140  int pxErrBin = conf_.getParameter<int>( "pxErrBin");
1141  double pxErrMin = conf_.getParameter<double>("pxErrMin");
1142  double pxErrMax = conf_.getParameter<double>("pxErrMax");
1143 
1144  int pyErrBin = conf_.getParameter<int>( "pyErrBin");
1145  double pyErrMin = conf_.getParameter<double>("pyErrMin");
1146  double pyErrMax = conf_.getParameter<double>("pyErrMax");
1147 
1148  int pzErrBin = conf_.getParameter<int>( "pzErrBin");
1149  double pzErrMin = conf_.getParameter<double>("pzErrMin");
1150  double pzErrMax = conf_.getParameter<double>("pzErrMax");
1151 
1152  int pErrBin = conf_.getParameter<int>( "pErrBin");
1153  double pErrMin = conf_.getParameter<double>("pErrMin");
1154  double pErrMax = conf_.getParameter<double>("pErrMax");
1155 
1156  int phiErrBin = conf_.getParameter<int>( "phiErrBin");
1157  double phiErrMin = conf_.getParameter<double>("phiErrMin");
1158  double phiErrMax = conf_.getParameter<double>("phiErrMax");
1159 
1160  int etaErrBin = conf_.getParameter<int>( "etaErrBin");
1161  double etaErrMin = conf_.getParameter<double>("etaErrMin");
1162  double etaErrMax = conf_.getParameter<double>("etaErrMax");
1163 
1164 
1165  double Chi2ProbMin = conf_.getParameter<double>("Chi2ProbMin");
1166  double Chi2ProbMax = conf_.getParameter<double>("Chi2ProbMax");
1167 
1168  ibooker.setCurrentFolder(TopFolder_);
1169 
1170  TkParameterMEs tkmes;
1171 
1172  std::string histTag = (sname == "default") ? CategoryName : sname + "_" + CategoryName;
1173 
1174  if(doAllPlots_) {
1175 
1176  // general properties
1177  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
1178 
1179  if (doThetaPlots_) {
1180  histname = "Chi2oNDFVsTheta_" + histTag;
1181  tkmes.Chi2oNDFVsTheta = ibooker.bookProfile(histname, histname, ThetaBin, ThetaMin, ThetaMax, Chi2NDFMin, Chi2NDFMax,"");
1182  tkmes.Chi2oNDFVsTheta->setAxisTitle("Track #theta",1);
1183  tkmes.Chi2oNDFVsTheta->setAxisTitle("Track #chi^{2}/ndf",2);
1184  }
1185  histname = "Chi2oNDFVsPhi_" + histTag;
1186  tkmes.Chi2oNDFVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, Chi2NDFMin, Chi2NDFMax,"");
1187  tkmes.Chi2oNDFVsPhi->setAxisTitle("Track #phi",1);
1188  tkmes.Chi2oNDFVsPhi->setAxisTitle("Track #chi^{2}/ndf",2);
1189 
1190  histname = "Chi2oNDFVsEta_" + histTag;
1191  tkmes.Chi2oNDFVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, Chi2NDFMin, Chi2NDFMax,"");
1192  tkmes.Chi2oNDFVsEta->setAxisTitle("Track #eta",1);
1193  tkmes.Chi2oNDFVsEta->setAxisTitle("Track #chi^{2}/ndf",2);
1194 
1195  histname = "Chi2ProbVsPhi_" + histTag;
1196  tkmes.Chi2ProbVsPhi = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, PhiBin, PhiMin, PhiMax, Chi2ProbMin, Chi2ProbMax);
1197  tkmes.Chi2ProbVsPhi->setAxisTitle("Tracks #phi" ,1);
1198  tkmes.Chi2ProbVsPhi->setAxisTitle("Track #chi^{2} probability",2);
1199 
1200  histname = "Chi2ProbVsEta_" + histTag;
1201  tkmes.Chi2ProbVsEta = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, EtaBin, EtaMin, EtaMax, Chi2ProbMin, Chi2ProbMax);
1202  tkmes.Chi2ProbVsEta->setAxisTitle("Tracks #eta" ,1);
1203  tkmes.Chi2ProbVsEta->setAxisTitle("Track #chi^{2} probability",2);
1204 
1205  }
1206 
1207  // general properties
1208  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
1209 
1210  histname = "TrackP_" + histTag;
1211  tkmes.TrackP = ibooker.book1D(histname, histname, TrackPBin, TrackPMin, TrackPMax);
1212  tkmes.TrackP->setAxisTitle("Track |p| (GeV/c)", 1);
1213  tkmes.TrackP->setAxisTitle("Number of Tracks",2);
1214 
1215  histname = "TrackPt_" + histTag;
1216  tkmes.TrackPt = ibooker.book1D(histname, histname, TrackPtBin, TrackPtMin, TrackPtMax);
1217  tkmes.TrackPt->setAxisTitle("Track p_{T} (GeV/c)", 1);
1218  tkmes.TrackPt->setAxisTitle("Number of Tracks",2);
1219 
1220  if (doTrackPxPyPlots_) {
1221  histname = "TrackPx_" + histTag;
1222  tkmes.TrackPx = ibooker.book1D(histname, histname, TrackPxBin, TrackPxMin, TrackPxMax);
1223  tkmes.TrackPx->setAxisTitle("Track p_{x} (GeV/c)", 1);
1224  tkmes.TrackPx->setAxisTitle("Number of Tracks",2);
1225 
1226  histname = "TrackPy_" + histTag;
1227  tkmes.TrackPy = ibooker.book1D(histname, histname, TrackPyBin, TrackPyMin, TrackPyMax);
1228  tkmes.TrackPy->setAxisTitle("Track p_{y} (GeV/c)", 1);
1229  tkmes.TrackPy->setAxisTitle("Number of Tracks",2);
1230  }
1231  histname = "TrackPz_" + histTag;
1232  tkmes.TrackPz = ibooker.book1D(histname, histname, TrackPzBin, TrackPzMin, TrackPzMax);
1233  tkmes.TrackPz->setAxisTitle("Track p_{z} (GeV/c)", 1);
1234  tkmes.TrackPz->setAxisTitle("Number of Tracks",2);
1235 
1236  histname = "TrackPhi_" + histTag;
1237  tkmes.TrackPhi = ibooker.book1D(histname, histname, PhiBin, PhiMin, PhiMax);
1238  tkmes.TrackPhi->setAxisTitle("Track #phi", 1);
1239  tkmes.TrackPhi->setAxisTitle("Number of Tracks",2);
1240 
1241  histname = "TrackEta_" + histTag;
1242  tkmes.TrackEta = ibooker.book1D(histname, histname, EtaBin, EtaMin, EtaMax);
1243  tkmes.TrackEta->setAxisTitle("Track #eta", 1);
1244  tkmes.TrackEta->setAxisTitle("Number of Tracks",2);
1245 
1246  histname = "TrackEtaPhi_" + histTag;
1247  tkmes.TrackEtaPhi = ibooker.book2D(histname, histname, EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax);
1248  tkmes.TrackEtaPhi->setAxisTitle("Track #eta", 1);
1249  tkmes.TrackEtaPhi->setAxisTitle("Track #phi", 2);
1250 
1251  histname = "TrackEtaPhiInner_" + histTag;
1252  tkmes.TrackEtaPhiInner = ibooker.book2D(histname, histname, EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax);
1253  tkmes.TrackEtaPhiInner->setAxisTitle("Track #eta", 1);
1254  tkmes.TrackEtaPhiInner->setAxisTitle("Track #phi", 2);
1255 
1256  histname = "TrackEtaPhiOuter_" + histTag;
1257  tkmes.TrackEtaPhiOuter = ibooker.book2D(histname, histname, EtaBin, EtaMin, EtaMax, PhiBin, PhiMin, PhiMax);
1258  tkmes.TrackEtaPhiOuter->setAxisTitle("Track #eta", 1);
1259  tkmes.TrackEtaPhiOuter->setAxisTitle("Track #phi", 2);
1260 
1261 
1262 
1263  if (doThetaPlots_) {
1264  histname = "TrackTheta_" + histTag;
1265  tkmes.TrackTheta = ibooker.book1D(histname, histname, ThetaBin, ThetaMin, ThetaMax);
1266  tkmes.TrackTheta->setAxisTitle("Track #theta", 1);
1267  tkmes.TrackTheta->setAxisTitle("Number of Tracks",2);
1268  }
1269  histname = "TrackQ_" + histTag;
1270  tkmes.TrackQ = ibooker.book1D(histname, histname, TrackQBin, TrackQMin, TrackQMax);
1271  tkmes.TrackQ->setAxisTitle("Track Charge", 1);
1272  tkmes.TrackQ->setAxisTitle("Number of Tracks",2);
1273 
1274  histname = "TrackPErrOverP_" + histTag;
1275  tkmes.TrackPErr = ibooker.book1D(histname, histname, pErrBin, pErrMin, pErrMax);
1276  tkmes.TrackPErr->setAxisTitle("track error(p)/p", 1);
1277  tkmes.TrackPErr->setAxisTitle("Number of Tracks",2);
1278 
1279  histname = "TrackPtErrOverPt_" + histTag;
1280  tkmes.TrackPtErr = ibooker.book1D(histname, histname, ptErrBin, ptErrMin, ptErrMax);
1281  tkmes.TrackPtErr->setAxisTitle("track error(p_{T})/p_{T}", 1);
1282  tkmes.TrackPtErr->setAxisTitle("Number of Tracks",2);
1283 
1284  histname = "TrackPtErrOverPtVsEta_" + histTag;
1285  tkmes.TrackPtErrVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, ptErrMin, ptErrMax);
1286  tkmes.TrackPtErrVsEta->setAxisTitle("Track #eta",1);
1287  tkmes.TrackPtErrVsEta->setAxisTitle("track error(p_{T})/p_{T}", 2);
1288 
1289  if (doTrackPxPyPlots_) {
1290  histname = "TrackPxErrOverPx_" + histTag;
1291  tkmes.TrackPxErr = ibooker.book1D(histname, histname, pxErrBin, pxErrMin, pxErrMax);
1292  tkmes.TrackPxErr->setAxisTitle("track error(p_{x})/p_{x}", 1);
1293  tkmes.TrackPxErr->setAxisTitle("Number of Tracks",2);
1294 
1295  histname = "TrackPyErrOverPy_" + histTag;
1296  tkmes.TrackPyErr = ibooker.book1D(histname, histname, pyErrBin, pyErrMin, pyErrMax);
1297  tkmes.TrackPyErr->setAxisTitle("track error(p_{y})/p_{y}", 1);
1298  tkmes.TrackPyErr->setAxisTitle("Number of Tracks",2);
1299  }
1300  histname = "TrackPzErrOverPz_" + histTag;
1301  tkmes.TrackPzErr = ibooker.book1D(histname, histname, pzErrBin, pzErrMin, pzErrMax);
1302  tkmes.TrackPzErr->setAxisTitle("track error(p_{z})/p_{z}", 1);
1303  tkmes.TrackPzErr->setAxisTitle("Number of Tracks",2);
1304 
1305  histname = "TrackPhiErr_" + histTag;
1306  tkmes.TrackPhiErr = ibooker.book1D(histname, histname, phiErrBin, phiErrMin, phiErrMax);
1307  tkmes.TrackPhiErr->setAxisTitle("track error(#phi)");
1308  tkmes.TrackPhiErr->setAxisTitle("Number of Tracks",2);
1309 
1310  histname = "TrackEtaErr_" + histTag;
1311  tkmes.TrackEtaErr = ibooker.book1D(histname, histname, etaErrBin, etaErrMin, etaErrMax);
1312  tkmes.TrackEtaErr->setAxisTitle("track error(#eta)");
1313  tkmes.TrackEtaErr->setAxisTitle("Number of Tracks",2);
1314 
1315  // rec hit profiles
1316  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
1317  histname = "NumberOfRecHitsPerTrackVsPhi_" + histTag;
1318  tkmes.NumberOfRecHitsPerTrackVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, RecHitBin, RecHitMin, RecHitMax,"");
1319  tkmes.NumberOfRecHitsPerTrackVsPhi->setAxisTitle("Track #phi",1);
1320  tkmes.NumberOfRecHitsPerTrackVsPhi->setAxisTitle("Number of RecHits in each Track",2);
1321 
1322  if (doThetaPlots_) {
1323  histname = "NumberOfRecHitsPerTrackVsTheta_" + histTag;
1324  tkmes.NumberOfRecHitsPerTrackVsTheta = ibooker.bookProfile(histname, histname, ThetaBin, ThetaMin, ThetaMax, RecHitBin, RecHitMin, RecHitMax,"");
1325  tkmes.NumberOfRecHitsPerTrackVsTheta->setAxisTitle("Track #phi",1);
1326  tkmes.NumberOfRecHitsPerTrackVsTheta->setAxisTitle("Number of RecHits in each Track",2);
1327  }
1328  histname = "NumberOfRecHitsPerTrackVsEta_" + histTag;
1329  tkmes.NumberOfRecHitsPerTrackVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, RecHitBin, RecHitMin, RecHitMax,"");
1330  tkmes.NumberOfRecHitsPerTrackVsEta->setAxisTitle("Track #eta",1);
1331  tkmes.NumberOfRecHitsPerTrackVsEta->setAxisTitle("Number of RecHits in each Track",2);
1332 
1333  histname = "NumberOfValidRecHitsPerTrackVsPhi_" + histTag;
1334  tkmes.NumberOfValidRecHitsPerTrackVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, RecHitMin, RecHitMax,"");
1335  tkmes.NumberOfValidRecHitsPerTrackVsPhi->setAxisTitle("Track #phi",1);
1336  tkmes.NumberOfValidRecHitsPerTrackVsPhi->setAxisTitle("Number of valid RecHits in each Track",2);
1337 
1338  // std::cout << "[TrackAnalyzer::bookHistosForState] histTag: " << histTag << std::endl;
1339  histname = "NumberOfValidRecHitsPerTrackVsEta_" + histTag;
1340  tkmes.NumberOfValidRecHitsPerTrackVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, RecHitMin, RecHitMax,"");
1341  tkmes.NumberOfValidRecHitsPerTrackVsEta->setAxisTitle("Track #eta",1);
1342  tkmes.NumberOfValidRecHitsPerTrackVsEta->setAxisTitle("Number of valid RecHits in each Track",2);
1343 
1345  histname = "NumberOfLayersPerTrackVsPhi_" + histTag;
1346  tkmes.NumberOfLayersPerTrackVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, RecLayBin, RecLayMin, RecLayMax,"");
1347  tkmes.NumberOfLayersPerTrackVsPhi->setAxisTitle("Track #phi",1);
1348  tkmes.NumberOfLayersPerTrackVsPhi->setAxisTitle("Number of Layers in each Track",2);
1349 
1350  if (doThetaPlots_) {
1351  histname = "NumberOfLayersPerTrackVsTheta_" + histTag;
1352  tkmes.NumberOfLayersPerTrackVsTheta = ibooker.bookProfile(histname, histname, ThetaBin, ThetaMin, ThetaMax, RecLayBin, RecLayMin, RecLayMax,"");
1353  tkmes.NumberOfLayersPerTrackVsTheta->setAxisTitle("Track #phi",1);
1354  tkmes.NumberOfLayersPerTrackVsTheta->setAxisTitle("Number of Layers in each Track",2);
1355  }
1356  histname = "NumberOfLayersPerTrackVsEta_" + histTag;
1357  tkmes.NumberOfLayersPerTrackVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, RecLayBin, RecLayMin, RecLayMax,"");
1358  tkmes.NumberOfLayersPerTrackVsEta->setAxisTitle("Track #eta",1);
1359  tkmes.NumberOfLayersPerTrackVsEta->setAxisTitle("Number of Layers in each Track",2);
1360 
1361  if (doThetaPlots_) {
1362  histname = "Chi2oNDFVsTheta_" + histTag;
1363  tkmes.Chi2oNDFVsTheta = ibooker.bookProfile(histname, histname, ThetaBin, ThetaMin, ThetaMax, Chi2NDFMin, Chi2NDFMax,"");
1364  tkmes.Chi2oNDFVsTheta->setAxisTitle("Track #theta",1);
1365  tkmes.Chi2oNDFVsTheta->setAxisTitle("Track #chi^{2}/ndf",2);
1366  }
1367  if (doAllPlots_) {
1368  histname = "Chi2oNDFVsPhi_" + histTag;
1369  tkmes.Chi2oNDFVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, Chi2NDFMin, Chi2NDFMax,"");
1370  tkmes.Chi2oNDFVsPhi->setAxisTitle("Track #phi",1);
1371  tkmes.Chi2oNDFVsPhi->setAxisTitle("Track #chi^{2}/ndf",2);
1372 
1373  histname = "Chi2oNDFVsEta_" + histTag;
1374  tkmes.Chi2oNDFVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, Chi2NDFMin, Chi2NDFMax,"");
1375  tkmes.Chi2oNDFVsEta->setAxisTitle("Track #eta",1);
1376  tkmes.Chi2oNDFVsEta->setAxisTitle("Track #chi^{2}/ndf",2);
1377 
1378  histname = "Chi2ProbVsPhi_" + histTag;
1379  tkmes.Chi2ProbVsPhi = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, PhiBin, PhiMin, PhiMax, Chi2ProbMin, Chi2ProbMax);
1380  tkmes.Chi2ProbVsPhi->setAxisTitle("Tracks #phi" ,1);
1381  tkmes.Chi2ProbVsPhi->setAxisTitle("Track #chi^{2} probability",2);
1382 
1383  histname = "Chi2ProbVsEta_" + histTag;
1384  tkmes.Chi2ProbVsEta = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, EtaBin, EtaMin, EtaMax, Chi2ProbMin, Chi2ProbMax);
1385  tkmes.Chi2ProbVsEta->setAxisTitle("Tracks #eta" ,1);
1386  tkmes.Chi2ProbVsEta->setAxisTitle("Track #chi^{2} probability",2);
1387  }
1388 
1389  // now put the MEs in the map
1390  TkParameterMEMap.insert( std::make_pair(sname, tkmes) );
1391 
1392 }
1393 
1394 
1395 // fill histograms at differnt measurement points
1396 // ---------------------------------------------------------------------------------//
1398 {
1399  //get the kinematic parameters
1400  double p, px, py, pz, pt, theta, phi, eta, q;
1401  double pxerror, pyerror, pzerror, pterror, perror, phierror, etaerror;
1402 
1403  auto phiIn = track.innerPosition().phi();
1404  auto etaIn = track.innerPosition().eta();
1405  auto phiOut = track.outerPosition().phi();
1406  auto etaOut = track.outerPosition().eta();
1407 
1408 
1409  if (sname == "default") {
1410 
1411  p = track.p();
1412  px = track.px();
1413  py = track.py();
1414  pz = track.pz();
1415  pt = track.pt();
1416  phi = track.phi();
1417  theta = track.theta();
1418  eta = track.eta();
1419  q = track.charge();
1420 
1421  pterror = (pt) ? track.ptError()/(pt*pt) : 0.0;
1422  pxerror = -1.0;
1423  pyerror = -1.0;
1424  pzerror = -1.0;
1425  perror = -1.0;
1426  phierror = track.phiError();
1427  etaerror = track.etaError();
1428 
1429  } else {
1430 
1432  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",theB);
1433  reco::TransientTrack TransTrack = theB->build(track);
1434 
1436 
1437  if (sname == "OuterSurface") TSOS = TransTrack.outermostMeasurementState();
1438  else if (sname == "InnerSurface") TSOS = TransTrack.innermostMeasurementState();
1439  else if (sname == "ImpactPoint") TSOS = TransTrack.impactPointState();
1440 
1441  p = TSOS.globalMomentum().mag();
1442  px = TSOS.globalMomentum().x();
1443  py = TSOS.globalMomentum().y();
1444  pz = TSOS.globalMomentum().z();
1445  pt = TSOS.globalMomentum().perp();
1446  phi = TSOS.globalMomentum().phi();
1447  theta = TSOS.globalMomentum().theta();
1448  eta = TSOS.globalMomentum().eta();
1449  q = TSOS.charge();
1450 
1451  //get the error of the kinimatic parameters
1453  double partialPterror = errors(3,3)*pow(TSOS.globalMomentum().x(),2) + errors(4,4)*pow(TSOS.globalMomentum().y(),2);
1454  pterror = sqrt(partialPterror)/TSOS.globalMomentum().perp();
1455  pxerror = sqrt(errors(3,3))/TSOS.globalMomentum().x();
1456  pyerror = sqrt(errors(4,4))/TSOS.globalMomentum().y();
1457  pzerror = sqrt(errors(5,5))/TSOS.globalMomentum().z();
1458  perror = sqrt(partialPterror+errors(5,5)*pow(TSOS.globalMomentum().z(),2))/TSOS.globalMomentum().mag();
1459  phierror = sqrt(TSOS.curvilinearError().matrix()(2,2));
1460  etaerror = sqrt(TSOS.curvilinearError().matrix()(1,1))*fabs(sin(TSOS.globalMomentum().theta()));
1461 
1462  }
1463 
1464  std::map<std::string, TkParameterMEs>::iterator iPos = TkParameterMEMap.find(sname);
1465  if (iPos != TkParameterMEMap.end()) {
1466 
1467  TkParameterMEs tkmes = iPos->second;
1468 
1469  // momentum
1470  tkmes.TrackP->Fill(p);
1471  if (doTrackPxPyPlots_) {
1472  tkmes.TrackPx->Fill(px);
1473  tkmes.TrackPy->Fill(py);
1474  }
1475  tkmes.TrackPz->Fill(pz);
1476  tkmes.TrackPt->Fill(pt);
1477 
1478  // angles
1479  tkmes.TrackPhi->Fill(phi);
1480  tkmes.TrackEta->Fill(eta);
1481  tkmes.TrackEtaPhi->Fill(eta,phi);
1482  tkmes.TrackEtaPhiInner->Fill(etaIn,phiIn);
1483  tkmes.TrackEtaPhiOuter->Fill(etaOut,phiOut);
1484 
1485  if (doThetaPlots_) {
1486  tkmes.TrackTheta->Fill(theta);
1487  }
1488  tkmes.TrackQ->Fill(q);
1489 
1490  // errors
1491  tkmes.TrackPtErr->Fill(pterror);
1492  tkmes.TrackPtErrVsEta->Fill(eta,pterror);
1493  if (doTrackPxPyPlots_) {
1494  tkmes.TrackPxErr->Fill(pxerror);
1495  tkmes.TrackPyErr->Fill(pyerror);
1496  }
1497  tkmes.TrackPzErr->Fill(pzerror);
1498  tkmes.TrackPErr->Fill(perror);
1499  tkmes.TrackPhiErr->Fill(phierror);
1500  tkmes.TrackEtaErr->Fill(etaerror);
1501 
1502  int nRecHits = track.hitPattern().numberOfHits(reco::HitPattern::TRACK_HITS);
1503  int nValidRecHits = track.numberOfValidHits();
1504  // rec hits
1505  tkmes.NumberOfRecHitsPerTrackVsPhi->Fill(phi, nRecHits);
1506  if (doThetaPlots_) {
1507  tkmes.NumberOfRecHitsPerTrackVsTheta->Fill(theta,nRecHits);
1508  }
1509  tkmes.NumberOfRecHitsPerTrackVsEta->Fill(eta, nRecHits);
1510 
1511  tkmes.NumberOfValidRecHitsPerTrackVsPhi->Fill(phi, nValidRecHits);
1512  tkmes.NumberOfValidRecHitsPerTrackVsEta->Fill(eta, nValidRecHits);
1513 
1514  int nLayers = track.hitPattern().trackerLayersWithMeasurement();
1515  // rec layers
1516  tkmes.NumberOfLayersPerTrackVsPhi->Fill(phi, nLayers);
1517  if (doThetaPlots_) {
1518  tkmes.NumberOfLayersPerTrackVsTheta->Fill(theta, nLayers);
1519  }
1520  tkmes.NumberOfLayersPerTrackVsEta->Fill(eta, nLayers);
1521 
1522  double chi2prob = TMath::Prob(track.chi2(),(int)track.ndof());
1523  double chi2oNDF = track.normalizedChi2();
1524 
1525  if(doAllPlots_) {
1526 
1527  // general properties
1528  if (doThetaPlots_) {
1529  tkmes.Chi2oNDFVsTheta->Fill(theta, chi2oNDF);
1530  }
1531  tkmes.Chi2oNDFVsPhi->Fill(phi, chi2oNDF);
1532  tkmes.Chi2oNDFVsEta->Fill(eta, chi2oNDF);
1533  tkmes.Chi2ProbVsPhi->Fill(phi, chi2prob);
1534  tkmes.Chi2ProbVsEta->Fill(eta, chi2prob);
1535  }
1536 
1537  }
1538 
1539 }
1540 
1541 
1543 {
1544 
1545  // parameters from the configuration
1546  std::string QualName = conf_.getParameter<std::string>("Quality");
1548 
1549  // use the AlgoName and Quality Name
1550  std::string CategoryName = QualName != "" ? AlgoName + "_" + QualName : AlgoName;
1551 
1552  int PhiBin = conf_.getParameter<int>( "PhiBin");
1553  double PhiMin = conf_.getParameter<double>("PhiMin");
1554  double PhiMax = conf_.getParameter<double>("PhiMax");
1555 
1556  int EtaBin = conf_.getParameter<int>( "EtaBin");
1557  double EtaMin = conf_.getParameter<double>("EtaMin");
1558  double EtaMax = conf_.getParameter<double>("EtaMax");
1559 
1560  // book hit property histograms
1561  // ---------------------------------------------------------------------------------//
1562  ibooker.setCurrentFolder(TopFolder_+"/HitProperties");
1563 
1564 
1565 
1566  std::vector<std::string> subdetectors = conf_.getParameter<std::vector<std::string> >("subdetectors");
1567  int detBin = conf_.getParameter<int>("subdetectorBin");
1568 
1569  for ( auto det : subdetectors ) {
1570 
1571  // hits properties
1572  ibooker.setCurrentFolder(TopFolder_+"/HitProperties/"+det);
1573 
1574  TkRecHitsPerSubDetMEs recHitsPerSubDet_mes;
1575 
1576  recHitsPerSubDet_mes.detectorTag = det;
1577  int detID = -1;
1578  if ( det == "TIB" ) detID = StripSubdetector::TIB;
1579  if ( det == "TOB" ) detID = StripSubdetector::TOB;
1580  if ( det == "TID" ) detID = StripSubdetector::TID;
1581  if ( det == "TEC" ) detID = StripSubdetector::TEC;
1582  if ( det == "PixBarrel" ) detID = PixelSubdetector::PixelBarrel;
1583  if ( det == "PixEndcap" ) detID = PixelSubdetector::PixelEndcap;
1584  recHitsPerSubDet_mes.detectorId = detID;
1585 
1586  histname = "NumberOfRecHitsPerTrack_" + det + "_" + CategoryName;
1587  recHitsPerSubDet_mes.NumberOfRecHitsPerTrack = ibooker.book1D(histname, histname, detBin, -0.5, double(detBin)-0.5);
1588  recHitsPerSubDet_mes.NumberOfRecHitsPerTrack->setAxisTitle("Number of " + det + " valid RecHits in each Track",1);
1589  recHitsPerSubDet_mes.NumberOfRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
1590 
1591  histname = "NumberOfRecHitsPerTrackVsPhi_" + det + "_" + CategoryName;
1592  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, detBin, -0.5, double(detBin)-0.5,"");
1593  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPhi->setAxisTitle("Track #phi",1);
1594  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPhi->setAxisTitle("Number of " + det + " valid RecHits in each Track",2);
1595 
1596  histname = "NumberOfRecHitsPerTrackVsEta_" + det + "_" + CategoryName;
1597  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, detBin, -0.5, double(detBin)-0.5,"");
1598  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsEta->setAxisTitle("Track #eta",1);
1599  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsEta->setAxisTitle("Number of " + det + " valid RecHits in each Track",2);
1600 
1601  histname = "NumberOfLayersPerTrack_" + det + "_" + CategoryName;
1602  recHitsPerSubDet_mes.NumberOfLayersPerTrack = ibooker.book1D(histname, histname, detBin, -0.5, double(detBin)-0.5);
1603  recHitsPerSubDet_mes.NumberOfLayersPerTrack->setAxisTitle("Number of " + det + " valid Layers in each Track",1);
1604  recHitsPerSubDet_mes.NumberOfLayersPerTrack->setAxisTitle("Number of Tracks", 2);
1605 
1606  histname = "NumberOfLayersPerTrackVsPhi_" + det + "_" + CategoryName;
1607  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, detBin, -0.5, double(detBin)-0.5,"");
1608  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPhi->setAxisTitle("Track #phi",1);
1609  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPhi->setAxisTitle("Number of " + det + " valid Layers in each Track",2);
1610 
1611  histname = "NumberOfLayersPerTrackVsEta_" + det + "_" + CategoryName;
1612  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, detBin, -0.5, double(detBin)-0.5,"");
1613  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsEta->setAxisTitle("Track #eta",1);
1614  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsEta->setAxisTitle("Number of " + det + " valid Layers in each Track",2);
1615 
1616  TkRecHitsPerSubDetMEMap.insert(std::pair<std::string,TkRecHitsPerSubDetMEs>(det,recHitsPerSubDet_mes));
1617 
1618 
1619  }
1620 
1621 
1622 }
1623 
1624 
1626 {
1627 
1628  double phi = track.phi();
1629  double eta = track.eta();
1630 
1631  for ( std::map<std::string,TkRecHitsPerSubDetMEs>::iterator it = TkRecHitsPerSubDetMEMap.begin();
1632  it != TkRecHitsPerSubDetMEMap.end(); it++ ) {
1633 
1634  int nValidLayers = 0;
1635  int nValidRecHits = 0;
1636  int substr = it->second.detectorId;
1637  switch(substr) {
1638  case StripSubdetector::TIB :
1639  nValidLayers = track.hitPattern().stripTIBLayersWithMeasurement(); // case 0: strip TIB
1640  nValidRecHits = track.hitPattern().numberOfValidStripTIBHits(); // case 0: strip TIB
1641  break;
1642  case StripSubdetector::TID :
1643  nValidLayers = track.hitPattern().stripTIDLayersWithMeasurement(); // case 0: strip TID
1644  nValidRecHits = track.hitPattern().numberOfValidStripTIDHits(); // case 0: strip TID
1645  break;
1646  case StripSubdetector::TOB :
1647  nValidLayers = track.hitPattern().stripTOBLayersWithMeasurement(); // case 0: strip TOB
1648  nValidRecHits = track.hitPattern().numberOfValidStripTOBHits(); // case 0: strip TOB
1649  break;
1650  case StripSubdetector::TEC :
1651  nValidLayers = track.hitPattern().stripTECLayersWithMeasurement(); // case 0: strip TEC
1652  nValidRecHits = track.hitPattern().numberOfValidStripTECHits(); // case 0: strip TEC
1653  break;
1655  nValidLayers = track.hitPattern().pixelBarrelLayersWithMeasurement(); // case 0: pixel PXB
1656  nValidRecHits = track.hitPattern().numberOfValidPixelBarrelHits(); // case 0: pixel PXB
1657  break;
1659  nValidLayers = track.hitPattern().pixelEndcapLayersWithMeasurement(); // case 0: pixel PXF
1660  nValidRecHits = track.hitPattern().numberOfValidPixelEndcapHits(); // case 0: pixel PXF
1661  break;
1662  default :
1663  break;
1664  }
1665 
1666  //Fill Layers and RecHits
1667  it->second.NumberOfRecHitsPerTrack -> Fill(nValidRecHits);
1668  it->second.NumberOfRecHitsPerTrackVsPhi -> Fill(phi, nValidRecHits);
1669  it->second.NumberOfRecHitsPerTrackVsEta -> Fill(eta, nValidRecHits);
1670 
1671  it->second.NumberOfLayersPerTrack -> Fill(nValidLayers);
1672  it->second.NumberOfLayersPerTrackVsPhi -> Fill(phi, nValidLayers);
1673  it->second.NumberOfLayersPerTrackVsEta -> Fill(eta, nValidLayers);
1674  }
1675 
1676 }
1677 //
1678 // -- Set Lumi Flag
1679 //
1681 
1682  TkParameterMEs tkmes;
1685 }
1686 //
1687 // -- Apply SoftReset
1688 //
1690  TkParameterMEs tkmes;
1691  dqmStore_->softReset(Chi2oNDF);
1692  dqmStore_->softReset(NumberOfRecHitsPerTrack);
1693 }
1694 //
1695 // -- Apply Reset
1696 //
1698  TkParameterMEs tkmes;
1701 }
1702 //
1703 // -- Remove SoftReset
1704 //
1706  TkParameterMEs tkmes;
1707  dqmStore_->disableSoftReset(Chi2oNDF);
1709 }
1710 
1711 
#define LogDebug(id)
MonitorElement * NumberOfRecHitsPerTrackVsPhi
MonitorElement * NumberOfValidRecHitsPerTrackVsPhi
MonitorElement * Chi2ProbVsPhi
double p() const
momentum vector magnitude
Definition: TrackBase.h:610
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
MonitorElement * NumberOfLayersPerTrackVsPhi
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:613
T getParameter(std::string const &) const
dictionary missing
Definition: combine.py:4
MonitorElement * DistanceOfClosestApproachToPVVsPhi
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:676
int i
Definition: DBlmapReader.cc:9
MonitorElement * NumberOfRecHitVsPhiVsEtaPerTrack
bool doTrackerSpecific_
Definition: TrackAnalyzer.h:75
MonitorElement * ValidFractionVsPhiVsEtaPerTrack
double d0Error() const
error on d0
Definition: TrackBase.h:797
MonitorElement * dNhitdPt_HighPurity
void fillHistosForTrackerSpecific(const reco::Track &track)
MonitorElement * NumberOfRecHitsPerTrackVsEta
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_valid_
void bookHistosForLScertification(DQMStore::IBooker &ibooker)
T perp() const
Definition: PV3DBase.h:72
double validFraction() const
fraction of valid hits on the track
Definition: TrackBase.h:827
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
Definition: TrackBase.h:592
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_bad_
MonitorElement * NumberOfValidRecHitsPerTrack
int stripTIBLayersWithMeasurement() const
Definition: HitPattern.cc:591
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:556
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
double zError() const
error on z
Definition: Vertex.h:111
MonitorElement * Chi2oNDF_lumiFlag
double theta() const
polar angle
Definition: TrackBase.h:574
double dxyError() const
error on dxy
Definition: TrackBase.h:791
MonitorElement * xPointOfClosestApproachToPV
const CurvilinearTrajectoryError & curvilinearError() const
MonitorElement * sip3dToPV
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::pair< bool, Measurement1D > signedTransverseImpactParameter(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:50
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:73
const CartesianTrajectoryError cartesianError() const
Geom::Theta< T > theta() const
bool doGeneralPropertiesPlots_
Definition: TrackAnalyzer.h:80
T y() const
Definition: PV3DBase.h:63
double etaError() const
error on eta
Definition: TrackBase.h:779
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)
std::pair< bool, Measurement1D > signedImpactParameter3D(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:71
MonitorElement * DistanceOfClosestApproachVsPhi
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:640
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
Definition: TrackBase.h:821
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
MonitorElement * sipDzToBS
std::map< std::string, TkParameterMEs > TkParameterMEMap
MonitorElement * NumberOfLayersPerTrack[4]
MonitorElement * NhitVsPhi_HighPurity
MonitorElement * NumberOfRecHitsPerTrackVsTheta
MonitorElement * algorithm
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:622
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:508
bool doHitPropertiesPlots_
Definition: TrackAnalyzer.h:82
MonitorElement * DistanceOfClosestApproach
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:65
bool doRecHitVsPhiVsEtaPerTrack_
Definition: TrackAnalyzer.h:83
MonitorElement * NumberOfLayersPerTrackVsTheta
MonitorElement * NumberOfRecHitsPerTrack_lumiFlag
std::map< std::string, TkRecHitsPerSubDetMEs > TkRecHitsPerSubDetMEMap
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:527
const Point & position() const
position
Definition: Vertex.h:99
MonitorElement * NumberOfValidRecHitVsPhiVsEtaPerTrack
int pixelEndcapLayersWithMeasurement() const
Definition: HitPattern.cc:579
int numberOfValidStripTOBHits() const
Definition: HitPattern.h:868
bool doMeasurementStatePlots_
Definition: TrackAnalyzer.h:81
TrajectoryStateOnSurface innermostMeasurementState() const
MonitorElement * NumberOfRecHitsPerTrack
MonitorElement * Ptdist_HighPurity
void Fill(long long x)
int numberOfLostTrackerHits(HitCategory category) const
Definition: HitPattern.h:907
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:55
MonitorElement * NumberOfLayersVsPhiVsEtaPerTrack[4]
TrackAlgorithm algo() const
Definition: TrackBase.h:492
void disableSoftReset(MonitorElement *me)
Definition: DQMStore.cc:3379
MonitorElement * TESTDistanceOfClosestApproachToBSVsPhi
MonitorElement * NumberOfValidRecHitsPerTrackVsEta
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_total_
MonitorElement * Chi2oNDFVsEta
MonitorElement * TransDCASig
int iEvent
Definition: GenABIO.cc:230
MonitorElement * NumberOfMIRecHitVsPhiVsEtaPerTrack
MonitorElement * NumberOfRecHitsPerTrackVsPhi
MonitorElement * xPointOfClosestApproachVsZ0wrt000
T mag() const
Definition: PV3DBase.h:67
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:646
int numberOfValidStripLayersWithMonoAndStereo(uint16_t stripdet, uint16_t layer) const
Definition: HitPattern.cc:350
std::string qualityString_
int trackerLayersTotallyOffOrBad() const
Definition: HitPattern.h:1061
int numberOfValidPixelBarrelHits() const
Definition: HitPattern.h:843
MonitorElement * oriAlgo
bool doDCAwrt000Plots_
Definition: TrackAnalyzer.h:97
MonitorElement * NumberOfRecHitsPerTrackVsTheta
MonitorElement * NumberOfLostRecHitVsPhiVsEtaPerTrack
MonitorElement * xPointOfClosestApproach
MonitorElement * Chi2oNDFVsTheta
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:544
MonitorElement * NumberOfMIRecHitsPerTrack
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:163
def cat
Definition: eostools.py:400
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
double ndof() const
number of degrees of freedom of the fit
Definition: TrackBase.h:550
int stripTIDLayersWithMeasurement() const
Definition: HitPattern.cc:602
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
MonitorElement * NumberOfValidRecHitsPerTrackVsEta
T sqrt(T t)
Definition: SSEVec.h:18
MonitorElement * NumberOfRecHitsPerTrackVsPhi
double pt() const
track transverse momentum
Definition: TrackBase.h:616
T z() const
Definition: PV3DBase.h:64
MonitorElement * dNdPt_HighPurity
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Definition: TrackBase.h:758
std::string TopFolder_
Definition: TrackAnalyzer.h:68
MonitorElement * xPointOfClosestApproachVsZ0wrtBS
double phiError() const
error on phi
Definition: TrackBase.h:785
MonitorElement * NumberOfValidRecHitsPerTrackVsPhi
MonitorElement * dNdPhi_HighPurity
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
int numberOfValidStripTIDHits() const
Definition: HitPattern.h:863
TH1 * getTH1(void) const
MonitorElement * yPointOfClosestApproachToPV
const double EtaMin[kNumberCalorimeter]
MonitorElement * NumberOfRecHitsPerTrackVsEta
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:815
int numberOfValidStripTECHits() const
Definition: HitPattern.h:873
MonitorElement * sip2dToPV
void softReset(MonitorElement *me)
Definition: DQMStore.cc:3371
MonitorElement * Chi2oNDFVsTheta
TrajectoryStateOnSurface outermostMeasurementState() const
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_inactive_
MonitorElement * sipDzToPV
MonitorElement * sipDxyToBS
bool isValid() const
Definition: HandleBase.h:75
void bookHistosForHitProperties(DQMStore::IBooker &ibooker)
MonitorElement * DistanceOfClosestApproachVsEta
MonitorElement * zPointOfClosestApproachVsPhi
const AlgebraicSymMatrix66 & matrix() const
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:634
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:604
MonitorElement * NumberOfLayersPerTrackVsEta
double dzError() const
error on dz
Definition: TrackBase.h:809
MonitorElement * dNdEta_HighPurity
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:664
void bookHistosForTrackerSpecific(DQMStore::IBooker &ibooker)
void fillHistosForState(const edm::EventSetup &iSetup, const reco::Track &track, std::string sname)
TrackAlgorithm originalAlgo() const
Definition: TrackBase.h:496
TrajectoryStateOnSurface TSOS
Definition: TestHits.cc:19
virtual ~TrackAnalyzer()
bool doLumiAnalysis_
Definition: TrackAnalyzer.h:99
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
double xError() const
error on x
Definition: Vertex.h:107
MonitorElement * NumberOfLayersPerTrackVsEta
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:273
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Definition: TrackAnalyzer.h:70
MonitorElement * sipDxyToPV
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
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:445
MonitorElement * xPointOfClosestApproachVsZ0wrtPV
MonitorElement * yPointOfClosestApproachVsZ0wrtBS
const T & get() const
Definition: EventSetup.h:56
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_missing_
int pixelBarrelLayersWithMeasurement() const
Definition: HitPattern.cc:567
MonitorElement * DistanceOfClosestApproachVsTheta
void bookHistosForBeamSpot(DQMStore::IBooker &ibooker)
MonitorElement * Chi2ProbVsEta
int numberOfValidStripTIBHits() const
Definition: HitPattern.h:858
static const std::string algoNames[]
Definition: TrackBase.h:148
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:505
bool doEffFromHitPattern_
int numberOfValidPixelEndcapHits() const
Definition: HitPattern.h:848
MonitorElement * zPointOfClosestApproachToPV
T eta() const
Definition: PV3DBase.h:76
int trackerLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:544
MonitorElement * DistanceOfClosestApproachToPV
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:658
const AlgebraicSymMatrix55 & matrix() const
bool doTrackPxPyPlots_
Definition: TrackAnalyzer.h:93
GlobalVector globalMomentum() const
MonitorElement * DistanceOfClosestApproachToBSVsPhi
bool doLayersVsPhiVsEtaPerTrack_
Definition: TrackAnalyzer.h:85
MonitorElement * ValidFractionPerTrack
MonitorElement * NhitVsEta_HighPurity
void doSoftReset(DQMStore *dqmStore_)
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:624
MonitorElement * yPointOfClosestApproachVsZ0wrt000
unsigned int good_vertices_
MonitorElement * TrackPtErrVsEta
MonitorElement * TESTDistanceOfClosestApproachToBS
virtual void initHisto(DQMStore::IBooker &ibooker, const edm::EventSetup &)
MonitorElement * NumberOfRecHitsPerTrackVsEta
int charge() const
track electric charge
Definition: TrackBase.h:562
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)
dbl *** dir
Definition: mlp_gen.cc:35
MonitorElement * Chi2Prob
MonitorElement * TrackEtaPhiOuter
Definition: Chi2.h:17
MonitorElement * yPointOfClosestApproachVsZ0wrtPV
void setNumberOfGoodVertices(const edm::Event &)
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:586
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 * TrackEtaPhiInner
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:109
std::string histname
MonitorElement * Chi2oNDFVsEta
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:628
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:652
void undoSoftReset(DQMStore *dqmStore_)
int numberOfHits(HitCategory category) const
Definition: HitPattern.h:807
MonitorElement * NumberOfMORecHitVsPhiVsEtaPerTrack
MonitorElement * NumberOfMORecHitsPerTrack
MonitorElement * NumberOfLayersPerTrackVsPhi
MonitorElement * LongDCASig
edm::EDGetTokenT< reco::VertexCollection > pvToken_
Definition: TrackAnalyzer.h:71
void bookHistosForEfficiencyFromHitPatter(DQMStore::IBooker &ibooker, const edm::EventSetup &iSetup)
MonitorElement * Chi2oNDFVsPhi