Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-07-08 01:45:43

0001 #ifndef PrimaryVertexMonitor_H
0002 #define PrimaryVertexMonitor_H
0003 
0004 #include "FWCore/Utilities/interface/EDGetToken.h"
0005 
0006 #include "FWCore/Framework/interface/Frameworkfwd.h"
0007 #include "FWCore/Framework/interface/Event.h"
0008 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0009 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0010 #include "FWCore/Utilities/interface/InputTag.h"
0011 #include "DataFormats/Common/interface/ValueMap.h"
0012 #include "DataFormats/Common/interface/Association.h"
0013 
0014 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0015 #include "DQMServices/Core/interface/DQMStore.h"
0016 
0017 #include "DataFormats/VertexReco/interface/Vertex.h"
0018 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0019 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0020 
0021 /** \class PrimaryVertexMonitor
0022  *
0023  *
0024  */
0025 
0026 class PrimaryVertexMonitor : public DQMEDAnalyzer {
0027 public:
0028   explicit PrimaryVertexMonitor(const edm::ParameterSet &pSet);
0029 
0030   ~PrimaryVertexMonitor() override = default;
0031 
0032   void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
0033   void analyze(const edm::Event &, const edm::EventSetup &) override;
0034 
0035 private:
0036   void pvTracksPlots(const reco::Vertex &v);
0037   void vertexPlots(const reco::Vertex &v, const reco::BeamSpot &beamSpot, int i);
0038 
0039   edm::EDGetTokenT<reco::VertexCollection> vertexToken_;
0040   edm::EDGetTokenT<reco::BeamSpot> beamspotToken_;
0041   using VertexScore = edm::ValueMap<float>;
0042   edm::EDGetTokenT<VertexScore> scoreToken_;
0043 
0044   edm::InputTag vertexInputTag_, beamSpotInputTag_;
0045 
0046   edm::ParameterSet conf_;
0047 
0048   std::string dqmLabel;
0049 
0050   std::string TopFolderName_;
0051   std::string AlignmentLabel_;
0052   int ndof_;
0053   bool useHPfoAlignmentPlots_;
0054   bool errorPrinted_;
0055 
0056   static constexpr int cmToUm = 10000;
0057 
0058   // the histos
0059   MonitorElement *nbvtx, *nbgvtx, *nbtksinvtx[2], *trksWeight[2], *score[2];
0060   MonitorElement *tt[2];
0061   MonitorElement *xrec[2], *yrec[2], *zrec[2], *xDiff[2], *yDiff[2], *xerr[2], *yerr[2], *zerr[2];
0062   MonitorElement *xerrVsTrks[2], *yerrVsTrks[2], *zerrVsTrks[2];
0063   MonitorElement *ntracksVsZ[2];
0064   MonitorElement *vtxchi2[2], *vtxndf[2], *vtxprob[2], *nans[2];
0065   MonitorElement *type[2];
0066   MonitorElement *bsX, *bsY, *bsZ, *bsSigmaZ, *bsDxdz, *bsDydz, *bsBeamWidthX, *bsBeamWidthY, *bsType;
0067 
0068   MonitorElement *sumpt, *ntracks, *weight, *chi2ndf, *chi2prob;
0069   MonitorElement *dxy, *dxy2, *dz, *dxyErr, *dzErr;
0070   MonitorElement *phi_pt1, *eta_pt1;
0071   MonitorElement *phi_pt10, *eta_pt10;
0072   MonitorElement *dxyVsPhi_pt1, *dzVsPhi_pt1;
0073   MonitorElement *dxyVsEta_pt1, *dzVsEta_pt1;
0074   MonitorElement *dxyVsEtaVsPhi_pt1, *dzVsEtaVsPhi_pt1;
0075   MonitorElement *dxyVsPhi_pt10, *dzVsPhi_pt10;
0076   MonitorElement *dxyVsEta_pt10, *dzVsEta_pt10;
0077   MonitorElement *dxyVsEtaVsPhi_pt10, *dzVsEtaVsPhi_pt10;
0078 };
0079 
0080 #endif