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