VertexMonitor

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
#ifndef VertexMonitor_H
#define VertexMonitor_H
// -*- C++ -*-
//
//
/**\class VertexMonitor VertexMonitor.cc
Monitoring source for general quantities related to vertex
*/

// system include files
#include <memory>

// user include files
#include "FWCore/Utilities/interface/EDGetToken.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/VertexReco/interface/VertexFwd.h"

class GetLumi;

class VertexMonitor {
public:
  typedef dqm::legacy::DQMStore DQMStore;
  typedef dqm::legacy::MonitorElement MonitorElement;

  VertexMonitor(const edm::ParameterSet&, const edm::InputTag&, const edm::InputTag&, std::string pvLabel);
  VertexMonitor(const edm::ParameterSet&,
                const edm::InputTag&,
                const edm::InputTag&,
                std::string pvLabel,
                edm::ConsumesCollector& iC);

  virtual ~VertexMonitor();
  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

  virtual void initHisto(DQMStore::IBooker& ibooker);
  virtual void analyze(const edm::Event&, const edm::EventSetup&);

  // ----------member data ---------------------------

  edm::ParameterSet conf_;

  edm::InputTag primaryVertexInputTag_;
  edm::InputTag selectedPrimaryVertexInputTag_;
  std::string label_;

  edm::EDGetTokenT<reco::VertexCollection> pvToken_;
  edm::EDGetTokenT<reco::VertexCollection> selpvToken_;

  GetLumi* lumiDetails_;

  MonitorElement* NumberOfPVtx;
  MonitorElement* NumberOfPVtxVsBXlumi;
  MonitorElement* NumberOfPVtxVsGoodPVtx;
  MonitorElement* NumberOfGoodPVtx;
  MonitorElement* NumberOfGoodPVtxVsBXlumi;
  MonitorElement* FractionOfGoodPVtx;
  MonitorElement* FractionOfGoodPVtxVsBXlumi;
  MonitorElement* FractionOfGoodPVtxVsGoodPVtx;
  MonitorElement* FractionOfGoodPVtxVsPVtx;
  MonitorElement* NumberOfFakePVtx;
  MonitorElement* NumberOfFakePVtxVsBXlumi;
  MonitorElement* NumberOfFakePVtxVsGoodPVtx;
  MonitorElement* NumberOfBADndofPVtx;
  MonitorElement* NumberOfBADndofPVtxVsBXlumi;
  MonitorElement* NumberOfBADndofPVtxVsGoodPVtx;

  MonitorElement* Chi2oNDFVsGoodPVtx;
  MonitorElement* Chi2oNDFVsBXlumi;
  MonitorElement* Chi2ProbVsGoodPVtx;
  MonitorElement* Chi2ProbVsBXlumi;

  MonitorElement* GoodPVtxSumPt;
  MonitorElement* GoodPVtxSumPtVsBXlumi;
  MonitorElement* GoodPVtxSumPtVsGoodPVtx;

  MonitorElement* GoodPVtxNumberOfTracks;
  MonitorElement* GoodPVtxNumberOfTracksVsBXlumi;
  MonitorElement* GoodPVtxNumberOfTracksVsGoodPVtx;
  MonitorElement* GoodPVtxNumberOfTracksVsGoodPVtxNdof;

  MonitorElement* GoodPVtxChi2oNDFVsGoodPVtx;
  MonitorElement* GoodPVtxChi2oNDFVsBXlumi;
  MonitorElement* GoodPVtxChi2ProbVsGoodPVtx;
  MonitorElement* GoodPVtxChi2ProbVsBXlumi;

  bool doAllPlots_;
  bool doPlotsVsBXlumi_;
  bool doPlotsVsGoodPVtx_;

  std::string histname;  //for naming the histograms according to algorithm used
};
#endif