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 
15 
20 #include <string>
21 #include "TMath.h"
23 
24 using namespace dqm;
25 
26 namespace {
27  template <typename T, size_t N>
28  std::array<T, N+1> makeLogBins(const double min, const double max) {
29  const double minLog10 = std::log10(min);
30  const double maxLog10 = std::log10(max);
31  const double width = (maxLog10-minLog10)/N;
32  std::array<T, N+1> ret;
33  ret[0] = std::pow(10,minLog10);
34  const double mult = std::pow(10, width);
35  for(size_t i=1; i<= N; ++i) {
36  ret[i] = ret[i-1]*mult;
37  }
38  return ret;
39  }
40 }
41 
43  : conf_( nullptr )
44  , stateName_ (iConfig.getParameter<std::string>("MeasurementState") )
45  , doTrackerSpecific_ ( iConfig.getParameter<bool>("doTrackerSpecific") )
46  , doAllPlots_ ( iConfig.getParameter<bool>("doAllPlots") )
47  , doBSPlots_ ( iConfig.getParameter<bool>("doBeamSpotPlots") )
48  , doPVPlots_ ( iConfig.getParameter<bool>("doPrimaryVertexPlots") )
49  , doDCAPlots_ ( iConfig.getParameter<bool>("doDCAPlots") )
50  , doGeneralPropertiesPlots_ ( iConfig.getParameter<bool>("doGeneralPropertiesPlots") )
51  , doMeasurementStatePlots_ ( iConfig.getParameter<bool>("doMeasurementStatePlots") )
52  , doHitPropertiesPlots_ ( iConfig.getParameter<bool>("doHitPropertiesPlots") )
53  , doRecHitVsPhiVsEtaPerTrack_ ( iConfig.getParameter<bool>("doRecHitVsPhiVsEtaPerTrack") )
54  , doRecHitVsPtVsEtaPerTrack_ ( iConfig.getParameter<bool>("doRecHitVsPtVsEtaPerTrack") )
55  , doLayersVsPhiVsEtaPerTrack_ ( iConfig.getParameter<bool>("doLayersVsPhiVsEtaPerTrack") )
56  , doRecHitsPerTrackProfile_ ( iConfig.getParameter<bool>("doRecHitsPerTrackProfile") )
57  , doThetaPlots_ ( iConfig.getParameter<bool>("doThetaPlots") )
58  , doTrackPxPyPlots_ ( iConfig.getParameter<bool>("doTrackPxPyPlots") )
59  , doDCAwrtPVPlots_ ( iConfig.getParameter<bool>("doDCAwrtPVPlots") )
60  , doDCAwrt000Plots_ ( iConfig.getParameter<bool>("doDCAwrt000Plots") )
61  , doLumiAnalysis_ ( iConfig.getParameter<bool>("doLumiAnalysis") )
62  , doTestPlots_ ( iConfig.getParameter<bool>("doTestPlots") )
63  , doHIPlots_ ( iConfig.getParameter<bool>("doHIPlots") )
64  , doSIPPlots_ ( iConfig.getParameter<bool>("doSIPPlots") )
65  , doEffFromHitPatternVsPU_ ( iConfig.getParameter<bool>("doEffFromHitPatternVsPU") )
66  , doEffFromHitPatternVsBX_ ( iConfig.getParameter<bool>("doEffFromHitPatternVsBX") )
67  , doEffFromHitPatternVsLUMI_ ( iConfig.getParameter<bool>("doEffFromHitPatternVsLUMI") )
68  , pvNDOF_ ( iConfig.getParameter<int> ("pvNDOF") )
69  , useBPixLayer1_ ( iConfig.getParameter<bool>("useBPixLayer1") )
70  , minNumberOfPixelsPerCluster_ ( iConfig.getParameter<int>("minNumberOfPixelsPerCluster") )
71  , minPixelClusterCharge_ ( iConfig.getParameter<double>("minPixelClusterCharge") )
72  , qualityString_ ( iConfig.getParameter<std::string>("qualityString"))
73  , good_vertices_(0)
74  , bx_(0)
75  , pixel_lumi_(0.)
76  , scal_lumi_(0.)
77 {
78  initHistos();
79  TopFolder_ = iConfig.getParameter<std::string>("FolderName");
80 }
81 
83  : TrackAnalyzer(iConfig)
84 {
85  edm::InputTag bsSrc = iConfig.getParameter<edm::InputTag>("beamSpot");
86  edm::InputTag primaryVertexInputTag = iConfig.getParameter<edm::InputTag>("primaryVertex");
87  edm::InputTag pixelClusterInputTag = iConfig.getParameter<edm::InputTag>("pixelCluster4lumi");
88  edm::InputTag scalInputTag = iConfig.getParameter<edm::InputTag>("scal");
90  pvToken_ = iC.consumes<reco::VertexCollection>(primaryVertexInputTag);
93 
94  if(useBPixLayer1_)
96  else
98 
99 
100 }
101 
103 {
104  Chi2 = nullptr;
105  Chi2Prob = nullptr;
106  Chi2ProbVsPhi = nullptr;
107  Chi2ProbVsEta = nullptr;
108  Chi2oNDF = nullptr;
109  Chi2oNDFVsEta = nullptr;
110  Chi2oNDFVsPhi = nullptr;
111  Chi2oNDFVsTheta = nullptr;
112 
113  NumberOfRecHitsPerTrack = nullptr;
115  NumberOfLostRecHitsPerTrack = nullptr;
116 
120 
122 
125 
126  DistanceOfClosestApproach = nullptr;
136  DeltaZToPV = nullptr;
137  DeltaZToPVZoom = nullptr;
143  xPointOfClosestApproach = nullptr;
146  yPointOfClosestApproach = nullptr;
149  zPointOfClosestApproach = nullptr;
151  algorithm = nullptr;
152  oriAlgo = nullptr;
153  stoppingSource = nullptr;
154  stoppingSourceVSeta = nullptr;
155  stoppingSourceVSphi = nullptr;
156  // TESTING
159 
160 // by Mia in order to deal w/ LS transitions
161  Chi2oNDF_lumiFlag = nullptr;
163 
165  //special Plots for HI DQM //SHOULD I ADD THE BOOL HERE??
167  LongDCASig = nullptr;
168  TransDCASig = nullptr;
169  dNdPhi_HighPurity = nullptr;
170  dNdEta_HighPurity = nullptr;
171  dNdPt_HighPurity = nullptr;
172  NhitVsEta_HighPurity = nullptr;
173  NhitVsPhi_HighPurity = nullptr;
174 
175  // IP significance
176  sipDxyToBS = nullptr;
177  sipDzToBS = nullptr;
178  sip3dToPV = nullptr;
179  sip2dToPV = nullptr;
180  sipDxyToPV = nullptr;
181  sipDzToPV = nullptr;
182 
183 }
184 
186 {
187 }
188 
189 void TrackAnalyzer::initHisto(DQMStore::IBooker & ibooker, const edm::EventSetup & iSetup, const edm::ParameterSet& iConfig)
190 {
191  conf_ = &iConfig;
193  bookHistosForBeamSpot(ibooker);
196  if (doEffFromHitPatternVsBX_ || doAllPlots_) bookHistosForEfficiencyFromHitPatter(ibooker, iSetup, "VsBX",false);
197  if (doEffFromHitPatternVsLUMI_ || doAllPlots_) bookHistosForEfficiencyFromHitPatter(ibooker, iSetup, "VsSCALLUMI",false);
198  // if (doEffFromHitPatternVsLUMI_ || doAllPlots_) bookHistosForEfficiencyFromHitPatter(ibooker, iSetup, "VsPIXELLUMI");
200  if (doEffFromHitPatternVsLUMI_ || doAllPlots_) bookHistosForEfficiencyFromHitPatter(ibooker, iSetup, "VsSCALLUMI",true);
201 
202  // book tracker specific related histograms
203  // ---------------------------------------------------------------------------------//
205 
206  // book state related histograms
207  // ---------------------------------------------------------------------------------//
209 
210 
211  if (stateName_ == "All") {
212  bookHistosForState("OuterSurface", ibooker);
213  bookHistosForState("InnerSurface", ibooker);
214  bookHistosForState("ImpactPoint" , ibooker);
215  } else if (
216  stateName_ != "OuterSurface" &&
217  stateName_ != "InnerSurface" &&
218  stateName_ != "ImpactPoint" &&
219  stateName_ != "default"
220  ) {
221  bookHistosForState("default", ibooker);
222 
223  } else {
224  bookHistosForState(stateName_, ibooker);
225  }
226  conf_ = nullptr;
227  }
228 }
229 
231  const edm::EventSetup & iSetup,
232  const std::string suffix,bool useInac)
233 {
234 
235  ibooker.setCurrentFolder(TopFolder_ + "/HitEffFromHitPattern" + (useInac ? "All" :"") + suffix);
236 
237  constexpr int LUMIBin = 300; // conf_->getParameter<int>("LUMIBin");
238  float LUMIMin = conf_->getParameter<double>("LUMIMin");
239  float LUMIMax = conf_->getParameter<double>("LUMIMax");
240 
241  int PVBin = conf_->getParameter<int> ("PVBin");
242  float PVMin = conf_->getParameter<double>("PVMin");
243  float PVMax = conf_->getParameter<double>("PVMax");
244 
245 
246  int NBINS[] = { PVBin, int(GetLumi::lastBunchCrossing), LUMIBin, LUMIBin};
247  float MIN[] = { PVMin, 0.5, LUMIMin, LUMIMin };
248  float MAX[] = { PVMax, float(GetLumi::lastBunchCrossing)+0.5, LUMIMax, LUMIMax };
249  std::string NAME[] = { "", "VsBX", "VsLUMI", "VsLUMI" };
250 
251  auto logBins = makeLogBins<float,LUMIBin>(LUMIMin,LUMIMax);
252 
253  int mon = -1;
254  int nbins = -1;
255  float min = -1.;
256  float max = -1.;
257  bool logQ = false;
258  std::string name = "";
259  for (int i=0; i<monQuantity::END; i++) {
260  if (monName[i] == suffix) {
261  logQ = (i>1); // VsLUMI
262  mon = i;
263  if (useInac) mon+=monQuantity::END;
264  nbins = NBINS[i];
265  min = MIN[i];
266  max = MAX[i];
267  name = NAME[i];
268  }
269  }
270 
271  edm::ESHandle<TrackerGeometry> trackerGeometry;
272  iSetup.get<TrackerDigiGeometryRecord>().get(trackerGeometry);
273 
274  // Values are not ordered randomly, but the order is taken from
275  // http://cmslxr.fnal.gov/dxr/CMSSW/source/Geometry/CommonDetUnit/interface/GeomDetEnumerators.h#15
276  const char * dets[] = { "None", "PXB", "PXF", "TIB", "TID", "TOB", "TEC"};
277 
278  // Also in this case, ordering is not random but extracted from
279  // http://cmslxr.fnal.gov/dxr/CMSSW/source/DataFormats/TrackReco/interface/HitPattern.h
280  // The category "total" is an addition to ease the computation of
281  // the efficiencies and is not part of the original HitPattern.
282  const char * hit_category[] = { "valid", "missing", "inactive", "bad", "total"};
283 
284  // We set sub_det to be a 1-based index since to it is the sub-sub-structure in the HitPattern
285  char title[50];
286  for (unsigned int det = 1; det < sizeof(dets)/sizeof(char*); ++det ) {
287  for (unsigned int sub_det = 1;
288  sub_det <= trackerGeometry->numberOfLayers(det); ++sub_det) {
289  for (unsigned int cat = 0;
290  cat < sizeof(hit_category)/sizeof(char *); ++cat) {
291  memset(title, 0, sizeof(title));
292  snprintf(title, sizeof(title), "Hits%s_%s_%s_Subdet%d", name.c_str(), hit_category[cat], dets[det], sub_det);
293  switch(cat) {
294  case 0:
295  hits_valid_.insert(std::make_pair(
296  Key(det, sub_det, mon), logQ?
297  ibooker.book1D(title, title, nbins, &logBins[0]) :
298  ibooker.book1D(title, title, nbins, min, max)));
299  break;
300  case 4:
301  hits_total_.insert(std::make_pair(
302  Key(det, sub_det, mon), logQ?
303  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 
317  // parameters from the configuration
318  std::string QualName = conf_->getParameter<std::string>("Quality");
319  std::string AlgoName = conf_->getParameter<std::string>("AlgoName");
320  std::string MEBSFolderName = conf_->getParameter<std::string>("BSFolderName");
321 
322  // use the AlgoName and Quality Name
323  std::string CategoryName = !QualName.empty() ? AlgoName + "_" + QualName : AlgoName;
324 
325  // get binning from the configuration
326  int TKHitBin = conf_->getParameter<int>( "RecHitBin");
327  double TKHitMin = conf_->getParameter<double>("RecHitMin");
328  double TKHitMax = conf_->getParameter<double>("RecHitMax");
329 
330  int TKLostBin = conf_->getParameter<int>( "RecLostBin");
331  double TKLostMin = conf_->getParameter<double>("RecLostMin");
332  double TKLostMax = conf_->getParameter<double>("RecLostMax");
333 
334  int TKLayBin = conf_->getParameter<int>( "RecLayBin");
335  double TKLayMin = conf_->getParameter<double>("RecLayMin");
336  double TKLayMax = conf_->getParameter<double>("RecLayMax");
337 
338  int PhiBin = conf_->getParameter<int>( "PhiBin");
339  double PhiMin = conf_->getParameter<double>("PhiMin");
340  double PhiMax = conf_->getParameter<double>("PhiMax");
341 
342  int EtaBin = conf_->getParameter<int>( "EtaBin");
343  double EtaMin = conf_->getParameter<double>("EtaMin");
344  double EtaMax = conf_->getParameter<double>("EtaMax");
345 
346  int PtBin = conf_->getParameter<int>( "TrackPtBin");
347  double PtMin = conf_->getParameter<double>("TrackPtMin");
348  double PtMax = conf_->getParameter<double>("TrackPtMax");
349 
350  int Phi2DBin = conf_->getParameter<int>( "Phi2DBin");
351  int Eta2DBin = conf_->getParameter<int>( "Eta2DBin");
352  int Pt2DBin = conf_->getParameter<int>( "TrackPt2DBin");
353 
354  int VXBin = conf_->getParameter<int>( "VXBin");
355  double VXMin = conf_->getParameter<double>("VXMin");
356  double VXMax = conf_->getParameter<double>("VXMax");
357 
358  int VYBin = conf_->getParameter<int>( "VYBin");
359  double VYMin = conf_->getParameter<double>("VYMin");
360  double VYMax = conf_->getParameter<double>("VYMax");
361 
362  int VZBin = conf_->getParameter<int>( "VZBin");
363  double VZMin = conf_->getParameter<double>("VZMin");
364  double VZMax = conf_->getParameter<double>("VZMax");
365 
366  ibooker.setCurrentFolder(TopFolder_);
367 
368  // book the Hit Property histograms
369  // ---------------------------------------------------------------------------------//
370 
371  TkParameterMEs tkmes;
373 
374  ibooker.setCurrentFolder(TopFolder_+"/HitProperties");
375 
376  histname = "NumberOfRecHitsPerTrack_";
377  NumberOfRecHitsPerTrack = ibooker.book1D(histname+CategoryName, histname+CategoryName, TKHitBin, TKHitMin, TKHitMax);
378  NumberOfRecHitsPerTrack->setAxisTitle("Number of all RecHits of each Track");
379  NumberOfRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
380 
381  histname = "NumberOfValidRecHitsPerTrack_";
382  NumberOfValidRecHitsPerTrack = 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_";
388  NumberOfLostRecHitsPerTrack = ibooker.book1D(histname+CategoryName, histname+CategoryName, TKLostBin, TKLostMin, TKLostMax);
389  NumberOfLostRecHitsPerTrack->setAxisTitle("Number of lost RecHits for each Track");
390  NumberOfLostRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
391 
392  histname = "NumberOfMissingInnerRecHitsPerTrack_";
393  NumberOfMIRecHitsPerTrack = ibooker.book1D(histname+CategoryName, histname+CategoryName, 10, -0.5, 9.5);
394  NumberOfMIRecHitsPerTrack->setAxisTitle("Number of missing-inner RecHits for each Track");
395  NumberOfMIRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
396 
397  histname = "NumberOfMissingOuterRecHitsPerTrack_";
398  NumberOfMORecHitsPerTrack = ibooker.book1D(histname+CategoryName, histname+CategoryName, 10, -0.5, 9.5);
399  NumberOfMORecHitsPerTrack->setAxisTitle("Number of missing-outer RecHits for each Track");
400  NumberOfMORecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
401 
402  histname = "ValidFractionPerTrack_";
403  ValidFractionPerTrack = ibooker.book1D(histname+CategoryName, histname+CategoryName, 101, 0., 1.01);
404  ValidFractionPerTrack->setAxisTitle("ValidFraction of RecHits for each Track");
405  ValidFractionPerTrack->setAxisTitle("Number of Tracks", 2);
406 
407 
408 
410 
411  histname = "NumberOfValidRecHitVsPhiVsEtaPerTrack_";
412  NumberOfValidRecHitVsPhiVsEtaPerTrack = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
413  Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax, 0, 40., "");
416 
417  histname = "NumberOfLostRecHitVsPhiVsEtaPerTrack_";
418  NumberOfLostRecHitVsPhiVsEtaPerTrack = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
419  Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax, 0, 5., "");
422 
423 
424  histname = "NumberMIRecHitVsPhiVsEtaPerTrack_";
425  NumberOfMIRecHitVsPhiVsEtaPerTrack = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
426  Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax, 0, 15., "");
429 
430  histname = "NumberMORecHitVsPhiVsEtaPerTrack_";
431  NumberOfMORecHitVsPhiVsEtaPerTrack = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
432  Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax, 0, 15., "");
435 
436  histname = "ValidFractionVsPhiVsEtaPerTrack_";
437  ValidFractionVsPhiVsEtaPerTrack = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
438  Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax, 0, 2., "");
441 
442  }
443 
445 
446  histname = "NumberOfValidRecHitVsPtVsEtaPerTrack_";
447  NumberOfValidRecHitVsPtVsEtaPerTrack = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
448  Eta2DBin, EtaMin, EtaMax, Pt2DBin, PtMin, PtMax, 0, 40., "");
450  NumberOfValidRecHitVsPtVsEtaPerTrack->setAxisTitle("Track p_{T} [GeV] ", 2);
451 
452  histname = "NumberOfLostRecHitVsPtVsEtaPerTrack_";
453  NumberOfLostRecHitVsPtVsEtaPerTrack = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
454  Eta2DBin, EtaMin, EtaMax, Pt2DBin, PtMin, PtMax, 0, 5., "");
456  NumberOfLostRecHitVsPtVsEtaPerTrack->setAxisTitle("Track p_{T} [GeV] ", 2);
457 
458 
459  histname = "NumberMIRecHitVsPtVsEtaPerTrack_";
460  NumberOfMIRecHitVsPtVsEtaPerTrack = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
461  Eta2DBin, EtaMin, EtaMax, Pt2DBin, PtMin, PtMax, 0, 15., "");
463  NumberOfMIRecHitVsPtVsEtaPerTrack->setAxisTitle("Track p_{T} [GeV] ", 2);
464 
465  histname = "NumberMORecHitVsPtVsEtaPerTrack_";
466  NumberOfMORecHitVsPtVsEtaPerTrack = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
467  Eta2DBin, EtaMin, EtaMax, Pt2DBin, PtMin, PtMax, 0, 15., "");
469  NumberOfMORecHitVsPtVsEtaPerTrack->setAxisTitle("Track p_{T} [GeV] ", 2);
470 
471  }
472 
473  histname = "NumberOfValidRecHitsPerTrackVsPt_";
474  NumberOfValidRecHitsPerTrackVsPt = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, PtBin, PtMin, PtMax, TKHitMin, TKHitMax,"");
475  NumberOfValidRecHitsPerTrackVsPt->setAxisTitle("Track p_{T} [GeV]",1);
476  NumberOfValidRecHitsPerTrackVsPt->setAxisTitle("Number of valid RecHits in each Track",2);
477 
478  histname = "NumberOfLostRecHitsPerTrackVsPt_";
479  NumberOfLostRecHitsPerTrackVsPt = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, PtBin, PtMin, PtMax,TKHitMin, TKHitMax,"");
480  NumberOfLostRecHitsPerTrackVsPt->setAxisTitle("Track p_{T} [GeV]", 1);
481  NumberOfLostRecHitsPerTrackVsPt->setAxisTitle("Average Number of Lost RecHits per Track", 2);
482 
483 
484  histname = "NumberMIRecHitsPerTrackVsPt_";
485  NumberOfMIRecHitsPerTrackVsPt = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, PtBin, PtMin, PtMax,TKHitMin, TKHitMax,"");
486  NumberOfMIRecHitsPerTrackVsPt->setAxisTitle("Track p_{T} [GeV]", 1);
487  NumberOfMIRecHitsPerTrackVsPt->setAxisTitle("Average Number of Lost RecHits per Track", 2);
488 
489  histname = "NumberMORecHitsPerTrackVsPt_";
490  NumberOfMORecHitsPerTrackVsPt = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, PtBin, PtMin, PtMax,TKHitMin, TKHitMax,"");
491  NumberOfMORecHitsPerTrackVsPt->setAxisTitle("Track p_{T} [GeV]", 1);
492  NumberOfMORecHitsPerTrackVsPt->setAxisTitle("Average Number of Lost RecHits per Track", 2);
493 
494  std::string layerTypeName[5] = {"","Off","3D","Missing","Pixel"};
495  for (int i=0; i<4; ++i) {
496  histname = "NumberOf"+ layerTypeName[i] + "LayersPerTrack_";
497  NumberOfLayersPerTrack[i] = ibooker.book1D(histname+CategoryName, histname+CategoryName, TKLayBin, TKLayMin, TKLayMax);
498  NumberOfLayersPerTrack[i]->setAxisTitle("Number of " + layerTypeName[i] + " Layers of each Track", 1);
499  NumberOfLayersPerTrack[i]->setAxisTitle("Number of Tracks", 2);
500  }
502  for (int i=0; i<5; ++i) {
503  histname = "NumberOf"+ layerTypeName[i] + "LayersVsPhiVsEtaPerTrack_";
504  NumberOfLayersVsPhiVsEtaPerTrack[i] = ibooker.bookProfile2D(histname+CategoryName, histname+CategoryName,
505  Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax, 0, 40., "");
506  NumberOfLayersVsPhiVsEtaPerTrack[i]->setAxisTitle("Track #eta ", 1);
507  NumberOfLayersVsPhiVsEtaPerTrack[i]->setAxisTitle("Track #phi ", 2);
508  }
509  }
510 
511  // book the General Property histograms
512  // ---------------------------------------------------------------------------------//
513 
515 
516  int Chi2Bin = conf_->getParameter<int>( "Chi2Bin");
517  double Chi2Min = conf_->getParameter<double>("Chi2Min");
518  double Chi2Max = conf_->getParameter<double>("Chi2Max");
519 
520  int Chi2NDFBin = conf_->getParameter<int>( "Chi2NDFBin");
521  double Chi2NDFMin = conf_->getParameter<double>("Chi2NDFMin");
522  double Chi2NDFMax = conf_->getParameter<double>("Chi2NDFMax");
523 
524  int Chi2ProbBin = conf_->getParameter<int>( "Chi2ProbBin");
525  double Chi2ProbMin = conf_->getParameter<double>("Chi2ProbMin");
526  double Chi2ProbMax = conf_->getParameter<double>("Chi2ProbMax");
527 
528 
529  //HI PLOTS////
530  int TransDCABins = conf_->getParameter<int>("TransDCABins");
531  double TransDCAMin = conf_->getParameter<double>("TransDCAMin");
532  double TransDCAMax = conf_->getParameter<double>("TransDCAMax");
533 
534  int LongDCABins = conf_->getParameter<int>("LongDCABins");
535  double LongDCAMin = conf_->getParameter<double>("LongDCAMin");
536  double LongDCAMax = conf_->getParameter<double>("LongDCAMax");
538 
539 
540  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
541 
542  histname = "Chi2_";
543  Chi2 = ibooker.book1D(histname+CategoryName, histname+CategoryName, Chi2Bin, Chi2Min, Chi2Max);
544  Chi2->setAxisTitle("Track #chi^{2}" ,1);
545  Chi2->setAxisTitle("Number of Tracks",2);
546 
547  histname = "Chi2Prob_";
548  Chi2Prob = ibooker.book1D(histname+CategoryName, histname+CategoryName, Chi2ProbBin, Chi2ProbMin, Chi2ProbMax);
549  Chi2Prob->setAxisTitle("Track #chi^{2} probability",1);
550  Chi2Prob->setAxisTitle("Number of Tracks" ,2);
551 
552  histname = "Chi2oNDF_";
553  Chi2oNDF = ibooker.book1D(histname+CategoryName, histname+CategoryName, Chi2NDFBin, Chi2NDFMin, Chi2NDFMax);
554  Chi2oNDF->setAxisTitle("Track #chi^{2}/ndf",1);
555  Chi2oNDF->setAxisTitle("Number of Tracks" ,2);
556 
557 
559  //HI PLOTS///
561  if (doHIPlots_)
562  {
563  histname = "LongDCASig_";
564  LongDCASig = ibooker.book1D(histname+CategoryName, histname+CategoryName,LongDCABins,LongDCAMin,LongDCAMax);
565  LongDCASig->setAxisTitle("dz/#sigma_{dz}",1);
566 
567  histname = "TransDCASig_";
568  TransDCASig = ibooker.book1D(histname+CategoryName,histname+CategoryName,TransDCABins,TransDCAMin,TransDCAMax);
569  TransDCASig->setAxisTitle("dxy/#sigma_{dxy}",1);
570 
571  histname = "dNdPhi_HighPurity_";
572  dNdPhi_HighPurity = ibooker.book1D(histname+CategoryName,histname+CategoryName,PhiBin,PhiMin,PhiMax);
573  dNdPhi_HighPurity->setAxisTitle("#phi",1);
574 
575  histname = "dNdEta_HighPurity_";
576  dNdEta_HighPurity = ibooker.book1D(histname+CategoryName,histname+CategoryName,EtaBin,EtaMin,EtaMax);
577  dNdEta_HighPurity->setAxisTitle("#eta",1);
578 
579  histname = "dNdPt_HighPurity_";
580  dNdPt_HighPurity = ibooker.book1D(histname+CategoryName,histname+CategoryName,150,0,0.3);
581  dNdPt_HighPurity->setAxisTitle("#sigma_{p_{T}}/p_{T}",1);
582 
583  histname = "NhitVsEta_HighPurity_";
584  NhitVsEta_HighPurity = ibooker.bookProfile(histname+CategoryName,histname+CategoryName,EtaBin,EtaMin,EtaMax,-0.5,39.5,"");
585  NhitVsEta_HighPurity->setAxisTitle("Track #eta",1);
586  NhitVsEta_HighPurity->setAxisTitle("Number of Valid RecHits in each Track",2);
587 
588  histname = "NhitVsPhi_HighPurity_";
589  NhitVsPhi_HighPurity = ibooker.bookProfile(histname+CategoryName,histname+CategoryName,PhiBin,PhiMin,PhiMax,-0.5,39.5,"");
590  NhitVsPhi_HighPurity->setAxisTitle("Track #phi",1);
591  NhitVsPhi_HighPurity->setAxisTitle("Number of Valid RecHits in each Track",2);
592 
593  histname = "Ptdist_HighPurity_";
594  Ptdist_HighPurity = ibooker.book1D(histname+CategoryName,histname+CategoryName,150,0,50.);
595  Ptdist_HighPurity->setAxisTitle("p_{T} (GeV/c)",1);
596  Ptdist_HighPurity->setAxisTitle("Number of Tracks",2);
597 
598  histname = "dNhitdPt_HighPurity_";
599  dNhitdPt_HighPurity = ibooker.bookProfile(histname+CategoryName,histname+CategoryName,150,0,25.,-0.5,39.5,"");
600  dNhitdPt_HighPurity->setAxisTitle("p_{T} (GeV/c)",1);
601  dNhitdPt_HighPurity->setAxisTitle("N_{hit}",2);
602 
603  }
604 
605 
606 
608  histname = "xPointOfClosestApproach_";
609  xPointOfClosestApproach = ibooker.book1D(histname+CategoryName, histname+CategoryName, VXBin, VXMin, VXMax);
610  xPointOfClosestApproach->setAxisTitle("x component of Track PCA to beam line (cm)",1);
611  xPointOfClosestApproach->setAxisTitle("Number of Tracks",2);
612 
613  histname = "yPointOfClosestApproach_";
614  yPointOfClosestApproach = ibooker.book1D(histname+CategoryName, histname+CategoryName, VYBin, VYMin, VYMax);
615  yPointOfClosestApproach->setAxisTitle("y component of Track PCA to beam line (cm)",1);
616  yPointOfClosestApproach->setAxisTitle("Number of Tracks",2);
617 
618  histname = "zPointOfClosestApproach_";
619  zPointOfClosestApproach = ibooker.book1D(histname+CategoryName, histname+CategoryName, VZBin, VZMin, VZMax);
620  zPointOfClosestApproach->setAxisTitle("z component of Track PCA to beam line (cm)",1);
621  zPointOfClosestApproach->setAxisTitle("Number of Tracks",2);
622 
623  histname = "xPointOfClosestApproachToPV_";
624  xPointOfClosestApproachToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, VXBin, VXMin, VXMax);
625  xPointOfClosestApproachToPV->setAxisTitle("x component of Track PCA to pv (cm)",1);
626  xPointOfClosestApproachToPV->setAxisTitle("Number of Tracks",2);
627 
628  histname = "yPointOfClosestApproachToPV_";
629  yPointOfClosestApproachToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, VYBin, VYMin, VYMax);
630  yPointOfClosestApproachToPV->setAxisTitle("y component of Track PCA to pv line (cm)",1);
631  yPointOfClosestApproachToPV->setAxisTitle("Number of Tracks",2);
632 
633  histname = "zPointOfClosestApproachToPV_";
634  zPointOfClosestApproachToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, VZBin, VZMin, VZMax);
635  zPointOfClosestApproachToPV->setAxisTitle("z component of Track PCA to pv line (cm)",1);
636  zPointOfClosestApproachToPV->setAxisTitle("Number of Tracks",2);
637  }
638 
639  // See DataFormats/TrackReco/interface/TrackBase.h for track algorithm enum definition
640  // http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/DataFormats/TrackReco/interface/TrackBase.h?view=log
641  histname = "algorithm_";
642  algorithm = ibooker.book1D(histname+CategoryName, histname+CategoryName, reco::TrackBase::algoSize, 0., double(reco::TrackBase::algoSize));
643  algorithm->setAxisTitle("Tracking algorithm",1);
644  algorithm->setAxisTitle("Number of Tracks",2);
645 
646  histname = "originalAlgorithm_";
647  oriAlgo = ibooker.book1D(histname+CategoryName, histname+CategoryName, reco::TrackBase::algoSize, 0., double(reco::TrackBase::algoSize));
648  oriAlgo->setAxisTitle("Tracking algorithm",1);
649  oriAlgo->setAxisTitle("Number of Tracks",2);
650 
651  for (size_t ibin=0; ibin<reco::TrackBase::algoSize-1; ibin++) {
654  }
655 
656  size_t StopReasonNameSize = sizeof(StopReasonName::StopReasonName)/sizeof(std::string);
657  histname = "stoppingSource_";
658  stoppingSource = ibooker.book1D(histname+CategoryName, histname+CategoryName, StopReasonNameSize, 0., double(StopReasonNameSize));
659  stoppingSource->setAxisTitle("stopping reason",1);
660  stoppingSource->setAxisTitle("Number of Tracks",2);
661 
662  histname = "stoppingSourceVSeta_";
663  stoppingSourceVSeta = ibooker.bookProfile(histname+CategoryName, histname+CategoryName,
664  EtaBin, EtaMin, EtaMax, 2, 0., 2.);
665  stoppingSourceVSeta->setAxisTitle("track #eta",1);
666  stoppingSourceVSeta->setAxisTitle("stopped fraction",2);
667 
668  histname = "stoppingSourceVSphi_";
669  stoppingSourceVSphi = ibooker.bookProfile(histname+CategoryName, histname+CategoryName,
670  PhiBin, PhiMin, PhiMax, 2, 0., 2.);
671  stoppingSourceVSphi->setAxisTitle("track #phi",1);
672  stoppingSourceVSphi->setAxisTitle("stopped fraction",2);
673 
674  for (size_t ibin=0; ibin<StopReasonNameSize; ibin++) {
676  }
677 
678  }
679 
680 }
681 
683 
684  // parameters from the configuration
685  std::string QualName = conf_->getParameter<std::string>("Quality");
686  std::string AlgoName = conf_->getParameter<std::string>("AlgoName");
687 
688  // use the AlgoName and Quality Name
689  std::string CategoryName = !QualName.empty() ? AlgoName + "_" + QualName : AlgoName;
690 
691 
692  // book LS analysis related histograms
693  // -----------------------------------
694  if ( doLumiAnalysis_ ) {
695 
696  // get binning from the configuration
697  int TKHitBin = conf_->getParameter<int>( "RecHitBin");
698  double TKHitMin = conf_->getParameter<double>("RecHitMin");
699  double TKHitMax = conf_->getParameter<double>("RecHitMax");
700 
701  int Chi2NDFBin = conf_->getParameter<int>( "Chi2NDFBin");
702  double Chi2NDFMin = conf_->getParameter<double>("Chi2NDFMin");
703  double Chi2NDFMax = conf_->getParameter<double>("Chi2NDFMax");
704 
705  // add by Mia in order to deal w/ LS transitions
706  ibooker.setCurrentFolder(TopFolder_+"/LSanalysis");
707 
708  histname = "NumberOfRecHitsPerTrack_lumiFlag_";
709  NumberOfRecHitsPerTrack_lumiFlag = ibooker.book1D(histname+CategoryName, histname+CategoryName, TKHitBin, TKHitMin, TKHitMax);
710  NumberOfRecHitsPerTrack_lumiFlag->setAxisTitle("Number of all RecHits of each Track");
711  NumberOfRecHitsPerTrack_lumiFlag->setAxisTitle("Number of Tracks", 2);
712 
713  histname = "Chi2oNDF_lumiFlag_";
714  Chi2oNDF_lumiFlag = ibooker.book1D(histname+CategoryName, histname+CategoryName, Chi2NDFBin, Chi2NDFMin, Chi2NDFMax);
715  Chi2oNDF_lumiFlag->setAxisTitle("Track #chi^{2}/ndf",1);
716  Chi2oNDF_lumiFlag->setAxisTitle("Number of Tracks" ,2);
717 
718  }
719 }
720 
722 
723  // parameters from the configuration
724  std::string QualName = conf_->getParameter<std::string>("Quality");
725  std::string AlgoName = conf_->getParameter<std::string>("AlgoName");
726 
727  // use the AlgoName and Quality Name
728  std::string CategoryName = !QualName.empty() ? AlgoName + "_" + QualName : AlgoName;
729 
730  // book the Beam Spot related histograms
731  // ---------------------------------------------------------------------------------//
732 
734 
735  int DxyErrBin = conf_->getParameter<int>( "DxyErrBin");
736  double DxyErrMax = conf_->getParameter<double>("DxyErrMax");
737 
738  int DxyBin = conf_->getParameter<int>( "DxyBin");
739  double DxyMin = conf_->getParameter<double>("DxyMin");
740  double DxyMax = conf_->getParameter<double>("DxyMax");
741 
742  int AbsDxyBin = conf_->getParameter<int>( "AbsDxyBin");
743  double AbsDxyMin = conf_->getParameter<double>("AbsDxyMin");
744  double AbsDxyMax = conf_->getParameter<double>("AbsDxyMax");
745 
746  int PhiBin = conf_->getParameter<int>( "PhiBin");
747  double PhiMin = conf_->getParameter<double>("PhiMin");
748  double PhiMax = conf_->getParameter<double>("PhiMax");
749 
750  int EtaBin = conf_->getParameter<int>( "EtaBin");
751  double EtaMin = conf_->getParameter<double>("EtaMin");
752  double EtaMax = conf_->getParameter<double>("EtaMax");
753 
754  int PtBin = conf_->getParameter<int>( "TrackPtBin");
755  double PtMin = conf_->getParameter<double>("TrackPtMin");
756  double PtMax = conf_->getParameter<double>("TrackPtMax");
757 
758  int X0Bin = conf_->getParameter<int>( "X0Bin");
759  double X0Min = conf_->getParameter<double>("X0Min");
760  double X0Max = conf_->getParameter<double>("X0Max");
761 
762  int Y0Bin = conf_->getParameter<int>( "Y0Bin");
763  double Y0Min = conf_->getParameter<double>("Y0Min");
764  double Y0Max = conf_->getParameter<double>("Y0Max");
765 
766  int Z0Bin = conf_->getParameter<int>( "Z0Bin");
767  double Z0Min = conf_->getParameter<double>("Z0Min");
768  double Z0Max = conf_->getParameter<double>("Z0Max");
769 
770  int VZBinProf = conf_->getParameter<int>( "VZBinProf");
771  double VZMinProf = conf_->getParameter<double>("VZMinProf");
772  double VZMaxProf = conf_->getParameter<double>("VZMaxProf");
773 
774 
775  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
776 
777  histname = "DistanceOfClosestApproachError_";
778  DistanceOfClosestApproachError = ibooker.book1D(histname+CategoryName,histname+CategoryName,DxyErrBin,0.,DxyErrMax);
779  DistanceOfClosestApproachError->setAxisTitle("Track d_{xy} error (cm)",1);
780  DistanceOfClosestApproachError->setAxisTitle("Number of Tracks",2);
781 
782  histname = "DistanceOfClosestApproachErrorVsPt_";
783  DistanceOfClosestApproachErrorVsPt = ibooker.bookProfile(histname+CategoryName,histname+CategoryName,PtBin,PtMin,PtMax,0.,DxyErrMax);
784  DistanceOfClosestApproachErrorVsPt->setAxisTitle("Track p_{T} (GeV)",1);
785  DistanceOfClosestApproachErrorVsPt->setAxisTitle("Track d_{xy} error (cm)",2);
786 
787  histname = "DistanceOfClosestApproachErrorVsEta_";
788  DistanceOfClosestApproachErrorVsEta = ibooker.bookProfile(histname+CategoryName,histname+CategoryName,EtaBin,EtaMin,EtaMax,0.,DxyErrMax);
790  DistanceOfClosestApproachErrorVsEta->setAxisTitle("Track d_{xy} error (cm)",2);
791 
792  histname = "DistanceOfClosestApproachErrorVsPhi_";
793  DistanceOfClosestApproachErrorVsPhi = ibooker.bookProfile(histname+CategoryName,histname+CategoryName,PhiBin,PhiMin,PhiMax,0.,DxyErrMax);
795  DistanceOfClosestApproachErrorVsPhi->setAxisTitle("Track d_{xy} error (cm)",2);
796 
797  histname = "DistanceOfClosestApproachErrorVsDxy_";
798  DistanceOfClosestApproachErrorVsDxy = ibooker.bookProfile(histname+CategoryName,histname+CategoryName,DxyBin,DxyMin,DxyMax,0.,DxyErrMax);
800  DistanceOfClosestApproachErrorVsDxy->setAxisTitle("Track d_{xy} error (cm)",2);
801 
802  histname = "DistanceOfClosestApproachToBS_";
803  DistanceOfClosestApproachToBS = ibooker.book1D(histname+CategoryName,histname+CategoryName,DxyBin,DxyMin,DxyMax);
804  DistanceOfClosestApproachToBS->setAxisTitle("Track d_{xy} wrt beam spot (cm)",1);
805  DistanceOfClosestApproachToBS->setAxisTitle("Number of Tracks",2);
806 
807  histname = "AbsDistanceOfClosestApproachToBS_";
808  AbsDistanceOfClosestApproachToBS = ibooker.book1D(histname+CategoryName,histname+CategoryName,AbsDxyBin,AbsDxyMin,AbsDxyMax);
809  AbsDistanceOfClosestApproachToBS->setAxisTitle("Track |d_{xy}| wrt beam spot (cm)",1);
810  AbsDistanceOfClosestApproachToBS->setAxisTitle("Number of Tracks",2);
811 
812  histname = "DistanceOfClosestApproachToBSVsPhi_";
813  DistanceOfClosestApproachToBSVsPhi = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, PhiBin, PhiMin, PhiMax, DxyBin, DxyMin, DxyMax,"");
814  DistanceOfClosestApproachToBSVsPhi->getTH1()->SetCanExtend(TH1::kAllAxes);
816  DistanceOfClosestApproachToBSVsPhi->setAxisTitle("Track d_{xy} wrt beam spot (cm)",2);
817 
818  histname = "xPointOfClosestApproachVsZ0wrt000_";
819  xPointOfClosestApproachVsZ0wrt000 = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, X0Bin, X0Min, X0Max,"");
821  xPointOfClosestApproachVsZ0wrt000->setAxisTitle("x component of Track PCA to beam line (cm)",2);
822 
823  histname = "yPointOfClosestApproachVsZ0wrt000_";
824  yPointOfClosestApproachVsZ0wrt000 = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, Y0Bin, Y0Min, Y0Max,"");
826  yPointOfClosestApproachVsZ0wrt000->setAxisTitle("y component of Track PCA to beam line (cm)",2);
827 
828  histname = "xPointOfClosestApproachVsZ0wrtBS_";
829  xPointOfClosestApproachVsZ0wrtBS = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, X0Bin, X0Min, X0Max,"");
830  xPointOfClosestApproachVsZ0wrtBS->setAxisTitle("d_{z} w.r.t. Beam Spot (cm)",1);
831  xPointOfClosestApproachVsZ0wrtBS->setAxisTitle("x component of Track PCA to BS (cm)",2);
832 
833  histname = "yPointOfClosestApproachVsZ0wrtBS_";
834  yPointOfClosestApproachVsZ0wrtBS = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, Y0Bin, Y0Min, Y0Max,"");
835  yPointOfClosestApproachVsZ0wrtBS->setAxisTitle("d_{z} w.r.t. Beam Spot (cm)",1);
836  yPointOfClosestApproachVsZ0wrtBS->setAxisTitle("y component of Track PCA to BS (cm)",2);
837 
838  histname = "zPointOfClosestApproachVsPhi_";
839  zPointOfClosestApproachVsPhi = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, PhiBin, PhiMin, PhiMax, VZBinProf, VZMinProf, VZMaxProf, "");
841  zPointOfClosestApproachVsPhi->setAxisTitle("z component of Track PCA to beam line (cm)",2);
842  }
843 
845 
846  int DxyBin = conf_->getParameter<int>( "DxyBin");
847  double DxyMin = conf_->getParameter<double>("DxyMin");
848  double DxyMax = conf_->getParameter<double>("DxyMax");
849 
850  int PhiBin = conf_->getParameter<int>( "PhiBin");
851  double PhiMin = conf_->getParameter<double>("PhiMin");
852  double PhiMax = conf_->getParameter<double>("PhiMax");
853 
854  int X0Bin = conf_->getParameter<int>( "X0Bin");
855  double X0Min = conf_->getParameter<double>("X0Min");
856  double X0Max = conf_->getParameter<double>("X0Max");
857 
858  int Y0Bin = conf_->getParameter<int>( "Y0Bin");
859  double Y0Min = conf_->getParameter<double>("Y0Min");
860  double Y0Max = conf_->getParameter<double>("Y0Max");
861 
862  int Z0Bin = conf_->getParameter<int>( "Z0Bin");
863  double Z0Min = conf_->getParameter<double>("Z0Min");
864  double Z0Max = conf_->getParameter<double>("Z0Max");
865 
866  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
867 
868  histname = "DistanceOfClosestApproachToPV_";
869  DistanceOfClosestApproachToPV = ibooker.book1D(histname+CategoryName,histname+CategoryName,DxyBin,DxyMin,DxyMax);
870  DistanceOfClosestApproachToPV->setAxisTitle("Track d_{xy} w.r.t. PV (cm)",1);
871  DistanceOfClosestApproachToPV->setAxisTitle("Number of Tracks",2);
872 
873  histname = "DistanceOfClosestApproachToPVZoom_";
874  DistanceOfClosestApproachToPVZoom = ibooker.book1D(histname+CategoryName,histname+CategoryName,100,-0.08,0.08);
875  DistanceOfClosestApproachToPVZoom->setAxisTitle("Track d_{xy} w.r.t. PV (cm)",1);
876  DistanceOfClosestApproachToPVZoom->setAxisTitle("Number of Tracks",2);
877 
878 
879  histname = "DeltaZToPV_";
880  DeltaZToPV = ibooker.book1D(histname+CategoryName,histname+CategoryName,Z0Bin,Z0Min,Z0Max);
881  DeltaZToPV->setAxisTitle("Track d_{z} w.r.t. PV (cm)",1);
882  DeltaZToPV->setAxisTitle("Number of Tracks",2);
883 
884  histname = "DeltaZToPVZoom_";
885  DeltaZToPVZoom = ibooker.book1D(histname+CategoryName,histname+CategoryName,100,-0.15,0.15);
886  DeltaZToPVZoom->setAxisTitle("Track d_{z} w.r.t. PV (cm)",1);
887  DeltaZToPVZoom->setAxisTitle("Number of Tracks",2);
888 
889 
890  histname = "DistanceOfClosestApproachToPVVsPhi_";
891  DistanceOfClosestApproachToPVVsPhi = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, PhiBin, PhiMin, PhiMax, DxyBin, DxyMin, DxyMax,"");
892  DistanceOfClosestApproachToPVVsPhi->getTH1()->SetCanExtend(TH1::kAllAxes);
894  DistanceOfClosestApproachToPVVsPhi->setAxisTitle("Track d_{xy} w.r.t. PV (cm)",2);
895 
896  histname = "xPointOfClosestApproachVsZ0wrtPV_";
897  xPointOfClosestApproachVsZ0wrtPV = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, X0Bin, X0Min, X0Max,"");
898  xPointOfClosestApproachVsZ0wrtPV->setAxisTitle("d_{z} w.r.t. PV (cm)",1);
899  xPointOfClosestApproachVsZ0wrtPV->setAxisTitle("x component of Track PCA to PV (cm)",2);
900 
901  histname = "yPointOfClosestApproachVsZ0wrtPV_";
902  yPointOfClosestApproachVsZ0wrtPV = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, Z0Bin, Z0Min, Z0Max, Y0Bin, Y0Min, Y0Max,"");
903  yPointOfClosestApproachVsZ0wrtPV->setAxisTitle("d_{z} w.r.t. PV (cm)",1);
904  yPointOfClosestApproachVsZ0wrtPV->setAxisTitle("y component of Track PCA to PV (cm)",2);
905 
906  }
907 
908  if (doBSPlots_ || doAllPlots_) {
909  if (doTestPlots_) {
910 
911  int DxyBin = conf_->getParameter<int>( "DxyBin");
912  double DxyMin = conf_->getParameter<double>("DxyMin");
913  double DxyMax = conf_->getParameter<double>("DxyMax");
914 
915  int PhiBin = conf_->getParameter<int>( "PhiBin");
916  double PhiMin = conf_->getParameter<double>("PhiMin");
917  double PhiMax = conf_->getParameter<double>("PhiMax");
918 
919  histname = "TESTDistanceOfClosestApproachToBS_";
920  TESTDistanceOfClosestApproachToBS = ibooker.book1D(histname+CategoryName,histname+CategoryName,DxyBin,DxyMin,DxyMax);
921  TESTDistanceOfClosestApproachToBS->setAxisTitle("Track d_{xy} wrt beam spot (cm)",1);
922  TESTDistanceOfClosestApproachToBS->setAxisTitle("Number of Tracks",2);
923 
924  histname = "TESTDistanceOfClosestApproachToBSVsPhi_";
925  TESTDistanceOfClosestApproachToBSVsPhi = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, PhiBin, PhiMin, PhiMax, DxyBin, DxyMin, DxyMax,"");
926  TESTDistanceOfClosestApproachToBSVsPhi->getTH1()->SetCanExtend(TH1::kAllAxes);
928  TESTDistanceOfClosestApproachToBSVsPhi->setAxisTitle("Track d_{xy} wrt beam spot (cm)",2);
929 
930  }
931 
932  }
933 
934  // book the Profile plots for DCA related histograms
935  // ---------------------------------------------------------------------------------//
936  if(doDCAPlots_ || doAllPlots_) {
937 
938  if (doDCAwrt000Plots_) {
939 
940  int EtaBin = conf_->getParameter<int>( "EtaBin");
941  double EtaMin = conf_->getParameter<double>("EtaMin");
942  double EtaMax = conf_->getParameter<double>("EtaMax");
943 
944  int PhiBin = conf_->getParameter<int>( "PhiBin");
945  double PhiMin = conf_->getParameter<double>("PhiMin");
946  double PhiMax = conf_->getParameter<double>("PhiMax");
947 
948  int DxyBin = conf_->getParameter<int>( "DxyBin");
949  double DxyMin = conf_->getParameter<double>("DxyMin");
950  double DxyMax = conf_->getParameter<double>("DxyMax");
951 
952  if (doThetaPlots_) {
953  int ThetaBin = conf_->getParameter<int>( "ThetaBin");
954  double ThetaMin = conf_->getParameter<double>("ThetaMin");
955  double ThetaMax = conf_->getParameter<double>("ThetaMax");
956 
957  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
958  histname = "DistanceOfClosestApproachVsTheta_";
959  DistanceOfClosestApproachVsTheta = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, ThetaBin, ThetaMin, ThetaMax, DxyMin,DxyMax,"");
961  DistanceOfClosestApproachVsTheta->setAxisTitle("Track d_{xy} wrt (0,0,0) (cm)",2);
962  }
963 
964  histname = "DistanceOfClosestApproachVsEta_";
965  DistanceOfClosestApproachVsEta = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, EtaBin, EtaMin, EtaMax, DxyMin, DxyMax,"");
967  DistanceOfClosestApproachVsEta->setAxisTitle("Track d_{xy} wrt (0,0,0) (cm)",2);
968  // temporary patch in order to put back those MEs in Muon Workspace
969 
970  histname = "DistanceOfClosestApproach_";
971  DistanceOfClosestApproach = ibooker.book1D(histname+CategoryName,histname+CategoryName,DxyBin,DxyMin,DxyMax);
972  DistanceOfClosestApproach->setAxisTitle("Track d_{xy} wrt (0,0,0) (cm)",1);
973  DistanceOfClosestApproach->setAxisTitle("Number of Tracks",2);
974 
975  histname = "DistanceOfClosestApproachVsPhi_";
976  DistanceOfClosestApproachVsPhi = ibooker.bookProfile(histname+CategoryName,histname+CategoryName, PhiBin, PhiMin, PhiMax, DxyMin,DxyMax,"");
977  DistanceOfClosestApproachVsPhi->getTH1()->SetCanExtend(TH1::kAllAxes);
979  DistanceOfClosestApproachVsPhi->setAxisTitle("Track d_{xy} wrt (0,0,0) (cm)",2);
980  }
981  }
982 
983 
984  if (doSIPPlots_ || doAllPlots_) {
985  const double sipBins = 200;
986  const double sipMin = -20;
987  const double sipMax = 20;
988 
989  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
990 
991  // SIP wrt. beamspot
992  histname = "SIPDxyToBS_";
993  sipDxyToBS = ibooker.book1D(histname+CategoryName, histname+CategoryName, sipBins, sipMin, sipMax);
994  sipDxyToBS->setAxisTitle("Track dxy significance wrt beam spot",1);
995  sipDxyToBS->setAxisTitle("Number of Tracks",2);
996 
997  histname = "SIPDzToBS_";
998  sipDzToBS = ibooker.book1D(histname+CategoryName, histname+CategoryName, sipBins, sipMin, sipMax);
999  sipDzToBS->setAxisTitle("Track dz significance wrt beam spot",1);
1000  sipDzToBS->setAxisTitle("Number of Tracks",2);
1001 
1002  // SIP wrt. vertex
1003  histname = "SIP3DToPV_";
1004  sip3dToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, sipBins, sipMin, sipMax);
1005  sip3dToPV->setAxisTitle("3D IP significance wrt primary vertex",1);
1006  sip3dToPV->setAxisTitle("Number of Tracks",2);
1007 
1008  histname = "SIP2DToPV_";
1009  sip2dToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, sipBins, sipMin, sipMax);
1010  sip2dToPV->setAxisTitle("2D IP significance wrt primary vertex",1);
1011  sip2dToPV->setAxisTitle("Number of Tracks",2);
1012 
1013  histname = "SIPDxyToPV_";
1014  sipDxyToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, sipBins, sipMin, sipMax);
1015  sipDxyToPV->setAxisTitle("Track dxy significance wrt primary vertex",1);
1016  sipDxyToPV->setAxisTitle("Number of Tracks",2);
1017 
1018  histname = "SIPDzToPV_";
1019  sipDzToPV = ibooker.book1D(histname+CategoryName, histname+CategoryName, sipBins, sipMin, sipMax);
1020  sipDzToPV->setAxisTitle("Track dz significance wrt primary vertex",1);
1021  sipDzToPV->setAxisTitle("Number of Tracks",2);
1022  }
1023 }
1024 
1025 // -- Analyse
1026 // ---------------------------------------------------------------------------------//
1028 
1029  good_vertices_ = 0;
1030 
1031  edm::Handle<reco::VertexCollection> recoPrimaryVerticesHandle;
1032  iEvent.getByToken(pvToken_, recoPrimaryVerticesHandle);
1033  if (recoPrimaryVerticesHandle.isValid())
1034  if (!recoPrimaryVerticesHandle->empty())
1035  for (auto v : *recoPrimaryVerticesHandle)
1036  if (v.ndof() >= pvNDOF_ && !v.isFake())
1037  ++good_vertices_;
1038 }
1039 
1041  bx_ = iEvent.bunchCrossing();
1042 }
1043 
1046  // as done by pixelLumi http://cmslxr.fnal.gov/source/DQM/PixelLumi/plugins/PixelLumiDQM.cc
1047 
1049  iEvent.getByToken(lumiscalersToken_, lumiScalers);
1050  if ( lumiScalers.isValid() && !lumiScalers->empty() ) {
1051  LumiScalersCollection::const_iterator scalit = lumiScalers->begin();
1052  scal_lumi_ = scalit->instantLumi();
1053  } else
1054  scal_lumi_ = -1;
1055 
1057  iEvent.getByToken(pixelClustersToken_, pixelClusters);
1058  if ( pixelClusters.isValid() ) {
1059 
1060  edm::ESHandle<TrackerTopology> tTopoHandle;
1061  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
1062  const TrackerTopology* const tTopo = tTopoHandle.product();
1063 
1064  // Count the number of clusters with at least a minimum
1065  // number of pixels per cluster and at least a minimum charge.
1066  size_t numClusters = 0;
1067  size_t tot = 0;
1068 
1069  edmNew::DetSetVector<SiPixelCluster>::const_iterator pixCluDet = pixelClusters->begin();
1070  for ( ; pixCluDet!=pixelClusters->end(); ++pixCluDet) {
1071 
1072  DetId detid = pixCluDet->detId();
1073  size_t subdetid = detid.subdetId();
1074  // std::cout << tTopo->print(detid) << std::endl;
1075  if ( subdetid == (int) PixelSubdetector::PixelBarrel )
1076  if ( tTopo->layer(detid)==1 )
1077  continue;
1078 
1080  for ( ; pixClu != pixCluDet->end(); ++pixClu ) {
1081  ++tot;
1082  if ( (pixClu->size() >= minNumberOfPixelsPerCluster_) &&
1083  (pixClu->charge() >= minPixelClusterCharge_ ) ) {
1084  ++numClusters;
1085  }
1086  }
1087  }
1088  pixel_lumi_ = lumi_factor_per_bx_ * numClusters / GetLumi::CM2_TO_NANOBARN ; // ?!?!
1089  } else
1090  pixel_lumi_ = -1.;
1091 
1092 }
1093 
1095 {
1096  auto pt = track.pt();
1097  auto phi = track.phi();
1098  // double eta = track.eta();
1099  auto phiIn = track.innerPosition().phi();
1100  auto etaIn = track.innerPosition().eta();
1101  auto phiOut = track.outerPosition().phi();
1102  auto etaOut = track.outerPosition().eta();
1103 
1105  int nValidRecHits = track.numberOfValidHits();
1106  int nLostRecHits = track.numberOfLostHits();
1109 
1110  auto chi2 = track.chi2();
1111  auto chi2prob = TMath::Prob(track.chi2(),(int)track.ndof());
1112  auto chi2oNDF = track.normalizedChi2();
1113 
1115  // rec hits
1116  NumberOfRecHitsPerTrack -> Fill(nRecHits);
1117  NumberOfValidRecHitsPerTrack-> Fill(nValidRecHits);
1118  NumberOfLostRecHitsPerTrack -> Fill(nLostRecHits);
1119  NumberOfMIRecHitsPerTrack -> Fill(nLostIn);
1120  NumberOfMORecHitsPerTrack -> Fill(nLostOut);
1122 
1123 
1124  // 2D plots
1126  NumberOfValidRecHitVsPhiVsEtaPerTrack->Fill(etaIn,phiIn,nValidRecHits);
1127  NumberOfLostRecHitVsPhiVsEtaPerTrack->Fill(etaIn,phiIn,nLostRecHits);
1128  NumberOfMIRecHitVsPhiVsEtaPerTrack->Fill(etaIn,phiIn,nLostIn);
1129  NumberOfMORecHitVsPhiVsEtaPerTrack->Fill(etaOut,phiOut,nLostOut);
1130  ValidFractionVsPhiVsEtaPerTrack -> Fill(etaIn,phiIn,track.validFraction());
1131  }
1133  NumberOfValidRecHitVsPtVsEtaPerTrack->Fill(etaIn,pt,nValidRecHits);
1134  NumberOfLostRecHitVsPtVsEtaPerTrack->Fill(etaIn,pt,nLostRecHits);
1135  NumberOfMIRecHitVsPtVsEtaPerTrack->Fill(etaIn,pt,nLostIn);
1136  NumberOfMORecHitVsPtVsEtaPerTrack->Fill(etaOut,pt,nLostOut);
1137  }
1138  NumberOfValidRecHitsPerTrackVsPt->Fill(pt,nValidRecHits);
1139  NumberOfLostRecHitsPerTrackVsPt->Fill(pt,nLostRecHits);
1142 
1143  int nLayers[5] = { track.hitPattern().trackerLayersWithMeasurement(),
1148  };
1149 
1150  // layers
1151  for (int i=0;i<4;++i) NumberOfLayersPerTrack[i]->Fill(nLayers[i]);
1152 
1153  // 2D plots
1155  for (int i=0;i<5;++i) NumberOfLayersVsPhiVsEtaPerTrack[i]->Fill(etaIn,phiIn,nLayers[i]);
1156 
1157  }
1158 
1160  if (doEffFromHitPatternVsBX_ || doAllPlots_) fillHistosForEfficiencyFromHitPatter(track,"VsBX", float(bx_), false );
1162  // if (doEffFromHitPatternVsLUMI_ || doAllPlots_) fillHistosForEfficiencyFromHitPatter(track,"VsPIXELLUMI", pixel_lumi_ );
1165 
1166 
1168  // fitting
1169  Chi2 -> Fill(chi2);
1170  Chi2Prob -> Fill(chi2prob);
1171  Chi2oNDF -> Fill(chi2oNDF);
1172 
1173  // DCA
1174  // temporary patch in order to put back those MEs in Muon Workspace
1175  if (doDCAPlots_) {
1176  if (doDCAwrt000Plots_) {
1178  DistanceOfClosestApproachVsPhi->Fill(phi, track.dxy());
1179  }
1180 
1181  // PCA
1185  }
1186 
1187  // algorithm
1188  algorithm->Fill(static_cast<double>(track.algo()));
1189  oriAlgo->Fill(static_cast<double>(track.originalAlgo()));
1190 
1191  // stopping source
1192  int max = stoppingSource->getNbinsX();
1193  double stop = track.stopReason() > max ? double(max-1) : static_cast<double>(track.stopReason());
1194  double stopped = int(StopReason::NOT_STOPPED)==track.stopReason() ? 0. : 1.;
1195  stoppingSource->Fill(stop);
1196  stoppingSourceVSeta->Fill(track.eta(),stopped);
1197  stoppingSourceVSphi->Fill(track.phi(),stopped);
1198  }
1199 
1200  if ( doLumiAnalysis_ ) {
1202  Chi2oNDF_lumiFlag -> Fill(chi2oNDF);
1203  }
1204 
1206 
1207  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
1208  iEvent.getByToken(beamSpotToken_,recoBeamSpotHandle);
1209  const reco::BeamSpot& bs = *recoBeamSpotHandle;
1210 
1212  DistanceOfClosestApproachErrorVsPt -> Fill(track.pt(),track.dxyError());
1216 
1219  DistanceOfClosestApproachToBSVsPhi -> Fill(track.phi(), track.dxy(bs.position()));
1220  zPointOfClosestApproachVsPhi -> Fill(track.phi(), track.vz());
1221  xPointOfClosestApproachVsZ0wrt000 -> Fill(track.dz(), track.vx());
1222  yPointOfClosestApproachVsZ0wrt000 -> Fill(track.dz(), track.vy());
1223  xPointOfClosestApproachVsZ0wrtBS -> Fill(track.dz(bs.position()),(track.vx()-bs.position(track.vz()).x()));
1224  yPointOfClosestApproachVsZ0wrtBS -> Fill(track.dz(bs.position()),(track.vy()-bs.position(track.vz()).y()));
1225  if (doTestPlots_) {
1226  TESTDistanceOfClosestApproachToBS -> Fill(track.dxy(bs.position(track.vz())));
1227  TESTDistanceOfClosestApproachToBSVsPhi -> Fill(track.phi(), track.dxy(bs.position(track.vz())));
1228  }
1229 
1230  if(doSIPPlots_) {
1231  sipDxyToBS->Fill(track.dxy(bs.position())/track.dxyError());
1232  sipDzToBS->Fill(track.dz(bs.position())/track.dzError());
1233  }
1234  }
1235 
1237  edm::Handle<reco::VertexCollection> recoPrimaryVerticesHandle;
1238  iEvent.getByToken(pvToken_,recoPrimaryVerticesHandle);
1239  if (recoPrimaryVerticesHandle.isValid() && !recoPrimaryVerticesHandle->empty()) {
1240  const reco::Vertex& pv = (*recoPrimaryVerticesHandle)[0];
1241 
1242 
1244  //HI PLOTS///////
1246 
1247  if(doHIPlots_)
1248  {
1249  double longDCAsig = 0, transDCAsig = 0;
1250  double zerr2 = track.dzError()*track.dzError()+pv.zError()*pv.zError();
1251  double xyerr2 = track.d0Error()*track.d0Error()+pv.xError()*pv.yError();
1252  if(zerr2 > 0) longDCAsig = track.dz(pv.position())/zerr2;
1253  if(xyerr2 > 0) transDCAsig = track.dxy(pv.position())/xyerr2;
1254  LongDCASig->Fill(longDCAsig);
1255  TransDCASig->Fill(transDCAsig);
1256 
1257 
1258 
1259 
1261  {
1262  dNdEta_HighPurity->Fill(track.eta());
1263  dNdPhi_HighPurity->Fill(track.phi());
1264  dNdPt_HighPurity->Fill(track.ptError()/track.pt());
1265  NhitVsEta_HighPurity->Fill(track.eta(),track.numberOfValidHits());
1266  NhitVsPhi_HighPurity->Fill(track.phi(),track.numberOfValidHits());
1267  dNhitdPt_HighPurity->Fill(track.pt(),track.numberOfValidHits());
1268  Ptdist_HighPurity->Fill(track.pt());
1269  }//end of high quality tracks requirement
1270  }
1271 
1272 
1273  xPointOfClosestApproachToPV->Fill(track.vx()-pv.position().x());
1274  yPointOfClosestApproachToPV->Fill(track.vy()-pv.position().y());
1277  DeltaZToPV -> Fill(track.dz (pv.position()));
1279  DeltaZToPVZoom -> Fill(track.dz (pv.position()));
1280  DistanceOfClosestApproachToPVVsPhi -> Fill(track.phi(), track.dxy(pv.position()));
1281  xPointOfClosestApproachVsZ0wrtPV -> Fill(track.dz(pv.position()),(track.vx()-pv.position().x()));
1282  yPointOfClosestApproachVsZ0wrtPV -> Fill(track.dz(pv.position()),(track.vy()-pv.position().y()));
1283 
1284 
1285  if(doSIPPlots_) {
1287  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",theB);
1288  reco::TransientTrack transTrack = theB->build(track);
1289 
1290  GlobalVector dir(track.px(), track.py(), track.pz());
1291  std::pair<bool, Measurement1D> ip3d = IPTools::signedImpactParameter3D(transTrack, dir, pv);
1292  std::pair<bool, Measurement1D> ip2d = IPTools::signedTransverseImpactParameter(transTrack, dir, pv);
1293  if(ip3d.first) sip3dToPV->Fill(ip3d.second.value() / ip3d.second.error());
1294  if(ip2d.first) sip2dToPV->Fill(ip2d.second.value() / ip2d.second.error());
1295  sipDxyToPV->Fill(track.dxy(pv.position())/track.dxyError());
1296  sipDzToPV->Fill(track.dz(pv.position())/track.dzError());
1297  }
1298  }
1299  }
1300 
1301  if(doDCAPlots_ || doAllPlots_) {
1302  if (doDCAwrt000Plots_) {
1303  if (doThetaPlots_) {
1304  DistanceOfClosestApproachVsTheta->Fill(track.theta(), track.d0());
1305  }
1306  DistanceOfClosestApproachVsEta->Fill(track.eta(), track.d0());
1307  }
1308 
1309  }
1310 
1311  //Tracker Specific Histograms
1314  }
1315 
1317 
1318  if (stateName_ == "All") {
1319  fillHistosForState(iSetup, track, std::string("OuterSurface"));
1320  fillHistosForState(iSetup, track, std::string("InnerSurface"));
1321  fillHistosForState(iSetup, track, std::string("ImpactPoint"));
1322  } else if (
1323  stateName_ != "OuterSurface" &&
1324  stateName_ != "InnerSurface" &&
1325  stateName_ != "ImpactPoint" &&
1326  stateName_ != "default"
1327  ) {
1328  fillHistosForState(iSetup, track, std::string("default"));
1329  } else {
1330  fillHistosForState(iSetup, track, stateName_);
1331  }
1332  }
1333 
1334  if ( doAllPlots_ ) {
1335  }
1336 
1337 }
1338 
1340 
1341  int mon = -1;
1342  for (int i=0; i<monQuantity::END; i++) {
1343  if (monName[i] == suffix) mon = i;
1344  }
1345  if (useInac) mon+=monQuantity::END;
1346 
1347  // if (track.pt() > 1.0 && track.dxy() < 0.1 and monitoring > 0) {
1348  if (track.pt() > 1.0 && track.dxy() < 0.1 and monitoring > -9.) {
1349  auto hp = track.hitPattern();
1350  // Here hit_category is meant to iterate over
1351  // reco::HitPattern::HitCategory, defined here:
1352  // http://cmslxr.fnal.gov/dxr/CMSSW/source/DataFormats/TrackReco/interface/HitPattern.h
1353  for (unsigned int category = 0; category < 3; ++category) {
1354  for (int hit = 0; hit < hp.numberOfAllHits((reco::HitPattern::HitCategory)(category)); ++hit) {
1355  auto pattern = hp.getHitPattern((reco::HitPattern::HitCategory)(category), hit);
1356  // Boolean bad is missing simply because it is inferred and the only missing case.
1357  bool valid = hp.validHitFilter(pattern);
1358  bool missing = hp.missingHitFilter(pattern);
1359  bool inactive = hp.inactiveHitFilter(pattern);
1360  int hit_type = -1;
1361  hit_type = valid ? 0 :
1362  ( missing ? 1 :
1363  ( inactive ? 2 : 3));
1364  if (hits_valid_.find(Key(hp.getSubStructure(pattern), hp.getSubSubStructure(pattern), mon)) == hits_valid_.end()) {
1365  LogDebug("TrackAnalyzer") << "Invalid combination of detector and subdetector: ("
1366  << hp.getSubStructure(pattern) << ", "
1367  << hp.getSubSubStructure(pattern) << ", "
1368  << mon
1369  << "): ignoring it.\n";
1370  continue;
1371  }
1372  switch (hit_type) {
1373  case 0:
1374  hits_valid_[Key(hp.getSubStructure(pattern), hp.getSubSubStructure(pattern), mon)]->Fill(monitoring);
1375  hits_total_[Key(hp.getSubStructure(pattern), hp.getSubSubStructure(pattern), mon)]->Fill(monitoring);
1376  break;
1377  case 2:
1378  if (!useInac) break;
1379  case 1:
1380  hits_total_[Key(hp.getSubStructure(pattern), hp.getSubSubStructure(pattern), mon)]->Fill(monitoring);
1381  break;
1382  default:
1383  LogDebug("TrackAnalyzer") << "Invalid hit category used " << hit_type << " ignored\n";
1384  }
1385  }
1386  }
1387  }
1388 
1389 }
1390 
1391 // book histograms at differnt measurement points
1392 // ---------------------------------------------------------------------------------//
1394 {
1395 
1396  // parameters from the configuration
1397  std::string QualName = conf_->getParameter<std::string>("Quality");
1398  std::string AlgoName = conf_->getParameter<std::string>("AlgoName");
1399 
1400  // use the AlgoName and Quality Name
1401  std::string CategoryName = !QualName.empty() ? AlgoName + "_" + QualName : AlgoName;
1402 
1403  // get binning from the configuration
1404  double Chi2NDFMin = conf_->getParameter<double>("Chi2NDFMin");
1405  double Chi2NDFMax = conf_->getParameter<double>("Chi2NDFMax");
1406 
1407  int RecHitBin = conf_->getParameter<int>( "RecHitBin");
1408  double RecHitMin = conf_->getParameter<double>("RecHitMin");
1409  double RecHitMax = conf_->getParameter<double>("RecHitMax");
1410 
1411  int RecLayBin = conf_->getParameter<int>( "RecHitBin");
1412  double RecLayMin = conf_->getParameter<double>("RecHitMin");
1413  double RecLayMax = conf_->getParameter<double>("RecHitMax");
1414 
1415 
1416  int PhiBin = conf_->getParameter<int>( "PhiBin");
1417  double PhiMin = conf_->getParameter<double>("PhiMin");
1418  double PhiMax = conf_->getParameter<double>("PhiMax");
1419 
1420  int EtaBin = conf_->getParameter<int>( "EtaBin");
1421  double EtaMin = conf_->getParameter<double>("EtaMin");
1422  double EtaMax = conf_->getParameter<double>("EtaMax");
1423 
1424  int Phi2DBin = conf_->getParameter<int>( "Phi2DBin");
1425  int Eta2DBin = conf_->getParameter<int>( "Eta2DBin");
1426 
1427  int ThetaBin = conf_->getParameter<int>( "ThetaBin");
1428  double ThetaMin = conf_->getParameter<double>("ThetaMin");
1429  double ThetaMax = conf_->getParameter<double>("ThetaMax");
1430 
1431  int TrackQBin = conf_->getParameter<int>( "TrackQBin");
1432  double TrackQMin = conf_->getParameter<double>("TrackQMin");
1433  double TrackQMax = conf_->getParameter<double>("TrackQMax");
1434 
1435  int TrackPtBin = conf_->getParameter<int>( "TrackPtBin");
1436  double TrackPtMin = conf_->getParameter<double>("TrackPtMin");
1437  double TrackPtMax = conf_->getParameter<double>("TrackPtMax");
1438 
1439  int TrackPBin = conf_->getParameter<int>( "TrackPBin");
1440  double TrackPMin = conf_->getParameter<double>("TrackPMin");
1441  double TrackPMax = conf_->getParameter<double>("TrackPMax");
1442 
1443  int TrackPxBin = conf_->getParameter<int>( "TrackPxBin");
1444  double TrackPxMin = conf_->getParameter<double>("TrackPxMin");
1445  double TrackPxMax = conf_->getParameter<double>("TrackPxMax");
1446 
1447  int TrackPyBin = conf_->getParameter<int>( "TrackPyBin");
1448  double TrackPyMin = conf_->getParameter<double>("TrackPyMin");
1449  double TrackPyMax = conf_->getParameter<double>("TrackPyMax");
1450 
1451  int TrackPzBin = conf_->getParameter<int>( "TrackPzBin");
1452  double TrackPzMin = conf_->getParameter<double>("TrackPzMin");
1453  double TrackPzMax = conf_->getParameter<double>("TrackPzMax");
1454 
1455  int ptErrBin = conf_->getParameter<int>( "ptErrBin");
1456  double ptErrMin = conf_->getParameter<double>("ptErrMin");
1457  double ptErrMax = conf_->getParameter<double>("ptErrMax");
1458 
1459  int pxErrBin = conf_->getParameter<int>( "pxErrBin");
1460  double pxErrMin = conf_->getParameter<double>("pxErrMin");
1461  double pxErrMax = conf_->getParameter<double>("pxErrMax");
1462 
1463  int pyErrBin = conf_->getParameter<int>( "pyErrBin");
1464  double pyErrMin = conf_->getParameter<double>("pyErrMin");
1465  double pyErrMax = conf_->getParameter<double>("pyErrMax");
1466 
1467  int pzErrBin = conf_->getParameter<int>( "pzErrBin");
1468  double pzErrMin = conf_->getParameter<double>("pzErrMin");
1469  double pzErrMax = conf_->getParameter<double>("pzErrMax");
1470 
1471  int pErrBin = conf_->getParameter<int>( "pErrBin");
1472  double pErrMin = conf_->getParameter<double>("pErrMin");
1473  double pErrMax = conf_->getParameter<double>("pErrMax");
1474 
1475  int phiErrBin = conf_->getParameter<int>( "phiErrBin");
1476  double phiErrMin = conf_->getParameter<double>("phiErrMin");
1477  double phiErrMax = conf_->getParameter<double>("phiErrMax");
1478 
1479  int etaErrBin = conf_->getParameter<int>( "etaErrBin");
1480  double etaErrMin = conf_->getParameter<double>("etaErrMin");
1481  double etaErrMax = conf_->getParameter<double>("etaErrMax");
1482 
1483 
1484  double Chi2ProbMin = conf_->getParameter<double>("Chi2ProbMin");
1485  double Chi2ProbMax = conf_->getParameter<double>("Chi2ProbMax");
1486 
1487  ibooker.setCurrentFolder(TopFolder_);
1488 
1489  TkParameterMEs tkmes;
1490 
1491  std::string histTag = (sname == "default") ? CategoryName : sname + "_" + CategoryName;
1492 
1493  if(doAllPlots_) {
1494 
1495  // general properties
1496  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
1497 
1498  if (doThetaPlots_) {
1499  histname = "Chi2oNDFVsTheta_" + histTag;
1500  tkmes.Chi2oNDFVsTheta = ibooker.bookProfile(histname, histname, ThetaBin, ThetaMin, ThetaMax, Chi2NDFMin, Chi2NDFMax,"");
1501  tkmes.Chi2oNDFVsTheta->setAxisTitle("Track #theta",1);
1502  tkmes.Chi2oNDFVsTheta->setAxisTitle("Track #chi^{2}/ndf",2);
1503  }
1504  histname = "Chi2oNDFVsPhi_" + histTag;
1505  tkmes.Chi2oNDFVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, Chi2NDFMin, Chi2NDFMax,"");
1506  tkmes.Chi2oNDFVsPhi->setAxisTitle("Track #phi",1);
1507  tkmes.Chi2oNDFVsPhi->setAxisTitle("Track #chi^{2}/ndf",2);
1508 
1509  histname = "Chi2ProbVsPhi_" + histTag;
1510  tkmes.Chi2ProbVsPhi = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, PhiBin, PhiMin, PhiMax, Chi2ProbMin, Chi2ProbMax);
1511  tkmes.Chi2ProbVsPhi->setAxisTitle("Tracks #phi" ,1);
1512  tkmes.Chi2ProbVsPhi->setAxisTitle("Track #chi^{2} probability",2);
1513 
1514  histname = "Chi2ProbVsEta_" + histTag;
1515  tkmes.Chi2ProbVsEta = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, EtaBin, EtaMin, EtaMax, Chi2ProbMin, Chi2ProbMax);
1516  tkmes.Chi2ProbVsEta->setAxisTitle("Tracks #eta" ,1);
1517  tkmes.Chi2ProbVsEta->setAxisTitle("Track #chi^{2} probability",2);
1518 
1519  }
1520 
1521  // general properties
1522  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
1523 
1524 
1525  histname = "Chi2oNDFVsEta_" + histTag;
1526  tkmes.Chi2oNDFVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, Chi2NDFMin, Chi2NDFMax,"");
1527  tkmes.Chi2oNDFVsEta->setAxisTitle("Track #eta",1);
1528  tkmes.Chi2oNDFVsEta->setAxisTitle("Track #chi^{2}/ndf",2);
1529 
1530  histname = "Chi2oNDFVsPt_" + histTag;
1531  tkmes.Chi2oNDFVsPt = ibooker.bookProfile(histname, histname, TrackPtBin, TrackPtMin, TrackPtMax, Chi2NDFMin, Chi2NDFMax,"");
1532  tkmes.Chi2oNDFVsPt->setAxisTitle("Track p_{T} (GeV/c)", 1);
1533  tkmes.Chi2oNDFVsPt->setAxisTitle("Track #chi^{2}/ndf",2);
1534 
1535  histname = "Chi2oNDFVsNHits_" + histTag;
1536  tkmes.Chi2oNDFVsNHits = ibooker.bookProfile(histname, histname, 50, 0, 50, Chi2NDFMin, Chi2NDFMax,"");
1537  tkmes.Chi2oNDFVsNHits->setAxisTitle("Track NHits", 1);
1538  tkmes.Chi2oNDFVsNHits->setAxisTitle("Track #chi^{2}/ndf",2);
1539 
1540  histname = "TrackP_" + histTag;
1541  tkmes.TrackP = ibooker.book1D(histname, histname, TrackPBin, TrackPMin, TrackPMax);
1542  tkmes.TrackP->setAxisTitle("Track |p| (GeV/c)", 1);
1543  tkmes.TrackP->setAxisTitle("Number of Tracks",2);
1544 
1545  histname = "TrackPt_" + histTag;
1546  tkmes.TrackPt = ibooker.book1D(histname, histname, TrackPtBin, TrackPtMin, TrackPtMax);
1547  tkmes.TrackPt->setAxisTitle("Track p_{T} (GeV/c)", 1);
1548  tkmes.TrackPt->setAxisTitle("Number of Tracks",2);
1549 
1550  if (doTrackPxPyPlots_) {
1551  histname = "TrackPx_" + histTag;
1552  tkmes.TrackPx = ibooker.book1D(histname, histname, TrackPxBin, TrackPxMin, TrackPxMax);
1553  tkmes.TrackPx->setAxisTitle("Track p_{x} (GeV/c)", 1);
1554  tkmes.TrackPx->setAxisTitle("Number of Tracks",2);
1555 
1556  histname = "TrackPy_" + histTag;
1557  tkmes.TrackPy = ibooker.book1D(histname, histname, TrackPyBin, TrackPyMin, TrackPyMax);
1558  tkmes.TrackPy->setAxisTitle("Track p_{y} (GeV/c)", 1);
1559  tkmes.TrackPy->setAxisTitle("Number of Tracks",2);
1560  }
1561  histname = "TrackPz_" + histTag;
1562  tkmes.TrackPz = ibooker.book1D(histname, histname, TrackPzBin, TrackPzMin, TrackPzMax);
1563  tkmes.TrackPz->setAxisTitle("Track p_{z} (GeV/c)", 1);
1564  tkmes.TrackPz->setAxisTitle("Number of Tracks",2);
1565 
1566  histname = "TrackPhi_" + histTag;
1567  tkmes.TrackPhi = ibooker.book1D(histname, histname, PhiBin, PhiMin, PhiMax);
1568  tkmes.TrackPhi->setAxisTitle("Track #phi", 1);
1569  tkmes.TrackPhi->setAxisTitle("Number of Tracks",2);
1570 
1571  histname = "TrackEta_" + histTag;
1572  tkmes.TrackEta = ibooker.book1D(histname, histname, EtaBin, EtaMin, EtaMax);
1573  tkmes.TrackEta->setAxisTitle("Track #eta", 1);
1574  tkmes.TrackEta->setAxisTitle("Number of Tracks",2);
1575 
1576  histname = "TrackEtaPhi_" + histTag;
1577  tkmes.TrackEtaPhi = ibooker.book2D(histname, histname, Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax);
1578  tkmes.TrackEtaPhi->setAxisTitle("Track #eta", 1);
1579  tkmes.TrackEtaPhi->setAxisTitle("Track #phi", 2);
1580 
1581  histname = "TrackEtaPhiInner_" + histTag;
1582  tkmes.TrackEtaPhiInner = ibooker.book2D(histname, histname, Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax);
1583  tkmes.TrackEtaPhiInner->setAxisTitle("Track #eta", 1);
1584  tkmes.TrackEtaPhiInner->setAxisTitle("Track #phi", 2);
1585 
1586  histname = "TrackEtaPhiOuter_" + histTag;
1587  tkmes.TrackEtaPhiOuter = ibooker.book2D(histname, histname, Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax);
1588  tkmes.TrackEtaPhiOuter->setAxisTitle("Track #eta", 1);
1589  tkmes.TrackEtaPhiOuter->setAxisTitle("Track #phi", 2);
1590 
1591 
1592 
1593  if (doThetaPlots_) {
1594  histname = "TrackTheta_" + histTag;
1595  tkmes.TrackTheta = ibooker.book1D(histname, histname, ThetaBin, ThetaMin, ThetaMax);
1596  tkmes.TrackTheta->setAxisTitle("Track #theta", 1);
1597  tkmes.TrackTheta->setAxisTitle("Number of Tracks",2);
1598  }
1599  histname = "TrackQ_" + histTag;
1600  tkmes.TrackQ = ibooker.book1D(histname, histname, TrackQBin, TrackQMin, TrackQMax);
1601  tkmes.TrackQ->setAxisTitle("Track Charge", 1);
1602  tkmes.TrackQ->setAxisTitle("Number of Tracks",2);
1603 
1604  histname = "TrackPErrOverP_" + histTag;
1605  tkmes.TrackPErr = ibooker.book1D(histname, histname, pErrBin, pErrMin, pErrMax);
1606  tkmes.TrackPErr->setAxisTitle("track error(p)/p", 1);
1607  tkmes.TrackPErr->setAxisTitle("Number of Tracks",2);
1608 
1609  histname = "TrackPtErrOverPt_" + histTag;
1610  tkmes.TrackPtErr = ibooker.book1D(histname, histname, ptErrBin, ptErrMin, ptErrMax);
1611  tkmes.TrackPtErr->setAxisTitle("track error(p_{T})/p_{T}", 1);
1612  tkmes.TrackPtErr->setAxisTitle("Number of Tracks",2);
1613 
1614  histname = "TrackPtErrOverPtVsEta_" + histTag;
1615  tkmes.TrackPtErrVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, ptErrMin, ptErrMax);
1616  tkmes.TrackPtErrVsEta->setAxisTitle("Track #eta",1);
1617  tkmes.TrackPtErrVsEta->setAxisTitle("track error(p_{T})/p_{T}", 2);
1618 
1619  if (doTrackPxPyPlots_) {
1620  histname = "TrackPxErrOverPx_" + histTag;
1621  tkmes.TrackPxErr = ibooker.book1D(histname, histname, pxErrBin, pxErrMin, pxErrMax);
1622  tkmes.TrackPxErr->setAxisTitle("track error(p_{x})/p_{x}", 1);
1623  tkmes.TrackPxErr->setAxisTitle("Number of Tracks",2);
1624 
1625  histname = "TrackPyErrOverPy_" + histTag;
1626  tkmes.TrackPyErr = ibooker.book1D(histname, histname, pyErrBin, pyErrMin, pyErrMax);
1627  tkmes.TrackPyErr->setAxisTitle("track error(p_{y})/p_{y}", 1);
1628  tkmes.TrackPyErr->setAxisTitle("Number of Tracks",2);
1629  }
1630  histname = "TrackPzErrOverPz_" + histTag;
1631  tkmes.TrackPzErr = ibooker.book1D(histname, histname, pzErrBin, pzErrMin, pzErrMax);
1632  tkmes.TrackPzErr->setAxisTitle("track error(p_{z})/p_{z}", 1);
1633  tkmes.TrackPzErr->setAxisTitle("Number of Tracks",2);
1634 
1635  histname = "TrackPhiErr_" + histTag;
1636  tkmes.TrackPhiErr = ibooker.book1D(histname, histname, phiErrBin, phiErrMin, phiErrMax);
1637  tkmes.TrackPhiErr->setAxisTitle("track error(#phi)");
1638  tkmes.TrackPhiErr->setAxisTitle("Number of Tracks",2);
1639 
1640  histname = "TrackEtaErr_" + histTag;
1641  tkmes.TrackEtaErr = ibooker.book1D(histname, histname, etaErrBin, etaErrMin, etaErrMax);
1642  tkmes.TrackEtaErr->setAxisTitle("track error(#eta)");
1643  tkmes.TrackEtaErr->setAxisTitle("Number of Tracks",2);
1644 
1645  // rec hit profiles
1646  ibooker.setCurrentFolder(TopFolder_+"/GeneralProperties");
1647  histname = "NumberOfRecHitsPerTrackVsPhi_" + histTag;
1648  tkmes.NumberOfRecHitsPerTrackVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, RecHitBin, RecHitMin, RecHitMax,"");
1649  tkmes.NumberOfRecHitsPerTrackVsPhi->setAxisTitle("Track #phi",1);
1650  tkmes.NumberOfRecHitsPerTrackVsPhi->setAxisTitle("Number of RecHits in each Track",2);
1651 
1652  if (doThetaPlots_) {
1653  histname = "NumberOfRecHitsPerTrackVsTheta_" + histTag;
1654  tkmes.NumberOfRecHitsPerTrackVsTheta = ibooker.bookProfile(histname, histname, ThetaBin, ThetaMin, ThetaMax, RecHitBin, RecHitMin, RecHitMax,"");
1655  tkmes.NumberOfRecHitsPerTrackVsTheta->setAxisTitle("Track #phi",1);
1656  tkmes.NumberOfRecHitsPerTrackVsTheta->setAxisTitle("Number of RecHits in each Track",2);
1657  }
1658  histname = "NumberOfRecHitsPerTrackVsEta_" + histTag;
1659  tkmes.NumberOfRecHitsPerTrackVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, RecHitBin, RecHitMin, RecHitMax,"");
1660  tkmes.NumberOfRecHitsPerTrackVsEta->setAxisTitle("Track #eta",1);
1661  tkmes.NumberOfRecHitsPerTrackVsEta->setAxisTitle("Number of RecHits in each Track",2);
1662 
1663  histname = "NumberOfValidRecHitsPerTrackVsPhi_" + histTag;
1664  tkmes.NumberOfValidRecHitsPerTrackVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, RecHitMin, RecHitMax,"");
1665  tkmes.NumberOfValidRecHitsPerTrackVsPhi->setAxisTitle("Track #phi",1);
1666  tkmes.NumberOfValidRecHitsPerTrackVsPhi->setAxisTitle("Number of valid RecHits in each Track",2);
1667 
1668  histname = "NumberOfValidRecHitsPerTrackVsEta_" + histTag;
1669  tkmes.NumberOfValidRecHitsPerTrackVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, RecHitMin, RecHitMax,"");
1670  tkmes.NumberOfValidRecHitsPerTrackVsEta->setAxisTitle("Track #eta",1);
1671  tkmes.NumberOfValidRecHitsPerTrackVsEta->setAxisTitle("Number of valid RecHits in each Track",2);
1672 
1673  histname = "NumberOfValidRecHitsPerTrackVsPt_" + histTag;
1674  tkmes.NumberOfValidRecHitsPerTrackVsPt = ibooker.bookProfile(histname, histname, TrackPtBin, TrackPtMin, TrackPtMax, RecHitMin, RecHitMax,"");
1675  tkmes.NumberOfValidRecHitsPerTrackVsPt->setAxisTitle("Track p_{T} [GeV]",1);
1676  tkmes.NumberOfValidRecHitsPerTrackVsPt->setAxisTitle("Number of valid RecHits in each Track",2);
1677 
1679  histname = "NumberOfLayersPerTrackVsPhi_" + histTag;
1680  tkmes.NumberOfLayersPerTrackVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, RecLayBin, RecLayMin, RecLayMax,"");
1681  tkmes.NumberOfLayersPerTrackVsPhi->setAxisTitle("Track #phi",1);
1682  tkmes.NumberOfLayersPerTrackVsPhi->setAxisTitle("Number of Layers in each Track",2);
1683 
1684  if (doThetaPlots_) {
1685  histname = "NumberOfLayersPerTrackVsTheta_" + histTag;
1686  tkmes.NumberOfLayersPerTrackVsTheta = ibooker.bookProfile(histname, histname, ThetaBin, ThetaMin, ThetaMax, RecLayBin, RecLayMin, RecLayMax,"");
1687  tkmes.NumberOfLayersPerTrackVsTheta->setAxisTitle("Track #phi",1);
1688  tkmes.NumberOfLayersPerTrackVsTheta->setAxisTitle("Number of Layers in each Track",2);
1689  }
1690  histname = "NumberOfLayersPerTrackVsEta_" + histTag;
1691  tkmes.NumberOfLayersPerTrackVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, RecLayBin, RecLayMin, RecLayMax,"");
1692  tkmes.NumberOfLayersPerTrackVsEta->setAxisTitle("Track #eta",1);
1693  tkmes.NumberOfLayersPerTrackVsEta->setAxisTitle("Number of Layers in each Track",2);
1694 
1695  if (doThetaPlots_) {
1696  histname = "Chi2oNDFVsTheta_" + histTag;
1697  tkmes.Chi2oNDFVsTheta = ibooker.bookProfile(histname, histname, ThetaBin, ThetaMin, ThetaMax, Chi2NDFMin, Chi2NDFMax,"");
1698  tkmes.Chi2oNDFVsTheta->setAxisTitle("Track #theta",1);
1699  tkmes.Chi2oNDFVsTheta->setAxisTitle("Track #chi^{2}/ndf",2);
1700  }
1701  if (doAllPlots_) {
1702  histname = "Chi2oNDFVsPhi_" + histTag;
1703  tkmes.Chi2oNDFVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, Chi2NDFMin, Chi2NDFMax,"");
1704  tkmes.Chi2oNDFVsPhi->setAxisTitle("Track #phi",1);
1705  tkmes.Chi2oNDFVsPhi->setAxisTitle("Track #chi^{2}/ndf",2);
1706 
1707  histname = "Chi2oNDFVsEta_" + histTag;
1708  tkmes.Chi2oNDFVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, Chi2NDFMin, Chi2NDFMax,"");
1709  tkmes.Chi2oNDFVsEta->setAxisTitle("Track #eta",1);
1710  tkmes.Chi2oNDFVsEta->setAxisTitle("Track #chi^{2}/ndf",2);
1711 
1712  histname = "Chi2ProbVsPhi_" + histTag;
1713  tkmes.Chi2ProbVsPhi = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, PhiBin, PhiMin, PhiMax, Chi2ProbMin, Chi2ProbMax);
1714  tkmes.Chi2ProbVsPhi->setAxisTitle("Tracks #phi" ,1);
1715  tkmes.Chi2ProbVsPhi->setAxisTitle("Track #chi^{2} probability",2);
1716 
1717  histname = "Chi2ProbVsEta_" + histTag;
1718  tkmes.Chi2ProbVsEta = ibooker.bookProfile(histname+CategoryName, histname+CategoryName, EtaBin, EtaMin, EtaMax, Chi2ProbMin, Chi2ProbMax);
1719  tkmes.Chi2ProbVsEta->setAxisTitle("Tracks #eta" ,1);
1720  tkmes.Chi2ProbVsEta->setAxisTitle("Track #chi^{2} probability",2);
1721  }
1722 
1723  // now put the MEs in the map
1724  TkParameterMEMap.insert( std::make_pair(sname, tkmes) );
1725 
1726 }
1727 
1728 
1729 // fill histograms at differnt measurement points
1730 // ---------------------------------------------------------------------------------//
1732 {
1733  //get the kinematic parameters
1734  double p, px, py, pz, pt, theta, phi, eta, q;
1735  double pxerror, pyerror, pzerror, pterror, perror, phierror, etaerror;
1736 
1737  auto phiIn = track.innerPosition().phi();
1738  auto etaIn = track.innerPosition().eta();
1739  auto phiOut = track.outerPosition().phi();
1740  auto etaOut = track.outerPosition().eta();
1741 
1742 
1743  if (sname == "default") {
1744 
1745  p = track.p();
1746  px = track.px();
1747  py = track.py();
1748  pz = track.pz();
1749  pt = track.pt();
1750  phi = track.phi();
1751  theta = track.theta();
1752  eta = track.eta();
1753  q = track.charge();
1754 
1755  pterror = (pt) ? track.ptError()/(pt*pt) : 0.0;
1756  pxerror = -1.0;
1757  pyerror = -1.0;
1758  pzerror = -1.0;
1759  perror = -1.0;
1760  phierror = track.phiError();
1761  etaerror = track.etaError();
1762 
1763  } else {
1764 
1766  iSetup.get<TransientTrackRecord>().get("TransientTrackBuilder",theB);
1767  reco::TransientTrack TransTrack = theB->build(track);
1768 
1770 
1771  if (sname == "OuterSurface") TSOS = TransTrack.outermostMeasurementState();
1772  else if (sname == "InnerSurface") TSOS = TransTrack.innermostMeasurementState();
1773  else if (sname == "ImpactPoint") TSOS = TransTrack.impactPointState();
1774 
1775  p = TSOS.globalMomentum().mag();
1776  px = TSOS.globalMomentum().x();
1777  py = TSOS.globalMomentum().y();
1778  pz = TSOS.globalMomentum().z();
1779  pt = TSOS.globalMomentum().perp();
1780  phi = TSOS.globalMomentum().phi();
1781  theta = TSOS.globalMomentum().theta();
1782  eta = TSOS.globalMomentum().eta();
1783  q = TSOS.charge();
1784 
1785  //get the error of the kinimatic parameters
1787  double partialPterror = errors(3,3)*pow(TSOS.globalMomentum().x(),2) + errors(4,4)*pow(TSOS.globalMomentum().y(),2);
1788  pterror = sqrt(partialPterror)/TSOS.globalMomentum().perp();
1789  pxerror = sqrt(errors(3,3))/TSOS.globalMomentum().x();
1790  pyerror = sqrt(errors(4,4))/TSOS.globalMomentum().y();
1791  pzerror = sqrt(errors(5,5))/TSOS.globalMomentum().z();
1792  perror = sqrt(partialPterror+errors(5,5)*pow(TSOS.globalMomentum().z(),2))/TSOS.globalMomentum().mag();
1793  phierror = sqrt(TSOS.curvilinearError().matrix()(2,2));
1794  etaerror = sqrt(TSOS.curvilinearError().matrix()(1,1))*fabs(sin(TSOS.globalMomentum().theta()));
1795 
1796  }
1797 
1798  std::map<std::string, TkParameterMEs>::iterator iPos = TkParameterMEMap.find(sname);
1799  if (iPos != TkParameterMEMap.end()) {
1800 
1801  TkParameterMEs tkmes = iPos->second;
1802 
1803  // momentum
1804  tkmes.TrackP->Fill(p);
1805  if (doTrackPxPyPlots_) {
1806  tkmes.TrackPx->Fill(px);
1807  tkmes.TrackPy->Fill(py);
1808  }
1809  tkmes.TrackPz->Fill(pz);
1810  tkmes.TrackPt->Fill(pt);
1811 
1812  // angles
1813  tkmes.TrackPhi->Fill(phi);
1814  tkmes.TrackEta->Fill(eta);
1815  tkmes.TrackEtaPhi->Fill(eta,phi);
1816  tkmes.TrackEtaPhiInner->Fill(etaIn,phiIn);
1817  tkmes.TrackEtaPhiOuter->Fill(etaOut,phiOut);
1818 
1819  if (doThetaPlots_) {
1820  tkmes.TrackTheta->Fill(theta);
1821  }
1822  tkmes.TrackQ->Fill(q);
1823 
1824  // errors
1825  tkmes.TrackPtErr->Fill(pterror);
1826  tkmes.TrackPtErrVsEta->Fill(eta,pterror);
1827  if (doTrackPxPyPlots_) {
1828  tkmes.TrackPxErr->Fill(pxerror);
1829  tkmes.TrackPyErr->Fill(pyerror);
1830  }
1831  tkmes.TrackPzErr->Fill(pzerror);
1832  tkmes.TrackPErr->Fill(perror);
1833  tkmes.TrackPhiErr->Fill(phierror);
1834  tkmes.TrackEtaErr->Fill(etaerror);
1835 
1837  int nValidRecHits = track.numberOfValidHits();
1838  // rec hits
1839  tkmes.NumberOfRecHitsPerTrackVsPhi->Fill(phi, nRecHits);
1840  if (doThetaPlots_) {
1841  tkmes.NumberOfRecHitsPerTrackVsTheta->Fill(theta,nRecHits);
1842  }
1843  tkmes.NumberOfRecHitsPerTrackVsEta->Fill(eta, nRecHits);
1844 
1845  tkmes.NumberOfValidRecHitsPerTrackVsPhi->Fill(phi, nValidRecHits);
1846  tkmes.NumberOfValidRecHitsPerTrackVsEta->Fill(eta, nValidRecHits);
1847  tkmes.NumberOfValidRecHitsPerTrackVsPt ->Fill(pt, nValidRecHits);
1848 
1850  // rec layers
1851  tkmes.NumberOfLayersPerTrackVsPhi->Fill(phi, nLayers);
1852  if (doThetaPlots_) {
1853  tkmes.NumberOfLayersPerTrackVsTheta->Fill(theta, nLayers);
1854  }
1855  tkmes.NumberOfLayersPerTrackVsEta->Fill(eta, nLayers);
1856 
1857  double chi2prob = TMath::Prob(track.chi2(),(int)track.ndof());
1858  double chi2oNDF = track.normalizedChi2();
1859 
1860  tkmes.Chi2oNDFVsEta->Fill(eta, chi2oNDF);
1861  tkmes.Chi2oNDFVsPt->Fill(pt, chi2oNDF);
1862  tkmes.Chi2oNDFVsNHits->Fill(nRecHits, chi2oNDF);
1863 
1864  if(doAllPlots_) {
1865 
1866  // general properties
1867  if (doThetaPlots_) {
1868  tkmes.Chi2oNDFVsTheta->Fill(theta, chi2oNDF);
1869  }
1870  tkmes.Chi2oNDFVsPhi->Fill(phi, chi2oNDF);
1871  tkmes.Chi2ProbVsPhi->Fill(phi, chi2prob);
1872  tkmes.Chi2ProbVsEta->Fill(eta, chi2prob);
1873  }
1874 
1875  }
1876 
1877 }
1878 
1879 
1881 {
1882 
1883  // parameters from the configuration
1884  std::string QualName = conf_->getParameter<std::string>("Quality");
1885  std::string AlgoName = conf_->getParameter<std::string>("AlgoName");
1886 
1887  // use the AlgoName and Quality Name
1888  std::string CategoryName = !QualName.empty() ? AlgoName + "_" + QualName : AlgoName;
1889 
1890  int PhiBin = conf_->getParameter<int>( "PhiBin");
1891  double PhiMin = conf_->getParameter<double>("PhiMin");
1892  double PhiMax = conf_->getParameter<double>("PhiMax");
1893 
1894  int EtaBin = conf_->getParameter<int>( "EtaBin");
1895  double EtaMin = conf_->getParameter<double>("EtaMin");
1896  double EtaMax = conf_->getParameter<double>("EtaMax");
1897 
1898  int PtBin = conf_->getParameter<int>( "TrackPtBin");
1899  double PtMin = conf_->getParameter<double>("TrackPtMin");
1900  double PtMax = conf_->getParameter<double>("TrackPtMax");
1901 
1902  // book hit property histograms
1903  // ---------------------------------------------------------------------------------//
1904  ibooker.setCurrentFolder(TopFolder_+"/HitProperties");
1905 
1906 
1907 
1908  std::vector<std::string> subdetectors = conf_->getParameter<std::vector<std::string> >("subdetectors");
1909  int detBin = conf_->getParameter<int>("subdetectorBin");
1910 
1911  for ( auto det : subdetectors ) {
1912 
1913  // hits properties
1914  ibooker.setCurrentFolder(TopFolder_+"/HitProperties/"+det);
1915 
1916  TkRecHitsPerSubDetMEs recHitsPerSubDet_mes;
1917 
1918  recHitsPerSubDet_mes.detectorTag = det;
1919  int detID = -1;
1920  if ( det == "TIB" ) detID = StripSubdetector::TIB; // 3
1921  if ( det == "TOB" ) detID = StripSubdetector::TOB; // 5
1922  if ( det == "TID" ) detID = StripSubdetector::TID; // 4
1923  if ( det == "TEC" ) detID = StripSubdetector::TEC; // 6
1924  if ( det == "PixBarrel" ) detID = PixelSubdetector::PixelBarrel; // 1
1925  if ( det == "PixEndcap" ) detID = PixelSubdetector::PixelEndcap; // 2
1926  if ( det == "Pixel" ) detID = 0;
1927  if ( det == "Strip" ) detID = 7;
1928 
1929  recHitsPerSubDet_mes.detectorId = detID;
1930 
1931  histname = "NumberOfRecHitsPerTrack_" + det + "_" + CategoryName;
1932  recHitsPerSubDet_mes.NumberOfRecHitsPerTrack = ibooker.book1D(histname, histname, detBin, -0.5, double(detBin)-0.5);
1933  recHitsPerSubDet_mes.NumberOfRecHitsPerTrack->setAxisTitle("Number of " + det + " valid RecHits in each Track",1);
1934  recHitsPerSubDet_mes.NumberOfRecHitsPerTrack->setAxisTitle("Number of Tracks", 2);
1935 
1936  histname = "NumberOfRecHitsPerTrackVsPhi_" + det + "_" + CategoryName;
1937  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, detBin, -0.5, double(detBin)-0.5,"");
1938  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPhi->setAxisTitle("Track #phi",1);
1939  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPhi->setAxisTitle("Number of " + det + " valid RecHits in each Track",2);
1940 
1941  histname = "NumberOfRecHitsPerTrackVsEta_" + det + "_" + CategoryName;
1942  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, detBin, -0.5, double(detBin)-0.5,"");
1943  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsEta->setAxisTitle("Track #eta",1);
1944  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsEta->setAxisTitle("Number of " + det + " valid RecHits in each Track",2);
1945 
1946  histname = "NumberOfRecHitsPerTrackVsPt_" + det + "_" + CategoryName;
1947  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPt = ibooker.bookProfile(histname, histname, PtBin, PtMin, PtMax, detBin, -0.5, double(detBin)-0.5,"");
1948  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPt->setAxisTitle("Track p_{T} [GeV]",1);
1949  recHitsPerSubDet_mes.NumberOfRecHitsPerTrackVsPt->setAxisTitle("Number of " + det + " valid RecHits in each Track",2);
1950 
1951  histname = "NumberOfLayersPerTrack_" + det + "_" + CategoryName;
1952  recHitsPerSubDet_mes.NumberOfLayersPerTrack = ibooker.book1D(histname, histname, detBin, -0.5, double(detBin)-0.5);
1953  recHitsPerSubDet_mes.NumberOfLayersPerTrack->setAxisTitle("Number of " + det + " valid Layers in each Track",1);
1954  recHitsPerSubDet_mes.NumberOfLayersPerTrack->setAxisTitle("Number of Tracks", 2);
1955 
1956  histname = "NumberOfLayersPerTrackVsPhi_" + det + "_" + CategoryName;
1957  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPhi = ibooker.bookProfile(histname, histname, PhiBin, PhiMin, PhiMax, detBin, -0.5, double(detBin)-0.5,"");
1958  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPhi->setAxisTitle("Track #phi",1);
1959  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPhi->setAxisTitle("Number of " + det + " valid Layers in each Track",2);
1960 
1961  histname = "NumberOfLayersPerTrackVsEta_" + det + "_" + CategoryName;
1962  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsEta = ibooker.bookProfile(histname, histname, EtaBin, EtaMin, EtaMax, detBin, -0.5, double(detBin)-0.5,"");
1963  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsEta->setAxisTitle("Track #eta",1);
1964  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsEta->setAxisTitle("Number of " + det + " valid Layers in each Track",2);
1965 
1966  histname = "NumberOfLayersPerTrackVsPt_" + det + "_" + CategoryName;
1967  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPt = ibooker.bookProfile(histname, histname, PtBin, PtMin, PtMax, detBin, -0.5, double(detBin)-0.5,"");
1968  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPt->setAxisTitle("Track p_{T} [GeV]",1);
1969  recHitsPerSubDet_mes.NumberOfLayersPerTrackVsPt->setAxisTitle("Number of " + det + " valid Layers in each Track",2);
1970 
1971  TkRecHitsPerSubDetMEMap.insert(std::pair<std::string,TkRecHitsPerSubDetMEs>(det,recHitsPerSubDet_mes));
1972 
1973 
1974  }
1975 
1976 
1977 }
1978 
1979 
1981 {
1982 
1983  double phi = track.phi();
1984  double eta = track.eta();
1985  double pt = track.pt();
1986 
1987  for ( std::map<std::string,TkRecHitsPerSubDetMEs>::iterator it = TkRecHitsPerSubDetMEMap.begin();
1988  it != TkRecHitsPerSubDetMEMap.end(); it++ ) {
1989 
1990  int nValidLayers = 0;
1991  int nValidRecHits = 0;
1992  int substr = it->second.detectorId;
1993  switch(substr) {
1994  case 0 :
1995  nValidLayers = track.hitPattern().pixelBarrelLayersWithMeasurement()
1996  + track.hitPattern().pixelEndcapLayersWithMeasurement(); // case 0: pixel
1997  nValidRecHits = track.hitPattern().numberOfValidPixelBarrelHits()
1998  + track.hitPattern().numberOfValidPixelEndcapHits(); // case 0: pixel
1999  break;
2000  case StripSubdetector::TIB :
2001  nValidLayers = track.hitPattern().stripTIBLayersWithMeasurement(); // case 3: strip TIB
2002  nValidRecHits = track.hitPattern().numberOfValidStripTIBHits(); // case 3: strip TIB
2003  break;
2004  case StripSubdetector::TID :
2005  nValidLayers = track.hitPattern().stripTIDLayersWithMeasurement(); // case 4: strip TID
2006  nValidRecHits = track.hitPattern().numberOfValidStripTIDHits(); // case 4: strip TID
2007  break;
2008  case StripSubdetector::TOB :
2009  nValidLayers = track.hitPattern().stripTOBLayersWithMeasurement(); // case 5: strip TOB
2010  nValidRecHits = track.hitPattern().numberOfValidStripTOBHits(); // case 5: strip TOB
2011  break;
2012  case StripSubdetector::TEC :
2013  nValidLayers = track.hitPattern().stripTECLayersWithMeasurement(); // case 6: strip TEC
2014  nValidRecHits = track.hitPattern().numberOfValidStripTECHits(); // case 6: strip TEC
2015  break;
2017  nValidLayers = track.hitPattern().pixelBarrelLayersWithMeasurement(); // case 1: pixel PXB
2018  nValidRecHits = track.hitPattern().numberOfValidPixelBarrelHits(); // case 1: pixel PXB
2019  break;
2021  nValidLayers = track.hitPattern().pixelEndcapLayersWithMeasurement(); // case 2: pixel PXF
2022  nValidRecHits = track.hitPattern().numberOfValidPixelEndcapHits(); // case 2: pixel PXF
2023  break;
2024  case 7 :
2025  nValidLayers = track.hitPattern().stripTIBLayersWithMeasurement() // case 7: strip
2029  nValidRecHits = track.hitPattern().numberOfValidStripTIBHits() // case 7: strip
2033  break;
2034  default :
2035  break;
2036  }
2037 
2038  //Fill Layers and RecHits
2039  it->second.NumberOfRecHitsPerTrack -> Fill(nValidRecHits);
2040  it->second.NumberOfRecHitsPerTrackVsPhi -> Fill(phi, nValidRecHits);
2041  it->second.NumberOfRecHitsPerTrackVsEta -> Fill(eta, nValidRecHits);
2042  it->second.NumberOfRecHitsPerTrackVsPt -> Fill(pt, nValidRecHits);
2043 
2044  it->second.NumberOfLayersPerTrack -> Fill(nValidLayers);
2045  it->second.NumberOfLayersPerTrackVsPhi -> Fill(phi, nValidLayers);
2046  it->second.NumberOfLayersPerTrackVsEta -> Fill(eta, nValidLayers);
2047  it->second.NumberOfLayersPerTrackVsPt -> Fill(pt, nValidLayers);
2048  }
2049 
2050 }
2051 //
2052 // -- Set Lumi Flag
2053 //
2055 
2056  TkParameterMEs tkmes;
2059 }
2060 //
2061 // -- Apply SoftReset
2062 //
2064  TkParameterMEs tkmes;
2065  dqmStore_->softReset(Chi2oNDF);
2066  dqmStore_->softReset(NumberOfRecHitsPerTrack);
2067 }
2068 //
2069 // -- Apply Reset
2070 //
2072  TkParameterMEs tkmes;
2075 }
2076 //
2077 // -- Remove SoftReset
2078 //
2080  TkParameterMEs tkmes;
2081  dqmStore_->disableSoftReset(Chi2oNDF);
2082  dqmStore_->disableSoftReset(NumberOfRecHitsPerTrack);
2083 }
2084 
2085 
#define LogDebug(id)
MonitorElement * sipDzToPV
std::map< std::string, TkParameterMEs > TkParameterMEMap
MonitorElement * NumberOfValidRecHitsPerTrack
MonitorElement * Ptdist_HighPurity
double p() const
momentum vector magnitude
Definition: TrackBase.h:615
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
int stripTOBLayersWithMeasurement() const
Definition: HitPattern.cc:606
unsigned int bx_
T getParameter(std::string const &) const
MonitorElement * NumberOfValidRecHitsPerTrackVsPt
MonitorElement * DistanceOfClosestApproachErrorVsEta
MonitorElement * sip2dToPV
const Point & referencePoint() const
Reference point on the track.
Definition: TrackBase.h:681
MonitorElement * Chi2oNDFVsTheta
double d0Error() const
error on d0
Definition: TrackBase.h:802
MonitorElement * xPointOfClosestApproachVsZ0wrtPV
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
MonitorElement * NumberOfValidRecHitsPerTrackVsEta
MonitorElement * NumberOfValidRecHitsPerTrackVsPhi
void fillHistosForEfficiencyFromHitPatter(const reco::Track &track, const std::string suffix, const float monitoring, bool useInac)
T perp() const
Definition: PV3DBase.h:72
MonitorElement * dNdPt_HighPurity
MonitorElement * sipDxyToPV
double validFraction() const
fraction of valid hits on the track
Definition: TrackBase.h:832
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
Definition: TrackBase.h:597
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
MonitorElement * NumberOfValidRecHitVsPhiVsEtaPerTrack
int stripTIBLayersWithMeasurement() const
Definition: HitPattern.cc:584
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:561
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:160
MonitorElement * NumberOfValidRecHitsPerTrackVsPhi
MonitorElement * LongDCASig
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
double zError() const
error on z
Definition: Vertex.h:123
MonitorElement * yPointOfClosestApproach
double theta() const
polar angle
Definition: TrackBase.h:579
double dxyError() const
error on dxy
Definition: TrackBase.h:796
void doSoftReset(DQMStore *dqmStore_)
MonitorElement * NumberOfMIRecHitsPerTrackVsPt
const CurvilinearTrajectoryError & curvilinearError() const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
MonitorElement * NumberOfValidRecHitsPerTrackVsPt
std::pair< bool, Measurement1D > signedTransverseImpactParameter(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:50
unsigned int good_vertices_
void initHisto(DQMStore::IBooker &ibooker, const edm::EventSetup &, const edm::ParameterSet &)
uint8_t stopReason() const
Definition: TrackBase.h:400
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
MonitorElement * DistanceOfClosestApproachToBSVsPhi
TH1 * getTH1() const
const CartesianTrajectoryError cartesianError() const
MonitorElement * zPointOfClosestApproachToPV
Geom::Theta< T > theta() const
reco::TransientTrack build(const reco::Track *p) const
T y() const
Definition: PV3DBase.h:63
double etaError() const
error on eta
Definition: TrackBase.h:784
int bunchCrossing() const
Definition: EventBase.h:66
std::string stateName_
Definition: TrackAnalyzer.h:83
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * NumberOfLostRecHitsPerTrackVsPt
std::pair< bool, Measurement1D > signedImpactParameter3D(const reco::TransientTrack &track, const GlobalVector &direction, const reco::Vertex &vertex)
Definition: IPTools.cc:71
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:645
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
Definition: TrackBase.h:826
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
data_type const * const_iterator
Definition: DetSetNew.h:30
const double EtaMax[kNumberCalorimeter]
double px() const
x coordinate of momentum vector
Definition: TrackBase.h:627
static const std::string StopReasonName[]
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:501
MonitorElement * yPointOfClosestApproachVsZ0wrtPV
#define nullptr
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:65
MonitorElement * NumberOfRecHitsPerTrackVsTheta
edm::EDGetTokenT< LumiScalersCollection > lumiscalersToken_
Definition: TrackAnalyzer.h:78
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:520
MonitorElement * sipDxyToBS
const Point & position() const
position
Definition: Vertex.h:109
int pixelEndcapLayersWithMeasurement() const
Definition: HitPattern.cc:572
int numberOfValidStripTOBHits() const
Definition: HitPattern.h:869
#define constexpr
MonitorElement * DistanceOfClosestApproachError
MonitorElement * algorithm
MonitorElement * NumberOfLayersPerTrackVsTheta
TrajectoryStateOnSurface innermostMeasurementState() const
static double XSEC_PIXEL_CLUSTER
Definition: GetLumi.h:41
unsigned int numberOfLayers(int subdet) const
void Fill(long long x)
int numberOfLostTrackerHits(HitCategory category) const
Definition: HitPattern.h:908
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:55
TrackAlgorithm algo() const
Definition: TrackBase.h:497
void bookHistosForHitProperties(DQMStore::IBooker &ibooker)
MonitorElement * NumberOfMORecHitVsPtVsEtaPerTrack
MonitorElement * yPointOfClosestApproachToPV
void bookHistosForTrackerSpecific(DQMStore::IBooker &ibooker)
MonitorElement * xPointOfClosestApproach
MonitorElement * Chi2oNDF_lumiFlag
MonitorElement * DistanceOfClosestApproach
MonitorElement * Chi2oNDF
MonitorElement * NumberOfRecHitsPerTrackVsPhi
static const unsigned int lastBunchCrossing
Definition: GetLumi.h:48
MonitorElement * ValidFractionPerTrack
bool doRecHitVsPtVsEtaPerTrack_
Definition: TrackAnalyzer.h:94
MonitorElement * NumberOfLostRecHitVsPhiVsEtaPerTrack
int iEvent
Definition: GenABIO.cc:230
def cat(path)
Definition: eostools.py:400
T mag() const
Definition: PV3DBase.h:67
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:651
int numberOfValidStripLayersWithMonoAndStereo(uint16_t stripdet, uint16_t layer) const
Definition: HitPattern.cc:343
int numberOfValidPixelBarrelHits() const
Definition: HitPattern.h:844
void setBX(const edm::Event &)
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:549
TrackAnalyzer(const edm::ParameterSet &)
MonitorElement * NumberOfLayersVsPhiVsEtaPerTrack[5]
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:166
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * DistanceOfClosestApproachToPVVsPhi
MonitorElement * NumberOfLayersPerTrackVsEta
double ndof() const
number of degrees of freedom of the fit
Definition: TrackBase.h:555
MonitorElement * NumberOfMORecHitsPerTrackVsPt
int stripTIDLayersWithMeasurement() const
Definition: HitPattern.cc:595
MonitorElement * NumberOfLayersPerTrackVsPhi
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
T sqrt(T t)
Definition: SSEVec.h:18
MonitorElement * NumberOfRecHitsPerTrackVsEta
MonitorElement * xPointOfClosestApproachVsZ0wrtBS
double pt() const
track transverse momentum
Definition: TrackBase.h:621
MonitorElement * Chi2ProbVsEta
T z() const
Definition: PV3DBase.h:64
MonitorElement * stoppingSourceVSeta
void bookHistosForLScertification(DQMStore::IBooker &ibooker)
MonitorElement * DistanceOfClosestApproachToBS
MonitorElement * yPointOfClosestApproachVsZ0wrtBS
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Definition: TrackBase.h:763
double phiError() const
error on phi
Definition: TrackBase.h:790
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
int numberOfAllHits(HitCategory category) const
Definition: HitPattern.h:808
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
void fillHistosForTrackerSpecific(const reco::Track &track)
def pv(vc)
Definition: MetAnalyzer.py:6
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::ParameterSet const * conf_
Definition: TrackAnalyzer.h:81
int numberOfValidStripTIDHits() const
Definition: HitPattern.h:864
MonitorElement * NumberOfMIRecHitVsPtVsEtaPerTrack
const double EtaMin[kNumberCalorimeter]
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:820
int numberOfValidStripTECHits() const
Definition: HitPattern.h:874
static double CM2_TO_NANOBARN
Definition: GetLumi.h:47
void bookHistosForEfficiencyFromHitPatter(DQMStore::IBooker &ibooker, const edm::EventSetup &iSetup, const std::string suffix, bool useInac)
MonitorElement * dNhitdPt_HighPurity
MonitorElement * sipDzToBS
T min(T a, T b)
Definition: MathUtil.h:58
MonitorElement * xPointOfClosestApproachVsZ0wrt000
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Definition: TrackAnalyzer.h:75
TrajectoryStateOnSurface outermostMeasurementState() const
std::array< T, N+1 > makeLogBins(const T min, const T max)
MonitorElement * DistanceOfClosestApproachVsPhi
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_valid_
MonitorElement * TESTDistanceOfClosestApproachToBS
void undoSoftReset(DQMStore *dqmStore_)
bool isValid() const
Definition: HandleBase.h:74
std::string monName[monQuantity::END]
int trackerLayersTotallyOffOrBad(HitCategory category=TRACK_HITS) const
Definition: HitPattern.h:1062
MonitorElement * NumberOfMIRecHitsPerTrack
MonitorElement * DeltaZToPVZoom
MonitorElement * DistanceOfClosestApproachErrorVsDxy
edm::EDGetTokenT< reco::VertexCollection > pvToken_
Definition: TrackAnalyzer.h:76
const AlgebraicSymMatrix66 & matrix() const
MonitorElement * ValidFractionVsPhiVsEtaPerTrack
double pz() const
z coordinate of momentum vector
Definition: TrackBase.h:639
MonitorElement * NhitVsEta_HighPurity
MonitorElement * stoppingSourceVSphi
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:609
void setNumberOfGoodVertices(const edm::Event &)
double dzError() const
error on dz
Definition: TrackBase.h:814
void bookHistosForBeamSpot(DQMStore::IBooker &ibooker)
MonitorElement * NumberOfLostRecHitVsPtVsEtaPerTrack
MonitorElement * dNdPhi_HighPurity
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:669
void fillHistosForState(const edm::EventSetup &iSetup, const reco::Track &track, std::string sname)
std::string histname
Definition: DetId.h:18
TrackAlgorithm originalAlgo() const
Definition: TrackBase.h:501
TrajectoryStateOnSurface TSOS
Definition: TestHits.cc:19
void bookHistosForState(std::string sname, DQMStore::IBooker &ibooker)
MonitorElement * TESTDistanceOfClosestApproachToBSVsPhi
MonitorElement * oriAlgo
bool doGeneralPropertiesPlots_
Definition: TrackAnalyzer.h:90
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:125
double xError() const
error on x
Definition: Vertex.h:119
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
#define N
Definition: blowfish.cc:9
MonitorElement * NumberOfRecHitsPerTrack
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:446
MonitorElement * NhitVsPhi_HighPurity
MonitorElement * yPointOfClosestApproachVsZ0wrt000
std::string TopFolder_
Definition: TrackAnalyzer.h:73
bool doRecHitVsPhiVsEtaPerTrack_
Definition: TrackAnalyzer.h:93
int pixelBarrelLayersWithMeasurement() const
Definition: HitPattern.cc:560
MonitorElement * NumberOfMIRecHitVsPhiVsEtaPerTrack
MonitorElement * DistanceOfClosestApproachErrorVsPt
MonitorElement * NumberOfRecHitsPerTrackVsEta
static double rXSEC_PIXEL_CLUSTER
Definition: GetLumi.h:45
int numberOfValidStripTIBHits() const
Definition: HitPattern.h:859
static const std::string algoNames[]
Definition: TrackBase.h:148
bool quality(const TrackQuality) const
Track quality.
Definition: TrackBase.h:510
unsigned int layer(const DetId &id) const
MonitorElement * Chi2oNDFVsPhi
int numberOfValidPixelEndcapHits() const
Definition: HitPattern.h:849
std::map< std::string, TkRecHitsPerSubDetMEs > TkRecHitsPerSubDetMEMap
T eta() const
Definition: PV3DBase.h:76
int trackerLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:537
MonitorElement * xPointOfClosestApproachToPV
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:663
const AlgebraicSymMatrix55 & matrix() const
GlobalVector globalMomentum() const
MonitorElement * NumberOfMORecHitVsPhiVsEtaPerTrack
MonitorElement * DistanceOfClosestApproachVsTheta
T get() const
Definition: EventSetup.h:63
MonitorElement * dNdEta_HighPurity
int stripTECLayersWithMeasurement() const
Definition: HitPattern.cc:617
MonitorElement * stoppingSource
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersToken_
Definition: TrackAnalyzer.h:77
std::vector< LumiScalers > LumiScalersCollection
Definition: LumiScalers.h:160
MonitorElement * DistanceOfClosestApproachToPVZoom
int charge() const
track electric charge
Definition: TrackBase.h:567
const Point & position() const
position
Definition: BeamSpot.h:62
TrajectoryStateOnSurface impactPointState() const
MonitorElement * DeltaZToPV
Definition: errors.py:1
MonitorElement * zPointOfClosestApproachVsPhi
MonitorElement * Chi2oNDFVsEta
void Reset(std::vector< TH2F > &depth)
int getNbinsX() const
get # of bins in X-axis
MonitorElement * NumberOfValidRecHitsPerTrackVsEta
std::string qualityString_
MonitorElement * NumberOfMORecHitsPerTrack
dbl *** dir
Definition: mlp_gen.cc:35
Definition: Chi2.h:17
size_type size() const
Definition: DetSetNew.h:87
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:591
T x() const
Definition: PV3DBase.h:62
MonitorElement * zPointOfClosestApproach
MonitorElement * Chi2ProbVsPhi
MonitorElement * AbsDistanceOfClosestApproachToBS
void setLumi(const edm::Event &, const edm::EventSetup &iSetup)
MonitorElement * DistanceOfClosestApproachErrorVsPhi
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_total_
MonitorElement * DistanceOfClosestApproachVsEta
T const * product() const
Definition: ESHandle.h:86
static double FREQ_ORBIT
Definition: GetLumi.h:32
MonitorElement * NumberOfRecHitsPerTrackVsTheta
MonitorElement * NumberOfValidRecHitVsPtVsEtaPerTrack
MonitorElement * sip3dToPV
MonitorElement * NumberOfRecHitVsPhiVsEtaPerTrack
MonitorElement * Chi2Prob
MonitorElement * NumberOfRecHitsPerTrackVsPhi
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
double yError() const
error on y
Definition: Vertex.h:121
MonitorElement * DistanceOfClosestApproachToPV
const_iterator begin(bool update=false) const
MonitorElement * TransDCASig
const int NBINS
double py() const
y coordinate of momentum vector
Definition: TrackBase.h:633
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::Track &track)
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:657
bool doLayersVsPhiVsEtaPerTrack_
Definition: TrackAnalyzer.h:96
MonitorElement * NumberOfLostRecHitsPerTrack
MonitorElement * NumberOfRecHitsPerTrack_lumiFlag
static double SECONDS_PER_LS
Definition: GetLumi.h:33
MonitorElement * NumberOfLayersPerTrack[4]