Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:12:16

0001 #ifndef LUMIMONITOR_H
0002 #define LUMIMONITOR_H
0003 
0004 #include <string>
0005 #include <vector>
0006 #include <map>
0007 
0008 #include "FWCore/Utilities/interface/EDGetToken.h"
0009 #include "FWCore/Framework/interface/Frameworkfwd.h"
0010 #include "FWCore/Framework/interface/Event.h"
0011 #include "FWCore/Framework/interface/MakerMacros.h"
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013 #include "FWCore/ServiceRegistry/interface/Service.h"
0014 #include "DQMServices/Core/interface/DQMStore.h"
0015 #include <DQMServices/Core/interface/DQMEDAnalyzer.h>
0016 
0017 #include "DataFormats/Candidate/interface/Candidate.h"
0018 #include "DataFormats/Candidate/interface/VertexCompositeCandidate.h"
0019 #include "DataFormats/V0Candidate/interface/V0Candidate.h"
0020 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
0021 
0022 #include "DataFormats/VertexReco/interface/Vertex.h"
0023 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0024 
0025 #include "DataFormats/Scalers/interface/LumiScalers.h"
0026 #include "DataFormats/OnlineMetaData/interface/OnlineLuminosityRecord.h"
0027 
0028 class GenericTriggerEventFlag;
0029 
0030 struct MEbinning {
0031   int nbins;
0032   double xmin;
0033   double xmax;
0034 };
0035 
0036 //
0037 // class declaration
0038 //
0039 
0040 class V0Monitor : public DQMEDAnalyzer {
0041 public:
0042   typedef dqm::legacy::DQMStore DQMStore;
0043   typedef dqm::legacy::MonitorElement MonitorElement;
0044 
0045   V0Monitor(const edm::ParameterSet&);
0046   ~V0Monitor() override;
0047 
0048 protected:
0049   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0050   MonitorElement* bookHisto1D(DQMStore::IBooker& ibooker,
0051                               std::string name,
0052                               std::string title,
0053                               std::string xaxis,
0054                               std::string yaxis,
0055                               MEbinning binning);
0056   MonitorElement* bookHisto2D(DQMStore::IBooker& ibooker,
0057                               std::string name,
0058                               std::string title,
0059                               std::string xaxis,
0060                               std::string yaxis,
0061                               MEbinning xbinning,
0062                               MEbinning ybinning);
0063   MonitorElement* bookProfile(DQMStore::IBooker& ibooker,
0064                               std::string name,
0065                               std::string title,
0066                               std::string xaxis,
0067                               std::string yaxis,
0068                               MEbinning xbinning,
0069                               MEbinning ybinning);
0070   void analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) override;
0071 
0072 private:
0073   void getHistoPSet(edm::ParameterSet pset, MEbinning& mebinning);
0074 
0075   std::string folderName_;
0076 
0077   edm::EDGetTokenT<reco::VertexCompositeCandidateCollection> v0Token_;
0078   edm::EDGetTokenT<reco::BeamSpot> bsToken_;
0079   edm::EDGetTokenT<reco::VertexCollection> pvToken_;
0080   edm::EDGetTokenT<LumiScalersCollection> lumiscalersToken_;
0081   edm::EDGetTokenT<OnlineLuminosityRecord> metaDataToken_;
0082 
0083   const bool forceSCAL_;
0084 
0085   int pvNDOF_;
0086 
0087   GenericTriggerEventFlag* genTriggerEventFlag_;
0088 
0089   MonitorElement* v0_N_;
0090   MonitorElement* v0_mass_;
0091   MonitorElement* v0_pt_;
0092   MonitorElement* v0_eta_;
0093   MonitorElement* v0_phi_;
0094   MonitorElement* v0_Lxy_;
0095   MonitorElement* v0_Lxy_wrtBS_;
0096   MonitorElement* v0_chi2oNDF_;
0097   MonitorElement* v0_mass_vs_p_;
0098   MonitorElement* v0_mass_vs_pt_;
0099   MonitorElement* v0_mass_vs_eta_;
0100   MonitorElement* v0_deltaMass_;
0101   MonitorElement* v0_deltaMass_vs_pt_;
0102   MonitorElement* v0_deltaMass_vs_eta_;
0103 
0104   MonitorElement* v0_Lxy_vs_deltaMass_;
0105   MonitorElement* v0_Lxy_vs_pt_;
0106   MonitorElement* v0_Lxy_vs_eta_;
0107 
0108   MonitorElement* n_vs_BX_;
0109   MonitorElement* v0_N_vs_BX_;
0110   MonitorElement* v0_mass_vs_BX_;
0111   MonitorElement* v0_Lxy_vs_BX_;
0112   MonitorElement* v0_deltaMass_vs_BX_;
0113 
0114   MonitorElement* n_vs_lumi_;
0115   MonitorElement* v0_N_vs_lumi_;
0116   MonitorElement* v0_mass_vs_lumi_;
0117   MonitorElement* v0_Lxy_vs_lumi_;
0118   MonitorElement* v0_deltaMass_vs_lumi_;
0119 
0120   MonitorElement* n_vs_PU_;
0121   MonitorElement* v0_N_vs_PU_;
0122   MonitorElement* v0_mass_vs_PU_;
0123   MonitorElement* v0_Lxy_vs_PU_;
0124   MonitorElement* v0_deltaMass_vs_PU_;
0125 
0126   MonitorElement* n_vs_LS_;
0127   MonitorElement* v0_N_vs_LS_;
0128 
0129   MEbinning mass_binning_;
0130   MEbinning pt_binning_;
0131   MEbinning eta_binning_;
0132   MEbinning Lxy_binning_;
0133   MEbinning chi2oNDF_binning_;
0134   MEbinning lumi_binning_;
0135   MEbinning pu_binning_;
0136   MEbinning ls_binning_;
0137 };
0138 
0139 #endif  // LUMIMONITOR_H