DiMuonVertexMonitor

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 114 115
#ifndef DQMOffline_Alignment_DiMuonVertexMonitor_H
#define DQMOffline_Alignment_DiMuonVertexMonitor_H

// -*- C++ -*-
//
// Package:    DiMuonVertexMonitor
// Class:      DiMuonVertexMonitor
//
/**\class DiMuonVertexMonitor DiMuonVertexMonitor.cc
   DQM/TrackerMonitorTrack/src/DiMuonVertexMonitor.cc
   Monitoring  quantities related to the DiMuon vertex during Tracker Alignment AlCaReco Production
*/

// system includes
#include <string>

// user includes
#include "DQMOffline/Alignment/interface/DiLeptonPlotHelpers.h"
#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
#include "DQMServices/Core/interface/DQMStore.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 "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/VertexReco/interface/VertexFwd.h"
#include "RecoVertex/VertexPrimitives/interface/TransientVertex.h"
#include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
#include "TrackingTools/Records/interface/TransientTrackRecord.h"

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

  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);

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

private:
  const reco::Vertex *findClosestVertex(const TransientVertex aTransVtx, const reco::VertexCollection *vertices) const;

  // ----------member data ---------------------------
  const edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> ttbESToken_;

  //used to select what tracks to read from configuration file
  const edm::EDGetTokenT<reco::TrackCollection> tracksToken_;
  //used to select what vertices to read from configuration file
  const edm::EDGetTokenT<reco::VertexCollection> vertexToken_;

  const std::string motherName_;
  const std::string MEFolderName_;  // Top-level folder name
  const bool useClosestVertex_;

  std::pair<float, float> massLimits_; /* for the mass plot x-range */
  const float maxSVdist_;

  // vertex quantities
  MonitorElement *hSVProb_;
  MonitorElement *hSVChi2_;
  MonitorElement *hSVNormChi2_;

  MonitorElement *hSVDist_;
  MonitorElement *hSVDistErr_;
  MonitorElement *hSVDistSig_;
  MonitorElement *hSVCompatibility_;

  MonitorElement *hSVDist3D_;
  MonitorElement *hSVDist3DErr_;
  MonitorElement *hSVDist3DSig_;
  MonitorElement *hSVCompatibility3D_;

  MonitorElement *hCosPhi_;
  MonitorElement *hCosPhi3D_;
  MonitorElement *hCosPhiInv_;
  MonitorElement *hCosPhiInv3D_;
  MonitorElement *hCosPhiUnbalance_;
  MonitorElement *hCosPhi3DUnbalance_;
  MonitorElement *hInvMass_;
  MonitorElement *hCutFlow_;

  // 2D histograms of pointing angle vs variable
  edm::ParameterSet CosPhi3DConfiguration_;
  DiLepPlotHelp::PlotsVsKinematics CosPhi3DPlots_ = DiLepPlotHelp::PlotsVsKinematics(DiLepPlotHelp::MM);

  // 2D histograms of 3D PV-SV distance vs variable
  edm::ParameterSet SVDistConfiguration_;
  DiLepPlotHelp::PlotsVsKinematics SVDistPlots_ = DiLepPlotHelp::PlotsVsKinematics(DiLepPlotHelp::MM);

  // 2D histograms of 3D PV-SV distance significance vs variable
  edm::ParameterSet SVDistSigConfiguration_;
  DiLepPlotHelp::PlotsVsKinematics SVDistSigPlots_ = DiLepPlotHelp::PlotsVsKinematics(DiLepPlotHelp::MM);

  // 2D histograms of PV-SV transverse distance vs variable
  edm::ParameterSet SVDist3DConfiguration_;
  DiLepPlotHelp::PlotsVsKinematics SVDist3DPlots_ = DiLepPlotHelp::PlotsVsKinematics(DiLepPlotHelp::MM);

  // 2D histograms of PV-SV transverse distance significance vs variable
  edm::ParameterSet SVDist3DSigConfiguration_;
  DiLepPlotHelp::PlotsVsKinematics SVDist3DSigPlots_ = DiLepPlotHelp::PlotsVsKinematics(DiLepPlotHelp::MM);

  // impact parameters information
  MonitorElement *hdxy_;
  MonitorElement *hdz_;
  MonitorElement *hdxyErr_;
  MonitorElement *hdzErr_;
  MonitorElement *hIP2d_;
  MonitorElement *hIP3d_;
  MonitorElement *hIP2dsig_;
  MonitorElement *hIP3dsig_;
};
#endif