Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "DQMOffline/Trigger/plugins/HTDQM.h"
0002 
0003 HTDQM::HTDQM() = default;
0004 
0005 HTDQM::~HTDQM() = default;
0006 
0007 void HTDQM::initialise(const edm::ParameterSet& iConfig) {
0008   ht_variable_binning_ =
0009       iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("htBinning");
0010   met_variable_binning_ =
0011       iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("metBinning2");
0012   ht_binning_ =
0013       getHistoPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("htPSet"));
0014   ls_binning_ =
0015       getHistoPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("htlsPSet"));
0016 }
0017 
0018 void HTDQM::bookHistograms(DQMStore::IBooker& ibooker) {
0019   std::string histname, histtitle;
0020 
0021   histname = "ht_variable";
0022   histtitle = "PFHT";
0023   bookME(ibooker, htME_variableBinning_, histname, histtitle, ht_variable_binning_);
0024   setMETitle(htME_variableBinning_, "PF HT [GeV]", "events / [GeV]");
0025 
0026   histname = "htVsMET";
0027   histtitle = "PFHT vs PFMET";
0028   bookME(ibooker, htVsMET_, histname, histtitle, met_variable_binning_, ht_variable_binning_);
0029   setMETitle(htVsMET_, "PF MET [GeV]", "PF HT [GeV]");
0030 
0031   histname = "htVsLS";
0032   histtitle = "PFHT vs LS";
0033   bookME(ibooker,
0034          htVsLS_,
0035          histname,
0036          histtitle,
0037          ls_binning_.nbins,
0038          ls_binning_.xmin,
0039          ls_binning_.xmax,
0040          ht_binning_.xmin,
0041          ht_binning_.xmax);
0042   setMETitle(htVsLS_, "LS", "PF HT [GeV]");
0043 }
0044 
0045 void HTDQM::fillHistograms(const std::vector<reco::PFJet>& htjets,
0046                            const double& met,
0047                            const int& ls,
0048                            const bool passCond) {
0049   // filling histograms (denominator)
0050   double htSum = 0;
0051   for (auto const& htjet : htjets) {
0052     htSum += htjet.pt();
0053   }
0054 
0055   htME_variableBinning_.denominator->Fill(htSum);
0056 
0057   htVsMET_.denominator->Fill(met, htSum);
0058   htVsLS_.denominator->Fill(ls, htSum);
0059 
0060   // applying selection for numerator
0061   if (passCond) {
0062     // filling histograms (num_genTriggerEventFlag_)
0063     htME_variableBinning_.numerator->Fill(htSum);
0064     htVsMET_.numerator->Fill(met, htSum);
0065     htVsLS_.numerator->Fill(ls, htSum);
0066   }
0067 }
0068 
0069 void HTDQM::fillHtDescription(edm::ParameterSetDescription& histoPSet) {
0070   edm::ParameterSetDescription htPSet;
0071   fillHistoPSetDescription(htPSet);
0072   histoPSet.add<edm::ParameterSetDescription>("htPSet", htPSet);
0073 
0074   std::vector<double> bins = {0.,   50.,  100., 150., 200., 250., 300., 350.,  400.,  450.,  500.,
0075                               550., 600., 650., 700., 750., 800., 900., 1000., 1200., 1500., 2000.};
0076   histoPSet.add<std::vector<double> >("htBinning", bins);
0077 
0078   std::vector<double> metbins = {0.,   20.,  40.,  60.,  80.,  100., 120., 140., 160., 180., 200., 220.,
0079                                  240., 260., 280., 300., 320., 340., 360., 380., 400., 450., 500., 1000.};
0080   histoPSet.add<std::vector<double> >("metBinning2", metbins);
0081 
0082   edm::ParameterSetDescription lsPSet;
0083   fillHistoLSPSetDescription(lsPSet);
0084   histoPSet.add<edm::ParameterSetDescription>("htlsPSet", lsPSet);
0085 }