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