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