TrackSplittingMonitor

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
#ifndef TrackSplittingMonitor_H
#define TrackSplittingMonitor_H
// -*- C++ -*-
//
// Package:    TrackSplittingMonitor
// Class:      TrackSplittingMonitor
//
/**\class TrackSplittingMonitor TrackSplittingMonitor.cc DQM/TrackingMonitor/src/TrackSplittingMonitor.cc
 Monitoring source for general quantities related to tracks.
 */
// Original Author:  Nhan Tran
//         Created:  Thu 28 22:45:30 CEST 2008

#include <fstream>
#include <memory>
#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/EDGetToken.h"
#include "Geometry/CSCGeometry/interface/CSCGeometry.h"
#include "Geometry/DTGeometry/interface/DTGeometry.h"
#include "Geometry/RPCGeometry/interface/RPCGeometry.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"
#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
#include "MagneticField/Engine/interface/MagneticField.h"
#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
#include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h"

class TProfile;

#include "DataFormats/MuonReco/interface/Muon.h"
#include "DataFormats/MuonReco/interface/MuonFwd.h"

class TrackSplittingMonitor : public DQMEDAnalyzer {
public:
  explicit TrackSplittingMonitor(const edm::ParameterSet&);
  ~TrackSplittingMonitor() override = default;

  void analyze(const edm::Event&, const edm::EventSetup&) override;
  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
  void doProfileX(TH2* th2, MonitorElement* me);
  void doProfileX(MonitorElement* th2m, MonitorElement* me);

  // ----------member data ---------------------------
  static constexpr double cmToUm = 10.e4;
  static constexpr double radToUrad = 10.e3;
  static constexpr double sqrt2 = 1.41421356237;

  std::string histname;  //for naming the histograms according to algorithm used
  edm::ParameterSet conf_;

  const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> mfToken_;
  const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> tkGeomToken_;
  const edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
  const edm::ESGetToken<CSCGeometry, MuonGeometryRecord> cscGeomToken_;
  const edm::ESGetToken<RPCGeometry, MuonGeometryRecord> rpcGeomToken_;

  const TrackerGeometry* theGeometry;
  const MagneticField* theMagField;
  const DTGeometry* dtGeometry;
  const CSCGeometry* cscGeometry;
  const RPCGeometry* rpcGeometry;

  const edm::EDGetTokenT<std::vector<reco::Track> > splitTracksToken_;
  const edm::EDGetTokenT<std::vector<reco::Muon> > splitMuonsToken_;

  const bool plotMuons_;
  const int pixelHitsPerLeg_;
  const int totalHitsPerLeg_;
  const double d0Cut_;
  const double dzCut_;
  const double ptCut_;
  const double norchiCut_;

  // histograms
  MonitorElement* ddxyAbsoluteResiduals_tracker_;
  MonitorElement* ddzAbsoluteResiduals_tracker_;
  MonitorElement* dphiAbsoluteResiduals_tracker_;
  MonitorElement* dthetaAbsoluteResiduals_tracker_;
  MonitorElement* dptAbsoluteResiduals_tracker_;
  MonitorElement* dcurvAbsoluteResiduals_tracker_;

  MonitorElement* ddxyNormalizedResiduals_tracker_;
  MonitorElement* ddzNormalizedResiduals_tracker_;
  MonitorElement* dphiNormalizedResiduals_tracker_;
  MonitorElement* dthetaNormalizedResiduals_tracker_;
  MonitorElement* dptNormalizedResiduals_tracker_;
  MonitorElement* dcurvNormalizedResiduals_tracker_;

  MonitorElement* ddxyAbsoluteResiduals_global_;
  MonitorElement* ddzAbsoluteResiduals_global_;
  MonitorElement* dphiAbsoluteResiduals_global_;
  MonitorElement* dthetaAbsoluteResiduals_global_;
  MonitorElement* dptAbsoluteResiduals_global_;
  MonitorElement* dcurvAbsoluteResiduals_global_;

  MonitorElement* ddxyNormalizedResiduals_global_;
  MonitorElement* ddzNormalizedResiduals_global_;
  MonitorElement* dphiNormalizedResiduals_global_;
  MonitorElement* dthetaNormalizedResiduals_global_;
  MonitorElement* dptNormalizedResiduals_global_;
  MonitorElement* dcurvNormalizedResiduals_global_;
};
#endif