CMS 3D CMS Logo

GeneralPurposeTrackAnalyzer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Alignment/OfflineValidation
4 // Class: GeneralPurposeTrackAnalyzer
5 //
9 //
10 // Original Author: Marco Musich
11 // Created: Mon, 13 Jun 2016 15:07:11 GMT
12 //
13 //
14 
15 // ROOT includes files
16 
17 #include "TMath.h"
18 #include "TFile.h"
19 #include "TH1D.h"
20 #include "TH1I.h"
21 #include "TH2D.h"
22 #include "TProfile.h"
23 
24 // system includes files
25 
26 #include <cmath>
27 #include <fstream>
28 #include <iostream>
29 #include <map>
30 #include <string>
31 #include <vector>
32 #include <boost/range/adaptor/indexed.hpp>
33 
34 // user include files
35 
79 
80 // toggle to enable debugging
81 #define DEBUG 0
82 
85 
86 class GeneralPurposeTrackAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::SharedResources> {
87 public:
92  usesResource(TFileService::kSharedResource);
93 
94  TkTag_ = pset.getParameter<edm::InputTag>("TkTag");
95  theTrackCollectionToken = consumes<reco::TrackCollection>(TkTag_);
96 
97  TriggerResultsTag_ = pset.getParameter<edm::InputTag>("TriggerResultsTag");
98  hltresultsToken = consumes<edm::TriggerResults>(TriggerResultsTag_);
99 
100  BeamSpotTag_ = pset.getParameter<edm::InputTag>("BeamSpotTag");
101  beamspotToken = consumes<reco::BeamSpot>(BeamSpotTag_);
102 
103  VerticesTag_ = pset.getParameter<edm::InputTag>("VerticesTag");
104  vertexToken = consumes<reco::VertexCollection>(VerticesTag_);
105 
106  isCosmics_ = pset.getParameter<bool>("isCosmics");
107 
108  pmap = std::make_unique<TrackerMap>("Pixel");
109  pmap->onlyPixel(true);
110  pmap->setTitle("Pixel Hit entries");
111  pmap->setPalette(1);
112 
113  tmap = std::make_unique<TrackerMap>("Strip");
114  tmap->setTitle("Strip Hit entries");
115  tmap->setPalette(1);
116 
117  pixelmap = std::make_unique<Phase1PixelMaps>("COLZ0 L");
118  pixelmap->bookBarrelHistograms("entriesBarrel", "# hits", "# pixel hits");
119  pixelmap->bookBarrelBins("entriesBarrel");
120  pixelmap->bookForwardHistograms("entriesForward", "# hits", "# pixel hits");
121  pixelmap->bookForwardBins("entriesForward");
122  }
123 
125 
127 
128  template <class OBJECT_TYPE>
129  int GetIndex(const std::vector<OBJECT_TYPE *> &vec, const TString &name) {
130  for (const auto &iter : vec | boost::adaptors::indexed(0)) {
131  if (iter.value() && iter.value()->GetName() == name) {
132  return iter.index();
133  }
134  }
135  edm::LogError("GeneralPurposeTrackAnalyzer") << "@SUB=GeneralPurposeTrackAnalyzer::GetIndex"
136  << " could not find " << name;
137  return -1;
138  }
139 
140 private:
141  // tokens for the event setup
145 
147 
149 
150  std::unique_ptr<TrackerMap> tmap;
151  std::unique_ptr<TrackerMap> pmap;
152 
153  std::unique_ptr<Phase1PixelMaps> pixelmap;
154 
155  TH1D *hchi2ndof;
156  TH1D *hNtrk;
157  TH1D *hNtrkZoom;
158  TH1I *htrkQuality;
159  TH1I *htrkAlgo;
160  TH1I *htrkOriAlgo;
162  TH1D *hP;
163  TH1D *hPPlus;
164  TH1D *hPMinus;
165  TH1D *hPt;
166  TH1D *hMinPt;
167  TH1D *hPtPlus;
168  TH1D *hPtMinus;
169  TH1D *hHit;
170  TH1D *hHit2D;
171 
178 
181 
184 
185  TH1D *hHitPlus;
186  TH1D *hHitMinus;
187 
188  TH1D *hPhp;
189  TH1D *hPthp;
190  TH1D *hHithp;
191  TH1D *hEtahp;
192  TH1D *hPhihp;
193  TH1D *hchi2ndofhp;
194  TH1D *hchi2Probhp;
195 
196  TH1D *hCharge;
197  TH1D *hQoverP;
198  TH1D *hQoverPZoom;
199  TH1D *hEta;
200  TH1D *hEtaPlus;
201  TH1D *hEtaMinus;
202  TH1D *hPhi;
203  TH1D *hPhiBarrel;
208  TH1D *hPhiPlus;
209  TH1D *hPhiMinus;
210 
211  TH1D *hDeltaPhi;
212  TH1D *hDeltaEta;
213  TH1D *hDeltaR;
214 
215  TH1D *hvx;
216  TH1D *hvy;
217  TH1D *hvz;
218  TH1D *hd0;
219  TH1D *hdz;
220  TH1D *hdxy;
221 
222  TH2D *hd0PVvsphi;
223  TH2D *hd0PVvseta;
224  TH2D *hd0PVvspt;
225 
226  TH2D *hd0vsphi;
227  TH2D *hd0vseta;
228  TH2D *hd0vspt;
229 
230  TH1D *hnhpxb;
231  TH1D *hnhpxe;
232  TH1D *hnhTIB;
233  TH1D *hnhTID;
234  TH1D *hnhTOB;
235  TH1D *hnhTEC;
236 
238 
239  TProfile *pNBpixHitsVsVx;
240  TProfile *pNBpixHitsVsVy;
241  TProfile *pNBpixHitsVsVz;
242 
243  TH1D *hMultCand;
244 
245  TH1D *hdxyBS;
246  TH1D *hd0BS;
247  TH1D *hdzBS;
248  TH1D *hdxyPV;
249  TH1D *hd0PV;
250  TH1D *hdzPV;
251  TH1D *hrun;
252  TH1D *hlumi;
253 
254  std::vector<TH1 *> vTrackHistos_;
255  std::vector<TH1 *> vTrackProfiles_;
256  std::vector<TH1 *> vTrack2DHistos_;
257 
260 
261  TH1D *modeByRun_;
262  TH1D *fieldByRun_;
263 
264  int ievt;
265  int itrks;
266  int mode;
268  bool isPhase1_;
269  float etaMax_;
270 
272 
277 
279 
284 
285  std::map<std::string, std::pair<int, int> > triggerMap_;
286  std::map<int, std::pair<int, float> > conditionsMap_;
287  std::map<int, std::pair<int, int> > runInfoMap_;
288 
289  //*************************************************************
290  void analyze(const edm::Event &event, const edm::EventSetup &setup) override
291  //*************************************************************
292  {
293  ievt++;
294 
296  event.getByToken(theTrackCollectionToken, trackCollection);
297 
298  // geometry setup
300  const TrackerGeometry *theGeometry = &(*geometry);
301 
302  // switch on the phase1
303  if ((theGeometry->isThere(GeomDetEnumerators::P1PXB)) || (theGeometry->isThere(GeomDetEnumerators::P1PXEC))) {
304  isPhase1_ = true;
305  } else {
306  isPhase1_ = false;
307  }
308 
309  const reco::TrackCollection tC = *(trackCollection.product());
310  itrks += tC.size();
311 
312  runInfoMap_[event.run()].first += 1;
313  runInfoMap_[event.run()].second += tC.size();
314 
315  if (DEBUG) {
316  edm::LogInfo("GeneralPurposeTrackAnalyzer") << "Reconstructed " << tC.size() << " tracks" << std::endl;
317  }
318  //int iCounter=0;
319 
321  event.getByToken(hltresultsToken, hltresults);
322  if (hltresults.isValid()) {
323  const edm::TriggerNames &triggerNames_ = event.triggerNames(*hltresults);
324  int ntrigs = hltresults->size();
325  //const vector<std::string> &triggernames = triggerNames_.triggerNames();
326 
327  for (int itrig = 0; itrig != ntrigs; ++itrig) {
328  const std::string &trigName = triggerNames_.triggerName(itrig);
329  bool accept = hltresults->accept(itrig);
330  if (accept == 1) {
331  if (DEBUG) {
332  edm::LogInfo("GeneralPurposeTrackAnalyzer")
333  << trigName << " " << accept << " ,track size: " << tC.size() << std::endl;
334  }
335  triggerMap_[trigName].first += 1;
336  triggerMap_[trigName].second += tC.size();
337  // triggerInfo.push_back(pair <std::string, int> (trigName, accept));
338  }
339  }
340  }
341 
342  hrun->Fill(event.run());
343  hlumi->Fill(event.luminosityBlock());
344 
345  int nHighPurityTracks = 0;
346 
347  for (auto track = tC.cbegin(); track != tC.cend(); track++) {
348  unsigned int nHit2D = 0;
349  for (auto iHit = track->recHitsBegin(); iHit != track->recHitsEnd(); ++iHit) {
350  if (this->isHit2D(**iHit)) {
351  ++nHit2D;
352  }
353 
354  const DetId &detId = (*iHit)->geographicalId();
355  const GeomDet *geomDet(theGeometry->idToDet(detId));
356 
357  const SiPixelRecHit *pixhit = dynamic_cast<const SiPixelRecHit *>(*iHit);
358 
359  if (pixhit) {
360  if (pixhit->isValid()) {
361  unsigned int subid = detId.subdetId();
362  int detid_db = detId.rawId();
363 
364  if (!isPhase1_) {
365  pmap->fill(detid_db, 1);
366  } else {
367  if (subid == PixelSubdetector::PixelBarrel) {
368  pixelmap->fillBarrelBin("entriesBarrel", detid_db, 1);
369  } else {
370  pixelmap->fillForwardBin("entriesForward", detid_db, 1);
371  }
372  }
373 
374  LocalPoint lp = (*iHit)->localPosition();
375  //LocalError le = (*iHit)->localPositionError();
376 
377  GlobalPoint GP = geomDet->surface().toGlobal(lp);
378 
379  if ((subid == PixelSubdetector::PixelBarrel) || (subid == PixelSubdetector::PixelEndcap)) {
380  // 1 = PXB, 2 = PXF
381  if (subid == PixelSubdetector::PixelBarrel) {
382  hHitCountVsThetaBPix->Fill(GP.theta());
383  hHitCountVsPhiBPix->Fill(GP.phi());
384 
385  hHitCountVsZBPix->Fill(GP.z());
386  hHitCountVsXBPix->Fill(GP.x());
387  hHitCountVsYBPix->Fill(GP.y());
388 
389  } else if (subid == PixelSubdetector::PixelEndcap) {
390  hHitCountVsThetaFPix->Fill(GP.theta());
391  hHitCountVsPhiFPix->Fill(GP.phi());
392 
393  hHitCountVsZFPix->Fill(GP.z());
394  hHitCountVsXFPix->Fill(GP.x());
395  hHitCountVsYFPix->Fill(GP.y());
396  }
397  }
398  }
399  } else {
400  if ((*iHit)->isValid()) {
401  tmap->fill(detId.rawId(), 1);
402  }
403  }
404  }
405 
406  hHit2D->Fill(nHit2D);
407  hHit->Fill(track->numberOfValidHits());
408  hnhpxb->Fill(track->hitPattern().numberOfValidPixelBarrelHits());
409  hnhpxe->Fill(track->hitPattern().numberOfValidPixelEndcapHits());
410  hnhTIB->Fill(track->hitPattern().numberOfValidStripTIBHits());
411  hnhTID->Fill(track->hitPattern().numberOfValidStripTIDHits());
412  hnhTOB->Fill(track->hitPattern().numberOfValidStripTOBHits());
413  hnhTEC->Fill(track->hitPattern().numberOfValidStripTECHits());
414 
415  // fill hit composition histogram
416  if (track->hitPattern().numberOfValidPixelBarrelHits() != 0) {
417  hHitComposition->Fill(0., track->hitPattern().numberOfValidPixelBarrelHits());
418 
419  pNBpixHitsVsVx->Fill(track->vx(), track->hitPattern().numberOfValidPixelBarrelHits());
420  pNBpixHitsVsVy->Fill(track->vy(), track->hitPattern().numberOfValidPixelBarrelHits());
421  pNBpixHitsVsVz->Fill(track->vz(), track->hitPattern().numberOfValidPixelBarrelHits());
422  }
423  if (track->hitPattern().numberOfValidPixelEndcapHits() != 0) {
424  hHitComposition->Fill(1., track->hitPattern().numberOfValidPixelEndcapHits());
425  }
426  if (track->hitPattern().numberOfValidStripTIBHits() != 0) {
427  hHitComposition->Fill(2., track->hitPattern().numberOfValidStripTIBHits());
428  }
429  if (track->hitPattern().numberOfValidStripTIDHits() != 0) {
430  hHitComposition->Fill(3., track->hitPattern().numberOfValidStripTIDHits());
431  }
432  if (track->hitPattern().numberOfValidStripTOBHits() != 0) {
433  hHitComposition->Fill(4., track->hitPattern().numberOfValidStripTOBHits());
434  }
435  if (track->hitPattern().numberOfValidStripTECHits() != 0) {
436  hHitComposition->Fill(5., track->hitPattern().numberOfValidStripTECHits());
437  }
438 
439  hCharge->Fill(track->charge());
440  hQoverP->Fill(track->qoverp());
441  hQoverPZoom->Fill(track->qoverp());
442  hPt->Fill(track->pt());
443  hP->Fill(track->p());
444  hchi2ndof->Fill(track->normalizedChi2());
445  hEta->Fill(track->eta());
446  hPhi->Fill(track->phi());
447 
448  if (fabs(track->eta()) < 0.8) {
449  hPhiBarrel->Fill(track->phi());
450  }
451  if (track->eta() > 0.8 && track->eta() < 1.4) {
452  hPhiOverlapPlus->Fill(track->phi());
453  }
454  if (track->eta() < -0.8 && track->eta() > -1.4) {
455  hPhiOverlapMinus->Fill(track->phi());
456  }
457  if (track->eta() > 1.4) {
458  hPhiEndcapPlus->Fill(track->phi());
459  }
460  if (track->eta() < -1.4) {
461  hPhiEndcapMinus->Fill(track->phi());
462  }
463 
464  hd0->Fill(track->d0());
465  hdz->Fill(track->dz());
466  hdxy->Fill(track->dxy());
467  hvx->Fill(track->vx());
468  hvy->Fill(track->vy());
469  hvz->Fill(track->vz());
470 
471  htrkAlgo->Fill(static_cast<int>(track->algo()));
472  htrkOriAlgo->Fill(static_cast<int>(track->originalAlgo()));
473 
474  int myquality = -99;
475  if (track->quality(reco::TrackBase::undefQuality)) {
476  myquality = -1;
477  htrkQuality->Fill(myquality);
478  }
479  if (track->quality(reco::TrackBase::loose)) {
480  myquality = 0;
481  htrkQuality->Fill(myquality);
482  }
483  if (track->quality(reco::TrackBase::tight)) {
484  myquality = 1;
485  htrkQuality->Fill(myquality);
486  }
487  if (track->quality(reco::TrackBase::highPurity) && (!isCosmics_)) {
488  myquality = 2;
489  htrkQuality->Fill(myquality);
490  hPhp->Fill(track->p());
491  hPthp->Fill(track->pt());
492  hHithp->Fill(track->numberOfValidHits());
493  hEtahp->Fill(track->eta());
494  hPhihp->Fill(track->phi());
495  hchi2ndofhp->Fill(track->normalizedChi2());
496  hchi2Probhp->Fill(TMath::Prob(track->chi2(), track->ndof()));
497  nHighPurityTracks++;
498  }
499  if (track->quality(reco::TrackBase::confirmed)) {
500  myquality = 3;
501  htrkQuality->Fill(myquality);
502  }
503  if (track->quality(reco::TrackBase::goodIterative)) {
504  myquality = 4;
505  htrkQuality->Fill(myquality);
506  }
507 
508  // Fill 1D track histos
509  static const int etaindex = this->GetIndex(vTrackHistos_, "h_tracketa");
510  vTrackHistos_[etaindex]->Fill(track->eta());
511  static const int phiindex = this->GetIndex(vTrackHistos_, "h_trackphi");
512  vTrackHistos_[phiindex]->Fill(track->phi());
513  static const int numOfValidHitsindex = this->GetIndex(vTrackHistos_, "h_trackNumberOfValidHits");
514  vTrackHistos_[numOfValidHitsindex]->Fill(track->numberOfValidHits());
515  static const int numOfLostHitsindex = this->GetIndex(vTrackHistos_, "h_trackNumberOfLostHits");
516  vTrackHistos_[numOfLostHitsindex]->Fill(track->numberOfLostHits());
517 
518  GlobalPoint gPoint(track->vx(), track->vy(), track->vz());
519  double theLocalMagFieldInInverseGeV = magneticField_->inInverseGeV(gPoint).z();
520  double kappa = -track->charge() * theLocalMagFieldInInverseGeV / track->pt();
521 
522  static const int kappaindex = this->GetIndex(vTrackHistos_, "h_curvature");
523  vTrackHistos_[kappaindex]->Fill(kappa);
524  static const int kappaposindex = this->GetIndex(vTrackHistos_, "h_curvature_pos");
525  if (track->charge() > 0)
526  vTrackHistos_[kappaposindex]->Fill(fabs(kappa));
527  static const int kappanegindex = this->GetIndex(vTrackHistos_, "h_curvature_neg");
528  if (track->charge() < 0)
529  vTrackHistos_[kappanegindex]->Fill(fabs(kappa));
530 
531  double chi2Prob = TMath::Prob(track->chi2(), track->ndof());
532  double normchi2 = track->normalizedChi2();
533 
534  static const int normchi2index = this->GetIndex(vTrackHistos_, "h_normchi2");
535  vTrackHistos_[normchi2index]->Fill(normchi2);
536  static const int chi2index = this->GetIndex(vTrackHistos_, "h_chi2");
537  vTrackHistos_[chi2index]->Fill(track->chi2());
538  static const int chi2Probindex = this->GetIndex(vTrackHistos_, "h_chi2Prob");
539  vTrackHistos_[chi2Probindex]->Fill(chi2Prob);
540  static const int ptindex = this->GetIndex(vTrackHistos_, "h_pt");
541  static const int pt2index = this->GetIndex(vTrackHistos_, "h_ptrebin");
542  vTrackHistos_[ptindex]->Fill(track->pt());
543  vTrackHistos_[pt2index]->Fill(track->pt());
544  if (track->ptError() != 0.) {
545  static const int ptResolutionindex = this->GetIndex(vTrackHistos_, "h_ptResolution");
546  vTrackHistos_[ptResolutionindex]->Fill(track->ptError() / track->pt());
547  }
548  // Fill track profiles
549  static const int d0phiindex = this->GetIndex(vTrackProfiles_, "p_d0_vs_phi");
550  vTrackProfiles_[d0phiindex]->Fill(track->phi(), track->d0());
551  static const int dzphiindex = this->GetIndex(vTrackProfiles_, "p_dz_vs_phi");
552  vTrackProfiles_[dzphiindex]->Fill(track->phi(), track->dz());
553  static const int d0etaindex = this->GetIndex(vTrackProfiles_, "p_d0_vs_eta");
554  vTrackProfiles_[d0etaindex]->Fill(track->eta(), track->d0());
555  static const int dzetaindex = this->GetIndex(vTrackProfiles_, "p_dz_vs_eta");
556  vTrackProfiles_[dzetaindex]->Fill(track->eta(), track->dz());
557  static const int chiProbphiindex = this->GetIndex(vTrackProfiles_, "p_chi2Prob_vs_phi");
558  vTrackProfiles_[chiProbphiindex]->Fill(track->phi(), chi2Prob);
559  static const int chiProbabsd0index = this->GetIndex(vTrackProfiles_, "p_chi2Prob_vs_d0");
560  vTrackProfiles_[chiProbabsd0index]->Fill(fabs(track->d0()), chi2Prob);
561  static const int chiProbabsdzindex = this->GetIndex(vTrackProfiles_, "p_chi2Prob_vs_dz");
562  vTrackProfiles_[chiProbabsdzindex]->Fill(track->dz(), chi2Prob);
563  static const int chiphiindex = this->GetIndex(vTrackProfiles_, "p_chi2_vs_phi");
564  vTrackProfiles_[chiphiindex]->Fill(track->phi(), track->chi2());
565  static const int normchiphiindex = this->GetIndex(vTrackProfiles_, "p_normchi2_vs_phi");
566  vTrackProfiles_[normchiphiindex]->Fill(track->phi(), normchi2);
567  static const int chietaindex = this->GetIndex(vTrackProfiles_, "p_chi2_vs_eta");
568  vTrackProfiles_[chietaindex]->Fill(track->eta(), track->chi2());
569  static const int normchiptindex = this->GetIndex(vTrackProfiles_, "p_normchi2_vs_pt");
570  vTrackProfiles_[normchiptindex]->Fill(track->pt(), normchi2);
571  static const int normchipindex = this->GetIndex(vTrackProfiles_, "p_normchi2_vs_p");
572  vTrackProfiles_[normchipindex]->Fill(track->p(), normchi2);
573  static const int chiProbetaindex = this->GetIndex(vTrackProfiles_, "p_chi2Prob_vs_eta");
574  vTrackProfiles_[chiProbetaindex]->Fill(track->eta(), chi2Prob);
575  static const int normchietaindex = this->GetIndex(vTrackProfiles_, "p_normchi2_vs_eta");
576  vTrackProfiles_[normchietaindex]->Fill(track->eta(), normchi2);
577  static const int kappaphiindex = this->GetIndex(vTrackProfiles_, "p_kappa_vs_phi");
578  vTrackProfiles_[kappaphiindex]->Fill(track->phi(), kappa);
579  static const int kappaetaindex = this->GetIndex(vTrackProfiles_, "p_kappa_vs_eta");
580  vTrackProfiles_[kappaetaindex]->Fill(track->eta(), kappa);
581  static const int ptResphiindex = this->GetIndex(vTrackProfiles_, "p_ptResolution_vs_phi");
582  vTrackProfiles_[ptResphiindex]->Fill(track->phi(), track->ptError() / track->pt());
583  static const int ptResetaindex = this->GetIndex(vTrackProfiles_, "p_ptResolution_vs_eta");
584  vTrackProfiles_[ptResetaindex]->Fill(track->eta(), track->ptError() / track->pt());
585 
586  // Fill 2D track histos
587  static const int d0phiindex_2d = this->GetIndex(vTrack2DHistos_, "h2_d0_vs_phi");
588  vTrack2DHistos_[d0phiindex_2d]->Fill(track->phi(), track->d0());
589  static const int dzphiindex_2d = this->GetIndex(vTrack2DHistos_, "h2_dz_vs_phi");
590  vTrack2DHistos_[dzphiindex_2d]->Fill(track->phi(), track->dz());
591  static const int d0etaindex_2d = this->GetIndex(vTrack2DHistos_, "h2_d0_vs_eta");
592  vTrack2DHistos_[d0etaindex_2d]->Fill(track->eta(), track->d0());
593  static const int dzetaindex_2d = this->GetIndex(vTrack2DHistos_, "h2_dz_vs_eta");
594  vTrack2DHistos_[dzetaindex_2d]->Fill(track->eta(), track->dz());
595  static const int chiphiindex_2d = this->GetIndex(vTrack2DHistos_, "h2_chi2_vs_phi");
596  vTrack2DHistos_[chiphiindex_2d]->Fill(track->phi(), track->chi2());
597  static const int chiProbphiindex_2d = this->GetIndex(vTrack2DHistos_, "h2_chi2Prob_vs_phi");
598  vTrack2DHistos_[chiProbphiindex_2d]->Fill(track->phi(), chi2Prob);
599  static const int chiProbabsd0index_2d = this->GetIndex(vTrack2DHistos_, "h2_chi2Prob_vs_d0");
600  vTrack2DHistos_[chiProbabsd0index_2d]->Fill(fabs(track->d0()), chi2Prob);
601  static const int normchiphiindex_2d = this->GetIndex(vTrack2DHistos_, "h2_normchi2_vs_phi");
602  vTrack2DHistos_[normchiphiindex_2d]->Fill(track->phi(), normchi2);
603  static const int chietaindex_2d = this->GetIndex(vTrack2DHistos_, "h2_chi2_vs_eta");
604  vTrack2DHistos_[chietaindex_2d]->Fill(track->eta(), track->chi2());
605  static const int chiProbetaindex_2d = this->GetIndex(vTrack2DHistos_, "h2_chi2Prob_vs_eta");
606  vTrack2DHistos_[chiProbetaindex_2d]->Fill(track->eta(), chi2Prob);
607  static const int normchietaindex_2d = this->GetIndex(vTrack2DHistos_, "h2_normchi2_vs_eta");
608  vTrack2DHistos_[normchietaindex_2d]->Fill(track->eta(), normchi2);
609  static const int kappaphiindex_2d = this->GetIndex(vTrack2DHistos_, "h2_kappa_vs_phi");
610  vTrack2DHistos_[kappaphiindex_2d]->Fill(track->phi(), kappa);
611  static const int kappaetaindex_2d = this->GetIndex(vTrack2DHistos_, "h2_kappa_vs_eta");
612  vTrack2DHistos_[kappaetaindex_2d]->Fill(track->eta(), kappa);
613  static const int normchi2kappa_2d = this->GetIndex(vTrack2DHistos_, "h2_normchi2_vs_kappa");
614  vTrack2DHistos_[normchi2kappa_2d]->Fill(normchi2, kappa);
615 
616  //dxy with respect to the beamspot
618  edm::Handle<reco::BeamSpot> beamSpotHandle;
619  event.getByToken(beamspotToken, beamSpotHandle);
620  if (beamSpotHandle.isValid()) {
621  beamSpot = *beamSpotHandle;
622  math::XYZPoint point(beamSpot.x0(), beamSpot.y0(), beamSpot.z0());
623  double dxy = track->dxy(point);
624  double dz = track->dz(point);
625  hdxyBS->Fill(dxy);
626  hd0BS->Fill(-dxy);
627  hdzBS->Fill(dz);
628  }
629 
630  //dxy with respect to the primary vertex
631  reco::Vertex pvtx;
634  event.getByLabel("offlinePrimaryVertices", vertexHandle);
635  double mindxy = 100.;
636  double dz = 100;
637  if (vertexHandle.isValid() && !isCosmics_) {
638  for (auto pvtx = vertexHandle->cbegin(); pvtx != vertexHandle->cend(); ++pvtx) {
639  math::XYZPoint mypoint(pvtx->x(), pvtx->y(), pvtx->z());
640  if (abs(mindxy) > abs(track->dxy(mypoint))) {
641  mindxy = track->dxy(mypoint);
642  dz = track->dz(mypoint);
643  }
644  }
645 
646  hdxyPV->Fill(mindxy);
647  hd0PV->Fill(-mindxy);
648  hdzPV->Fill(dz);
649 
650  hd0PVvsphi->Fill(track->phi(), -mindxy);
651  hd0PVvseta->Fill(track->eta(), -mindxy);
652  hd0PVvspt->Fill(track->pt(), -mindxy);
653 
654  } else {
655  hdxyPV->Fill(100);
656  hd0PV->Fill(100);
657  hdzPV->Fill(100);
658 
659  hd0vsphi->Fill(track->phi(), -track->dxy());
660  hd0vseta->Fill(track->eta(), -track->dxy());
661  hd0vspt->Fill(track->pt(), -track->dxy());
662  }
663 
664  if (DEBUG) {
665  edm::LogInfo("GeneralPurposeTrackAnalyzer") << "end of track loop" << std::endl;
666  }
667  }
668 
669  hNtrk->Fill(tC.size());
670  hNtrkZoom->Fill(tC.size());
671  hNhighPurity->Fill(nHighPurityTracks);
672 
673  if (DEBUG) {
674  edm::LogInfo("GeneralPurposeTrackAnalyzer") << "end of analysis" << std::endl;
675  }
676  }
677 
678  //*************************************************************
679  void beginRun(edm::Run const &run, edm::EventSetup const &setup) override
680  //*************************************************************
681  {
682  // Magnetic Field setup
683  magneticField_ = setup.getHandle(magFieldToken_);
684  float B_ = magneticField_.product()->inTesla(GlobalPoint(0, 0, 0)).mag();
685 
686  if (DEBUG) {
687  edm::LogInfo("GeneralPurposeTrackAnalyzer")
688  << "run number:" << run.run() << " magnetic field: " << B_ << " [T]" << std::endl;
689  }
690 
691  //SiStrip Latency
693  if (apvlat->singleReadOutMode() == 1) {
694  mode = 1; // peak mode
695  } else if (apvlat->singleReadOutMode() == 0) {
696  mode = -1; // deco mode
697  }
698 
699  conditionsMap_[run.run()].first = mode;
700  conditionsMap_[run.run()].second = B_;
701  }
702 
703  //*************************************************************
704  void endRun(edm::Run const &, edm::EventSetup const &) override {}
705  //*************************************************************
706 
707  //*************************************************************
708  void beginJob() override
709  //*************************************************************
710  {
711  if (DEBUG) {
712  edm::LogInfo("GeneralPurposeTrackAnalyzer") << __LINE__ << std::endl;
713  }
714 
715  TH1D::SetDefaultSumw2(kTRUE);
716 
717  isPhase1_ = true;
718  etaMax_ = 3.0;
719 
720  ievt = 0;
721  itrks = 0;
722 
723  hrun = fs->make<TH1D>("h_run", "run", 100000, 230000, 240000);
724  hlumi = fs->make<TH1D>("h_lumi", "lumi", 1000, 0, 1000);
725 
726  hchi2ndof = fs->make<TH1D>("h_chi2ndof", "chi2/ndf;#chi^{2}/ndf;tracks", 100, 0, 5.);
727  hCharge = fs->make<TH1D>("h_charge", "charge;Charge of the track;tracks", 5, -2.5, 2.5);
728  hNtrk = fs->make<TH1D>("h_Ntrk", "ntracks;Number of Tracks;events", 200, 0., 200.);
729  hNtrkZoom = fs->make<TH1D>("h_NtrkZoom", "Number of tracks; number of tracks;events", 10, 0., 10.);
730  hNhighPurity =
731  fs->make<TH1D>("h_NhighPurity", "n. high purity tracks;Number of high purity tracks;events", 200, 0., 200.);
732 
733  htrkAlgo = fs->make<TH1I>("h_trkAlgo",
734  "tracking step;iterative tracking step;tracks",
736  0.,
737  double(reco::TrackBase::algoSize));
738 
739  htrkOriAlgo = fs->make<TH1I>("h_trkOriAlgo",
740  "original tracking step;original iterative tracking step;tracks",
742  0.,
743  double(reco::TrackBase::algoSize));
744 
745  for (size_t ibin = 0; ibin < reco::TrackBase::algoSize - 1; ibin++) {
746  htrkAlgo->GetXaxis()->SetBinLabel(ibin + 1, (reco::TrackBase::algoNames[ibin]).c_str());
747  htrkOriAlgo->GetXaxis()->SetBinLabel(ibin + 1, (reco::TrackBase::algoNames[ibin]).c_str());
748  }
749 
750  htrkQuality = fs->make<TH1I>("h_trkQuality", "track quality;track quality;tracks", 6, -1, 5);
751  std::string qualities[7] = {"undef", "loose", "tight", "highPurity", "confirmed", "goodIterative"};
752  for (int nbin = 1; nbin <= htrkQuality->GetNbinsX(); nbin++) {
753  htrkQuality->GetXaxis()->SetBinLabel(nbin, (qualities[nbin - 1]).c_str());
754  }
755 
756  hP = fs->make<TH1D>("h_P", "Momentum;track momentum [GeV];tracks", 100, 0., 100.);
757  hQoverP = fs->make<TH1D>("h_qoverp", "Track q/p; track q/p [GeV^{-1}];tracks", 100, -1., 1.);
758  hQoverPZoom = fs->make<TH1D>("h_qoverpZoom", "Track q/p; track q/p [GeV^{-1}];tracks", 100, -0.1, 0.1);
759  hPt = fs->make<TH1D>("h_Pt", "Transverse Momentum;track p_{T} [GeV];tracks", 100, 0., 100.);
760  hHit = fs->make<TH1D>("h_nHits", "Number of hits;track n. hits;tracks", 50, -0.5, 49.5);
761  hHit2D = fs->make<TH1D>("h_nHit2D", "Number of 2D hits; number of 2D hits;tracks", 20, 0, 20);
762 
763  hHitCountVsZBPix = fs->make<TH1D>("h_HitCountVsZBpix", "Number of BPix hits vs z;hit global z;hits", 60, -30, 30);
765  fs->make<TH1D>("h_HitCountVsZFpix", "Number of FPix hits vs z;hit global z;hits", 100, -100, 100);
766 
767  hHitCountVsXBPix = fs->make<TH1D>("h_HitCountVsXBpix", "Number of BPix hits vs x;hit global x;hits", 20, -20, 20);
768  hHitCountVsXFPix = fs->make<TH1D>("h_HitCountVsXFpix", "Number of FPix hits vs x;hit global x;hits", 20, -20, 20);
769 
770  hHitCountVsYBPix = fs->make<TH1D>("h_HitCountVsYBpix", "Number of BPix hits vs y;hit global y;hits", 20, -20, 20);
771  hHitCountVsYFPix = fs->make<TH1D>("h_HitCountVsYFpix", "Number of FPix hits vs y;hit global y;hits", 20, -20, 20);
772 
774  fs->make<TH1D>("h_HitCountVsThetaBpix", "Number of BPix hits vs #theta;hit global #theta;hits", 20, 0., M_PI);
776  fs->make<TH1D>("h_HitCountVsPhiBpix", "Number of BPix hits vs #phi;hit global #phi;hits", 20, -M_PI, M_PI);
777 
779  fs->make<TH1D>("h_HitCountVsThetaFpix", "Number of FPix hits vs #theta;hit global #theta;hits", 40, 0., M_PI);
781  fs->make<TH1D>("h_HitCountVsPhiFpix", "Number of FPix hits vs #phi;hit global #phi;hits", 20, -M_PI, M_PI);
782 
783  hEta = fs->make<TH1D>("h_Eta", "Track pseudorapidity; track #eta;tracks", 100, -etaMax_, etaMax_);
784  hPhi = fs->make<TH1D>("h_Phi", "Track azimuth; track #phi;tracks", 100, -M_PI, M_PI);
785 
786  hPhiBarrel = fs->make<TH1D>("h_PhiBarrel", "hPhiBarrel (0<|#eta|<0.8);track #Phi;tracks", 100, -M_PI, M_PI);
788  fs->make<TH1D>("h_PhiOverlapPlus", "hPhiOverlapPlus (0.8<#eta<1.4);track #phi;tracks", 100, -M_PI, M_PI);
790  fs->make<TH1D>("h_PhiOverlapMinus", "hPhiOverlapMinus (-1.4<#eta<-0.8);track #phi;tracks", 100, -M_PI, M_PI);
791  hPhiEndcapPlus = fs->make<TH1D>("h_PhiEndcapPlus", "hPhiEndcapPlus (#eta>1.4);track #phi;track", 100, -M_PI, M_PI);
793  fs->make<TH1D>("h_PhiEndcapMinus", "hPhiEndcapMinus (#eta<1.4);track #phi;tracks", 100, -M_PI, M_PI);
794 
795  if (!isCosmics_) {
796  hPhp = fs->make<TH1D>("h_P_hp", "Momentum (high purity);track momentum [GeV];tracks", 100, 0., 100.);
797  hPthp = fs->make<TH1D>("h_Pt_hp", "Transverse Momentum (high purity);track p_{T} [GeV];tracks", 100, 0., 100.);
798  hHithp = fs->make<TH1D>("h_nHit_hp", "Number of hits (high purity);track n. hits;tracks", 30, 0, 30);
799  hEtahp =
800  fs->make<TH1D>("h_Eta_hp", "Track pseudorapidity (high purity); track #eta;tracks", 100, -etaMax_, etaMax_);
801  hPhihp = fs->make<TH1D>("h_Phi_hp", "Track azimuth (high purity); track #phi;tracks", 100, -M_PI, M_PI);
802  hchi2ndofhp = fs->make<TH1D>("h_chi2ndof_hp", "chi2/ndf (high purity);#chi^{2}/ndf;tracks", 100, 0, 5.);
803  hchi2Probhp = fs->make<TH1D>(
804  "h_chi2_Prob_hp", "#chi^{2} probability (high purity);#chi^{2}prob_{Track};Number of Tracks", 100, 0.0, 1.);
805 
806  hvx = fs->make<TH1D>("h_vx", "Track v_{x} ; track v_{x} [cm];tracks", 100, -1.5, 1.5);
807  hvy = fs->make<TH1D>("h_vy", "Track v_{y} ; track v_{y} [cm];tracks", 100, -1.5, 1.5);
808  hvz = fs->make<TH1D>("h_vz", "Track v_{z} ; track v_{z} [cm];tracks", 100, -20., 20.);
809  hd0 = fs->make<TH1D>("h_d0", "Track d_{0} ; track d_{0} [cm];tracks", 100, -1., 1.);
810  hdxy = fs->make<TH1D>("h_dxy", "Track d_{xy}; track d_{xy} [cm]; tracks", 100, -0.5, 0.5);
811  hdz = fs->make<TH1D>("h_dz", "Track d_{z} ; track d_{z} [cm]; tracks", 100, -20, 20);
812 
813  hd0PVvsphi =
814  fs->make<TH2D>("h2_d0PVvsphi", "hd0PVvsphi;track #phi;track d_{0}(PV) [cm]", 160, -M_PI, M_PI, 100, -1., 1.);
815  hd0PVvseta =
816  fs->make<TH2D>("h2_d0PVvseta", "hdPV0vseta;track #eta;track d_{0}(PV) [cm]", 160, -2.5, 2.5, 100, -1., 1.);
817  hd0PVvspt = fs->make<TH2D>("h2_d0PVvspt", "hdPV0vspt;track p_{T};d_{0}(PV) [cm]", 50, 0., 100., 100, -1, 1.);
818 
819  hdxyBS = fs->make<TH1D>("h_dxyBS", "hdxyBS; track d_{xy}(BS) [cm];tracks", 100, -0.1, 0.1);
820  hd0BS = fs->make<TH1D>("h_d0BS", "hd0BS ; track d_{0}(BS) [cm];tracks", 100, -0.1, 0.1);
821  hdzBS = fs->make<TH1D>("h_dzBS", "hdzBS ; track d_{z}(BS) [cm];tracks", 100, -12, 12);
822  hdxyPV = fs->make<TH1D>("h_dxyPV", "hdxyPV; track d_{xy}(PV) [cm];tracks", 100, -0.1, 0.1);
823  hd0PV = fs->make<TH1D>("h_d0PV", "hd0PV ; track d_{0}(PV) [cm];tracks", 100, -0.15, 0.15);
824  hdzPV = fs->make<TH1D>("h_dzPV", "hdzPV ; track d_{z}(PV) [cm];tracks", 100, -0.1, 0.1);
825 
826  hnhTIB = fs->make<TH1D>("h_nHitTIB", "nhTIB;# hits in TIB; tracks", 20, 0., 20.);
827  hnhTID = fs->make<TH1D>("h_nHitTID", "nhTID;# hits in TID; tracks", 20, 0., 20.);
828  hnhTOB = fs->make<TH1D>("h_nHitTOB", "nhTOB;# hits in TOB; tracks", 20, 0., 20.);
829  hnhTEC = fs->make<TH1D>("h_nHitTEC", "nhTEC;# hits in TEC; tracks", 20, 0., 20.);
830 
831  } else {
832  hvx = fs->make<TH1D>("h_vx", "Track v_{x};track v_{x} [cm];tracks", 100, -100., 100.);
833  hvy = fs->make<TH1D>("h_vy", "Track v_{y};track v_{y} [cm];tracks", 100, -100., 100.);
834  hvz = fs->make<TH1D>("h_vz", "Track v_{z};track v_{z} [cm];track", 100, -100., 100.);
835  hd0 = fs->make<TH1D>("h_d0", "Track d_{0};track d_{0} [cm];track", 100, -100., 100.);
836  hdxy = fs->make<TH1D>("h_dxy", "Track d_{xy};track d_{xy} [cm];tracks", 100, -100, 100);
837  hdz = fs->make<TH1D>("h_dz", "Track d_{z};track d_{z} [cm];tracks", 100, -200, 200);
838 
839  hd0vsphi = fs->make<TH2D>(
840  "h2_d0vsphi", "Track d_{0} vs #phi; track #phi;track d_{0} [cm]", 160, -3.20, 3.20, 100, -100., 100.);
841  hd0vseta = fs->make<TH2D>(
842  "h2_d0vseta", "Track d_{0} vs #eta; track #eta;track d_{0} [cm]", 160, -3.20, 3.20, 100, -100., 100.);
843  hd0vspt = fs->make<TH2D>(
844  "h2_d0vspt", "Track d_{0} vs p_{T};track p_{T};track d_{0} [cm]", 50, 0., 100., 100, -100, 100);
845 
846  hdxyBS = fs->make<TH1D>("h_dxyBS", "Track d_{xy}(BS);d_{xy}(BS) [cm];tracks", 100, -100., 100.);
847  hd0BS = fs->make<TH1D>("h_d0BS", "Track d_{0}(BS);d_{0}(BS) [cm];tracks", 100, -100., 100.);
848  hdzBS = fs->make<TH1D>("h_dzBS", "Track d_{z}(BS);d_{z}(BS) [cm];tracks", 100, -100., 100.);
849  hdxyPV = fs->make<TH1D>("h_dxyPV", "Track d_{xy}(PV); d_{xy}(PV) [cm];tracks", 100, -100., 100.);
850  hd0PV = fs->make<TH1D>("h_d0PV", "Track d_{0}(PV); d_{0}(PV) [cm];tracks", 100, -100., 100.);
851  hdzPV = fs->make<TH1D>("h_dzPV", "Track d_{z}(PV); d_{z}(PV) [cm];tracks", 100, -100., 100.);
852 
853  hnhTIB = fs->make<TH1D>("h_nHitTIB", "nhTIB;# hits in TIB; tracks", 30, 0., 30.);
854  hnhTID = fs->make<TH1D>("h_nHitTID", "nhTID;# hits in TID; tracks", 30, 0., 30.);
855  hnhTOB = fs->make<TH1D>("h_nHitTOB", "nhTOB;# hits in TOB; tracks", 30, 0., 30.);
856  hnhTEC = fs->make<TH1D>("h_nHitTEC", "nhTEC;# hits in TEC; tracks", 30, 0., 30.);
857  }
858 
859  hnhpxb = fs->make<TH1D>("h_nHitPXB", "nhpxb;# hits in Pixel Barrel; tracks", 10, 0., 10.);
860  hnhpxe = fs->make<TH1D>("h_nHitPXE", "nhpxe;# hits in Pixel Endcap; tracks", 10, 0., 10.);
861 
862  hHitComposition = fs->make<TH1D>("h_hitcomposition", "track hit composition;;# hits", 6, -0.5, 5.5);
863 
865  fs->make<TProfile>("p_NpixHits_vs_Vx", "n. Barrel Pixel hits vs. v_{x};v_{x} (cm);n. BPix hits", 20, -20, 20);
866 
868  fs->make<TProfile>("p_NpixHits_vs_Vy", "n. Barrel Pixel hits vs. v_{y};v_{y} (cm);n. BPix hits", 20, -20, 20);
869 
871  fs->make<TProfile>("p_NpixHits_vs_Vz", "n. Barrel Pixel hits vs. v_{z};v_{z} (cm);n. BPix hits", 20, -100, 100);
872 
873  std::string dets[6] = {"PXB", "PXF", "TIB", "TID", "TOB", "TEC"};
874 
875  for (int i = 1; i <= hHitComposition->GetNbinsX(); i++) {
876  hHitComposition->GetXaxis()->SetBinLabel(i, (dets[i - 1]).c_str());
877  }
878 
879  vTrackHistos_.push_back(
880  fs->make<TH1F>("h_tracketa", "Track #eta;#eta_{Track};Number of Tracks", 90, -etaMax_, etaMax_));
881  vTrackHistos_.push_back(fs->make<TH1F>("h_trackphi", "Track #phi;#phi_{Track};Number of Tracks", 90, -M_PI, M_PI));
882  vTrackHistos_.push_back(fs->make<TH1F>(
883  "h_trackNumberOfValidHits", "Track # of valid hits;# of valid hits _{Track};Number of Tracks", 40, 0., 40.));
884  vTrackHistos_.push_back(fs->make<TH1F>(
885  "h_trackNumberOfLostHits", "Track # of lost hits;# of lost hits _{Track};Number of Tracks", 10, 0., 10.));
886  vTrackHistos_.push_back(
887  fs->make<TH1F>("h_curvature", "Curvature #kappa;#kappa_{Track};Number of Tracks", 100, -.05, .05));
888  vTrackHistos_.push_back(fs->make<TH1F>(
889  "h_curvature_pos", "Curvature |#kappa| Positive Tracks;|#kappa_{pos Track}|;Number of Tracks", 100, .0, .05));
890  vTrackHistos_.push_back(fs->make<TH1F>(
891  "h_curvature_neg", "Curvature |#kappa| Negative Tracks;|#kappa_{neg Track}|;Number of Tracks", 100, .0, .05));
892  vTrackHistos_.push_back(
893  fs->make<TH1F>("h_diff_curvature",
894  "Curvature |#kappa| Tracks Difference;|#kappa_{Track}|;# Pos Tracks - # Neg Tracks",
895  100,
896  .0,
897  .05));
898 
899  vTrackHistos_.push_back(
900  fs->make<TH1F>("h_chi2", "Track #chi^{2};#chi^{2}_{Track};Number of Tracks", 500, -0.01, 500.));
901  vTrackHistos_.push_back(
902  fs->make<TH1F>("h_chi2Prob", "#chi^{2} probability;Track Prob(#chi^{2},ndof);Number of Tracks", 100, 0.0, 1.));
903  vTrackHistos_.push_back(
904  fs->make<TH1F>("h_normchi2", "#chi^{2}/ndof;#chi^{2}/ndof;Number of Tracks", 100, -0.01, 10.));
905  //variable binning for chi2/ndof vs. pT
906  double xBins[19] = {0., 0.15, 0.5, 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 7., 10., 15., 25., 40., 100., 200.};
907  vTrackHistos_.push_back(fs->make<TH1F>("h_pt", "Track p_{T};p_{T}^{track} [GeV];Number of Tracks", 250, 0., 250));
908  vTrackHistos_.push_back(fs->make<TH1F>("h_ptrebin", "Track p_{T};p_{T}^{track} [GeV];Number of Tracks", 18, xBins));
909  vTrackHistos_.push_back(fs->make<TH1F>(
910  "h_ptResolution", "#delta_{p_{T}}/p_{T}^{track};#delta_{p_{T}}/p_{T}^{track};Number of Tracks", 100, 0., 0.5));
911  vTrackProfiles_.push_back(fs->make<TProfile>(
912  "p_d0_vs_phi", "Transverse Impact Parameter vs. #phi;#phi_{Track};#LT d_{0} #GT [cm]", 100, -M_PI, M_PI));
913  vTrackProfiles_.push_back(fs->make<TProfile>(
914  "p_dz_vs_phi", "Longitudinal Impact Parameter vs. #phi;#phi_{Track};#LT d_{z} #GT [cm]", 100, -M_PI, M_PI));
915  vTrackProfiles_.push_back(fs->make<TProfile>(
916  "p_d0_vs_eta", "Transverse Impact Parameter vs. #eta;#eta_{Track};#LT d_{0} #GT [cm]", 100, -etaMax_, etaMax_));
917  vTrackProfiles_.push_back(
918  fs->make<TProfile>("p_dz_vs_eta",
919  "Longitudinal Impact Parameter vs. #eta;#eta_{Track};#LT d_{z} #GT [cm]",
920  100,
921  -etaMax_,
922  etaMax_));
923  vTrackProfiles_.push_back(
924  fs->make<TProfile>("p_chi2_vs_phi", "#chi^{2} vs. #phi;#phi_{Track};#LT #chi^{2} #GT", 100, -M_PI, M_PI));
925  vTrackProfiles_.push_back(
926  fs->make<TProfile>("p_chi2Prob_vs_phi",
927  "#chi^{2} probablility vs. #phi;#phi_{Track};#LT #chi^{2} probability#GT",
928  100,
929  -M_PI,
930  M_PI));
931 
932  vTrackProfiles_.push_back(fs->make<TProfile>(
933  "p_chi2Prob_vs_d0", "#chi^{2} probablility vs. |d_{0}|;|d_{0}|[cm];#LT #chi^{2} probability#GT", 100, 0, 80));
934  vTrackProfiles_.push_back(fs->make<TProfile>(
935  "p_chi2Prob_vs_dz", "#chi^{2} probablility vs. dz;d_{z} [cm];#LT #chi^{2} probability#GT", 100, -30, 30));
936  vTrackProfiles_.push_back(fs->make<TProfile>(
937  "p_normchi2_vs_phi", "#chi^{2}/ndof vs. #phi;#phi_{Track};#LT #chi^{2}/ndof #GT", 100, -M_PI, M_PI));
938  vTrackProfiles_.push_back(
939  fs->make<TProfile>("p_chi2_vs_eta", "#chi^{2} vs. #eta;#eta_{Track};#LT #chi^{2} #GT", 100, -etaMax_, etaMax_));
940  vTrackProfiles_.push_back(fs->make<TProfile>(
941  "p_normchi2_vs_pt", "norm #chi^{2} vs. p_{T}_{Track}; p_{T}_{Track};#LT #chi^{2}/ndof #GT", 18, xBins));
942  vTrackProfiles_.push_back(fs->make<TProfile>(
943  "p_normchi2_vs_p", "#chi^{2}/ndof vs. p_{Track};p_{Track};#LT #chi^{2}/ndof #GT", 18, xBins));
944  vTrackProfiles_.push_back(
945  fs->make<TProfile>("p_chi2Prob_vs_eta",
946  "#chi^{2} probability vs. #eta;#eta_{Track};#LT #chi^{2} probability #GT",
947  100,
948  -etaMax_,
949  etaMax_));
950 
951  vTrackProfiles_.push_back(fs->make<TProfile>(
952  "p_normchi2_vs_eta", "#chi^{2}/ndof vs. #eta;#eta_{Track};#LT #chi^{2}/ndof #GT", 100, -etaMax_, etaMax_));
953  vTrackProfiles_.push_back(
954  fs->make<TProfile>("p_kappa_vs_phi", "#kappa vs. #phi;#phi_{Track};#kappa", 100, -M_PI, M_PI));
955  vTrackProfiles_.push_back(
956  fs->make<TProfile>("p_kappa_vs_eta", "#kappa vs. #eta;#eta_{Track};#kappa", 100, -etaMax_, etaMax_));
957  vTrackProfiles_.push_back(
958  fs->make<TProfile>("p_ptResolution_vs_phi",
959  "#delta_{p_{T}}/p_{T}^{track};#phi^{track};#delta_{p_{T}}/p_{T}^{track}",
960  100,
961  -M_PI,
962  M_PI));
963 
964  vTrackProfiles_.push_back(
965  fs->make<TProfile>("p_ptResolution_vs_eta",
966  "#delta_{p_{T}}/p_{T}^{track};#eta^{track};#delta_{p_{T}}/p_{T}^{track}",
967  100,
968  -etaMax_,
969  etaMax_));
970 
971  vTrack2DHistos_.push_back(fs->make<TH2F>(
972  "h2_d0_vs_phi", "Transverse Impact Parameter vs. #phi;#phi_{Track};d_{0} [cm]", 100, -M_PI, M_PI, 100, -1., 1.));
973  vTrack2DHistos_.push_back(fs->make<TH2F>("h2_dz_vs_phi",
974  "Longitudinal Impact Parameter vs. #phi;#phi_{Track};d_{z} [cm]",
975  100,
976  -M_PI,
977  M_PI,
978  100,
979  -100.,
980  100.));
981 
982  vTrack2DHistos_.push_back(fs->make<TH2F>("h2_d0_vs_eta",
983  "Transverse Impact Parameter vs. #eta;#eta_{Track};d_{0} [cm]",
984  100,
985  -etaMax_,
986  etaMax_,
987  100,
988  -1.,
989  1.));
990  vTrack2DHistos_.push_back(fs->make<TH2F>("h2_dz_vs_eta",
991  "Longitudinal Impact Parameter vs. #eta;#eta_{Track};d_{z} [cm]",
992  100,
993  -etaMax_,
994  etaMax_,
995  100,
996  -100.,
997  100.));
998 
999  vTrack2DHistos_.push_back(
1000  fs->make<TH2F>("h2_chi2_vs_phi", "#chi^{2} vs. #phi;#phi_{Track};#chi^{2}", 100, -M_PI, M_PI, 500, 0., 500.));
1001  vTrack2DHistos_.push_back(fs->make<TH2F>("h2_chi2Prob_vs_phi",
1002  "#chi^{2} probability vs. #phi;#phi_{Track};#chi^{2} probability",
1003  100,
1004  -M_PI,
1005  M_PI,
1006  100,
1007  0.,
1008  1.));
1009 
1010  vTrack2DHistos_.push_back(fs->make<TH2F>("h2_chi2Prob_vs_d0",
1011  "#chi^{2} probability vs. |d_{0}|;|d_{0}| [cm];#chi^{2} probability",
1012  100,
1013  0,
1014  80,
1015  100,
1016  0.,
1017  1.));
1018 
1019  vTrack2DHistos_.push_back(fs->make<TH2F>(
1020  "h2_normchi2_vs_phi", "#chi^{2}/ndof vs. #phi;#phi_{Track};#chi^{2}/ndof", 100, -M_PI, M_PI, 100, 0., 10.));
1021  vTrack2DHistos_.push_back(fs->make<TH2F>(
1022  "h2_chi2_vs_eta", "#chi^{2} vs. #eta;#eta_{Track};#chi^{2}", 100, -etaMax_, etaMax_, 500, 0., 500.));
1023  vTrack2DHistos_.push_back(fs->make<TH2F>("h2_chi2Prob_vs_eta",
1024  "#chi^{2} probaility vs. #eta;#eta_{Track};#chi^{2} probability",
1025  100,
1026  -etaMax_,
1027  etaMax_,
1028  100,
1029  0.,
1030  1.));
1031 
1032  vTrack2DHistos_.push_back(fs->make<TH2F>(
1033  "h2_normchi2_vs_eta", "#chi^{2}/ndof vs. #eta;#eta_{Track};#chi^{2}/ndof", 100, -etaMax_, etaMax_, 100, 0., 10.));
1034  vTrack2DHistos_.push_back(
1035  fs->make<TH2F>("h2_kappa_vs_phi", "#kappa vs. #phi;#phi_{Track};#kappa", 100, -M_PI, M_PI, 100, .0, .05));
1036  vTrack2DHistos_.push_back(
1037  fs->make<TH2F>("h2_kappa_vs_eta", "#kappa vs. #eta;#eta_{Track};#kappa", 100, -etaMax_, etaMax_, 100, .0, .05));
1038  vTrack2DHistos_.push_back(fs->make<TH2F>(
1039  "h2_normchi2_vs_kappa", "#kappa vs. #chi^{2}/ndof;#chi^{2}/ndof;#kappa", 100, 0., 10, 100, -.03, .03));
1040 
1041  firstEvent_ = true;
1042 
1043  } //beginJob
1044 
1045  //*************************************************************
1046  void endJob() override
1047  //*************************************************************
1048  {
1049  edm::LogPrint("GeneralPurposeTrackAnalyzer") << "*******************************" << std::endl;
1050  edm::LogPrint("GeneralPurposeTrackAnalyzer") << "Events run in total: " << ievt << std::endl;
1051  edm::LogPrint("GeneralPurposeTrackAnalyzer") << "n. tracks: " << itrks << std::endl;
1052  edm::LogPrint("GeneralPurposeTrackAnalyzer") << "*******************************" << std::endl;
1053 
1054  int nFiringTriggers = triggerMap_.size();
1055  edm::LogPrint("GeneralPurposeTrackAnalyzer") << "firing triggers: " << nFiringTriggers << std::endl;
1056  edm::LogPrint("GeneralPurposeTrackAnalyzer") << "*******************************" << std::endl;
1057 
1058  tksByTrigger_ = fs->make<TH1D>(
1059  "tksByTrigger", "tracks by HLT path;;% of # traks", nFiringTriggers, -0.5, nFiringTriggers - 0.5);
1060  evtsByTrigger_ = fs->make<TH1D>(
1061  "evtsByTrigger", "events by HLT path;;% of # events", nFiringTriggers, -0.5, nFiringTriggers - 0.5);
1062 
1063  int i = 0;
1064  for (const auto &it : triggerMap_) {
1065  i++;
1066 
1067  double trkpercent = ((it.second).second) * 100. / double(itrks);
1068  double evtpercent = ((it.second).first) * 100. / double(ievt);
1069 
1070  std::cout.precision(4);
1071 
1072  edm::LogPrint("GeneralPurposeTrackAnalyzer")
1073  << "HLT path: " << std::setw(60) << std::left << it.first << " | events firing: " << std::right
1074  << std::setw(8) << (it.second).first << " (" << std::setw(8) << std::fixed << std::setprecision(4)
1075  << evtpercent << "%)"
1076  << " | tracks collected: " << std::setw(10) << (it.second).second << " (" << std::setw(8) << std::fixed
1077  << std::setprecision(4) << trkpercent << "%)";
1078 
1079  tksByTrigger_->SetBinContent(i, trkpercent);
1080  tksByTrigger_->GetXaxis()->SetBinLabel(i, (it.first).c_str());
1081 
1082  evtsByTrigger_->SetBinContent(i, evtpercent);
1083  evtsByTrigger_->GetXaxis()->SetBinLabel(i, (it.first).c_str());
1084  }
1085 
1086  int nRuns = conditionsMap_.size();
1087 
1088  std::vector<int> theRuns_;
1089  for (const auto &it : conditionsMap_) {
1090  theRuns_.push_back(it.first);
1091  }
1092 
1093  sort(theRuns_.begin(), theRuns_.end());
1094  int runRange = theRuns_.back() - theRuns_.front() + 1;
1095 
1096  edm::LogPrint("GeneralPurposeTrackAnalyzer") << "*******************************" << std::endl;
1097  edm::LogPrint("GeneralPurposeTrackAnalyzer") << "first run: " << theRuns_.front() << std::endl;
1098  edm::LogPrint("GeneralPurposeTrackAnalyzer") << "last run: " << theRuns_.back() << std::endl;
1099  edm::LogPrint("GeneralPurposeTrackAnalyzer") << "considered runs: " << nRuns << std::endl;
1100  edm::LogPrint("GeneralPurposeTrackAnalyzer") << "*******************************" << std::endl;
1101 
1102  modeByRun_ = fs->make<TH1D>("modeByRun",
1103  "Strip APV mode by run number;;APV mode (-1=deco,+1=peak)",
1104  runRange,
1105  theRuns_.front() - 0.5,
1106  theRuns_.back() + 0.5);
1107 
1108  fieldByRun_ = fs->make<TH1D>("fieldByRun",
1109  "CMS B-field intensity by run number;;B-field intensity [T]",
1110  runRange,
1111  theRuns_.front() - 0.5,
1112  theRuns_.back() + 0.5);
1113 
1114  for (const auto &the_r : theRuns_) {
1115  if (conditionsMap_.find(the_r)->second.first != 0) {
1116  edm::LogPrint("GeneralPurposeTrackAnalyzer")
1117  << "run:" << the_r << " | isPeak: " << std::setw(4) << conditionsMap_.find(the_r)->second.first
1118  << "| B-field: " << conditionsMap_.find(the_r)->second.second << " [T]"
1119  << "| events: " << std::setw(10) << runInfoMap_.find(the_r)->second.first << ", tracks " << std::setw(10)
1120  << runInfoMap_.find(the_r)->second.second << std::endl;
1121  }
1122 
1123  modeByRun_->SetBinContent((the_r - theRuns_.front()) + 1, conditionsMap_.find(the_r)->second.first);
1124  fieldByRun_->SetBinContent((the_r - theRuns_.front()) + 1, conditionsMap_.find(the_r)->second.second);
1125  modeByRun_->GetXaxis()->SetBinLabel((the_r - theRuns_.front()) + 1, std::to_string(the_r).c_str());
1126  fieldByRun_->GetXaxis()->SetBinLabel((the_r - theRuns_.front()) + 1, std::to_string(the_r).c_str());
1127  }
1128 
1129  pmap->save(true, 0, 0, "PixelHitMap.pdf", 600, 800);
1130  pmap->save(true, 0, 0, "PixelHitMap.png", 500, 750);
1131 
1132  tmap->save(true, 0, 0, "StripHitMap.pdf");
1133  tmap->save(true, 0, 0, "StripHitMap.png");
1134 
1135  gStyle->SetPalette(kRainBow);
1136  pixelmap->beautifyAllHistograms();
1137 
1138  TCanvas cB("CanvBarrel", "CanvBarrel", 1200, 1000);
1139  pixelmap->DrawBarrelMaps("entriesBarrel", cB);
1140  cB.SaveAs("pixelBarrelEntries.png");
1141 
1142  TCanvas cF("CanvForward", "CanvForward", 1600, 1000);
1143  pixelmap->DrawForwardMaps("entriesForward", cF);
1144  cF.SaveAs("pixelForwardEntries.png");
1145  }
1146 
1147  //*************************************************************
1149  //*************************************************************
1150  {
1151  bool countStereoHitAs2D_ = true;
1152  // we count SiStrip stereo modules as 2D if selected via countStereoHitAs2D_
1153  // (since they provide theta information)
1154  if (!hit.isValid() ||
1155  (hit.dimension() < 2 && !countStereoHitAs2D_ && !dynamic_cast<const SiStripRecHit1D *>(&hit))) {
1156  return false; // real RecHit1D - but SiStripRecHit1D depends on countStereoHitAs2D_
1157  } else {
1158  const DetId detId(hit.geographicalId());
1159  if (detId.det() == DetId::Tracker) {
1160  if (detId.subdetId() == kBPIX || detId.subdetId() == kFPIX) {
1161  return true; // pixel is always 2D
1162  } else { // should be SiStrip now
1163  const SiStripDetId stripId(detId);
1164  if (stripId.stereo())
1165  return countStereoHitAs2D_; // stereo modules
1166  else if (dynamic_cast<const SiStripRecHit1D *>(&hit) || dynamic_cast<const SiStripRecHit2D *>(&hit))
1167  return false; // rphi modules hit
1168  //the following two are not used any more since ages...
1169  else if (dynamic_cast<const SiStripMatchedRecHit2D *>(&hit))
1170  return true; // matched is 2D
1171  else if (dynamic_cast<const ProjectedSiStripRecHit2D *>(&hit)) {
1172  const ProjectedSiStripRecHit2D *pH = static_cast<const ProjectedSiStripRecHit2D *>(&hit);
1173  return (countStereoHitAs2D_ && this->isHit2D(pH->originalHit())); // depends on original...
1174  } else {
1175  edm::LogError("UnkownType") << "@SUB=GeneralPurposeTrackAnalyzer::isHit2D"
1176  << "Tracker hit not in pixel, neither SiStripRecHit[12]D nor "
1177  << "SiStripMatchedRecHit2D nor ProjectedSiStripRecHit2D.";
1178  return false;
1179  }
1180  }
1181  } else { // not tracker??
1182  edm::LogWarning("DetectorMismatch") << "@SUB=GeneralPurposeTrackAnalyzer::isHit2D"
1183  << "Hit not in tracker with 'official' dimension >=2.";
1184  return true; // dimension() >= 2 so accept that...
1185  }
1186  }
1187  // never reached...
1188  }
1189 };
1190 
1191 //*************************************************************
1193 //*************************************************************
1194 {
1196  desc.setComment("Generic track analyzer to check ALCARECO sample quantities");
1197  desc.add<edm::InputTag>("TkTag", edm::InputTag("generalTracks"));
1198  desc.add<edm::InputTag>("TriggerResultsTag", edm::InputTag("TriggerResults", "", "HLT"));
1199  desc.add<edm::InputTag>("BeamSpotTag", edm::InputTag("offlineBeamSpot"));
1200  desc.add<edm::InputTag>("VerticesTag", edm::InputTag("offlinePrimaryVertices"));
1201  desc.add<bool>("isCosmics", false);
1202  descriptions.add("GeneralPurposeTrackAnalyzer", desc);
1203 }
1204 
TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
TrajectoryStateCombiner.h
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
GeneralPurposeTrackAnalyzer::hHitCountVsYBPix
TH1D * hHitCountVsYBPix
Definition: GeneralPurposeTrackAnalyzer.cc:174
GeneralPurposeTrackAnalyzer::itrks
int itrks
Definition: GeneralPurposeTrackAnalyzer.cc:265
GeneralPurposeTrackAnalyzer::hEtaMinus
TH1D * hEtaMinus
Definition: GeneralPurposeTrackAnalyzer.cc:201
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
GlobalPositionRcd.h
GeneralPurposeTrackAnalyzer::conditionsMap_
std::map< int, std::pair< int, float > > conditionsMap_
Definition: GeneralPurposeTrackAnalyzer.cc:286
MagneticField::inTesla
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
EDAnalyzer.h
mps_fire.i
i
Definition: mps_fire.py:428
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
GeneralPurposeTrackAnalyzer::hnhTOB
TH1D * hnhTOB
Definition: GeneralPurposeTrackAnalyzer.cc:234
MessageLogger.h
reco::TrackBase::tight
Definition: TrackBase.h:153
GeneralPurposeTrackAnalyzer::hPhiPlus
TH1D * hPhiPlus
Definition: GeneralPurposeTrackAnalyzer.cc:208
GeneralPurposeTrackAnalyzer::hd0BS
TH1D * hd0BS
Definition: GeneralPurposeTrackAnalyzer.cc:246
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
TrackerGeometry.h
reco::TrackBase::loose
Definition: TrackBase.h:152
GeomDet
Definition: GeomDet.h:27
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
reco::TrackBase::goodIterative
Definition: TrackBase.h:156
ESHandle.h
TriggerResults.h
HLTBitAnalyser_cfi.hltresults
hltresults
Definition: HLTBitAnalyser_cfi.py:13
GeneralPurposeTrackAnalyzer::triggerMap_
std::map< std::string, std::pair< int, int > > triggerMap_
Definition: GeneralPurposeTrackAnalyzer.cc:285
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
SiStripMatchedRecHit2DCollection.h
edm::Run
Definition: Run.h:45
GeneralPurposeTrackAnalyzer::vTrack2DHistos_
std::vector< TH1 * > vTrack2DHistos_
Definition: GeneralPurposeTrackAnalyzer.cc:256
reco::Vertex::z
double z() const
z coordinate
Definition: Vertex.h:120
reco::TrackBase::confirmed
Definition: TrackBase.h:155
edm::EDGetTokenT< reco::TrackCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
GeneralPurposeTrackAnalyzer::isHit2D
bool isHit2D(const TrackingRecHit &hit)
Definition: GeneralPurposeTrackAnalyzer.cc:1148
GeneralPurposeTrackAnalyzer::hd0
TH1D * hd0
Definition: GeneralPurposeTrackAnalyzer.cc:218
GeneralPurposeTrackAnalyzer::endRun
void endRun(edm::Run const &, edm::EventSetup const &) override
Definition: GeneralPurposeTrackAnalyzer.cc:704
GeneralPurposeTrackAnalyzer::hPthp
TH1D * hPthp
Definition: GeneralPurposeTrackAnalyzer.cc:189
PV3DBase::theta
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
reco::TrackBase::undefQuality
Definition: TrackBase.h:151
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
gather_cfg.cout
cout
Definition: gather_cfg.py:144
geometry
Definition: geometry.py:1
edm::LogPrint
Log< level::Warning, true > LogPrint
Definition: MessageLogger.h:130
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
GeneralPurposeTrackAnalyzer::hvz
TH1D * hvz
Definition: GeneralPurposeTrackAnalyzer.cc:217
GeneralPurposeTrackAnalyzer::hHitMinus
TH1D * hHitMinus
Definition: GeneralPurposeTrackAnalyzer.cc:186
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
GeneralPurposeTrackAnalyzer::hNhighPurity
TH1D * hNhighPurity
Definition: GeneralPurposeTrackAnalyzer.cc:161
GeneralPurposeTrackAnalyzer::tksByTrigger_
TH1D * tksByTrigger_
Definition: GeneralPurposeTrackAnalyzer.cc:258
GeneralPurposeTrackAnalyzer::hnhpxb
TH1D * hnhpxb
Definition: GeneralPurposeTrackAnalyzer.cc:230
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
SiStripDetId.h
GeneralPurposeTrackAnalyzer::trackerGeometry_
const TrackerGeometry * trackerGeometry_
Definition: GeneralPurposeTrackAnalyzer.cc:271
GeneralPurposeTrackAnalyzer::hDeltaR
TH1D * hDeltaR
Definition: GeneralPurposeTrackAnalyzer.cc:213
GeneralPurposeTrackAnalyzer::hHitCountVsPhiFPix
TH1D * hHitCountVsPhiFPix
Definition: GeneralPurposeTrackAnalyzer.cc:183
GeneralPurposeTrackAnalyzer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: GeneralPurposeTrackAnalyzer.cc:1192
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
GeneralPurposeTrackAnalyzer::TriggerResultsTag_
edm::InputTag TriggerResultsTag_
Definition: GeneralPurposeTrackAnalyzer.cc:274
GeneralPurposeTrackAnalyzer::hHitCountVsPhiBPix
TH1D * hHitCountVsPhiBPix
Definition: GeneralPurposeTrackAnalyzer.cc:180
GeneralPurposeTrackAnalyzer::magneticField_
edm::ESHandle< MagneticField > magneticField_
Definition: GeneralPurposeTrackAnalyzer.cc:146
GeneralPurposeTrackAnalyzer::hHitCountVsThetaFPix
TH1D * hHitCountVsThetaFPix
Definition: GeneralPurposeTrackAnalyzer.cc:182
edm::Handle< reco::TrackCollection >
GeneralPurposeTrackAnalyzer::beamspotToken
edm::EDGetTokenT< reco::BeamSpot > beamspotToken
Definition: GeneralPurposeTrackAnalyzer.cc:282
dqmdumpme.first
first
Definition: dqmdumpme.py:55
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
ProjectedSiStripRecHit2D
Definition: ProjectedSiStripRecHit2D.h:8
GeneralPurposeTrackAnalyzer::hd0PVvspt
TH2D * hd0PVvspt
Definition: GeneralPurposeTrackAnalyzer.cc:224
GeneralPurposeTrackAnalyzer::hdxy
TH1D * hdxy
Definition: GeneralPurposeTrackAnalyzer.cc:220
SiPixelRecHit
Our base class.
Definition: SiPixelRecHit.h:23
GeneralPurposeTrackAnalyzer::hPPlus
TH1D * hPPlus
Definition: GeneralPurposeTrackAnalyzer.cc:163
GeneralPurposeTrackAnalyzer::runInfoMap_
std::map< int, std::pair< int, int > > runInfoMap_
Definition: GeneralPurposeTrackAnalyzer.cc:287
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
GeneralPurposeTrackAnalyzer::modeByRun_
TH1D * modeByRun_
Definition: GeneralPurposeTrackAnalyzer.cc:261
GeneralPurposeTrackAnalyzer::hHitCountVsYFPix
TH1D * hHitCountVsYFPix
Definition: GeneralPurposeTrackAnalyzer.cc:175
GeneralPurposeTrackAnalyzer::hnhTEC
TH1D * hnhTEC
Definition: GeneralPurposeTrackAnalyzer.cc:235
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
GeneralPurposeTrackAnalyzer::BeamSpotTag_
edm::InputTag BeamSpotTag_
Definition: GeneralPurposeTrackAnalyzer.cc:275
DetId
Definition: DetId.h:17
GeneralPurposeTrackAnalyzer::hQoverPZoom
TH1D * hQoverPZoom
Definition: GeneralPurposeTrackAnalyzer.cc:198
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
MakerMacros.h
TrackerTopology.h
TrackingRecHit.h
Track.h
GeneralPurposeTrackAnalyzer::hd0PVvseta
TH2D * hd0PVvseta
Definition: GeneralPurposeTrackAnalyzer.cc:223
TrackFwd.h
GeneralPurposeTrackAnalyzer::isCosmics_
bool isCosmics_
Definition: GeneralPurposeTrackAnalyzer.cc:278
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
BeamSpot.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
GeneralPurposeTrackAnalyzer::hlumi
TH1D * hlumi
Definition: GeneralPurposeTrackAnalyzer.cc:252
GeneralPurposeTrackAnalyzer::endJob
void endJob() override
Definition: GeneralPurposeTrackAnalyzer.cc:1046
LocalError.h
GeomDetEnumerators::P1PXEC
Definition: GeomDetEnumerators.h:26
Service.h
GeneralPurposeTrackAnalyzer::beginJob
void beginJob() override
Definition: GeneralPurposeTrackAnalyzer.cc:708
GeneralPurposeTrackAnalyzer::hdxyBS
TH1D * hdxyBS
Definition: GeneralPurposeTrackAnalyzer.cc:245
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
GeneralPurposeTrackAnalyzer::hdz
TH1D * hdz
Definition: GeneralPurposeTrackAnalyzer.cc:219
GeneralPurposeTrackAnalyzer::hEta
TH1D * hEta
Definition: GeneralPurposeTrackAnalyzer.cc:199
reco::BeamSpot
Definition: BeamSpot.h:21
SiTrackerMultiRecHit.h
GeneralPurposeTrackAnalyzer::hPtPlus
TH1D * hPtPlus
Definition: GeneralPurposeTrackAnalyzer.cc:167
IdealMagneticFieldRecord.h
GeneralPurposeTrackAnalyzer::~GeneralPurposeTrackAnalyzer
~GeneralPurposeTrackAnalyzer() override
Definition: GeneralPurposeTrackAnalyzer.cc:124
edm::ESHandle< MagneticField >
GeneralPurposeTrackAnalyzer::hPhiOverlapMinus
TH1D * hPhiOverlapMinus
Definition: GeneralPurposeTrackAnalyzer.cc:205
ProjectedSiStripRecHit2D::originalHit
SiStripRecHit2D originalHit() const
Definition: ProjectedSiStripRecHit2D.h:56
kFPIX
const int kFPIX
Definition: GeneralPurposeTrackAnalyzer.cc:84
GeneralPurposeTrackAnalyzer::hd0PVvsphi
TH2D * hd0PVvsphi
Definition: GeneralPurposeTrackAnalyzer.cc:222
multiplicitycorr_cfi.xBins
xBins
Definition: multiplicitycorr_cfi.py:5
edm::TriggerNames::triggerNames
Strings const & triggerNames() const
Definition: TriggerNames.cc:20
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GeneralPurposeTrackAnalyzer::pNBpixHitsVsVx
TProfile * pNBpixHitsVsVx
Definition: GeneralPurposeTrackAnalyzer.cc:239
Point3DBase< float, LocalTag >
GeneralPurposeTrackAnalyzer::pNBpixHitsVsVy
TProfile * pNBpixHitsVsVy
Definition: GeneralPurposeTrackAnalyzer.cc:240
SiPixelRecHit.h
TrackerGeometry::isThere
bool isThere(GeomDetEnumerators::SubDetector subdet) const
Definition: TrackerGeometry.cc:219
GeneralPurposeTrackAnalyzer::hHit2D
TH1D * hHit2D
Definition: GeneralPurposeTrackAnalyzer.cc:170
GeneralPurposeTrackAnalyzer::VerticesTag_
edm::InputTag VerticesTag_
Definition: GeneralPurposeTrackAnalyzer.cc:276
GeneralPurposeTrackAnalyzer::hd0vseta
TH2D * hd0vseta
Definition: GeneralPurposeTrackAnalyzer.cc:227
MagneticField::inInverseGeV
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
Definition: MagneticField.h:36
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
DEBUG
#define DEBUG
Definition: GeneralPurposeTrackAnalyzer.cc:81
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GeneralPurposeTrackAnalyzer::hchi2Probhp
TH1D * hchi2Probhp
Definition: GeneralPurposeTrackAnalyzer.cc:194
Vertex.h
GeneralPurposeTrackAnalyzer::hHitCountVsThetaBPix
TH1D * hHitCountVsThetaBPix
Definition: GeneralPurposeTrackAnalyzer.cc:179
GeneralPurposeTrackAnalyzer::hPhp
TH1D * hPhp
Definition: GeneralPurposeTrackAnalyzer.cc:188
GeneralPurposeTrackAnalyzer::evtsByTrigger_
TH1D * evtsByTrigger_
Definition: GeneralPurposeTrackAnalyzer.cc:259
EgHLTOffTrigSelection_cfi.trigName
trigName
Definition: EgHLTOffTrigSelection_cfi.py:8
TFileService.h
GeneralPurposeTrackAnalyzer::beginRun
void beginRun(edm::Run const &run, edm::EventSetup const &setup) override
Definition: GeneralPurposeTrackAnalyzer.cc:679
Phase1PixelMaps.h
GeneralPurposeTrackAnalyzer::hPhiEndcapPlus
TH1D * hPhiEndcapPlus
Definition: GeneralPurposeTrackAnalyzer.cc:206
GeneralPurposeTrackAnalyzer::etaMax_
float etaMax_
Definition: GeneralPurposeTrackAnalyzer.cc:269
GeneralPurposeTrackAnalyzer::hvy
TH1D * hvy
Definition: GeneralPurposeTrackAnalyzer.cc:216
GeomDetEnumerators::P1PXB
Definition: GeomDetEnumerators.h:25
TrackerDigiGeometryRecord.h
GeneralPurposeTrackAnalyzer::pmap
std::unique_ptr< TrackerMap > pmap
Definition: GeneralPurposeTrackAnalyzer.cc:151
GeneralPurposeTrackAnalyzer::latencyToken_
const edm::ESGetToken< SiStripLatency, SiStripLatencyRcd > latencyToken_
Definition: GeneralPurposeTrackAnalyzer.cc:144
edm::ParameterSet
Definition: ParameterSet.h:47
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
edm::Transition
Transition
Definition: Transition.h:12
GeneralPurposeTrackAnalyzer::analyze
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
Definition: GeneralPurposeTrackAnalyzer.cc:290
DetId::Tracker
Definition: DetId.h:25
SiStripCondDataRecords.h
GeneralPurposeTrackAnalyzer::htrkOriAlgo
TH1I * htrkOriAlgo
Definition: GeneralPurposeTrackAnalyzer.cc:160
SiStripCluster.h
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
Event.h
GeneralPurposeTrackAnalyzer::hPhiBarrel
TH1D * hPhiBarrel
Definition: GeneralPurposeTrackAnalyzer.cc:203
GeneralPurposeTrackAnalyzer::hPtMinus
TH1D * hPtMinus
Definition: GeneralPurposeTrackAnalyzer.cc:168
reco::Vertex::x
double x() const
x coordinate
Definition: Vertex.h:116
GeneralPurposeTrackAnalyzer::vertexToken
edm::EDGetTokenT< reco::VertexCollection > vertexToken
Definition: GeneralPurposeTrackAnalyzer.cc:283
GeneralPurposeTrackAnalyzer::hEtahp
TH1D * hEtahp
Definition: GeneralPurposeTrackAnalyzer.cc:191
GeneralPurposeTrackAnalyzer::pNBpixHitsVsVz
TProfile * pNBpixHitsVsVz
Definition: GeneralPurposeTrackAnalyzer.cc:241
GeneralPurposeTrackAnalyzer::hnhpxe
TH1D * hnhpxe
Definition: GeneralPurposeTrackAnalyzer.cc:231
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
edm::Service< TFileService >
TriggerNames.h
SiStripRecHit2DCollection.h
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
GeneralPurposeTrackAnalyzer::hrun
TH1D * hrun
Definition: GeneralPurposeTrackAnalyzer.cc:251
GeneralPurposeTrackAnalyzer::hchi2ndof
TH1D * hchi2ndof
Definition: GeneralPurposeTrackAnalyzer.cc:155
IdealGeometryRecord.h
GeneralPurposeTrackAnalyzer::hnhTIB
TH1D * hnhTIB
Definition: GeneralPurposeTrackAnalyzer.cc:232
ProjectedSiStripRecHit2D.h
MagneticField.h
GeneralPurposeTrackAnalyzer::hHitCountVsZFPix
TH1D * hHitCountVsZFPix
Definition: GeneralPurposeTrackAnalyzer.cc:177
edm::EventSetup
Definition: EventSetup.h:57
SiStripLatency::singleReadOutMode
int16_t singleReadOutMode() const
Definition: SiStripLatency.cc:122
GeneralPurposeTrackAnalyzer::tmap
std::unique_ptr< TrackerMap > tmap
Definition: GeneralPurposeTrackAnalyzer.cc:150
GeneralPurposeTrackAnalyzer::fs
edm::Service< TFileService > fs
Definition: GeneralPurposeTrackAnalyzer.cc:148
GeneralPurposeTrackAnalyzer::hP
TH1D * hP
Definition: GeneralPurposeTrackAnalyzer.cc:162
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
GeneralPurposeTrackAnalyzer::hMinPt
TH1D * hMinPt
Definition: GeneralPurposeTrackAnalyzer.cc:166
GeneralPurposeTrackAnalyzer::hHit
TH1D * hHit
Definition: GeneralPurposeTrackAnalyzer.cc:169
HitPattern.h
GeneralPurposeTrackAnalyzer::htrkAlgo
TH1I * htrkAlgo
Definition: GeneralPurposeTrackAnalyzer.cc:159
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord >
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
GeneralPurposeTrackAnalyzer::hnhTID
TH1D * hnhTID
Definition: GeneralPurposeTrackAnalyzer.cc:233
kBPIX
const int kBPIX
Definition: GeneralPurposeTrackAnalyzer.cc:83
GeneralPurposeTrackAnalyzer::hHithp
TH1D * hHithp
Definition: GeneralPurposeTrackAnalyzer.cc:190
GeneralPurposeTrackAnalyzer::hHitCountVsZBPix
TH1D * hHitCountVsZBPix
Definition: GeneralPurposeTrackAnalyzer.cc:176
edm::TriggerNames::triggerName
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:22
TrackerMap.h
GeneralPurposeTrackAnalyzer::hPhihp
TH1D * hPhihp
Definition: GeneralPurposeTrackAnalyzer.cc:192
GeneralPurposeTrackAnalyzer::hPhiMinus
TH1D * hPhiMinus
Definition: GeneralPurposeTrackAnalyzer.cc:209
TrackingRecHit
Definition: TrackingRecHit.h:21
SiStripRecHit1D.h
GeneralPurposeTrackAnalyzer::ievt
int ievt
Definition: GeneralPurposeTrackAnalyzer.cc:264
GeneralPurposeTrackAnalyzer::hEtaPlus
TH1D * hEtaPlus
Definition: GeneralPurposeTrackAnalyzer.cc:200
VertexFwd.h
GeneralPurposeTrackAnalyzer::hvx
TH1D * hvx
Definition: GeneralPurposeTrackAnalyzer.cc:215
GeneralPurposeTrackAnalyzer::GetIndex
int GetIndex(const std::vector< OBJECT_TYPE * > &vec, const TString &name)
Definition: GeneralPurposeTrackAnalyzer.cc:129
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
GeneralPurposeTrackAnalyzer::hdzPV
TH1D * hdzPV
Definition: GeneralPurposeTrackAnalyzer.cc:250
Trajectory.h
GeneralPurposeTrackAnalyzer::hPhiEndcapMinus
TH1D * hPhiEndcapMinus
Definition: GeneralPurposeTrackAnalyzer.cc:207
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
GeneralPurposeTrackAnalyzer::theTrackCollectionToken
edm::EDGetTokenT< reco::TrackCollection > theTrackCollectionToken
Definition: GeneralPurposeTrackAnalyzer.cc:280
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
writedatasetfile.run
run
Definition: writedatasetfile.py:27
GeneralPurposeTrackAnalyzer::fieldByRun_
TH1D * fieldByRun_
Definition: GeneralPurposeTrackAnalyzer.cc:262
GeneralPurposeTrackAnalyzer::hHitPlus
TH1D * hHitPlus
Definition: GeneralPurposeTrackAnalyzer.cc:185
reco::Vertex::y
double y() const
y coordinate
Definition: Vertex.h:118
GeneralPurposeTrackAnalyzer::hHitCountVsXFPix
TH1D * hHitCountVsXFPix
Definition: GeneralPurposeTrackAnalyzer.cc:173
GeneralPurposeTrackAnalyzer::hNtrkZoom
TH1D * hNtrkZoom
Definition: GeneralPurposeTrackAnalyzer.cc:157
PVValHelper::dxy
Definition: PVValidationHelpers.h:47
reco::TrackBase::algoSize
Definition: TrackBase.h:141
DetId.h
PVValHelper::dz
Definition: PVValidationHelpers.h:50
GeneralPurposeTrackAnalyzer::mode
int mode
Definition: GeneralPurposeTrackAnalyzer.cc:266
GeneralPurposeTrackAnalyzer::hMultCand
TH1D * hMultCand
Definition: GeneralPurposeTrackAnalyzer.cc:243
Frameworkfwd.h
spclusmultinvestigator_cfi.vertexCollection
vertexCollection
Definition: spclusmultinvestigator_cfi.py:4
GeneralPurposeTrackAnalyzer::magFieldToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
Definition: GeneralPurposeTrackAnalyzer.cc:143
TFileService::kSharedResource
static const std::string kSharedResource
Definition: TFileService.h:76
GeneralPurposeTrackAnalyzer::hNtrk
TH1D * hNtrk
Definition: GeneralPurposeTrackAnalyzer.cc:156
edm::TriggerNames
Definition: TriggerNames.h:55
ZMuMuCategoriesSequences_cff.nbin
nbin
Definition: ZMuMuCategoriesSequences_cff.py:25
GeneralPurposeTrackAnalyzer::hPhi
TH1D * hPhi
Definition: GeneralPurposeTrackAnalyzer.cc:202
GeneralPurposeTrackAnalyzer::hPMinus
TH1D * hPMinus
Definition: GeneralPurposeTrackAnalyzer.cc:164
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
EventSetup.h
GeneralPurposeTrackAnalyzer
Definition: GeneralPurposeTrackAnalyzer.cc:86
GeneralPurposeTrackAnalyzer::hDeltaPhi
TH1D * hDeltaPhi
Definition: GeneralPurposeTrackAnalyzer.cc:211
SiStripLatencyRcd
Definition: SiStripCondDataRecords.h:36
GeneralPurposeTrackAnalyzer::hQoverP
TH1D * hQoverP
Definition: GeneralPurposeTrackAnalyzer.cc:197
GeneralPurposeTrackAnalyzer::hltresultsToken
edm::EDGetTokenT< edm::TriggerResults > hltresultsToken
Definition: GeneralPurposeTrackAnalyzer.cc:281
GeneralPurposeTrackAnalyzer::geomToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Definition: GeneralPurposeTrackAnalyzer.cc:142
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition: EDConsumerBase.h:200
GeneralPurposeTrackAnalyzer::hdzBS
TH1D * hdzBS
Definition: GeneralPurposeTrackAnalyzer.cc:247
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
kappa
static const G4double kappa
Definition: UrbanMscModel93.cc:35
SiStripLatency.h
GeneralPurposeTrackAnalyzer::isPhase1_
bool isPhase1_
Definition: GeneralPurposeTrackAnalyzer.cc:268
GeneralPurposeTrackAnalyzer::TkTag_
edm::InputTag TkTag_
Definition: GeneralPurposeTrackAnalyzer.cc:273
ParameterSet.h
SiStripDetId
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
SiStripMatchedRecHit2D.h
GeneralPurposeTrackAnalyzer::hHitCountVsXBPix
TH1D * hHitCountVsXBPix
Definition: GeneralPurposeTrackAnalyzer.cc:172
GeneralPurposeTrackAnalyzer::hPt
TH1D * hPt
Definition: GeneralPurposeTrackAnalyzer.cc:165
GeneralPurposeTrackAnalyzer::hchi2ndofhp
TH1D * hchi2ndofhp
Definition: GeneralPurposeTrackAnalyzer.cc:193
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
event
Definition: event.py:1
GeneralPurposeTrackAnalyzer::hHitComposition
TH1D * hHitComposition
Definition: GeneralPurposeTrackAnalyzer.cc:237
GeneralPurposeTrackAnalyzer::firstEvent_
bool firstEvent_
Definition: GeneralPurposeTrackAnalyzer.cc:267
edm::Event
Definition: Event.h:73
GeneralPurposeTrackAnalyzer::hPhiOverlapPlus
TH1D * hPhiOverlapPlus
Definition: GeneralPurposeTrackAnalyzer.cc:204
SiStripLatency
Definition: SiStripLatency.h:59
MagneticField
Definition: MagneticField.h:19
GeneralPurposeTrackAnalyzer::vTrackHistos_
std::vector< TH1 * > vTrackHistos_
Definition: GeneralPurposeTrackAnalyzer.cc:254
GeneralPurposeTrackAnalyzer::hCharge
TH1D * hCharge
Definition: GeneralPurposeTrackAnalyzer.cc:196
GeneralPurposeTrackAnalyzer::hd0PV
TH1D * hd0PV
Definition: GeneralPurposeTrackAnalyzer.cc:249
reco::TrackBase::algoNames
static const std::string algoNames[]
Definition: TrackBase.h:147
GeneralPurposeTrackAnalyzer::hDeltaEta
TH1D * hDeltaEta
Definition: GeneralPurposeTrackAnalyzer.cc:212
GeneralPurposeTrackAnalyzer::hd0vsphi
TH2D * hd0vsphi
Definition: GeneralPurposeTrackAnalyzer.cc:226
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
GeneralPurposeTrackAnalyzer::hd0vspt
TH2D * hd0vspt
Definition: GeneralPurposeTrackAnalyzer.cc:228
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
GeneralPurposeTrackAnalyzer::hdxyPV
TH1D * hdxyPV
Definition: GeneralPurposeTrackAnalyzer.cc:248
reco::Vertex
Definition: Vertex.h:35
hit
Definition: SiStripHitEffFromCalibTree.cc:88
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
SiStripDetId::stereo
uint32_t stereo() const
Definition: SiStripDetId.h:168
GeneralPurposeTrackAnalyzer::GeneralPurposeTrackAnalyzer
GeneralPurposeTrackAnalyzer(const edm::ParameterSet &pset)
Definition: GeneralPurposeTrackAnalyzer.cc:88
GeneralPurposeTrackAnalyzer::pixelmap
std::unique_ptr< Phase1PixelMaps > pixelmap
Definition: GeneralPurposeTrackAnalyzer.cc:153
GeneralPurposeTrackAnalyzer::vTrackProfiles_
std::vector< TH1 * > vTrackProfiles_
Definition: GeneralPurposeTrackAnalyzer.cc:255
TrackerGeometry
Definition: TrackerGeometry.h:14
GeneralPurposeTrackAnalyzer::htrkQuality
TH1I * htrkQuality
Definition: GeneralPurposeTrackAnalyzer.cc:158
reco::TrackBase::highPurity
Definition: TrackBase.h:154