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