Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:09:47

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   struct IPMonitoring {
0036     std::string varname_;
0037     float pTcut_;
0038     dqm::reco::MonitorElement *IP_, *IPErr_;
0039     dqm::reco::MonitorElement *IPVsPhi_, *IPVsEta_;
0040     dqm::reco::MonitorElement *IPErrVsPhi_, *IPErrVsEta_;
0041     dqm::reco::MonitorElement *IPVsEtaVsPhi_, *IPErrVsEtaVsPhi_;
0042 
0043     void bookIPMonitor(DQMStore::IBooker &, const edm::ParameterSet &);
0044   };
0045 
0046 private:
0047   void pvTracksPlots(const reco::Vertex &v);
0048   void vertexPlots(const reco::Vertex &v, const reco::BeamSpot &beamSpot, int i);
0049 
0050   edm::EDGetTokenT<reco::VertexCollection> vertexToken_;
0051   edm::EDGetTokenT<reco::BeamSpot> beamspotToken_;
0052   using VertexScore = edm::ValueMap<float>;
0053   edm::EDGetTokenT<VertexScore> scoreToken_;
0054 
0055   edm::InputTag vertexInputTag_, beamSpotInputTag_;
0056 
0057   edm::ParameterSet conf_;
0058 
0059   std::string dqmLabel;
0060 
0061   std::string TopFolderName_;
0062   std::string AlignmentLabel_;
0063   int ndof_;
0064   bool useHPfoAlignmentPlots_;
0065   bool errorPrinted_;
0066 
0067   static constexpr int cmToUm = 10000;
0068 
0069   // the histos
0070   MonitorElement *nbvtx, *nbgvtx, *nbtksinvtx[2], *trksWeight[2], *score[2];
0071   MonitorElement *tt[2];
0072   MonitorElement *xrec[2], *yrec[2], *zrec[2], *xDiff[2], *yDiff[2], *xerr[2], *yerr[2], *zerr[2];
0073   MonitorElement *xerrVsTrks[2], *yerrVsTrks[2], *zerrVsTrks[2];
0074   MonitorElement *ntracksVsZ[2];
0075   MonitorElement *vtxchi2[2], *vtxndf[2], *vtxprob[2], *nans[2];
0076   MonitorElement *type[2];
0077   MonitorElement *bsX, *bsY, *bsZ, *bsSigmaZ, *bsDxdz, *bsDydz, *bsBeamWidthX, *bsBeamWidthY, *bsType;
0078 
0079   MonitorElement *sumpt, *ntracks, *weight, *chi2ndf, *chi2prob;
0080   MonitorElement *phi_pt1, *eta_pt1;
0081   MonitorElement *phi_pt10, *eta_pt10;
0082 
0083   MonitorElement *dxy2;
0084 
0085   // IP monitoring structs
0086   IPMonitoring dxy_pt1;
0087   IPMonitoring dxy_pt10;
0088 
0089   IPMonitoring dz_pt1;
0090   IPMonitoring dz_pt10;
0091 };
0092 
0093 #endif