CMS 3D CMS Logo

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 
12 
19 #include <string>
20 #include "TMath.h"
22 
23 namespace {
24  template <typename T, size_t N>
25  std::array<T, N + 1> makeLogBins(const double min, const double max) {
26  const double minLog10 = std::log10(min);
27  const double maxLog10 = std::log10(max);
28  const double width = (maxLog10 - minLog10) / N;
29  std::array<T, N + 1> ret;
30  ret[0] = std::pow(10, minLog10);
31  const double mult = std::pow(10, width);
32  for (size_t i = 1; i <= N; ++i) {
33  ret[i] = ret[i - 1] * mult;
34  }
35  return ret;
36  }
37 } // namespace
38 
39 using namespace tadqm;
41  : conf_(nullptr),
42  stateName_(iConfig.getParameter<std::string>("MeasurementState")),
43  doTrackerSpecific_(iConfig.getParameter<bool>("doTrackerSpecific")),
44  doAllPlots_(iConfig.getParameter<bool>("doAllPlots")),
45  doBSPlots_(iConfig.getParameter<bool>("doBeamSpotPlots")),
46  doPVPlots_(iConfig.getParameter<bool>("doPrimaryVertexPlots")),
47  doDCAPlots_(iConfig.getParameter<bool>("doDCAPlots")),
48  doGeneralPropertiesPlots_(iConfig.getParameter<bool>("doGeneralPropertiesPlots")),
49  doMeasurementStatePlots_(iConfig.getParameter<bool>("doMeasurementStatePlots")),
50  doHitPropertiesPlots_(iConfig.getParameter<bool>("doHitPropertiesPlots")),
51  doRecHitVsPhiVsEtaPerTrack_(iConfig.getParameter<bool>("doRecHitVsPhiVsEtaPerTrack")),
52  doRecHitVsPtVsEtaPerTrack_(iConfig.getParameter<bool>("doRecHitVsPtVsEtaPerTrack")),
53  doLayersVsPhiVsEtaPerTrack_(iConfig.getParameter<bool>("doLayersVsPhiVsEtaPerTrack")),
54  doRecHitsPerTrackProfile_(iConfig.getParameter<bool>("doRecHitsPerTrackProfile")),
55  doThetaPlots_(iConfig.getParameter<bool>("doThetaPlots")),
56  doTrackPxPyPlots_(iConfig.getParameter<bool>("doTrackPxPyPlots")),
57  doDCAwrtPVPlots_(iConfig.getParameter<bool>("doDCAwrtPVPlots")),
58  doDCAwrt000Plots_(iConfig.getParameter<bool>("doDCAwrt000Plots")),
59  doLumiAnalysis_(iConfig.getParameter<bool>("doLumiAnalysis")),
60  doTestPlots_(iConfig.getParameter<bool>("doTestPlots")),
61  doHIPlots_(iConfig.getParameter<bool>("doHIPlots")),
62  doSIPPlots_(iConfig.getParameter<bool>("doSIPPlots")),
63  doEffFromHitPatternVsPU_(iConfig.getParameter<bool>("doEffFromHitPatternVsPU")),
64  doEffFromHitPatternVsBX_(iConfig.getParameter<bool>("doEffFromHitPatternVsBX")),
65  doEffFromHitPatternVsLUMI_(iConfig.getParameter<bool>("doEffFromHitPatternVsLUMI")),
66  pvNDOF_(iConfig.getParameter<int>("pvNDOF")),
67  forceSCAL_(iConfig.getParameter<bool>("forceSCAL")),
68  useBPixLayer1_(iConfig.getParameter<bool>("useBPixLayer1")),
69  minNumberOfPixelsPerCluster_(iConfig.getParameter<int>("minNumberOfPixelsPerCluster")),
70  minPixelClusterCharge_(iConfig.getParameter<double>("minPixelClusterCharge")),
71  qualityString_(iConfig.getParameter<std::string>("qualityString")),
72  good_vertices_(0),
73  bx_(0),
74  pixel_lumi_(0.),
75  online_lumi_(0.) {
76  initHistos();
77  TopFolder_ = iConfig.getParameter<std::string>("FolderName");
78 }
79 
81  edm::InputTag bsSrc = iConfig.getParameter<edm::InputTag>("beamSpot");
82  edm::InputTag primaryVertexInputTag = iConfig.getParameter<edm::InputTag>("primaryVertex");
83  edm::InputTag pixelClusterInputTag = iConfig.getParameter<edm::InputTag>("pixelCluster4lumi");
84  edm::InputTag scalInputTag = iConfig.getParameter<edm::InputTag>("scal");
85  edm::InputTag metaDataInputTag = iConfig.getParameter<edm::InputTag>("metadata");
87  pvToken_ = iC.consumes<reco::VertexCollection>(primaryVertexInputTag);
90  metaDataToken_ = iC.mayConsume<OnlineLuminosityRecord>(metaDataInputTag);
91 
94  }
96  if (doSIPPlots_ ||
97  ((doMeasurementStatePlots_ || doAllPlots_) && (stateName_ == "All" || stateName_ == "OuterSurface" ||
98  stateName_ == "InnerSurface" || stateName_ == "ImpactPoint"))) {
100  iC.esConsumes<TransientTrackBuilder, TransientTrackRecord>(edm::ESInputTag("", "TransientTrackBuilder"));
101  }
102 
103  if (useBPixLayer1_)
105  else
107 }
108 
110  Chi2 = nullptr;
111  Chi2Prob = nullptr;
112  Chi2ProbVsPhi = nullptr;
113  Chi2ProbVsEta = nullptr;
114  Chi2oNDF = nullptr;
115  Chi2oNDFVsEta = nullptr;
116  Chi2oNDFVsPhi = nullptr;
117  Chi2oNDFVsTheta = nullptr;
118 
119  NumberOfRecHitsPerTrack = nullptr;
121  NumberOfLostRecHitsPerTrack = nullptr;
122 
126 
128 
131 
132  DistanceOfClosestApproach = nullptr;
143  DeltaZToPV = nullptr;
144  DeltaZToPVZoom = nullptr;
151  xPointOfClosestApproach = nullptr;
154  yPointOfClosestApproach = nullptr;
157  zPointOfClosestApproach = nullptr;
159  algorithm = nullptr;
160  oriAlgo = nullptr;
161  stoppingSource = nullptr;
162  stoppingSourceVSeta = nullptr;
163  stoppingSourceVSphi = nullptr;
164  // TESTING
167 
168  // by Mia in order to deal w/ LS transitions
169  Chi2oNDF_lumiFlag = nullptr;
171 
173  //special Plots for HI DQM //SHOULD I ADD THE BOOL HERE??
175  LongDCASig = nullptr;
176  TransDCASig = nullptr;
177  dNdPhi_HighPurity = nullptr;
178  dNdEta_HighPurity = nullptr;
179  dNdPt_HighPurity = nullptr;
180  NhitVsEta_HighPurity = nullptr;
181  NhitVsPhi_HighPurity = nullptr;
182 
183  // IP significance
184  sipDxyToBS = nullptr;
185  sipDzToBS = nullptr;
186  sip3dToPV = nullptr;
187  sip2dToPV = nullptr;
188  sipDxyToPV = nullptr;
189  sipDzToPV = nullptr;
190 }
191 
193 
195  const edm::EventSetup& iSetup,
196  const edm::ParameterSet& iConfig) {
197  conf_ = &iConfig;
199  bookHistosForBeamSpot(ibooker);
202  bookHistosForEfficiencyFromHitPatter(ibooker, iSetup, "", false);
204  bookHistosForEfficiencyFromHitPatter(ibooker, iSetup, "VsBX", false);
206  bookHistosForEfficiencyFromHitPatter(ibooker, iSetup, "VsOnlineLUMI", false);
207  // if (doEffFromHitPatternVsLUMI_ || doAllPlots_) bookHistosForEfficiencyFromHitPatter(ibooker, iSetup, "VsPIXELLUMI");
209  bookHistosForEfficiencyFromHitPatter(ibooker, iSetup, "", true);
211  bookHistosForEfficiencyFromHitPatter(ibooker, iSetup, "VsOnlineLUMI", true);
212 
213  // book tracker specific related histograms
214  // ---------------------------------------------------------------------------------//
217 
218  // book state related histograms
219  // ---------------------------------------------------------------------------------//
221  if (stateName_ == "All") {
222  bookHistosForState("OuterSurface", ibooker);
223  bookHistosForState("InnerSurface", ibooker);
224  bookHistosForState("ImpactPoint", ibooker);
225  } else if (stateName_ != "OuterSurface" && stateName_ != "InnerSurface" && stateName_ != "ImpactPoint" &&
226  stateName_ != "default") {
227  bookHistosForState("default", ibooker);
228 
229  } else {
230  bookHistosForState(stateName_, ibooker);
231  }
232  conf_ = nullptr;
233  }
234 }
235 
237  const edm::EventSetup& iSetup,
238  const std::string suffix,
239  bool useInac) {
240  ibooker.setCurrentFolder(TopFolder_ + "/HitEffFromHitPattern" + (useInac ? "All" : "") + suffix);
241 
242  constexpr int LUMIBin = 300; // conf_->getParameter<int>("LUMIBin");
243  float LUMIMin = conf_->getParameter<double>("LUMIMin");
244  float LUMIMax = conf_->getParameter<double>("LUMIMax");
245 
246  int PVBin = conf_->getParameter<int>("PVBin");
247  float PVMin = conf_->getParameter<double>("PVMin");
248  float PVMax = conf_->getParameter<double>("PVMax");
249 
251  float MIN[] = {PVMin, 0.5, LUMIMin, LUMIMin};
252  float MAX[] = {PVMax, float(GetLumi::lastBunchCrossing) + 0.5, LUMIMax, LUMIMax};
253  std::string NAME[] = {"", "VsBX", "VsLUMI", "VsLUMI"};
254 
255  auto logBins = makeLogBins<float, LUMIBin>(LUMIMin, LUMIMax);
256 
257  int mon = -1;
258  int nbins = -1;
259  float min = -1.;
260  float max = -1.;
261  bool logQ = false;
262  std::string name = "";
263  for (int i = 0; i < monQuantity::END; i++) {
264  if (monName[i] == suffix) {
265  logQ = (i > 1); // VsLUMI
266  mon = i;
267  if (useInac)
268  mon += monQuantity::END;
269  nbins = NBINS[i];
270  min = MIN[i];
271  max = MAX[i];
272  name = NAME[i];
273  }
274  }
275 
276  TrackerGeometry const& trackerGeometry = iSetup.getData(trackerGeometryToken_);
277 
278  // Values are not ordered randomly, but the order is taken from
279  // http://cmslxr.fnal.gov/dxr/CMSSW/source/Geometry/CommonDetUnit/interface/GeomDetEnumerators.h#15
280  const char* dets[] = {"None", "PXB", "PXF", "TIB", "TID", "TOB", "TEC"};
281 
282  // Also in this case, ordering is not random but extracted from
283  // http://cmslxr.fnal.gov/dxr/CMSSW/source/DataFormats/TrackReco/interface/HitPattern.h
284  // The category "total" is an addition to ease the computation of
285  // the efficiencies and is not part of the original HitPattern.
286  const char* hit_category[] = {"valid", "missing", "inactive", "bad", "total"};
287 
288  // We set sub_det to be a 1-based index since to it is the sub-sub-structure in the HitPattern
289  char title[50];
290  for (unsigned int det = 1; det < sizeof(dets) / sizeof(char*); ++det) {
291  for (unsigned int sub_det = 1; sub_det <= trackerGeometry.numberOfLayers(det); ++sub_det) {
292  for (unsigned int cat = 0; cat < sizeof(hit_category) / sizeof(char*); ++cat) {
293  memset(title, 0, sizeof(title));
294  snprintf(title, sizeof(title), "Hits%s_%s_%s_Subdet%d", name.c_str(), hit_category[cat], dets[det], sub_det);
295  switch (cat) {
296  case 0:
297  hits_valid_.insert(std::make_pair(Key(det, sub_det, mon),
298  logQ ? ibooker.book1D(title, title, nbins, &logBins[0])
299  : ibooker.book1D(title, title, nbins, min, max)));
300  break;
301  case 4:
302  hits_total_.insert(std::make_pair(Key(det, sub_det, mon),
303  logQ ? ibooker.book1D(title, title, nbins, &logBins[0])
304  : ibooker.book1D(title, title, nbins, min, max)));
305  break;
306  default:
307  LogDebug("TrackAnalyzer") << "Invalid hit category used " << cat << " ignored\n";
308  }
309  }
310  }
311  }
312 }
313 
316  // parameters from the configuration
317  std::string QualName = conf_->getParameter<std::string>("Quality");
319  std::string MEBSFolderName = conf_->getParameter<std::string>("BSFolderName");
320 
321  // use the AlgoName and Quality Name
322  std::string CategoryName = !QualName.empty() ? AlgoName + "_" + QualName : AlgoName;
323 
324  // get binning from the configuration
325  int TKHitBin = conf_->getParameter<int>("RecHitBin");
326  double TKHitMin = conf_->getParameter<double>("RecHitMin");
327  double TKHitMax = conf_->getParameter<double>("RecHitMax");
328 
329  int TKLostBin = conf_->getParameter<int>("RecLostBin");
330  double TKLostMin = conf_->getParameter<double>("RecLostMin");
331  double TKLostMax = conf_->getParameter<double>("RecLostMax");
332 
333  int TKLayBin = conf_->getParameter<int>("RecLayBin");
334  double TKLayMin = conf_->getParameter<double>("RecLayMin");
335  double TKLayMax = conf_->getParameter<double>("RecLayMax");
336 
337  int PhiBin = conf_->getParameter<int>("PhiBin");
338  double PhiMin = conf_->getParameter<double>("PhiMin");
339  double PhiMax = conf_->getParameter<double>("PhiMax");
340 
341  int EtaBin = conf_->getParameter<int>("EtaBin");
342  double EtaMin = conf_->getParameter<double>("EtaMin");
343  double EtaMax = conf_->getParameter<double>("EtaMax");
344 
345  int PtBin = conf_->getParameter<int>("TrackPtBin");
346  double PtMin = conf_->getParameter<double>("TrackPtMin");
347  double PtMax = conf_->getParameter<double>("TrackPtMax");
348 
349  int Phi2DBin = conf_->getParameter<int>("Phi2DBin");
350  int Eta2DBin = conf_->getParameter<int>("Eta2DBin");
351  int Pt2DBin = conf_->getParameter<int>("TrackPt2DBin");
352 
353  int VXBin = conf_->getParameter<int>("VXBin");
354  double VXMin = conf_->getParameter<double>("VXMin");
355  double VXMax = conf_->getParameter<double>("VXMax");
356 
357  int VYBin = conf_->getParameter<int>("VYBin");
358  double VYMin = conf_->getParameter<double>("VYMin");
359  double VYMax = conf_->getParameter<double>("VYMax");
360 
361  int VZBin = conf_->getParameter<int>("VZBin");
362  double VZMin = conf_->getParameter<double>("VZMin");
363  double VZMax = conf_->getParameter<double>("VZMax");
364 
365  ibooker.setCurrentFolder(TopFolder_);
366 
367  // book the Hit Property histograms
368  // ---------------------------------------------------------------------------------//
369 
370  TkParameterMEs tkmes;
372  ibooker.setCurrentFolder(TopFolder_ + "/HitProperties");
373 
374  histname = "NumberOfRecHitsPerTrack_";
376  ibooker.book1D(histname + CategoryName, histname + CategoryName, TKHitBin, TKHitMin, TKHitMax);
377  NumberOfRecHitsPerTrack->setAxisTitle("Number of all RecHits of each Track");
378  NumberOfRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
379 
380  histname = "NumberOfValidRecHitsPerTrack_";
382  ibooker.book1D(histname + CategoryName, histname + CategoryName, TKHitBin, TKHitMin, TKHitMax);
383  NumberOfValidRecHitsPerTrack->setAxisTitle("Number of valid RecHits for each Track");
384 
385  NumberOfValidRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
386 
387  histname = "NumberOfLostRecHitsPerTrack_";
389  ibooker.book1D(histname + CategoryName, histname + CategoryName, TKLostBin, TKLostMin, TKLostMax);
390  NumberOfLostRecHitsPerTrack->setAxisTitle("Number of lost RecHits for each Track");
391  NumberOfLostRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
392 
393  histname = "NumberOfMissingInnerRecHitsPerTrack_";
394  NumberOfMIRecHitsPerTrack = ibooker.book1D(histname + CategoryName, histname + CategoryName, 10, -0.5, 9.5);
395  NumberOfMIRecHitsPerTrack->setAxisTitle("Number of missing-inner RecHits for each Track");
396  NumberOfMIRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
397 
398  histname = "NumberOfMissingOuterRecHitsPerTrack_";
399  NumberOfMORecHitsPerTrack = ibooker.book1D(histname + CategoryName, histname + CategoryName, 10, -0.5, 9.5);
400  NumberOfMORecHitsPerTrack->setAxisTitle("Number of missing-outer RecHits for each Track");
401  NumberOfMORecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
402 
403  histname = "ValidFractionPerTrack_";
404  ValidFractionPerTrack = ibooker.book1D(histname + CategoryName, histname + CategoryName, 101, 0., 1.01);
405  ValidFractionPerTrack->setAxisTitle("ValidFraction of RecHits for each Track");
406  ValidFractionPerTrack->setAxisTitle("Number of Tracks", 2);
407 
409  histname = "NumberOfValidRecHitVsPhiVsEtaPerTrack_";
411  histname + CategoryName,
412  Eta2DBin,
413  EtaMin,
414  EtaMax,
415  Phi2DBin,
416  PhiMin,
417  PhiMax,
418  0,
419  40.,
420  "");
423 
424  histname = "NumberOfLostRecHitVsPhiVsEtaPerTrack_";
426  histname + CategoryName,
427  Eta2DBin,
428  EtaMin,
429  EtaMax,
430  Phi2DBin,
431  PhiMin,
432  PhiMax,
433  0,
434  5.,
435  "");
438 
439  histname = "NumberMIRecHitVsPhiVsEtaPerTrack_";
441  histname + CategoryName,
442  Eta2DBin,
443  EtaMin,
444  EtaMax,
445  Phi2DBin,
446  PhiMin,
447  PhiMax,
448  0,
449  15.,
450  "");
453 
454  histname = "NumberMORecHitVsPhiVsEtaPerTrack_";
456  histname + CategoryName,
457  Eta2DBin,
458  EtaMin,
459  EtaMax,
460  Phi2DBin,
461  PhiMin,
462  PhiMax,
463  0,
464  15.,
465  "");
468 
469  histname = "ValidFractionVsPhiVsEtaPerTrack_";
470  ValidFractionVsPhiVsEtaPerTrack = ibooker.bookProfile2D(histname + CategoryName,
471  histname + CategoryName,
472  Eta2DBin,
473  EtaMin,
474  EtaMax,
475  Phi2DBin,
476  PhiMin,
477  PhiMax,
478  0,
479  2.,
480  "");
483  }
484 
486  histname = "NumberOfValidRecHitVsPtVsEtaPerTrack_";
488  histname + CategoryName, histname + CategoryName, Eta2DBin, EtaMin, EtaMax, Pt2DBin, PtMin, PtMax, 0, 40., "");
490  NumberOfValidRecHitVsPtVsEtaPerTrack->setAxisTitle("Track p_{T} [GeV] ", 2);
491 
492  histname = "NumberOfLostRecHitVsPtVsEtaPerTrack_";
494  histname + CategoryName, histname + CategoryName, Eta2DBin, EtaMin, EtaMax, Pt2DBin, PtMin, PtMax, 0, 5., "");
496  NumberOfLostRecHitVsPtVsEtaPerTrack->setAxisTitle("Track p_{T} [GeV] ", 2);
497 
498  histname = "NumberMIRecHitVsPtVsEtaPerTrack_";
500  histname + CategoryName, histname + CategoryName, Eta2DBin, EtaMin, EtaMax, Pt2DBin, PtMin, PtMax, 0, 15., "");
502  NumberOfMIRecHitVsPtVsEtaPerTrack->setAxisTitle("Track p_{T} [GeV] ", 2);
503 
504  histname = "NumberMORecHitVsPtVsEtaPerTrack_";
506  histname + CategoryName, histname + CategoryName, Eta2DBin, EtaMin, EtaMax, Pt2DBin, PtMin, PtMax, 0, 15., "");
508  NumberOfMORecHitVsPtVsEtaPerTrack->setAxisTitle("Track p_{T} [GeV] ", 2);
509  }
510 
511  histname = "NumberOfValidRecHitsPerTrackVsPt_";
513  histname + CategoryName, histname + CategoryName, PtBin, PtMin, PtMax, TKHitMin, TKHitMax, "");
514  NumberOfValidRecHitsPerTrackVsPt->setAxisTitle("Track p_{T} [GeV]", 1);
515  NumberOfValidRecHitsPerTrackVsPt->setAxisTitle("Number of valid RecHits in each Track", 2);
516 
517  histname = "NumberOfLostRecHitsPerTrackVsPt_";
519  histname + CategoryName, histname + CategoryName, PtBin, PtMin, PtMax, TKHitMin, TKHitMax, "");
520  NumberOfLostRecHitsPerTrackVsPt->setAxisTitle("Track p_{T} [GeV]", 1);
521  NumberOfLostRecHitsPerTrackVsPt->setAxisTitle("Average Number of Lost RecHits per Track", 2);
522 
523  histname = "NumberMIRecHitsPerTrackVsPt_";
525  histname + CategoryName, histname + CategoryName, PtBin, PtMin, PtMax, TKHitMin, TKHitMax, "");
526  NumberOfMIRecHitsPerTrackVsPt->setAxisTitle("Track p_{T} [GeV]", 1);
527  NumberOfMIRecHitsPerTrackVsPt->setAxisTitle("Average Number of Lost RecHits per Track", 2);
528 
529  histname = "NumberMORecHitsPerTrackVsPt_";
531  histname + CategoryName, histname + CategoryName, PtBin, PtMin, PtMax, TKHitMin, TKHitMax, "");
532  NumberOfMORecHitsPerTrackVsPt->setAxisTitle("Track p_{T} [GeV]", 1);
533  NumberOfMORecHitsPerTrackVsPt->setAxisTitle("Average Number of Lost RecHits per Track", 2);
534 
535  std::string layerTypeName[5] = {"", "Off", "3D", "Missing", "Pixel"};
536  for (int i = 0; i < 4; ++i) {
537  histname = "NumberOf" + layerTypeName[i] + "LayersPerTrack_";
539  ibooker.book1D(histname + CategoryName, histname + CategoryName, TKLayBin, TKLayMin, TKLayMax);
540  NumberOfLayersPerTrack[i]->setAxisTitle("Number of " + layerTypeName[i] + " Layers of each Track", 1);
541  NumberOfLayersPerTrack[i]->setAxisTitle("Number of Tracks", 2);
542  }
544  for (int i = 0; i < 5; ++i) {
545  histname = "NumberOf" + layerTypeName[i] + "LayersVsPhiVsEtaPerTrack_";
546  NumberOfLayersVsPhiVsEtaPerTrack[i] = ibooker.bookProfile2D(histname + CategoryName,
547  histname + CategoryName,
548  Eta2DBin,
549  EtaMin,
550  EtaMax,
551  Phi2DBin,
552  PhiMin,
553  PhiMax,
554  0,
555  40.,
556  "");
557  NumberOfLayersVsPhiVsEtaPerTrack[i]->setAxisTitle("Track #eta ", 1);
558  NumberOfLayersVsPhiVsEtaPerTrack[i]->setAxisTitle("Track #phi ", 2);
559  }
560  }
561 
562  // book the General Property histograms
563  // ---------------------------------------------------------------------------------//
564 
566  int Chi2Bin = conf_->getParameter<int>("Chi2Bin");
567  double Chi2Min = conf_->getParameter<double>("Chi2Min");
568  double Chi2Max = conf_->getParameter<double>("Chi2Max");
569 
570  int Chi2NDFBin = conf_->getParameter<int>("Chi2NDFBin");
571  double Chi2NDFMin = conf_->getParameter<double>("Chi2NDFMin");
572  double Chi2NDFMax = conf_->getParameter<double>("Chi2NDFMax");
573 
574  int Chi2ProbBin = conf_->getParameter<int>("Chi2ProbBin");
575  double Chi2ProbMin = conf_->getParameter<double>("Chi2ProbMin");
576  double Chi2ProbMax = conf_->getParameter<double>("Chi2ProbMax");
577 
578  //HI PLOTS////
579  int TransDCABins = conf_->getParameter<int>("TransDCABins");
580  double TransDCAMin = conf_->getParameter<double>("TransDCAMin");
581  double TransDCAMax = conf_->getParameter<double>("TransDCAMax");
582 
583  int LongDCABins = conf_->getParameter<int>("LongDCABins");
584  double LongDCAMin = conf_->getParameter<double>("LongDCAMin");
585  double LongDCAMax = conf_->getParameter<double>("LongDCAMax");
587 
588  ibooker.setCurrentFolder(TopFolder_ + "/GeneralProperties");
589 
590  histname = "Chi2_";
591  Chi2 = ibooker.book1D(histname + CategoryName, histname + CategoryName, Chi2Bin, Chi2Min, Chi2Max);
592  Chi2->setAxisTitle("Track #chi^{2}", 1);
593  Chi2->setAxisTitle("Number of Tracks", 2);
594 
595  histname = "Chi2Prob_";
596  Chi2Prob = ibooker.book1D(histname + CategoryName, histname + CategoryName, Chi2ProbBin, Chi2ProbMin, Chi2ProbMax);
597  Chi2Prob->setAxisTitle("Track #chi^{2} probability", 1);
598  Chi2Prob->setAxisTitle("Number of Tracks", 2);
599 
600  histname = "Chi2oNDF_";
601  Chi2oNDF = ibooker.book1D(histname + CategoryName, histname + CategoryName, Chi2NDFBin, Chi2NDFMin, Chi2NDFMax);
602  Chi2oNDF->setAxisTitle("Track #chi^{2}/ndf", 1);
603  Chi2oNDF->setAxisTitle("Number of Tracks", 2);
604 
606  //HI PLOTS///
608  if (doHIPlots_) {
609  histname = "LongDCASig_";
610  LongDCASig =
611  ibooker.book1D(histname + CategoryName, histname + CategoryName, LongDCABins, LongDCAMin, LongDCAMax);
612  LongDCASig->setAxisTitle("dz/#sigma_{dz}", 1);
613 
614  histname = "TransDCASig_";
615  TransDCASig =
616  ibooker.book1D(histname + CategoryName, histname + CategoryName, TransDCABins, TransDCAMin, TransDCAMax);
617  TransDCASig->setAxisTitle("dxy/#sigma_{dxy}", 1);
618 
619  histname = "dNdPhi_HighPurity_";
620  dNdPhi_HighPurity = ibooker.book1D(histname + CategoryName, histname + CategoryName, PhiBin, PhiMin, PhiMax);
621  dNdPhi_HighPurity->setAxisTitle("#phi", 1);
622 
623  histname = "dNdEta_HighPurity_";
624  dNdEta_HighPurity = ibooker.book1D(histname + CategoryName, histname + CategoryName, EtaBin, EtaMin, EtaMax);
625  dNdEta_HighPurity->setAxisTitle("#eta", 1);
626 
627  histname = "dNdPt_HighPurity_";
628  dNdPt_HighPurity = ibooker.book1D(histname + CategoryName, histname + CategoryName, 150, 0, 0.3);
629  dNdPt_HighPurity->setAxisTitle("#sigma_{p_{T}}/p_{T}", 1);
630 
631  histname = "NhitVsEta_HighPurity_";
633  ibooker.bookProfile(histname + CategoryName, histname + CategoryName, EtaBin, EtaMin, EtaMax, -0.5, 39.5, "");
634  NhitVsEta_HighPurity->setAxisTitle("Track #eta", 1);
635  NhitVsEta_HighPurity->setAxisTitle("Number of Valid RecHits in each Track", 2);
636 
637  histname = "NhitVsPhi_HighPurity_";
639  ibooker.bookProfile(histname + CategoryName, histname + CategoryName, PhiBin, PhiMin, PhiMax, -0.5, 39.5, "");
640  NhitVsPhi_HighPurity->setAxisTitle("Track #phi", 1);
641  NhitVsPhi_HighPurity->setAxisTitle("Number of Valid RecHits in each Track", 2);
642 
643  histname = "Ptdist_HighPurity_";
644  Ptdist_HighPurity = ibooker.book1D(histname + CategoryName, histname + CategoryName, 150, 0, 50.);
645  Ptdist_HighPurity->setAxisTitle("p_{T} (GeV/c)", 1);
646  Ptdist_HighPurity->setAxisTitle("Number of Tracks", 2);
647 
648  histname = "dNhitdPt_HighPurity_";
650  ibooker.bookProfile(histname + CategoryName, histname + CategoryName, 150, 0, 25., -0.5, 39.5, "");
651  dNhitdPt_HighPurity->setAxisTitle("p_{T} (GeV/c)", 1);
652  dNhitdPt_HighPurity->setAxisTitle("N_{hit}", 2);
653  }
654 
656  histname = "xPointOfClosestApproach_";
657  xPointOfClosestApproach = ibooker.book1D(histname + CategoryName, histname + CategoryName, VXBin, VXMin, VXMax);
658  xPointOfClosestApproach->setAxisTitle("x component of Track PCA to beam line (cm)", 1);
659  xPointOfClosestApproach->setAxisTitle("Number of Tracks", 2);
660 
661  histname = "yPointOfClosestApproach_";
662  yPointOfClosestApproach = ibooker.book1D(histname + CategoryName, histname + CategoryName, VYBin, VYMin, VYMax);
663  yPointOfClosestApproach->setAxisTitle("y component of Track PCA to beam line (cm)", 1);
664  yPointOfClosestApproach->setAxisTitle("Number of Tracks", 2);
665 
666  histname = "zPointOfClosestApproach_";
667  zPointOfClosestApproach = ibooker.book1D(histname + CategoryName, histname + CategoryName, VZBin, VZMin, VZMax);
668  zPointOfClosestApproach->setAxisTitle("z component of Track PCA to beam line (cm)", 1);
669  zPointOfClosestApproach->setAxisTitle("Number of Tracks", 2);
670 
671  histname = "xPointOfClosestApproachToPV_";
673  ibooker.book1D(histname + CategoryName, histname + CategoryName, VXBin, VXMin, VXMax);
674  xPointOfClosestApproachToPV->setAxisTitle("x component of Track PCA to pv (cm)", 1);
675  xPointOfClosestApproachToPV->setAxisTitle("Number of Tracks", 2);
676 
677  histname = "yPointOfClosestApproachToPV_";
679  ibooker.book1D(histname + CategoryName, histname + CategoryName, VYBin, VYMin, VYMax);
680  yPointOfClosestApproachToPV->setAxisTitle("y component of Track PCA to pv line (cm)", 1);
681  yPointOfClosestApproachToPV->setAxisTitle("Number of Tracks", 2);
682 
683  histname = "zPointOfClosestApproachToPV_";
685  ibooker.book1D(histname + CategoryName, histname + CategoryName, VZBin, VZMin, VZMax);
686  zPointOfClosestApproachToPV->setAxisTitle("z component of Track PCA to pv line (cm)", 1);
687  zPointOfClosestApproachToPV->setAxisTitle("Number of Tracks", 2);
688  }
689 
690  // See DataFormats/TrackReco/interface/TrackBase.h for track algorithm enum definition
691  // http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/DataFormats/TrackReco/interface/TrackBase.h?view=log
692  histname = "algorithm_";
693  algorithm = ibooker.book1D(histname + CategoryName,
694  histname + CategoryName,
696  0.,
697  double(reco::TrackBase::algoSize));
698  algorithm->setAxisTitle("Tracking algorithm", 1);
699  algorithm->setAxisTitle("Number of Tracks", 2);
700 
701  histname = "originalAlgorithm_";
702  oriAlgo = ibooker.book1D(histname + CategoryName,
703  histname + CategoryName,
705  0.,
706  double(reco::TrackBase::algoSize));
707  oriAlgo->setAxisTitle("Tracking algorithm", 1);
708  oriAlgo->setAxisTitle("Number of Tracks", 2);
709 
710  for (size_t ibin = 0; ibin < reco::TrackBase::algoSize - 1; ibin++) {
713  }
714 
715  size_t StopReasonNameSize = sizeof(StopReasonName::StopReasonName) / sizeof(std::string);
716  histname = "stoppingSource_";
717  stoppingSource = ibooker.book1D(
718  histname + CategoryName, histname + CategoryName, StopReasonNameSize, 0., double(StopReasonNameSize));
719  stoppingSource->setAxisTitle("stopping reason", 1);
720  stoppingSource->setAxisTitle("Number of Tracks", 2);
721 
722  histname = "stoppingSourceVSeta_";
724  ibooker.bookProfile(histname + CategoryName, histname + CategoryName, EtaBin, EtaMin, EtaMax, 2, 0., 2.);
725  stoppingSourceVSeta->setAxisTitle("track #eta", 1);
726  stoppingSourceVSeta->setAxisTitle("stopped fraction", 2);
727 
728  histname = "stoppingSourceVSphi_";
730  ibooker.bookProfile(histname + CategoryName, histname + CategoryName, PhiBin, PhiMin, PhiMax, 2, 0., 2.);
731  stoppingSourceVSphi->setAxisTitle("track #phi", 1);
732  stoppingSourceVSphi->setAxisTitle("stopped fraction", 2);
733 
734  for (size_t ibin = 0; ibin < StopReasonNameSize; ibin++) {
736  }
737  }
738 }
739 
741  // parameters from the configuration
742  std::string QualName = conf_->getParameter<std::string>("Quality");
744 
745  // use the AlgoName and Quality Name
746  std::string CategoryName = !QualName.empty() ? AlgoName + "_" + QualName : AlgoName;
747 
748  // book LS analysis related histograms
749  // -----------------------------------
750  if (doLumiAnalysis_) {
751  // get binning from the configuration
752  int TKHitBin = conf_->getParameter<int>("RecHitBin");
753  double TKHitMin = conf_->getParameter<double>("RecHitMin");
754  double TKHitMax = conf_->getParameter<double>("RecHitMax");
755 
756  int Chi2NDFBin = conf_->getParameter<int>("Chi2NDFBin");
757  double Chi2NDFMin = conf_->getParameter<double>("Chi2NDFMin");
758  double Chi2NDFMax = conf_->getParameter<double>("Chi2NDFMax");
759 
760  // add by Mia in order to deal w/ LS transitions
761  ibooker.setCurrentFolder(TopFolder_ + "/LSanalysis");
762 
763  histname = "NumberOfRecHitsPerTrack_lumiFlag_";
765  ibooker.book1D(histname + CategoryName, histname + CategoryName, TKHitBin, TKHitMin, TKHitMax);
766  NumberOfRecHitsPerTrack_lumiFlag->setAxisTitle("Number of all RecHits of each Track");
767  NumberOfRecHitsPerTrack_lumiFlag->setAxisTitle("Number of Tracks", 2);
768 
769  histname = "Chi2oNDF_lumiFlag_";
771  ibooker.book1D(histname + CategoryName, histname + CategoryName, Chi2NDFBin, Chi2NDFMin, Chi2NDFMax);
772  Chi2oNDF_lumiFlag->setAxisTitle("Track #chi^{2}/ndf", 1);
773  Chi2oNDF_lumiFlag->setAxisTitle("Number of Tracks", 2);
774  }
775 }
776 
778  // parameters from the configuration
779  std::string QualName = conf_->getParameter<std::string>("Quality");
781 
782  // use the AlgoName and Quality Name
783  std::string CategoryName = !QualName.empty() ? AlgoName + "_" + QualName : AlgoName;
784  std::string Folder = TopFolder_.substr(0, 2);
785 
786  // book the Beam Spot related histograms
787  // ---------------------------------------------------------------------------------//
788 
789  if (doDCAPlots_ || doBSPlots_ || doAllPlots_) {
790  int DxyErrBin = conf_->getParameter<int>("DxyErrBin");
791  double DxyErrMax = conf_->getParameter<double>("DxyErrMax");
792 
793  int DxyBin = conf_->getParameter<int>("DxyBin");
794  double DxyMin = conf_->getParameter<double>("DxyMin");
795  double DxyMax = conf_->getParameter<double>("DxyMax");
796 
797  int AbsDxyBin = conf_->getParameter<int>("AbsDxyBin");
798  double AbsDxyMin = conf_->getParameter<double>("AbsDxyMin");
799  double AbsDxyMax = conf_->getParameter<double>("AbsDxyMax");
800 
801  int PhiBin = conf_->getParameter<int>("PhiBin");
802  double PhiMin = conf_->getParameter<double>("PhiMin");
803  double PhiMax = conf_->getParameter<double>("PhiMax");
804 
805  int EtaBin = conf_->getParameter<int>("EtaBin");
806  double EtaMin = conf_->getParameter<double>("EtaMin");
807  double EtaMax = conf_->getParameter<double>("EtaMax");
808 
809  int PtBin = conf_->getParameter<int>("TrackPtBin");
810  double PtMin = conf_->getParameter<double>("TrackPtMin");
811  double PtMax = conf_->getParameter<double>("TrackPtMax");
812 
813  int X0Bin = conf_->getParameter<int>("X0Bin");
814  double X0Min = conf_->getParameter<double>("X0Min");
815  double X0Max = conf_->getParameter<double>("X0Max");
816 
817  int Y0Bin = conf_->getParameter<int>("Y0Bin");
818  double Y0Min = conf_->getParameter<double>("Y0Min");
819  double Y0Max = conf_->getParameter<double>("Y0Max");
820 
821  int Z0Bin = conf_->getParameter<int>("Z0Bin");
822  double Z0Min = conf_->getParameter<double>("Z0Min");
823  double Z0Max = conf_->getParameter<double>("Z0Max");
824 
825  int VZBinProf = conf_->getParameter<int>("VZBinProf");
826  double VZMinProf = conf_->getParameter<double>("VZMinProf");
827  double VZMaxProf = conf_->getParameter<double>("VZMaxProf");
828 
829  ibooker.setCurrentFolder(TopFolder_ + "/GeneralProperties");
830 
831  histname = "DistanceOfClosestApproachError_";
833  ibooker.book1D(histname + CategoryName, histname + CategoryName, DxyErrBin, 0., DxyErrMax);
834  DistanceOfClosestApproachError->setAxisTitle("Track d_{xy} error (cm)", 1);
835  DistanceOfClosestApproachError->setAxisTitle("Number of Tracks", 2);
836 
837  histname = "DistanceOfClosestApproachErrorVsPt_";
839  ibooker.bookProfile(histname + CategoryName, histname + CategoryName, PtBin, PtMin, PtMax, 0., DxyErrMax);
840  DistanceOfClosestApproachErrorVsPt->setAxisTitle("Track p_{T} (GeV)", 1);
841  DistanceOfClosestApproachErrorVsPt->setAxisTitle("Track d_{xy} error (cm)", 2);
842 
843  histname = "DistanceOfClosestApproachErrorVsEta_";
845  ibooker.bookProfile(histname + CategoryName, histname + CategoryName, EtaBin, EtaMin, EtaMax, 0., DxyErrMax);
847  DistanceOfClosestApproachErrorVsEta->setAxisTitle("Track d_{xy} error (cm)", 2);
848 
849  histname = "DistanceOfClosestApproachErrorVsPhi_";
851  ibooker.bookProfile(histname + CategoryName, histname + CategoryName, PhiBin, PhiMin, PhiMax, 0., DxyErrMax);
853  DistanceOfClosestApproachErrorVsPhi->setAxisTitle("Track d_{xy} error (cm)", 2);
854 
855  histname = "DistanceOfClosestApproachErrorVsDxy_";
857  ibooker.bookProfile(histname + CategoryName, histname + CategoryName, DxyBin, DxyMin, DxyMax, 0., DxyErrMax);
859  DistanceOfClosestApproachErrorVsDxy->setAxisTitle("Track d_{xy} error (cm)", 2);
860 
861  histname = "DistanceOfClosestApproachToBS_";
863  ibooker.book1D(histname + CategoryName, histname + CategoryName, DxyBin, DxyMin, DxyMax);
864  DistanceOfClosestApproachToBS->setAxisTitle("Track d_{xy} wrt beam spot (cm)", 1);
865  DistanceOfClosestApproachToBS->setAxisTitle("Number of Tracks", 2);
866 
867  if (Folder == "Tr") {
868  histname = "DistanceOfClosestApproachToBSdz_";
870  ibooker.book1D(histname + CategoryName, histname + CategoryName, 100, -20.1, 20.1);
871  DistanceOfClosestApproachToBSdz->setAxisTitle("Track d_{z} wrt beam spot (cm)", 1);
872  DistanceOfClosestApproachToBSdz->setAxisTitle("Number of Tracks", 2);
873 
874  histname = "DistanceOfClosestApproachToBSVsEta_";
876  histname + CategoryName, histname + CategoryName, EtaBin, EtaMin, EtaMax, DxyBin, DxyMin, DxyMax, "");
878  DistanceOfClosestApproachToBSVsEta->setAxisTitle("Track d_{xy} wrt beam spot (cm)", 2);
879  }
880 
881  histname = "AbsDistanceOfClosestApproachToBS_";
883  ibooker.book1D(histname + CategoryName, histname + CategoryName, AbsDxyBin, AbsDxyMin, AbsDxyMax);
884  AbsDistanceOfClosestApproachToBS->setAxisTitle("Track |d_{xy}| wrt beam spot (cm)", 1);
885  AbsDistanceOfClosestApproachToBS->setAxisTitle("Number of Tracks", 2);
886 
887  histname = "DistanceOfClosestApproachToBSVsPhi_";
889  histname + CategoryName, histname + CategoryName, PhiBin, PhiMin, PhiMax, DxyBin, DxyMin, DxyMax, "");
891  DistanceOfClosestApproachToBSVsPhi->setAxisTitle("Track d_{xy} wrt beam spot (cm)", 2);
892 
893  histname = "xPointOfClosestApproachVsZ0wrt000_";
895  histname + CategoryName, histname + CategoryName, Z0Bin, Z0Min, Z0Max, X0Bin, X0Min, X0Max, "");
897  xPointOfClosestApproachVsZ0wrt000->setAxisTitle("x component of Track PCA to beam line (cm)", 2);
898 
899  histname = "yPointOfClosestApproachVsZ0wrt000_";
901  histname + CategoryName, histname + CategoryName, Z0Bin, Z0Min, Z0Max, Y0Bin, Y0Min, Y0Max, "");
903  yPointOfClosestApproachVsZ0wrt000->setAxisTitle("y component of Track PCA to beam line (cm)", 2);
904 
905  histname = "xPointOfClosestApproachVsZ0wrtBS_";
907  histname + CategoryName, histname + CategoryName, Z0Bin, Z0Min, Z0Max, X0Bin, X0Min, X0Max, "");
908  xPointOfClosestApproachVsZ0wrtBS->setAxisTitle("d_{z} w.r.t. Beam Spot (cm)", 1);
909  xPointOfClosestApproachVsZ0wrtBS->setAxisTitle("x component of Track PCA to BS (cm)", 2);
910 
911  histname = "yPointOfClosestApproachVsZ0wrtBS_";
913  histname + CategoryName, histname + CategoryName, Z0Bin, Z0Min, Z0Max, Y0Bin, Y0Min, Y0Max, "");
914  yPointOfClosestApproachVsZ0wrtBS->setAxisTitle("d_{z} w.r.t. Beam Spot (cm)", 1);
915  yPointOfClosestApproachVsZ0wrtBS->setAxisTitle("y component of Track PCA to BS (cm)", 2);
916 
917  histname = "zPointOfClosestApproachVsPhi_";
919  histname + CategoryName, histname + CategoryName, PhiBin, PhiMin, PhiMax, VZBinProf, VZMinProf, VZMaxProf, "");
920  zPointOfClosestApproachVsPhi->setAxisTitle("Track #phi", 1);
921  zPointOfClosestApproachVsPhi->setAxisTitle("z component of Track PCA to beam line (cm)", 2);
922  }
923 
924  if (doDCAPlots_ || doPVPlots_ || doAllPlots_) {
925  int DxyBin = conf_->getParameter<int>("DxyBin");
926  double DxyMin = conf_->getParameter<double>("DxyMin");
927  double DxyMax = conf_->getParameter<double>("DxyMax");
928 
929  int PhiBin = conf_->getParameter<int>("PhiBin");
930  double PhiMin = conf_->getParameter<double>("PhiMin");
931  double PhiMax = conf_->getParameter<double>("PhiMax");
932 
933  int X0Bin = conf_->getParameter<int>("X0Bin");
934  double X0Min = conf_->getParameter<double>("X0Min");
935  double X0Max = conf_->getParameter<double>("X0Max");
936 
937  int Y0Bin = conf_->getParameter<int>("Y0Bin");
938  double Y0Min = conf_->getParameter<double>("Y0Min");
939  double Y0Max = conf_->getParameter<double>("Y0Max");
940 
941  int Z0Bin = conf_->getParameter<int>("Z0Bin");
942  double Z0Min = conf_->getParameter<double>("Z0Min");
943  double Z0Max = conf_->getParameter<double>("Z0Max");
944 
945  ibooker.setCurrentFolder(TopFolder_ + "/GeneralProperties");
946 
947  histname = "DistanceOfClosestApproachToPV_";
949  ibooker.book1D(histname + CategoryName, histname + CategoryName, DxyBin, DxyMin, DxyMax);
950  DistanceOfClosestApproachToPV->setAxisTitle("Track d_{xy} w.r.t. PV (cm)", 1);
951  DistanceOfClosestApproachToPV->setAxisTitle("Number of Tracks", 2);
952 
953  histname = "DistanceOfClosestApproachToPVZoom_";
955  ibooker.book1D(histname + CategoryName, histname + CategoryName, 100, -0.08, 0.08);
956  DistanceOfClosestApproachToPVZoom->setAxisTitle("Track d_{xy} w.r.t. PV (cm)", 1);
957  DistanceOfClosestApproachToPVZoom->setAxisTitle("Number of Tracks", 2);
958 
959  histname = "DeltaZToPV_";
960  DeltaZToPV = ibooker.book1D(histname + CategoryName, histname + CategoryName, Z0Bin, Z0Min, Z0Max);
961  DeltaZToPV->setAxisTitle("Track d_{z} w.r.t. PV (cm)", 1);
962  DeltaZToPV->setAxisTitle("Number of Tracks", 2);
963 
964  histname = "DeltaZToPVZoom_";
965  DeltaZToPVZoom = ibooker.book1D(histname + CategoryName, histname + CategoryName, 100, -0.15, 0.15);
966  DeltaZToPVZoom->setAxisTitle("Track d_{z} w.r.t. PV (cm)", 1);
967  DeltaZToPVZoom->setAxisTitle("Number of Tracks", 2);
968 
969  histname = "DistanceOfClosestApproachToPVVsPhi_";
971  histname + CategoryName, histname + CategoryName, PhiBin, PhiMin, PhiMax, DxyBin, DxyMin, DxyMax, "");
973  DistanceOfClosestApproachToPVVsPhi->setAxisTitle("Track d_{xy} w.r.t. PV (cm)", 2);
974 
975  histname = "xPointOfClosestApproachVsZ0wrtPV_";
977  histname + CategoryName, histname + CategoryName, Z0Bin, Z0Min, Z0Max, X0Bin, X0Min, X0Max, "");
978  xPointOfClosestApproachVsZ0wrtPV->setAxisTitle("d_{z} w.r.t. PV (cm)", 1);
979  xPointOfClosestApproachVsZ0wrtPV->setAxisTitle("x component of Track PCA to PV (cm)", 2);
980 
981  histname = "yPointOfClosestApproachVsZ0wrtPV_";
983  histname + CategoryName, histname + CategoryName, Z0Bin, Z0Min, Z0Max, Y0Bin, Y0Min, Y0Max, "");
984  yPointOfClosestApproachVsZ0wrtPV->setAxisTitle("d_{z} w.r.t. PV (cm)", 1);
985  yPointOfClosestApproachVsZ0wrtPV->setAxisTitle("y component of Track PCA to PV (cm)", 2);
986  }
987 
988  if (doBSPlots_ || doAllPlots_) {
989  if (doTestPlots_) {
990  int DxyBin = conf_->getParameter<int>("DxyBin");
991  double DxyMin = conf_->getParameter<double>("DxyMin");
992  double DxyMax = conf_->getParameter<double>("DxyMax");
993 
994  int PhiBin = conf_->getParameter<int>("PhiBin");
995  double PhiMin = conf_->getParameter<double>("PhiMin");
996  double PhiMax = conf_->getParameter<double>("PhiMax");
997 
998  histname = "TESTDistanceOfClosestApproachToBS_";
1000  ibooker.book1D(histname + CategoryName, histname + CategoryName, DxyBin, DxyMin, DxyMax);
1001  TESTDistanceOfClosestApproachToBS->setAxisTitle("Track d_{xy} wrt beam spot (cm)", 1);
1002  TESTDistanceOfClosestApproachToBS->setAxisTitle("Number of Tracks", 2);
1003 
1004  histname = "TESTDistanceOfClosestApproachToBSVsPhi_";
1006  histname + CategoryName, histname + CategoryName, PhiBin, PhiMin, PhiMax, DxyBin, DxyMin, DxyMax, "");
1008  TESTDistanceOfClosestApproachToBSVsPhi->setAxisTitle("Track d_{xy} wrt beam spot (cm)", 2);
1009  }
1010  }
1011 
1012  // book the Profile plots for DCA related histograms
1013  // ---------------------------------------------------------------------------------//
1014  if (doDCAPlots_ || doAllPlots_) {
1015  if (doDCAwrt000Plots_) {
1016  int EtaBin = conf_->getParameter<int>("EtaBin");
1017  double EtaMin = conf_->getParameter<double>("EtaMin");
1018  double EtaMax = conf_->getParameter<double>("EtaMax");
1019 
1020  int PhiBin = conf_->getParameter<int>("PhiBin");
1021  double PhiMin = conf_->getParameter<double>("PhiMin");
1022  double PhiMax = conf_->getParameter<double>("PhiMax");
1023 
1024  int DxyBin = conf_->getParameter<int>("DxyBin");
1025  double DxyMin = conf_->getParameter<double>("DxyMin");
1026  double DxyMax = conf_->getParameter<double>("DxyMax");
1027 
1028  if (doThetaPlots_) {
1029  int ThetaBin = conf_->getParameter<int>("ThetaBin");
1030  double ThetaMin = conf_->getParameter<double>("ThetaMin");
1031  double ThetaMax = conf_->getParameter<double>("ThetaMax");
1032 
1033  ibooker.setCurrentFolder(TopFolder_ + "/GeneralProperties");
1034  histname = "DistanceOfClosestApproachVsTheta_";
1036  histname + CategoryName, histname + CategoryName, ThetaBin, ThetaMin, ThetaMax, DxyMin, DxyMax, "");
1037  DistanceOfClosestApproachVsTheta->setAxisTitle("Track #theta", 1);
1038  DistanceOfClosestApproachVsTheta->setAxisTitle("Track d_{xy} wrt (0,0,0) (cm)", 2);
1039  }
1040 
1041  histname = "DistanceOfClosestApproachVsEta_";
1043  histname + CategoryName, histname + CategoryName, EtaBin, EtaMin, EtaMax, DxyMin, DxyMax, "");
1044  DistanceOfClosestApproachVsEta->setAxisTitle("Track #eta", 1);
1045  DistanceOfClosestApproachVsEta->setAxisTitle("Track d_{xy} wrt (0,0,0) (cm)", 2);
1046  // temporary patch in order to put back those MEs in Muon Workspace
1047 
1048  histname = "DistanceOfClosestApproach_";
1050  ibooker.book1D(histname + CategoryName, histname + CategoryName, DxyBin, DxyMin, DxyMax);
1051  DistanceOfClosestApproach->setAxisTitle("Track d_{xy} wrt (0,0,0) (cm)", 1);
1052  DistanceOfClosestApproach->setAxisTitle("Number of Tracks", 2);
1053 
1054  histname = "DistanceOfClosestApproachVsPhi_";
1056  histname + CategoryName, histname + CategoryName, PhiBin, PhiMin, PhiMax, DxyMin, DxyMax, "");
1057  DistanceOfClosestApproachVsPhi->setAxisTitle("Track #phi", 1);
1058  DistanceOfClosestApproachVsPhi->setAxisTitle("Track d_{xy} wrt (0,0,0) (cm)", 2);
1059  }
1060  }
1061 
1062  if (doSIPPlots_ || doAllPlots_) {
1063  const double sipBins = 200;
1064  const double sipMin = -20;
1065  const double sipMax = 20;
1066 
1067  ibooker.setCurrentFolder(TopFolder_ + "/GeneralProperties");
1068 
1069  // SIP wrt. beamspot
1070  histname = "SIPDxyToBS_";
1071  sipDxyToBS = ibooker.book1D(histname + CategoryName, histname + CategoryName, sipBins, sipMin, sipMax);
1072  sipDxyToBS->setAxisTitle("Track dxy significance wrt beam spot", 1);
1073  sipDxyToBS->setAxisTitle("Number of Tracks", 2);
1074 
1075  histname = "SIPDzToBS_";
1076  sipDzToBS = ibooker.book1D(histname + CategoryName, histname + CategoryName, sipBins, sipMin, sipMax);
1077  sipDzToBS->setAxisTitle("Track dz significance wrt beam spot", 1);
1078  sipDzToBS->setAxisTitle("Number of Tracks", 2);
1079 
1080  // SIP wrt. vertex
1081  histname = "SIP3DToPV_";
1082  sip3dToPV = ibooker.book1D(histname + CategoryName, histname + CategoryName, sipBins, sipMin, sipMax);
1083  sip3dToPV->setAxisTitle("3D IP significance wrt primary vertex", 1);
1084  sip3dToPV->setAxisTitle("Number of Tracks", 2);
1085 
1086  histname = "SIP2DToPV_";
1087  sip2dToPV = ibooker.book1D(histname + CategoryName, histname + CategoryName, sipBins, sipMin, sipMax);
1088  sip2dToPV->setAxisTitle("2D IP significance wrt primary vertex", 1);
1089  sip2dToPV->setAxisTitle("Number of Tracks", 2);
1090 
1091  histname = "SIPDxyToPV_";
1092  sipDxyToPV = ibooker.book1D(histname + CategoryName, histname + CategoryName, sipBins, sipMin, sipMax);
1093  sipDxyToPV->setAxisTitle("Track dxy significance wrt primary vertex", 1);
1094  sipDxyToPV->setAxisTitle("Number of Tracks", 2);
1095 
1096  histname = "SIPDzToPV_";
1097  sipDzToPV = ibooker.book1D(histname + CategoryName, histname + CategoryName, sipBins, sipMin, sipMax);
1098  sipDzToPV->setAxisTitle("Track dz significance wrt primary vertex", 1);
1099  sipDzToPV->setAxisTitle("Number of Tracks", 2);
1100  }
1101 }
1102 
1103 // -- Analyse
1104 // ---------------------------------------------------------------------------------//
1106  good_vertices_ = 0;
1107 
1108  edm::Handle<reco::VertexCollection> recoPrimaryVerticesHandle = iEvent.getHandle(pvToken_);
1109  if (recoPrimaryVerticesHandle.isValid())
1110  if (!recoPrimaryVerticesHandle->empty())
1111  for (const auto& v : *recoPrimaryVerticesHandle)
1112  if (v.ndof() >= pvNDOF_ && !v.isFake())
1113  ++good_vertices_;
1114 }
1115 
1116 void TrackAnalyzer::setBX(const edm::Event& iEvent) { bx_ = iEvent.bunchCrossing(); }
1117 
1119  // as done by pixelLumi http://cmslxr.fnal.gov/source/DQM/PixelLumi/plugins/PixelLumiDQM.cc
1120 
1121  if (forceSCAL_) {
1123  if (lumiScalers.isValid() && !lumiScalers->empty()) {
1124  LumiScalersCollection::const_iterator scalit = lumiScalers->begin();
1125  online_lumi_ = scalit->instantLumi();
1126  } else
1127  online_lumi_ = -1;
1128  } else {
1130  if (metaData.isValid())
1131  online_lumi_ = metaData->instLumi();
1132  else
1133  online_lumi_ = -1;
1134  }
1135 
1137  if (pixelClusters.isValid()) {
1138  TrackerTopology const& tTopo = iSetup.getData(trackerTopologyToken_);
1139 
1140  // Count the number of clusters with at least a minimum
1141  // number of pixels per cluster and at least a minimum charge.
1142  size_t numClusters = 0;
1143 
1145  for (; pixCluDet != pixelClusters->end(); ++pixCluDet) {
1146  DetId detid = pixCluDet->detId();
1147  size_t subdetid = detid.subdetId();
1148  // std::cout << tTopo.print(detid) << std::endl;
1149  if (subdetid == (int)PixelSubdetector::PixelBarrel)
1150  if (tTopo.layer(detid) == 1)
1151  continue;
1152 
1154  for (; pixClu != pixCluDet->end(); ++pixClu) {
1155  if ((pixClu->size() >= minNumberOfPixelsPerCluster_) && (pixClu->charge() >= minPixelClusterCharge_)) {
1156  ++numClusters;
1157  }
1158  }
1159  }
1160  pixel_lumi_ = lumi_factor_per_bx_ * numClusters / GetLumi::CM2_TO_NANOBARN; // ?!?!
1161  } else
1162  pixel_lumi_ = -1.;
1163 }
1164 
1166  auto pt = track.pt();
1167  auto phi = track.phi();
1168  // double eta = track.eta();
1169  auto phiIn = track.innerPosition().phi();
1170  auto etaIn = track.innerPosition().eta();
1171  auto phiOut = track.outerPosition().phi();
1172  auto etaOut = track.outerPosition().eta();
1173 
1174  int nRecHits = track.hitPattern().numberOfAllHits(reco::HitPattern::TRACK_HITS);
1175  int nValidRecHits = track.numberOfValidHits();
1176  int nLostRecHits = track.numberOfLostHits();
1177  int nLostIn = track.hitPattern().numberOfLostTrackerHits(reco::HitPattern::MISSING_INNER_HITS);
1178  int nLostOut = track.hitPattern().numberOfLostTrackerHits(reco::HitPattern::MISSING_OUTER_HITS);
1179 
1180  auto chi2 = track.chi2();
1181  auto chi2prob = TMath::Prob(track.chi2(), (int)track.ndof());
1182  auto chi2oNDF = track.normalizedChi2();
1183 
1184  std::string Folder = TopFolder_.substr(0, 2);
1185 
1187  // rec hits
1188  NumberOfRecHitsPerTrack->Fill(nRecHits);
1189  NumberOfValidRecHitsPerTrack->Fill(nValidRecHits);
1190  NumberOfLostRecHitsPerTrack->Fill(nLostRecHits);
1191  NumberOfMIRecHitsPerTrack->Fill(nLostIn);
1192  NumberOfMORecHitsPerTrack->Fill(nLostOut);
1193  ValidFractionPerTrack->Fill(track.validFraction());
1194 
1195  // 2D plots
1197  NumberOfValidRecHitVsPhiVsEtaPerTrack->Fill(etaIn, phiIn, nValidRecHits);
1198  NumberOfLostRecHitVsPhiVsEtaPerTrack->Fill(etaIn, phiIn, nLostRecHits);
1199  NumberOfMIRecHitVsPhiVsEtaPerTrack->Fill(etaIn, phiIn, nLostIn);
1200  NumberOfMORecHitVsPhiVsEtaPerTrack->Fill(etaOut, phiOut, nLostOut);
1201  ValidFractionVsPhiVsEtaPerTrack->Fill(etaIn, phiIn, track.validFraction());
1202  }
1204  NumberOfValidRecHitVsPtVsEtaPerTrack->Fill(etaIn, pt, nValidRecHits);
1205  NumberOfLostRecHitVsPtVsEtaPerTrack->Fill(etaIn, pt, nLostRecHits);
1206  NumberOfMIRecHitVsPtVsEtaPerTrack->Fill(etaIn, pt, nLostIn);
1207  NumberOfMORecHitVsPtVsEtaPerTrack->Fill(etaOut, pt, nLostOut);
1208  }
1209  NumberOfValidRecHitsPerTrackVsPt->Fill(pt, nValidRecHits);
1210  NumberOfLostRecHitsPerTrackVsPt->Fill(pt, nLostRecHits);
1213 
1214  int nLayers[5] = {track.hitPattern().trackerLayersWithMeasurement(),
1215  track.hitPattern().trackerLayersTotallyOffOrBad(),
1216  track.hitPattern().numberOfValidStripLayersWithMonoAndStereo() +
1217  track.hitPattern().pixelLayersWithMeasurement(),
1218  track.hitPattern().trackerLayersWithoutMeasurement(reco::HitPattern::TRACK_HITS),
1219  track.hitPattern().pixelLayersWithMeasurement()};
1220 
1221  // layers
1222  for (int i = 0; i < 4; ++i)
1224 
1225  // 2D plots
1227  for (int i = 0; i < 5; ++i)
1228  NumberOfLayersVsPhiVsEtaPerTrack[i]->Fill(etaIn, phiIn, nLayers[i]);
1229  }
1230 
1234  fillHistosForEfficiencyFromHitPatter(track, "VsBX", float(bx_), false);
1236  fillHistosForEfficiencyFromHitPatter(track, "VsOnlineLUMI", online_lumi_, false);
1237  // if (doEffFromHitPatternVsLUMI_ || doAllPlots_) fillHistosForEfficiencyFromHitPatter(track,"VsPIXELLUMI", pixel_lumi_ );
1242 
1244  // fitting
1245  Chi2->Fill(chi2);
1246  Chi2Prob->Fill(chi2prob);
1247  Chi2oNDF->Fill(chi2oNDF);
1248 
1249  // DCA
1250  // temporary patch in order to put back those MEs in Muon Workspace
1251  if (doDCAPlots_) {
1252  if (doDCAwrt000Plots_) {
1255  }
1256 
1257  // PCA
1258  xPointOfClosestApproach->Fill(track.referencePoint().x());
1259  yPointOfClosestApproach->Fill(track.referencePoint().y());
1260  zPointOfClosestApproach->Fill(track.referencePoint().z());
1261  }
1262 
1263  // algorithm
1264  algorithm->Fill(static_cast<double>(track.algo()));
1265  oriAlgo->Fill(static_cast<double>(track.originalAlgo()));
1266 
1267  // stopping source
1268  int max = stoppingSource->getNbinsX();
1269  double stop = track.stopReason() > max ? double(max - 1) : static_cast<double>(track.stopReason());
1270  double stopped = int(StopReason::NOT_STOPPED) == track.stopReason() ? 0. : 1.;
1271  stoppingSource->Fill(stop);
1272  stoppingSourceVSeta->Fill(track.eta(), stopped);
1273  stoppingSourceVSphi->Fill(track.phi(), stopped);
1274  }
1275 
1276  if (doLumiAnalysis_) {
1278  Chi2oNDF_lumiFlag->Fill(chi2oNDF);
1279  }
1280 
1282  edm::Handle<reco::BeamSpot> recoBeamSpotHandle = iEvent.getHandle(beamSpotToken_);
1283  const reco::BeamSpot& bs = *recoBeamSpotHandle;
1284 
1289  DistanceOfClosestApproachErrorVsDxy->Fill(track.dxy(bs.position()), track.dxyError());
1290 
1291  DistanceOfClosestApproachToBS->Fill(track.dxy(bs.position()));
1292 
1293  if (Folder == "Tr") {
1294  DistanceOfClosestApproachToBSdz->Fill(track.dz(bs.position()));
1295  DistanceOfClosestApproachToBSVsEta->Fill(track.eta(), track.dxy(bs.position()));
1296  }
1297 
1299  DistanceOfClosestApproachToBSVsPhi->Fill(track.phi(), track.dxy(bs.position()));
1303  xPointOfClosestApproachVsZ0wrtBS->Fill(track.dz(bs.position()), (track.vx() - bs.position(track.vz()).x()));
1304  yPointOfClosestApproachVsZ0wrtBS->Fill(track.dz(bs.position()), (track.vy() - bs.position(track.vz()).y()));
1305  if (doTestPlots_) {
1306  TESTDistanceOfClosestApproachToBS->Fill(track.dxy(bs.position(track.vz())));
1307  TESTDistanceOfClosestApproachToBSVsPhi->Fill(track.phi(), track.dxy(bs.position(track.vz())));
1308  }
1309 
1310  if (doSIPPlots_) {
1311  sipDxyToBS->Fill(track.dxy(bs.position()) / track.dxyError());
1312  sipDzToBS->Fill(track.dz(bs.position()) / track.dzError());
1313  }
1314  }
1315 
1317  edm::Handle<reco::VertexCollection> recoPrimaryVerticesHandle = iEvent.getHandle(pvToken_);
1318  if (recoPrimaryVerticesHandle.isValid() && !recoPrimaryVerticesHandle->empty()) {
1319  const reco::Vertex& pv = (*recoPrimaryVerticesHandle)[0];
1320 
1322  //HI PLOTS///////
1324 
1325  if (doHIPlots_) {
1326  double longDCAsig = 0, transDCAsig = 0;
1327  double zerr2 = track.dzError() * track.dzError() + pv.zError() * pv.zError();
1328  double xyerr2 = track.d0Error() * track.d0Error() + pv.xError() * pv.yError();
1329  if (zerr2 > 0)
1330  longDCAsig = track.dz(pv.position()) / zerr2;
1331  if (xyerr2 > 0)
1332  transDCAsig = track.dxy(pv.position()) / xyerr2;
1333  LongDCASig->Fill(longDCAsig);
1334  TransDCASig->Fill(transDCAsig);
1335 
1337  dNdEta_HighPurity->Fill(track.eta());
1338  dNdPhi_HighPurity->Fill(track.phi());
1339  dNdPt_HighPurity->Fill(track.ptError() / track.pt());
1340  NhitVsEta_HighPurity->Fill(track.eta(), track.numberOfValidHits());
1341  NhitVsPhi_HighPurity->Fill(track.phi(), track.numberOfValidHits());
1342  dNhitdPt_HighPurity->Fill(track.pt(), track.numberOfValidHits());
1343  Ptdist_HighPurity->Fill(track.pt());
1344  } //end of high quality tracks requirement
1345  }
1346 
1347  xPointOfClosestApproachToPV->Fill(track.vx() - pv.position().x());
1348  yPointOfClosestApproachToPV->Fill(track.vy() - pv.position().y());
1349  zPointOfClosestApproachToPV->Fill(track.dz(pv.position()));
1350  DistanceOfClosestApproachToPV->Fill(track.dxy(pv.position()));
1351  DeltaZToPV->Fill(track.dz(pv.position()));
1352  DistanceOfClosestApproachToPVZoom->Fill(track.dxy(pv.position()));
1353  DeltaZToPVZoom->Fill(track.dz(pv.position()));
1354  DistanceOfClosestApproachToPVVsPhi->Fill(track.phi(), track.dxy(pv.position()));
1355  xPointOfClosestApproachVsZ0wrtPV->Fill(track.dz(pv.position()), (track.vx() - pv.position().x()));
1356  yPointOfClosestApproachVsZ0wrtPV->Fill(track.dz(pv.position()), (track.vy() - pv.position().y()));
1357 
1358  if (doSIPPlots_) {
1360  reco::TransientTrack transTrack = theB.build(track);
1361 
1362  GlobalVector dir(track.px(), track.py(), track.pz());
1363  std::pair<bool, Measurement1D> ip3d = IPTools::signedImpactParameter3D(transTrack, dir, pv);
1364  std::pair<bool, Measurement1D> ip2d = IPTools::signedTransverseImpactParameter(transTrack, dir, pv);
1365  if (ip3d.first)
1366  sip3dToPV->Fill(ip3d.second.value() / ip3d.second.error());
1367  if (ip2d.first)
1368  sip2dToPV->Fill(ip2d.second.value() / ip2d.second.error());
1369  sipDxyToPV->Fill(track.dxy(pv.position()) / track.dxyError());
1370  sipDzToPV->Fill(track.dz(pv.position()) / track.dzError());
1371  }
1372  }
1373  }
1374 
1375  if (doDCAPlots_ || doAllPlots_) {
1376  if (doDCAwrt000Plots_) {
1377  if (doThetaPlots_) {
1379  }
1381  }
1382  }
1383 
1384  //Tracker Specific Histograms
1387  }
1389  if (stateName_ == "All") {
1390  fillHistosForState(iSetup, track, std::string("OuterSurface"));
1391  fillHistosForState(iSetup, track, std::string("InnerSurface"));
1392  fillHistosForState(iSetup, track, std::string("ImpactPoint"));
1393  } else if (stateName_ != "OuterSurface" && stateName_ != "InnerSurface" && stateName_ != "ImpactPoint" &&
1394  stateName_ != "default") {
1395  fillHistosForState(iSetup, track, std::string("default"));
1396  } else {
1398  }
1399  }
1400 
1401  if (doAllPlots_) {
1402  }
1403 }
1404 
1406  const std::string suffix,
1407  const float monitoring,
1408  bool useInac) {
1409  int mon = -1;
1410  for (int i = 0; i < monQuantity::END; i++) {
1411  if (monName[i] == suffix)
1412  mon = i;
1413  }
1414  if (useInac)
1415  mon += monQuantity::END;
1416 
1417  // if (track.pt() > 1.0 && track.dxy() < 0.1 and monitoring > 0) {
1418  if (track.pt() > 1.0 && track.dxy() < 0.1 and monitoring > -9.) {
1419  auto hp = track.hitPattern();
1420  // Here hit_category is meant to iterate over
1421  // reco::HitPattern::HitCategory, defined here:
1422  // http://cmslxr.fnal.gov/dxr/CMSSW/source/DataFormats/TrackReco/interface/HitPattern.h
1423  for (unsigned int category = 0; category < 3; ++category) {
1424  for (int hit = 0; hit < hp.numberOfAllHits((reco::HitPattern::HitCategory)(category)); ++hit) {
1425  auto pattern = hp.getHitPattern((reco::HitPattern::HitCategory)(category), hit);
1426  // Boolean bad is missing simply because it is inferred and the only missing case.
1427  bool valid = hp.validHitFilter(pattern);
1428  bool missing = hp.missingHitFilter(pattern);
1429  bool inactive = hp.inactiveHitFilter(pattern);
1430  int hit_type = -1;
1431  hit_type = valid ? 0 : (missing ? 1 : (inactive ? 2 : 3));
1432  if (hits_valid_.find(Key(hp.getSubStructure(pattern), hp.getSubSubStructure(pattern), mon)) ==
1433  hits_valid_.end()) {
1434  LogDebug("TrackAnalyzer") << "Invalid combination of detector and subdetector: ("
1435  << hp.getSubStructure(pattern) << ", " << hp.getSubSubStructure(pattern) << ", "
1436  << mon << "): ignoring it.\n";
1437  continue;
1438  }
1439  switch (hit_type) {
1440  case 0:
1441  hits_valid_[Key(hp.getSubStructure(pattern), hp.getSubSubStructure(pattern), mon)]->Fill(monitoring);
1442  hits_total_[Key(hp.getSubStructure(pattern), hp.getSubSubStructure(pattern), mon)]->Fill(monitoring);
1443  break;
1444  case 2:
1445  if (!useInac)
1446  break;
1447  [[fallthrough]];
1448  case 1:
1449  hits_total_[Key(hp.getSubStructure(pattern), hp.getSubSubStructure(pattern), mon)]->Fill(monitoring);
1450  break;
1451  default:
1452  LogDebug("TrackAnalyzer") << "Invalid hit category used " << hit_type << " ignored\n";
1453  }
1454  }
1455  }
1456  }
1457 }
1458 
1459 // book histograms at differnt measurement points
1460 // ---------------------------------------------------------------------------------//
1462  // parameters from the configuration
1463  std::string QualName = conf_->getParameter<std::string>("Quality");
1465  std::string Folder = TopFolder_.substr(0, 2);
1466 
1467  // use the AlgoName and Quality Name
1468  std::string CategoryName = !QualName.empty() ? AlgoName + "_" + QualName : AlgoName;
1469 
1470  // get binning from the configuration
1471  double Chi2NDFMin = conf_->getParameter<double>("Chi2NDFMin");
1472  double Chi2NDFMax = conf_->getParameter<double>("Chi2NDFMax");
1473 
1474  int RecHitBin = conf_->getParameter<int>("RecHitBin");
1475  double RecHitMin = conf_->getParameter<double>("RecHitMin");
1476  double RecHitMax = conf_->getParameter<double>("RecHitMax");
1477 
1478  int RecLayBin = conf_->getParameter<int>("RecHitBin");
1479  double RecLayMin = conf_->getParameter<double>("RecHitMin");
1480  double RecLayMax = conf_->getParameter<double>("RecHitMax");
1481 
1482  int PhiBin = conf_->getParameter<int>("PhiBin");
1483  double PhiMin = conf_->getParameter<double>("PhiMin");
1484  double PhiMax = conf_->getParameter<double>("PhiMax");
1485 
1486  int EtaBin = conf_->getParameter<int>("EtaBin");
1487  double EtaMin = conf_->getParameter<double>("EtaMin");
1488  double EtaMax = conf_->getParameter<double>("EtaMax");
1489 
1490  int Phi2DBin = conf_->getParameter<int>("Phi2DBin");
1491  int Eta2DBin = conf_->getParameter<int>("Eta2DBin");
1492 
1493  int ThetaBin = conf_->getParameter<int>("ThetaBin");
1494  double ThetaMin = conf_->getParameter<double>("ThetaMin");
1495  double ThetaMax = conf_->getParameter<double>("ThetaMax");
1496 
1497  int TrackQBin = conf_->getParameter<int>("TrackQBin");
1498  double TrackQMin = conf_->getParameter<double>("TrackQMin");
1499  double TrackQMax = conf_->getParameter<double>("TrackQMax");
1500 
1501  int TrackPtBin = conf_->getParameter<int>("TrackPtBin");
1502  double TrackPtMin = conf_->getParameter<double>("TrackPtMin");
1503  double TrackPtMax = conf_->getParameter<double>("TrackPtMax");
1504 
1505  int TrackPBin = conf_->getParameter<int>("TrackPBin");
1506  double TrackPMin = conf_->getParameter<double>("TrackPMin");
1507  double TrackPMax = conf_->getParameter<double>("TrackPMax");
1508 
1509  int TrackPxBin = conf_->getParameter<int>("TrackPxBin");
1510  double TrackPxMin = conf_->getParameter<double>("TrackPxMin");
1511  double TrackPxMax = conf_->getParameter<double>("TrackPxMax");
1512 
1513  int TrackPyBin = conf_->getParameter<int>("TrackPyBin");
1514  double TrackPyMin = conf_->getParameter<double>("TrackPyMin");
1515  double TrackPyMax = conf_->getParameter<double>("TrackPyMax");
1516 
1517  int TrackPzBin = conf_->getParameter<int>("TrackPzBin");
1518  double TrackPzMin = conf_->getParameter<double>("TrackPzMin");
1519  double TrackPzMax = conf_->getParameter<double>("TrackPzMax");
1520 
1521  int ptErrBin = conf_->getParameter<int>("ptErrBin");
1522  double ptErrMin = conf_->getParameter<double>("ptErrMin");
1523  double ptErrMax = conf_->getParameter<double>("ptErrMax");
1524 
1525  int pxErrBin = conf_->getParameter<int>("pxErrBin");
1526  double pxErrMin = conf_->getParameter<double>("pxErrMin");
1527  double pxErrMax = conf_->getParameter<double>("pxErrMax");
1528 
1529  int pyErrBin = conf_->getParameter<int>("pyErrBin");
1530  double pyErrMin = conf_->getParameter<double>("pyErrMin");
1531  double pyErrMax = conf_->getParameter<double>("pyErrMax");
1532 
1533  int pzErrBin = conf_->getParameter<int>("pzErrBin");
1534  double pzErrMin = conf_->getParameter<double>("pzErrMin");
1535  double pzErrMax = conf_->getParameter<double>("pzErrMax");
1536 
1537  int pErrBin = conf_->getParameter<int>("pErrBin");
1538  double pErrMin = conf_->getParameter<double>("pErrMin");
1539  double pErrMax = conf_->getParameter<double>("pErrMax");
1540 
1541  int phiErrBin = conf_->getParameter<int>("phiErrBin");
1542  double phiErrMin = conf_->getParameter<double>("phiErrMin");
1543  double phiErrMax = conf_->getParameter<double>("phiErrMax");
1544 
1545  int etaErrBin = conf_->getParameter<int>("etaErrBin");
1546  double etaErrMin = conf_->getParameter<double>("etaErrMin");
1547  double etaErrMax = conf_->getParameter<double>("etaErrMax");
1548 
1549  double Chi2ProbMin = conf_->getParameter<double>("Chi2ProbMin");
1550  double Chi2ProbMax = conf_->getParameter<double>("Chi2ProbMax");
1551 
1552  ibooker.setCurrentFolder(TopFolder_);
1553 
1554  TkParameterMEs tkmes;
1555 
1556  std::string histTag = (sname == "default") ? CategoryName : sname + "_" + CategoryName;
1557 
1558  if (doAllPlots_) {
1559  // general properties
1560  ibooker.setCurrentFolder(TopFolder_ + "/GeneralProperties");
1561 
1562  if (doThetaPlots_) {
1563  histname = "Chi2oNDFVsTheta_" + histTag;
1564  tkmes.Chi2oNDFVsTheta =
1566  tkmes.Chi2oNDFVsTheta->setAxisTitle("Track #theta", 1);
1567  tkmes.Chi2oNDFVsTheta->setAxisTitle("Track #chi^{2}/ndf", 2);
1568  }
1569  histname = "Chi2oNDFVsPhi_" + histTag;
1571  tkmes.Chi2oNDFVsPhi->setAxisTitle("Track #phi", 1);
1572  tkmes.Chi2oNDFVsPhi->setAxisTitle("Track #chi^{2}/ndf", 2);
1573 
1574  histname = "Chi2ProbVsPhi_" + histTag;
1575  tkmes.Chi2ProbVsPhi = ibooker.bookProfile(
1576  histname + CategoryName, histname + CategoryName, PhiBin, PhiMin, PhiMax, Chi2ProbMin, Chi2ProbMax);
1577  tkmes.Chi2ProbVsPhi->setAxisTitle("Tracks #phi", 1);
1578  tkmes.Chi2ProbVsPhi->setAxisTitle("Track #chi^{2} probability", 2);
1579 
1580  histname = "Chi2ProbVsEta_" + histTag;
1581  tkmes.Chi2ProbVsEta = ibooker.bookProfile(
1582  histname + CategoryName, histname + CategoryName, EtaBin, EtaMin, EtaMax, Chi2ProbMin, Chi2ProbMax);
1583  tkmes.Chi2ProbVsEta->setAxisTitle("Tracks #eta", 1);
1584  tkmes.Chi2ProbVsEta->setAxisTitle("Track #chi^{2} probability", 2);
1585  }
1586 
1587  // general properties
1588  ibooker.setCurrentFolder(TopFolder_ + "/GeneralProperties");
1589 
1590  histname = "Chi2oNDFVsEta_" + histTag;
1592  tkmes.Chi2oNDFVsEta->setAxisTitle("Track #eta", 1);
1593  tkmes.Chi2oNDFVsEta->setAxisTitle("Track #chi^{2}/ndf", 2);
1594 
1595  histname = "Chi2oNDFVsPt_" + histTag;
1596  tkmes.Chi2oNDFVsPt =
1598  tkmes.Chi2oNDFVsPt->setAxisTitle("Track p_{T} (GeV/c)", 1);
1599  tkmes.Chi2oNDFVsPt->setAxisTitle("Track #chi^{2}/ndf", 2);
1600 
1601  histname = "Chi2oNDFVsNHits_" + histTag;
1602  tkmes.Chi2oNDFVsNHits = ibooker.bookProfile(histname, histname, 50, 0., 50, Chi2NDFMin, Chi2NDFMax, "");
1603  tkmes.Chi2oNDFVsNHits->setAxisTitle("Track NHits", 1);
1604  tkmes.Chi2oNDFVsNHits->setAxisTitle("Track #chi^{2}/ndf", 2);
1605 
1606  histname = "TrackP_" + histTag;
1608  tkmes.TrackP->setAxisTitle("Track |p| (GeV/c)", 1);
1609  tkmes.TrackP->setAxisTitle("Number of Tracks", 2);
1610 
1611  histname = "TrackPt_" + histTag;
1613  tkmes.TrackPt->setAxisTitle("Track p_{T} (GeV/c)", 1);
1614  tkmes.TrackPt->setAxisTitle("Number of Tracks", 2);
1615 
1616  if (doTrackPxPyPlots_) {
1617  histname = "TrackPx_" + histTag;
1619  tkmes.TrackPx->setAxisTitle("Track p_{x} (GeV/c)", 1);
1620  tkmes.TrackPx->setAxisTitle("Number of Tracks", 2);
1621 
1622  histname = "TrackPy_" + histTag;
1624  tkmes.TrackPy->setAxisTitle("Track p_{y} (GeV/c)", 1);
1625  tkmes.TrackPy->setAxisTitle("Number of Tracks", 2);
1626  }
1627  histname = "TrackPz_" + histTag;
1629  tkmes.TrackPz->setAxisTitle("Track p_{z} (GeV/c)", 1);
1630  tkmes.TrackPz->setAxisTitle("Number of Tracks", 2);
1631 
1632  histname = "TrackPhi_" + histTag;
1633  tkmes.TrackPhi = ibooker.book1D(histname, histname, PhiBin, PhiMin, PhiMax);
1634  tkmes.TrackPhi->setAxisTitle("Track #phi", 1);
1635  tkmes.TrackPhi->setAxisTitle("Number of Tracks", 2);
1636 
1637  histname = "TrackEta_" + histTag;
1638  tkmes.TrackEta = ibooker.book1D(histname, histname, EtaBin, EtaMin, EtaMax);
1639  tkmes.TrackEta->setAxisTitle("Track #eta", 1);
1640  tkmes.TrackEta->setAxisTitle("Number of Tracks", 2);
1641 
1642  if (Folder == "Tr") {
1643  histname = "TrackPtHighPurity_" + histTag;
1645  tkmes.TrackPtHighPurity->setAxisTitle("Track p_{T} (GeV/c)", 1);
1646  tkmes.TrackPtHighPurity->setAxisTitle("Number of High Purity Tracks", 2);
1647 
1648  histname = "TrackPtTight_" + histTag;
1650  tkmes.TrackPtTight->setAxisTitle("Track p_{T} (GeV/c)", 1);
1651  tkmes.TrackPtTight->setAxisTitle("Number of Tight Tracks", 2);
1652 
1653  histname = "TrackPtLoose_" + histTag;
1655  tkmes.TrackPtLoose->setAxisTitle("Track p_{T} (GeV/c)", 1);
1656  tkmes.TrackPtLoose->setAxisTitle("Number of Loose Tracks", 2);
1657 
1658  histname = "Quality_";
1659  tkmes.Quality = ibooker.book1D(histname + CategoryName, histname + CategoryName, 3, 0., 3.);
1660  tkmes.Quality->setAxisTitle("Track quality", 1);
1661  tkmes.Quality->setAxisTitle("Number of Tracks", 2);
1662 
1663  for (size_t ibin = 0; ibin < 3; ibin++) {
1664  tkmes.Quality->setBinLabel(ibin + 1, reco::TrackBase::qualityNames[ibin]);
1665  }
1666 
1667  histname = "TrackPt_NegEta_Phi_btw_neg16_neg32_" + histTag;
1669  tkmes.TrackPt_NegEta_Phi_btw_neg16_neg32->setAxisTitle("Track p_{T} (GeV/c)", 1);
1670  tkmes.TrackPt_NegEta_Phi_btw_neg16_neg32->setAxisTitle("Number of Tracks", 2);
1671 
1672  histname = "TrackPt_NegEta_Phi_btw_0_neg16_" + histTag;
1674  tkmes.TrackPt_NegEta_Phi_btw_0_neg16->setAxisTitle("Track p_{T} (GeV/c)", 1);
1675  tkmes.TrackPt_NegEta_Phi_btw_0_neg16->setAxisTitle("Number of Tracks", 2);
1676 
1677  histname = "TrackPt_NegEta_Phi_btw_16_0_" + histTag;
1679  tkmes.TrackPt_NegEta_Phi_btw_16_0->setAxisTitle("Track p_{T} (GeV/c)", 1);
1680  tkmes.TrackPt_NegEta_Phi_btw_16_0->setAxisTitle("Number of Tracks", 2);
1681 
1682  histname = "TrackPt_NegEta_Phi_btw_32_16_" + histTag;
1684  tkmes.TrackPt_NegEta_Phi_btw_32_16->setAxisTitle("Track p_{T} (GeV/c)", 1);
1685  tkmes.TrackPt_NegEta_Phi_btw_32_16->setAxisTitle("Number of Tracks", 2);
1686 
1687  histname = "TrackPt_PosEta_Phi_btw_neg16_neg32_" + histTag;
1689  tkmes.TrackPt_PosEta_Phi_btw_neg16_neg32->setAxisTitle("Track p_{T} (GeV/c)", 1);
1690  tkmes.TrackPt_PosEta_Phi_btw_neg16_neg32->setAxisTitle("Number of Tracks", 2);
1691 
1692  histname = "TrackPt_PosEta_Phi_btw_0_neg16_" + histTag;
1694  tkmes.TrackPt_PosEta_Phi_btw_0_neg16->setAxisTitle("Track p_{T} (GeV/c)", 1);
1695  tkmes.TrackPt_PosEta_Phi_btw_0_neg16->setAxisTitle("Number of Tracks", 2);
1696 
1697  histname = "TrackPt_PosEta_Phi_btw_16_0_" + histTag;
1699  tkmes.TrackPt_PosEta_Phi_btw_16_0->setAxisTitle("Track p_{T} (GeV/c)", 1);
1700  tkmes.TrackPt_PosEta_Phi_btw_16_0->setAxisTitle("Number of Tracks", 2);
1701 
1702  histname = "TrackPt_PosEta_Phi_btw_32_16_" + histTag;
1704  tkmes.TrackPt_PosEta_Phi_btw_32_16->setAxisTitle("Track p_{T} (GeV/c)", 1);
1705  tkmes.TrackPt_PosEta_Phi_btw_32_16->setAxisTitle("Number of Tracks", 2);
1706 
1707  histname = "Ratio_byFolding_" + histTag;
1709  tkmes.Ratio_byFolding->setAxisTitle("Track p_{T} (GeV/c)", 1);
1710 
1711  histname = "Ratio_byFolding2_" + histTag;
1713  tkmes.Ratio_byFolding2->setAxisTitle("Track p_{T} (GeV/c)", 1);
1714 
1715  histname = "TrackEtaHighpurity_" + histTag;
1717  tkmes.TrackEtaHighPurity->setAxisTitle("Track #eta", 1);
1718  tkmes.TrackEtaHighPurity->setAxisTitle("Number of High Purity Tracks", 2);
1719 
1720  histname = "TrackEtaTight_" + histTag;
1721  tkmes.TrackEtaTight = ibooker.book1D(histname, histname, EtaBin, EtaMin, EtaMax);
1722  tkmes.TrackEtaTight->setAxisTitle("Track #eta", 1);
1723  tkmes.TrackEtaTight->setAxisTitle("Number of Tight Tracks", 2);
1724 
1725  histname = "TrackEtaLoose_" + histTag;
1726  tkmes.TrackEtaLoose = ibooker.book1D(histname, histname, EtaBin, EtaMin, EtaMax);
1727  tkmes.TrackEtaLoose->setAxisTitle("Track #eta", 1);
1728  tkmes.TrackEtaLoose->setAxisTitle("Number of Loose Tracks", 2);
1729 
1730  histname = "TrackEtaPhiInverted_" + histTag;
1732  tkmes.TrackEtaPhiInverted->setAxisTitle("Track #eta", 1);
1733  tkmes.TrackEtaPhiInverted->setAxisTitle("Track #phi", 2);
1734 
1735  histname = "TrackEtaPhiInvertedoutofphase_" + histTag;
1738  tkmes.TrackEtaPhiInvertedoutofphase->setAxisTitle("Track #eta", 1);
1739  tkmes.TrackEtaPhiInvertedoutofphase->setAxisTitle("Track #phi", 2);
1740 
1741  histname = "TrackQoverP_" + histTag;
1742  tkmes.TrackQoverP = ibooker.book1D(histname, histname, 10 * TrackQBin, TrackQMin, TrackQMax);
1743  tkmes.TrackQoverP->setAxisTitle("Track QoverP", 1);
1744  tkmes.TrackQoverP->setAxisTitle("Number of Tracks", 2);
1745  }
1746 
1747  histname = "TrackEtaPhi_" + histTag;
1749  tkmes.TrackEtaPhi->setAxisTitle("Track #eta", 1);
1750  tkmes.TrackEtaPhi->setAxisTitle("Track #phi", 2);
1751 
1752  histname = "TrackEtaPhiInner_" + histTag;
1754  tkmes.TrackEtaPhiInner->setAxisTitle("Track #eta", 1);
1755  tkmes.TrackEtaPhiInner->setAxisTitle("Track #phi", 2);
1756 
1757  histname = "TrackEtaPhiOuter_" + histTag;
1759  tkmes.TrackEtaPhiOuter->setAxisTitle("Track #eta", 1);
1760  tkmes.TrackEtaPhiOuter->setAxisTitle("Track #phi", 2);
1761 
1762  if (doThetaPlots_) {
1763  histname = "TrackTheta_" + histTag;
1765  tkmes.TrackTheta->setAxisTitle("Track #theta", 1);
1766  tkmes.TrackTheta->setAxisTitle("Number of Tracks", 2);
1767  }
1768  histname = "TrackQ_" + histTag;
1770  tkmes.TrackQ->setAxisTitle("Track Charge", 1);
1771  tkmes.TrackQ->setAxisTitle("Number of Tracks", 2);
1772 
1773  histname = "TrackPErrOverP_" + histTag;
1774  tkmes.TrackPErr = ibooker.book1D(histname, histname, pErrBin, pErrMin, pErrMax);
1775  tkmes.TrackPErr->setAxisTitle("track error(p)/p", 1);
1776  tkmes.TrackPErr->setAxisTitle("Number of Tracks", 2);
1777 
1778  histname = "TrackPtErrOverPt_" + histTag;
1780  tkmes.TrackPtErr->setAxisTitle("track error(p_{T})/p_{T}", 1);
1781  tkmes.TrackPtErr->setAxisTitle("Number of Tracks", 2);
1782 
1783  histname = "TrackPtErrOverPtVsEta_" + histTag;
1785  tkmes.TrackPtErrVsEta->setAxisTitle("Track #eta", 1);
1786  tkmes.TrackPtErrVsEta->setAxisTitle("track error(p_{T})/p_{T}", 2);
1787 
1788  if (doTrackPxPyPlots_) {
1789  histname = "TrackPxErrOverPx_" + histTag;
1791  tkmes.TrackPxErr->setAxisTitle("track error(p_{x})/p_{x}", 1);
1792  tkmes.TrackPxErr->setAxisTitle("Number of Tracks", 2);
1793 
1794  histname = "TrackPyErrOverPy_" + histTag;
1796  tkmes.TrackPyErr->setAxisTitle("track error(p_{y})/p_{y}", 1);
1797  tkmes.TrackPyErr->setAxisTitle("Number of Tracks", 2);
1798  }
1799  histname = "TrackPzErrOverPz_" + histTag;
1801  tkmes.TrackPzErr->setAxisTitle("track error(p_{z})/p_{z}", 1);
1802  tkmes.TrackPzErr->setAxisTitle("Number of Tracks", 2);
1803 
1804  histname = "TrackPhiErr_" + histTag;
1806  tkmes.TrackPhiErr->setAxisTitle("track error(#phi)");
1807  tkmes.TrackPhiErr->setAxisTitle("Number of Tracks", 2);
1808 
1809  histname = "TrackEtaErr_" + histTag;
1811  tkmes.TrackEtaErr->setAxisTitle("track error(#eta)");
1812  tkmes.TrackEtaErr->setAxisTitle("Number of Tracks", 2);
1813 
1814  // rec hit profiles
1815  ibooker.setCurrentFolder(TopFolder_ + "/GeneralProperties");
1816  histname = "NumberOfRecHitsPerTrackVsPhi_" + histTag;
1819  tkmes.NumberOfRecHitsPerTrackVsPhi->setAxisTitle("Track #phi", 1);
1820  tkmes.NumberOfRecHitsPerTrackVsPhi->setAxisTitle("Number of RecHits in each Track", 2);
1821 
1822  if (doThetaPlots_) {
1823  histname = "NumberOfRecHitsPerTrackVsTheta_" + histTag;
1826  tkmes.NumberOfRecHitsPerTrackVsTheta->setAxisTitle("Track #phi", 1);
1827  tkmes.NumberOfRecHitsPerTrackVsTheta->setAxisTitle("Number of RecHits in each Track", 2);
1828  }
1829  histname = "NumberOfRecHitsPerTrackVsEta_" + histTag;
1832  tkmes.NumberOfRecHitsPerTrackVsEta->setAxisTitle("Track #eta", 1);
1833  tkmes.NumberOfRecHitsPerTrackVsEta->setAxisTitle("Number of RecHits in each Track", 2);
1834 
1835  histname = "NumberOfValidRecHitsPerTrackVsPhi_" + histTag;
1838  tkmes.NumberOfValidRecHitsPerTrackVsPhi->setAxisTitle("Track #phi", 1);
1839  tkmes.NumberOfValidRecHitsPerTrackVsPhi->setAxisTitle("Number of valid RecHits in each Track", 2);
1840 
1841  histname = "NumberOfValidRecHitsPerTrackVsEta_" + histTag;
1844  tkmes.NumberOfValidRecHitsPerTrackVsEta->setAxisTitle("Track #eta", 1);
1845  tkmes.NumberOfValidRecHitsPerTrackVsEta->setAxisTitle("Number of valid RecHits in each Track", 2);
1846 
1847  histname = "NumberOfValidRecHitsPerTrackVsPt_" + histTag;
1850  tkmes.NumberOfValidRecHitsPerTrackVsPt->setAxisTitle("Track p_{T} [GeV]", 1);
1851  tkmes.NumberOfValidRecHitsPerTrackVsPt->setAxisTitle("Number of valid RecHits in each Track", 2);
1852 
1854  histname = "NumberOfLayersPerTrackVsPhi_" + histTag;
1857  tkmes.NumberOfLayersPerTrackVsPhi->setAxisTitle("Track #phi", 1);
1858  tkmes.NumberOfLayersPerTrackVsPhi->setAxisTitle("Number of Layers in each Track", 2);
1859 
1860  if (doThetaPlots_) {
1861  histname = "NumberOfLayersPerTrackVsTheta_" + histTag;
1864  tkmes.NumberOfLayersPerTrackVsTheta->setAxisTitle("Track #phi", 1);
1865  tkmes.NumberOfLayersPerTrackVsTheta->setAxisTitle("Number of Layers in each Track", 2);
1866  }
1867  histname = "NumberOfLayersPerTrackVsEta_" + histTag;
1870  tkmes.NumberOfLayersPerTrackVsEta->setAxisTitle("Track #eta", 1);
1871  tkmes.NumberOfLayersPerTrackVsEta->setAxisTitle("Number of Layers in each Track", 2);
1872 
1873  if (doThetaPlots_) {
1874  histname = "Chi2oNDFVsTheta_" + histTag;
1875  tkmes.Chi2oNDFVsTheta =
1877  tkmes.Chi2oNDFVsTheta->setAxisTitle("Track #theta", 1);
1878  tkmes.Chi2oNDFVsTheta->setAxisTitle("Track #chi^{2}/ndf", 2);
1879  }
1880  if (doAllPlots_) {
1881  histname = "Chi2oNDFVsPhi_" + histTag;
1883  tkmes.Chi2oNDFVsPhi->setAxisTitle("Track #phi", 1);
1884  tkmes.Chi2oNDFVsPhi->setAxisTitle("Track #chi^{2}/ndf", 2);
1885 
1886  histname = "Chi2oNDFVsEta_" + histTag;
1888  tkmes.Chi2oNDFVsEta->setAxisTitle("Track #eta", 1);
1889  tkmes.Chi2oNDFVsEta->setAxisTitle("Track #chi^{2}/ndf", 2);
1890 
1891  histname = "Chi2ProbVsPhi_" + histTag;
1892  tkmes.Chi2ProbVsPhi = ibooker.bookProfile(
1893  histname + CategoryName, histname + CategoryName, PhiBin, PhiMin, PhiMax, Chi2ProbMin, Chi2ProbMax);
1894  tkmes.Chi2ProbVsPhi->setAxisTitle("Tracks #phi", 1);
1895  tkmes.Chi2ProbVsPhi->setAxisTitle("Track #chi^{2} probability", 2);
1896 
1897  histname = "Chi2ProbVsEta_" + histTag;
1898  tkmes.Chi2ProbVsEta = ibooker.bookProfile(
1899  histname + CategoryName, histname + CategoryName, EtaBin, EtaMin, EtaMax, Chi2ProbMin, Chi2ProbMax);
1900  tkmes.Chi2ProbVsEta->setAxisTitle("Tracks #eta", 1);
1901  tkmes.Chi2ProbVsEta->setAxisTitle("Track #chi^{2} probability", 2);
1902  }
1903 
1904  // now put the MEs in the map
1905  TkParameterMEMap.insert(std::make_pair(sname, tkmes));
1906 }
1907 
1908 // fill histograms at differnt measurement points
1909 // ---------------------------------------------------------------------------------//
1911  //get the kinematic parameters
1912  double p, px, py, pz, pt, theta, phi, eta, q;
1913  double pxerror, pyerror, pzerror, pterror, perror, phierror, etaerror;
1914 
1915  std::string Folder = TopFolder_.substr(0, 2);
1916 
1917  auto phiIn = track.innerPosition().phi();
1918  auto etaIn = track.innerPosition().eta();
1919  auto phiOut = track.outerPosition().phi();
1920  auto etaOut = track.outerPosition().eta();
1921 
1922  if (sname == "default") {
1923  p = track.p();
1924  px = track.px();
1925  py = track.py();
1926  pz = track.pz();
1927  pt = track.pt();
1928  phi = track.phi();
1929  theta = track.theta();
1930  eta = track.eta();
1931  q = track.charge();
1932 
1933  pterror = (pt) ? track.ptError() / (pt * pt) : 0.0;
1934  pxerror = -1.0;
1935  pyerror = -1.0;
1936  pzerror = -1.0;
1937  perror = -1.0;
1938  phierror = track.phiError();
1939  etaerror = track.etaError();
1940 
1941  } else {
1943  reco::TransientTrack TransTrack = theB.build(track);
1944 
1946 
1947  if (sname == "OuterSurface")
1948  TSOS = TransTrack.outermostMeasurementState();
1949  else if (sname == "InnerSurface")
1950  TSOS = TransTrack.innermostMeasurementState();
1951  else if (sname == "ImpactPoint")
1952  TSOS = TransTrack.impactPointState();
1953 
1954  p = TSOS.globalMomentum().mag();
1955  px = TSOS.globalMomentum().x();
1956  py = TSOS.globalMomentum().y();
1957  pz = TSOS.globalMomentum().z();
1958  pt = TSOS.globalMomentum().perp();
1959  phi = TSOS.globalMomentum().phi();
1961  eta = TSOS.globalMomentum().eta();
1962  q = TSOS.charge();
1963 
1964  //get the error of the kinimatic parameters
1966  double partialPterror =
1967  errors(3, 3) * pow(TSOS.globalMomentum().x(), 2) + errors(4, 4) * pow(TSOS.globalMomentum().y(), 2);
1968  pterror = sqrt(partialPterror) / TSOS.globalMomentum().perp();
1969  pxerror = sqrt(errors(3, 3)) / TSOS.globalMomentum().x();
1970  pyerror = sqrt(errors(4, 4)) / TSOS.globalMomentum().y();
1971  pzerror = sqrt(errors(5, 5)) / TSOS.globalMomentum().z();
1972  perror = sqrt(partialPterror + errors(5, 5) * pow(TSOS.globalMomentum().z(), 2)) / TSOS.globalMomentum().mag();
1973  phierror = sqrt(TSOS.curvilinearError().matrix()(2, 2));
1974  etaerror = sqrt(TSOS.curvilinearError().matrix()(1, 1)) * fabs(sin(TSOS.globalMomentum().theta()));
1975  }
1976 
1977  std::map<std::string, TkParameterMEs>::iterator iPos = TkParameterMEMap.find(sname);
1978  if (iPos != TkParameterMEMap.end()) {
1979  TkParameterMEs tkmes = iPos->second;
1980 
1981  // momentum
1982  tkmes.TrackP->Fill(p);
1983  if (doTrackPxPyPlots_) {
1984  tkmes.TrackPx->Fill(px);
1985  tkmes.TrackPy->Fill(py);
1986  }
1987  tkmes.TrackPz->Fill(pz);
1988  tkmes.TrackPt->Fill(pt);
1989 
1990  // angles
1991  tkmes.TrackPhi->Fill(phi);
1992  tkmes.TrackEta->Fill(eta);
1993  tkmes.TrackEtaPhi->Fill(eta, phi);
1994 
1995  if (Folder == "Tr") {
1996  tkmes.TrackEtaPhiInverted->Fill(eta, -1 * phi);
1997  tkmes.TrackEtaPhiInvertedoutofphase->Fill(eta, M_PI - phi);
1998  tkmes.TrackEtaPhiInvertedoutofphase->Fill(eta, -(phi + M_PI));
1999  //pT histograms to create efficiency vs pT plot, only for the most inefficient region.
2000 
2001  if (eta < 0. && phi < -1.6) {
2003  }
2004  if (eta < 0. && phi < 0 && phi >= -1.6) {
2006  }
2007  if (eta < 0. && phi < 1.6 && phi >= 0) {
2009  }
2010  if (eta < 0. && phi >= 1.6) {
2012  }
2013  if (eta >= 0. && phi < -1.6) {
2015  }
2016  if (eta >= 0. && phi < 0 && phi >= -1.6) {
2018  }
2019  if (eta >= 0. && phi < 1.6 && phi >= 0) {
2021  }
2022  if (eta >= 0. && phi >= 1.6) {
2024  }
2025 
2026  float A[8];
2029  A[2] = tkmes.TrackPt_NegEta_Phi_btw_16_0->integral();
2030  A[3] = tkmes.TrackPt_NegEta_Phi_btw_32_16->integral();
2033  A[6] = tkmes.TrackPt_PosEta_Phi_btw_16_0->integral();
2034  A[7] = tkmes.TrackPt_PosEta_Phi_btw_32_16->integral();
2035 
2036  //WZ (the worst zone)
2037  int WZ = 0;
2038  float minA = A[0];
2039  for (int w = 1; w < 8; w++) {
2040  if (minA > A[w]) {
2041  minA = A[w];
2042  WZ = w;
2043  }
2044  }
2045 
2046  switch (WZ) {
2047  case 1:
2048  tkmes.Ratio_byFolding->divide(
2050  tkmes.Ratio_byFolding2->divide(
2052  break;
2053  case 2:
2054  tkmes.Ratio_byFolding->divide(
2056  tkmes.Ratio_byFolding2->divide(
2058  break;
2059  case 3:
2060  tkmes.Ratio_byFolding->divide(
2062  tkmes.Ratio_byFolding2->divide(
2063  tkmes.TrackPt_NegEta_Phi_btw_16_0, tkmes.TrackPt_NegEta_Phi_btw_32_16, 1., 1., "B");
2064  break;
2065  case 4:
2066  tkmes.Ratio_byFolding->divide(
2068  tkmes.Ratio_byFolding2->divide(
2069  tkmes.TrackPt_NegEta_Phi_btw_32_16, tkmes.TrackPt_NegEta_Phi_btw_16_0, 1., 1., "B");
2070  break;
2071  case 5:
2072  tkmes.Ratio_byFolding->divide(
2074  tkmes.Ratio_byFolding2->divide(
2076  break;
2077  case 6:
2078  tkmes.Ratio_byFolding->divide(
2080  tkmes.Ratio_byFolding2->divide(
2082  break;
2083  case 7:
2084  tkmes.Ratio_byFolding->divide(
2086  tkmes.Ratio_byFolding2->divide(
2087  tkmes.TrackPt_PosEta_Phi_btw_16_0, tkmes.TrackPt_PosEta_Phi_btw_32_16, 1., 1., "B");
2088  break;
2089  case 8:
2090  tkmes.Ratio_byFolding->divide(
2092  tkmes.Ratio_byFolding2->divide(
2093  tkmes.TrackPt_PosEta_Phi_btw_32_16, tkmes.TrackPt_PosEta_Phi_btw_16_0, 1., 1., "B");
2094  break;
2095  }
2096  tkmes.Ratio_byFolding->setAxisTitle("Efficiency(Ratio)_" + std::to_string(WZ), 2);
2097  tkmes.Ratio_byFolding2->setAxisTitle("Efficiency(Ratio)_" + std::to_string(WZ), 2);
2098 
2099  if (track.quality(reco::TrackBase::highPurity)) {
2100  tkmes.TrackPtHighPurity->Fill(pt);
2102  }
2103  if (track.quality(reco::TrackBase::tight)) {
2104  tkmes.TrackPtTight->Fill(pt);
2105  tkmes.Quality->Fill(reco::TrackBase::tight, 1.);
2106  }
2107  if (track.quality(reco::TrackBase::loose)) {
2108  tkmes.TrackPtLoose->Fill(pt);
2109  tkmes.Quality->Fill(reco::TrackBase::loose, 1.);
2110  }
2111  if (track.quality(reco::TrackBase::highPurity)) {
2112  tkmes.TrackEtaHighPurity->Fill(eta);
2113  }
2114  if (track.quality(reco::TrackBase::tight)) {
2115  tkmes.TrackEtaTight->Fill(eta);
2116  }
2117  if (track.quality(reco::TrackBase::loose)) {
2118  tkmes.TrackEtaLoose->Fill(eta);
2119  }
2120 
2121  if (p > 0.) {
2122  tkmes.TrackQoverP->Fill(q / p);
2123  }
2124  }
2125 
2126  tkmes.TrackEtaPhiInner->Fill(etaIn, phiIn);
2127  tkmes.TrackEtaPhiOuter->Fill(etaOut, phiOut);
2128 
2129  if (doThetaPlots_) {
2130  tkmes.TrackTheta->Fill(theta);
2131  }
2132  tkmes.TrackQ->Fill(q);
2133 
2134  // errors
2135  tkmes.TrackPtErr->Fill(pterror);
2136  tkmes.TrackPtErrVsEta->Fill(eta, pterror);
2137  if (doTrackPxPyPlots_) {
2138  tkmes.TrackPxErr->Fill(pxerror);
2139  tkmes.TrackPyErr->Fill(pyerror);
2140  }
2141  tkmes.TrackPzErr->Fill(pzerror);
2142  tkmes.TrackPErr->Fill(perror);
2143  tkmes.TrackPhiErr->Fill(phierror);
2144  tkmes.TrackEtaErr->Fill(etaerror);
2145 
2146  int nRecHits = track.hitPattern().numberOfAllHits(reco::HitPattern::TRACK_HITS);
2147  int nValidRecHits = track.numberOfValidHits();
2148  // rec hits
2149  tkmes.NumberOfRecHitsPerTrackVsPhi->Fill(phi, nRecHits);
2150  if (doThetaPlots_) {
2151  tkmes.NumberOfRecHitsPerTrackVsTheta->Fill(theta, nRecHits);
2152  }
2153  tkmes.NumberOfRecHitsPerTrackVsEta->Fill(eta, nRecHits);
2154  tkmes.NumberOfValidRecHitsPerTrackVsPhi->Fill(phi, nValidRecHits);
2155  tkmes.NumberOfValidRecHitsPerTrackVsEta->Fill(eta, nValidRecHits);
2156  tkmes.NumberOfValidRecHitsPerTrackVsPt->Fill(pt, nValidRecHits);
2157 
2158  int nLayers = track.hitPattern().trackerLayersWithMeasurement();
2159  // rec layers
2161  if (doThetaPlots_) {
2163  }
2165 
2166  double chi2prob = TMath::Prob(track.chi2(), (int)track.ndof());
2167  double chi2oNDF = track.normalizedChi2();
2168 
2169  tkmes.Chi2oNDFVsEta->Fill(eta, chi2oNDF);
2170  tkmes.Chi2oNDFVsPt->Fill(pt, chi2oNDF);
2171  tkmes.Chi2oNDFVsNHits->Fill(nRecHits, chi2oNDF);
2172 
2173  if (doAllPlots_) {
2174  // general properties
2175  if (doThetaPlots_) {
2176  tkmes.Chi2oNDFVsTheta->Fill(theta, chi2oNDF);
2177  }
2178  tkmes.Chi2oNDFVsPhi->Fill(phi, chi2oNDF);
2179  tkmes.Chi2ProbVsPhi->Fill(phi, chi2prob);
2180  tkmes.Chi2ProbVsEta->Fill(eta, chi2prob);
2181  }
2182  }
2183 }
2184 
2186  // parameters from the configuration
2187  std::string QualName = conf_->getParameter<std::string>("Quality");
2189 
2190  // use the AlgoName and Quality Name
2191  std::string CategoryName = !QualName.empty() ? AlgoName + "_" + QualName : AlgoName;
2192 
2193  int PhiBin = conf_->getParameter<int>("PhiBin");
2194  double PhiMin = conf_->getParameter<double>("PhiMin");
2195  double PhiMax = conf_->getParameter<double>("PhiMax");
2196 
2197  int EtaBin = conf_->getParameter<int>("EtaBin");
2198  double EtaMin = conf_->getParameter<double>("EtaMin");
2199  double EtaMax = conf_->getParameter<double>("EtaMax");
2200 
2201  int PtBin = conf_->getParameter<int>("TrackPtBin");
2202  double PtMin = conf_->getParameter<double>("TrackPtMin");
2203  double PtMax = conf_->getParameter<double>("TrackPtMax");
2204 
2205  // book hit property histograms
2206  // ---------------------------------------------------------------------------------//
2207  ibooker.setCurrentFolder(TopFolder_ + "/HitProperties");
2208 
2209  std::vector<std::string> subdetectors = conf_->getParameter<std::vector<std::string> >("subdetectors");
2210  int detBin = conf_->getParameter<int>("subdetectorBin");
2211 
2212  for (const auto& det : subdetectors) {
2213  // hits properties
2214  ibooker.setCurrentFolder(TopFolder_ + "/HitProperties/" + det);
2215 
2216  TkRecHitsPerSubDetMEs recHitsPerSubDet_mes;
2217 
2218  recHitsPerSubDet_mes.detectorTag = det;
2219  int detID = -1;
2220  if (det == "TIB")
2221  detID = StripSubdetector::TIB; // 3
2222  if (det == "TOB")
2223  detID = StripSubdetector::TOB; // 5
2224  if (det == "TID")
2225  detID = StripSubdetector::TID; // 4
2226  if (det == "TEC")
2227  detID = StripSubdetector::TEC; // 6
2228  if (det == "PixBarrel")
2229  detID = PixelSubdetector::PixelBarrel; // 1
2230  if (det == "PixEndcap")
2231  detID = PixelSubdetector::PixelEndcap; // 2
2232  if (det == "Pixel")
2233  detID = 0;
2234  if (det == "Strip")
2235  detID = 7;
2236 
2237  recHitsPerSubDet_mes.detectorId = detID;
2238 
2239  histname = "NumberOfRecHitsPerTrack_" + det + "_" + CategoryName;
2240  recHitsPerSubDet_mes.NumberOfRecHitsPerTrack =
2241  ibooker.book1D(histname, histname, detBin, -0.5, double(detBin) - 0.5);
2242  recHitsPerSubDet_mes.NumberOfRecHitsPerTrack->setAxisTitle("Number of " + det + " valid RecHits in each Track", 1);
2243  recHitsPerSubDet_mes.NumberOfRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
2244 
2245  histname = "NumberOfRecHitsPerTrackVsPhi_" + det + "_" + CategoryName;
2246  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPhi =
2247  ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, detBin, -0.5, double(detBin) - 0.5, "");
2248  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPhi->setAxisTitle("Track #phi", 1);
2249  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPhi->setAxisTitle("Number of " + det + " valid RecHits in each Track",
2250  2);
2251 
2252  histname = "NumberOfRecHitsPerTrackVsEta_" + det + "_" + CategoryName;
2253  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsEta =
2254  ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, detBin, -0.5, double(detBin) - 0.5, "");
2255  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsEta->setAxisTitle("Track #eta", 1);
2256  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsEta->setAxisTitle("Number of " + det + " valid RecHits in each Track",
2257  2);
2258 
2259  histname = "NumberOfRecHitsPerTrackVsPt_" + det + "_" + CategoryName;
2260  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPt =
2261  ibooker.bookProfile(histname, histname, PtBin, PtMin, PtMax, detBin, -0.5, double(detBin) - 0.5, "");
2262  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPt->setAxisTitle("Track p_{T} [GeV]", 1);
2263  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPt->setAxisTitle("Number of " + det + " valid RecHits in each Track",
2264  2);
2265 
2266  histname = "NumberOfLayersPerTrack_" + det + "_" + CategoryName;
2267  recHitsPerSubDet_mes.NumberOfLayersPerTrack =
2268  ibooker.book1D(histname, histname, detBin, -0.5, double(detBin) - 0.5);
2269  recHitsPerSubDet_mes.NumberOfLayersPerTrack->setAxisTitle("Number of " + det + " valid Layers in each Track", 1);
2270  recHitsPerSubDet_mes.NumberOfLayersPerTrack->setAxisTitle("Number of Tracks", 2);
2271 
2272  histname = "NumberOfLayersPerTrackVsPhi_" + det + "_" + CategoryName;
2273  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPhi =
2274  ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, detBin, -0.5, double(detBin) - 0.5, "");
2275  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPhi->setAxisTitle("Track #phi", 1);
2276  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPhi->setAxisTitle("Number of " + det + " valid Layers in each Track",
2277  2);
2278 
2279  histname = "NumberOfLayersPerTrackVsEta_" + det + "_" + CategoryName;
2280  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsEta =
2281  ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, detBin, -0.5, double(detBin) - 0.5, "");
2282  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsEta->setAxisTitle("Track #eta", 1);
2283  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsEta->setAxisTitle("Number of " + det + " valid Layers in each Track",
2284  2);
2285 
2286  histname = "NumberOfLayersPerTrackVsPt_" + det + "_" + CategoryName;
2287  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPt =
2288  ibooker.bookProfile(histname, histname, PtBin, PtMin, PtMax, detBin, -0.5, double(detBin) - 0.5, "");
2289  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPt->setAxisTitle("Track p_{T} [GeV]", 1);
2290  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPt->setAxisTitle("Number of " + det + " valid Layers in each Track",
2291  2);
2292 
2293  TkRecHitsPerSubDetMEMap.insert(std::pair<std::string, TkRecHitsPerSubDetMEs>(det, recHitsPerSubDet_mes));
2294  }
2295 }
2296 
2298  double phi = track.phi();
2299  double eta = track.eta();
2300  double pt = track.pt();
2301 
2302  for (std::map<std::string, TkRecHitsPerSubDetMEs>::iterator it = TkRecHitsPerSubDetMEMap.begin();
2303  it != TkRecHitsPerSubDetMEMap.end();
2304  it++) {
2305  int nValidLayers = 0;
2306  int nValidRecHits = 0;
2307  int substr = it->second.detectorId;
2308  switch (substr) {
2309  case 0:
2310  nValidLayers = track.hitPattern().pixelBarrelLayersWithMeasurement() +
2311  track.hitPattern().pixelEndcapLayersWithMeasurement(); // case 0: pixel
2312  nValidRecHits = track.hitPattern().numberOfValidPixelBarrelHits() +
2313  track.hitPattern().numberOfValidPixelEndcapHits(); // case 0: pixel
2314  break;
2315  case StripSubdetector::TIB:
2316  nValidLayers = track.hitPattern().stripTIBLayersWithMeasurement(); // case 3: strip TIB
2317  nValidRecHits = track.hitPattern().numberOfValidStripTIBHits(); // case 3: strip TIB
2318  break;
2319  case StripSubdetector::TID:
2320  nValidLayers = track.hitPattern().stripTIDLayersWithMeasurement(); // case 4: strip TID
2321  nValidRecHits = track.hitPattern().numberOfValidStripTIDHits(); // case 4: strip TID
2322  break;
2323  case StripSubdetector::TOB:
2324  nValidLayers = track.hitPattern().stripTOBLayersWithMeasurement(); // case 5: strip TOB
2325  nValidRecHits = track.hitPattern().numberOfValidStripTOBHits(); // case 5: strip TOB
2326  break;
2327  case StripSubdetector::TEC:
2328  nValidLayers = track.hitPattern().stripTECLayersWithMeasurement(); // case 6: strip TEC
2329  nValidRecHits = track.hitPattern().numberOfValidStripTECHits(); // case 6: strip TEC
2330  break;
2332  nValidLayers = track.hitPattern().pixelBarrelLayersWithMeasurement(); // case 1: pixel PXB
2333  nValidRecHits = track.hitPattern().numberOfValidPixelBarrelHits(); // case 1: pixel PXB
2334  break;
2336  nValidLayers = track.hitPattern().pixelEndcapLayersWithMeasurement(); // case 2: pixel PXF
2337  nValidRecHits = track.hitPattern().numberOfValidPixelEndcapHits(); // case 2: pixel PXF
2338  break;
2339  case 7:
2340  nValidLayers = track.hitPattern().stripTIBLayersWithMeasurement() // case 7: strip
2341  + track.hitPattern().stripTIDLayersWithMeasurement() +
2342  track.hitPattern().stripTOBLayersWithMeasurement() +
2343  track.hitPattern().stripTECLayersWithMeasurement();
2344  nValidRecHits = track.hitPattern().numberOfValidStripTIBHits() // case 7: strip
2345  + track.hitPattern().numberOfValidStripTIDHits() +
2346  track.hitPattern().numberOfValidStripTOBHits() + track.hitPattern().numberOfValidStripTECHits();
2347  break;
2348  default:
2349  break;
2350  }
2351 
2352  //Fill Layers and RecHits
2353  it->second.NumberOfRecHitsPerTrack->Fill(nValidRecHits);
2354  it->second.NumberOfRecHitsPerTrackVsPhi->Fill(phi, nValidRecHits);
2355  it->second.NumberOfRecHitsPerTrackVsEta->Fill(eta, nValidRecHits);
2356  it->second.NumberOfRecHitsPerTrackVsPt->Fill(pt, nValidRecHits);
2357 
2358  it->second.NumberOfLayersPerTrack->Fill(nValidLayers);
2359  it->second.NumberOfLayersPerTrackVsPhi->Fill(phi, nValidLayers);
2360  it->second.NumberOfLayersPerTrackVsEta->Fill(eta, nValidLayers);
2361  it->second.NumberOfLayersPerTrackVsPt->Fill(pt, nValidLayers);
2362  }
2363 }
MonitorElement * dNdPhi_HighPurity
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
MonitorElement * NumberOfValidRecHitsPerTrackVsPt
static constexpr auto TEC
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
T perp() const
Definition: PV3DBase.h:69
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:476
std::string monName[monQuantity::END]
MonitorElement * NumberOfRecHitsPerTrackVsPhi
MonitorElement * NumberOfLayersPerTrack[4]
MonitorElement * ValidFractionVsPhiVsEtaPerTrack
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
MonitorElement * LongDCASig
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_total_
MonitorElement * NumberOfRecHitsPerTrackVsEta
MonitorElement * algorithm
MonitorElement * TrackPt_NegEta_Phi_btw_32_16
MonitorElement * sipDxyToPV
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
virtual double integral() const
get integral of bins
unsigned int numberOfLayers(int subdet) const
MonitorElement * DistanceOfClosestApproach
T w() const
T z() const
Definition: PV3DBase.h:61
std::string qualityString_
ret
prodAgent to be discontinued
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersToken_
Definition: TrackAnalyzer.h:85
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
MonitorElement * stoppingSource
MonitorElement * NumberOfLostRecHitsPerTrackVsPt
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:57
T eta() const
Definition: PV3DBase.h:73
DxyErrBin
it might need to be adjust if CMS asks to have lumi levelling at lower values
Class to contain the online luminosity from soft FED 1022.
void bookHistosForTrackerSpecific(DQMStore::IBooker &ibooker)
void bookHistosForHitProperties(DQMStore::IBooker &ibooker)
void setBX(const edm::Event &)
std::pair< bool, Measurement1D > signedImpactParameter3D(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:81
MonitorElement * DistanceOfClosestApproachToBSdz
MonitorElement * NumberOfMORecHitVsPhiVsEtaPerTrack
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
constexpr int pow(int x)
Definition: conifer.h:24
MonitorElement * DistanceOfClosestApproachError
MonitorElement * Chi2oNDFVsPhi
MonitorElement * NumberOfLayersPerTrackVsPhi
MonitorElement * DeltaZToPVZoom
data_type const * const_iterator
Definition: DetSetNew.h:31
MonitorElement * xPointOfClosestApproachVsZ0wrtPV
static const std::string StopReasonName[]
float instLumi() const
Return the luminosity for the current nibble.
MonitorElement * sip2dToPV
MonitorElement * Chi2oNDF
TrackAnalyzer(const edm::ParameterSet &)
MonitorElement * DeltaZToPV
MonitorElement * NumberOfLostRecHitsPerTrack
MonitorElement * yPointOfClosestApproach
MonitorElement * sipDxyToBS
void initHisto(DQMStore::IBooker &ibooker, const edm::EventSetup &, const edm::ParameterSet &)
MonitorElement * xPointOfClosestApproach
static constexpr double FREQ_ORBIT
Definition: GetLumi.h:23
MonitorElement * DistanceOfClosestApproachErrorVsEta
edm::EDGetTokenT< OnlineLuminosityRecord > metaDataToken_
Definition: TrackAnalyzer.h:87
missing
Definition: combine.py:5
static std::string to_string(const XMLCh *ch)
const CartesianTrajectoryError cartesianError() const
unsigned int layer(const DetId &id) const
MonitorElement * TrackPt_NegEta_Phi_btw_16_0
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::Track &track)
const_iterator end(bool update=false) const
MonitorElement * NumberOfLayersPerTrackVsEta
MonitorElement * TransDCASig
void bookHistosForEfficiencyFromHitPatter(DQMStore::IBooker &ibooker, const edm::EventSetup &iSetup, const std::string suffix, bool useInac)
MonitorElement * DistanceOfClosestApproachVsPhi
reco::TransientTrack build(const reco::Track *p) const
MonitorElement * Chi2oNDFVsTheta
void Fill(long long x)
static const unsigned int lastBunchCrossing
Definition: GetLumi.h:40
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
MonitorElement * NumberOfMIRecHitVsPhiVsEtaPerTrack
MonitorElement * DistanceOfClosestApproachToPVVsPhi
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
Definition: TrackAnalyzer.h:88
int iEvent
Definition: GenABIO.cc:224
def cat(path)
Definition: eostools.py:401
MonitorElement * stoppingSourceVSeta
MonitorElement * dNdPt_HighPurity
edm::EDGetTokenT< LumiScalersCollection > lumiscalersToken_
Definition: TrackAnalyzer.h:86
MonitorElement * Chi2oNDF_lumiFlag
MonitorElement * stoppingSourceVSphi
MonitorElement * NumberOfValidRecHitsPerTrackVsEta
static constexpr double SECONDS_PER_LS
Definition: GetLumi.h:24
static const std::string qualityNames[]
Definition: TrackBase.h:163
MonitorElement * NumberOfLayersPerTrackVsTheta
MonitorElement * DistanceOfClosestApproachErrorVsPt
MonitorElement * sip3dToPV
void fillHistosForState(const edm::EventSetup &iSetup, const reco::Track &track, std::string sname)
TrajectoryStateOnSurface outermostMeasurementState() const
MonitorElement * xPointOfClosestApproachToPV
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:399
MonitorElement * NumberOfMORecHitsPerTrack
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
T sqrt(T t)
Definition: SSEVec.h:19
MonitorElement * Chi2Prob
MonitorElement * dNhitdPt_HighPurity
unsigned int good_vertices_
MonitorElement * NumberOfValidRecHitVsPhiVsEtaPerTrack
MonitorElement * Chi2ProbVsEta
MonitorElement * TrackPt_PosEta_Phi_btw_16_0
T mag() const
Definition: PV3DBase.h:64
void fillHistosForTrackerSpecific(const reco::Track &track)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::string stateName_
Definition: TrackAnalyzer.h:96
MonitorElement * yPointOfClosestApproachVsZ0wrtPV
MonitorElement * zPointOfClosestApproachToPV
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
TrajectoryStateOnSurface innermostMeasurementState() const
MonitorElement * NhitVsEta_HighPurity
MonitorElement * DistanceOfClosestApproachVsTheta
static constexpr auto TOB
MonitorElement * Chi2ProbVsPhi
virtual 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::map< std::string, TkParameterMEs > TkParameterMEMap
MonitorElement * NumberOfLayersVsPhiVsEtaPerTrack[5]
#define M_PI
MonitorElement * NumberOfRecHitsPerTrackVsPhi
MonitorElement * NumberOfMIRecHitVsPtVsEtaPerTrack
MonitorElement * zPointOfClosestApproach
edm::ParameterSet const * conf_
Definition: TrackAnalyzer.h:94
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
MonitorElement * sipDzToPV
MonitorElement * sipDzToBS
MonitorElement * NumberOfValidRecHitsPerTrackVsPhi
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Definition: TrackAnalyzer.h:83
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetId.h:17
TrajectoryStateOnSurface TSOS
Definition: TestHits.cc:19
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transientTrackBuilderToken_
Definition: TrackAnalyzer.h:90
void bookHistosForState(std::string sname, DQMStore::IBooker &ibooker)
MonitorElement * DistanceOfClosestApproachErrorVsPhi
void setLumi(const edm::Event &, const edm::EventSetup &iSetup)
void bookHistosForBeamSpot(DQMStore::IBooker &ibooker)
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
static constexpr auto TIB
const_iterator begin(bool update=false) const
MonitorElement * DistanceOfClosestApproachVsEta
#define N
Definition: blowfish.cc:9
void setNumberOfGoodVertices(const edm::Event &)
const CurvilinearTrajectoryError & curvilinearError() const
MonitorElement * TESTDistanceOfClosestApproachToBSVsPhi
MonitorElement * DistanceOfClosestApproachToBS
std::string TopFolder_
Definition: TrackAnalyzer.h:81
MonitorElement * NumberOfValidRecHitsPerTrackVsEta
const AlgebraicSymMatrix55 & matrix() const
MonitorElement * NumberOfMIRecHitsPerTrackVsPt
MonitorElement * NhitVsPhi_HighPurity
std::array< T, N+1 > makeLogBins(const T &min, const T &max)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
MonitorElement * NumberOfRecHitsPerTrack
MonitorElement * xPointOfClosestApproachVsZ0wrtBS
MonitorElement * NumberOfRecHitsPerTrack_lumiFlag
GlobalVector globalMomentum() const
edm::EDGetTokenT< reco::VertexCollection > pvToken_
Definition: TrackAnalyzer.h:84
MonitorElement * Ptdist_HighPurity
static const std::string algoNames[]
Definition: TrackBase.h:147
MonitorElement * DistanceOfClosestApproachToPVZoom
bool isValid() const
Definition: HandleBase.h:70
size_type size() const
Definition: DetSetNew.h:65
MonitorElement * DistanceOfClosestApproachToBSVsEta
MonitorElement * DistanceOfClosestApproachErrorVsDxy
MonitorElement * NumberOfValidRecHitsPerTrack
static constexpr double rXSEC_PIXEL_CLUSTER
Definition: GetLumi.h:37
void fillHistosForEfficiencyFromHitPatter(const reco::Track &track, const std::string suffix, const float monitoring, bool useInac)
MonitorElement * AbsDistanceOfClosestApproachToBS
MonitorElement * yPointOfClosestApproachVsZ0wrtBS
TransDCABins
FOR HI PLOTS#####################.
MonitorElement * TESTDistanceOfClosestApproachToBS
MonitorElement * yPointOfClosestApproachToPV
static constexpr double CM2_TO_NANOBARN
Definition: GetLumi.h:39
MonitorElement * NumberOfRecHitsPerTrackVsTheta
MonitorElement * oriAlgo
MonitorElement * TrackPt_NegEta_Phi_btw_neg16_neg32
const AlgebraicSymMatrix66 & matrix() const
float x
MonitorElement * NumberOfValidRecHitsPerTrackVsPt
MonitorElement * NumberOfLostRecHitVsPtVsEtaPerTrack
virtual int getNbinsX() const
get # of bins in X-axis
std::vector< LumiScalers > LumiScalersCollection
Definition: LumiScalers.h:144
Definition: errors.py:1
MonitorElement * yPointOfClosestApproachVsZ0wrt000
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_valid_
MonitorElement * NumberOfMORecHitsPerTrackVsPt
Definition: APVGainStruct.h:7
MonitorElement * dNdEta_HighPurity
MonitorElement * NumberOfValidRecHitVsPtVsEtaPerTrack
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
Definition: Chi2.h:15
MonitorElement * xPointOfClosestApproachVsZ0wrt000
std::map< std::string, TkRecHitsPerSubDetMEs > TkRecHitsPerSubDetMEMap
MonitorElement * TrackPt_PosEta_Phi_btw_neg16_neg32
MonitorElement * TrackEtaPhiInvertedoutofphase
MonitorElement * NumberOfMIRecHitsPerTrack
static constexpr double XSEC_PIXEL_CLUSTER
Definition: GetLumi.h:33
MonitorElement * NumberOfValidRecHitsPerTrackVsPhi
MonitorElement * zPointOfClosestApproachVsPhi
MonitorElement * TrackPt_NegEta_Phi_btw_0_neg16
static constexpr auto TID
Geom::Theta< T > theta() const
MonitorElement * NumberOfLostRecHitVsPhiVsEtaPerTrack
MonitorElement * NumberOfMORecHitVsPtVsEtaPerTrack
MonitorElement * DistanceOfClosestApproachToPV
MonitorElement * Chi2oNDFVsEta
MonitorElement * NumberOfRecHitsPerTrackVsTheta
TrajectoryStateOnSurface impactPointState() const
virtual void divide(const MonitorElement *, const MonitorElement *, double, double, const char *)
Replace entries with results of dividing num by denom.
const int NBINS
MonitorElement * DistanceOfClosestApproachToBSVsPhi
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
MonitorElement * NumberOfRecHitVsPhiVsEtaPerTrack
MonitorElement * NumberOfRecHitsPerTrackVsEta
MonitorElement * ValidFractionPerTrack
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
Definition: TrackAnalyzer.h:89
void bookHistosForLScertification(DQMStore::IBooker &ibooker)
#define LogDebug(id)
MonitorElement * TrackPt_PosEta_Phi_btw_0_neg16
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * TrackPt_PosEta_Phi_btw_32_16