Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:13:26

0001 #include "DQMOffline/Trigger/plugins/HMesonGammaDQM.h"
0002 #include "DataFormats/Math/interface/deltaR.h"
0003 
0004 HMesonGammaDQM::HMesonGammaDQM() = default;
0005 
0006 HMesonGammaDQM::~HMesonGammaDQM() = default;
0007 
0008 void HMesonGammaDQM::initialise(const edm::ParameterSet& iConfig) {
0009   gammapt_variable_binning_ =
0010       iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("gammaptBinning");
0011   mesonpt_variable_binning_ =
0012       iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("mesonptBinning");
0013   eta_binning_ =
0014       getHistoPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("hmgetaPSet"));
0015   ls_binning_ =
0016       getHistoPSet(iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet>("hmglsPSet"));
0017 }
0018 
0019 void HMesonGammaDQM::bookHistograms(DQMStore::IBooker& ibooker) {
0020   std::string histname, histtitle;
0021 
0022   histname = "gammapt";
0023   histtitle = "Gamma pT";
0024   bookME(ibooker, gammaptME_, histname, histtitle, gammapt_variable_binning_);
0025   setMETitle(gammaptME_, "Gamma p_{T} [GeV]", "events / [GeV]");
0026 
0027   histname = "mesonpt";
0028   histtitle = "Meson pT";
0029   bookME(ibooker, mesonptME_, histname, histtitle, mesonpt_variable_binning_);
0030   setMETitle(mesonptME_, "Meson p_{T} [GeV]", "events / [GeV]");
0031 
0032   histname = "gammaeta";
0033   histtitle = "Gamma eta";
0034   bookME(ibooker, gammaetaME_, histname, histtitle, eta_binning_.nbins, eta_binning_.xmin, eta_binning_.xmax);
0035   setMETitle(gammaetaME_, "Gamma #eta", "events");
0036 
0037   histname = "mesoneta";
0038   histtitle = "Meson eta";
0039   bookME(ibooker, mesonetaME_, histname, histtitle, eta_binning_.nbins, eta_binning_.xmin, eta_binning_.xmax);
0040   setMETitle(mesonetaME_, "Meson #eta", "events");
0041 
0042   histname = "gammaetaVsLS";
0043   histtitle = "Gamma eta vs LS";
0044   bookME(ibooker,
0045          gammaetaVsLS_,
0046          histname,
0047          histtitle,
0048          ls_binning_.nbins,
0049          ls_binning_.xmin,
0050          ls_binning_.xmax,
0051          eta_binning_.xmin,
0052          eta_binning_.xmax);
0053   setMETitle(gammaetaVsLS_, "LS", "Gamma #eta");
0054 }
0055 
0056 void HMesonGammaDQM::fillHistograms(const reco::PhotonCollection& photons,
0057                                     const std::vector<TLorentzVector>& mesons,
0058                                     const int ls,
0059                                     const bool passCond) {
0060   // filling histograms (denominator)
0061   if (!photons.empty()) {
0062     double eta1 = photons[0].eta();
0063     gammaptME_.denominator->Fill(photons[0].pt());
0064     gammaetaME_.denominator->Fill(eta1);
0065     gammaetaVsLS_.denominator->Fill(ls, eta1);
0066   }
0067   if (!mesons.empty()) {
0068     double eta2 = mesons[0].Eta();
0069     mesonptME_.denominator->Fill(mesons[0].Pt());
0070     mesonetaME_.denominator->Fill(eta2);
0071   }
0072 
0073   // applying selection for numerator
0074   if (passCond) {
0075     if (!photons.empty()) {
0076       double eta1 = photons[0].eta();
0077       gammaptME_.numerator->Fill(photons[0].pt());
0078       gammaetaME_.numerator->Fill(eta1);
0079       gammaetaVsLS_.numerator->Fill(ls, eta1);
0080     }
0081     if (!mesons.empty()) {
0082       double eta2 = mesons[0].Eta();
0083       mesonptME_.numerator->Fill(mesons[0].Pt());
0084       mesonetaME_.numerator->Fill(eta2);
0085     }
0086   }
0087 }
0088 
0089 void HMesonGammaDQM::fillHmgDescription(edm::ParameterSetDescription& histoPSet) {
0090   edm::ParameterSetDescription hmgetaPSet;
0091   fillHistoPSetDescription(hmgetaPSet);
0092   histoPSet.add<edm::ParameterSetDescription>("hmgetaPSet", hmgetaPSet);
0093 
0094   std::vector<double> pt1bins = {0.,   20.,  40.,  60.,  80.,  90.,  100., 110., 120., 130., 140., 150.,  160.,
0095                                  180., 210., 240., 270., 300., 330., 360., 400., 450., 500., 750., 1000., 1500.};
0096   histoPSet.add<std::vector<double> >("gammaptBinning", pt1bins);
0097 
0098   std::vector<double> pt2bins = {0.,   20.,  40.,  45.,  50.,  55.,  60.,  65.,  70.,  80.,  90.,  100.,
0099                                  110., 120., 150., 180., 210., 240., 270., 300., 350., 400., 1000.};
0100   histoPSet.add<std::vector<double> >("mesonptBinning", pt2bins);
0101 
0102   edm::ParameterSetDescription lsPSet;
0103   fillHistoLSPSetDescription(lsPSet);
0104   histoPSet.add<edm::ParameterSetDescription>("hmglsPSet", lsPSet);
0105 }