Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "DQMOffline/PFTau/interface/METBenchmark.h"
0002 
0003 #include "DataFormats/METReco/interface/MET.h"
0004 
0005 #include "DQMServices/Core/interface/DQMStore.h"
0006 
0007 #include <TFile.h>
0008 #include <TH1.h>
0009 #include <TH2.h>
0010 #include <TROOT.h>
0011 
0012 using namespace std;
0013 
0014 METBenchmark::~METBenchmark() {}
0015 
0016 void METBenchmark::setup(DQMStore::IBooker &b) {
0017   // std::cout << "FL: METBenchmark.cc: start setup()" << std::endl;
0018 
0019   PhaseSpace ptPS(100, 0, 200);
0020   PhaseSpace pt2PS(100, 0, 7000);
0021   PhaseSpace pxPS(100, -100., 100);
0022   PhaseSpace phiPS(50, -3.1416, 3.1416);
0023   PhaseSpace sumEtPS(100, 0, 3000);
0024   PhaseSpace sumEt2PS(100, 0, 7000);
0025   PhaseSpace sumEt3PS(50, 0, 200);
0026   PhaseSpace etOverSumEtPS(100, 0.0, 1.0);
0027 
0028   switch (mode_) {
0029     case DQMOFFLINE:
0030       ptPS = PhaseSpace(200, 0, 200);
0031       pxPS = PhaseSpace(200, -100., 100);
0032       sumEtPS = PhaseSpace(200, 0, 200);
0033       break;
0034     default:
0035       break;
0036   }
0037 
0038   pt_ = book1D(b, "pt_", "pt_;p_{T} [GeV]", ptPS.n, ptPS.m, ptPS.M);
0039   pt2_ = book1D(b, "pt2_", "pt2_;p_{T} [GeV]", pt2PS.n, pt2PS.m, pt2PS.M);
0040   px_ = book1D(b, "px_", "px_;p_{X} [GeV]", pxPS.n, pxPS.m, pxPS.M);
0041   py_ = book1D(b, "py_", "py_;p_{Y} [GeV]", pxPS.n, pxPS.m, pxPS.M);
0042 
0043   // might want to increase the number of bins, to match the size of the ECAL
0044   // crystals
0045   phi_ = book1D(b, "phi_", "phi_;#phi", phiPS.n, phiPS.m, phiPS.M);
0046   sumEt_ = book1D(b, "sumEt_", "sumEt_;#SigmaE_{T} [GeV]", sumEtPS.n, sumEtPS.m, sumEtPS.M);
0047   sumEt2_ = book1D(b, "sumEt2_", "sumEt2_;#SigmaE_{T} [GeV]", sumEt2PS.n, sumEt2PS.m, sumEt2PS.M);
0048   etOverSumEt_ =
0049       book1D(b, "etOverSumEt_", "etOverSumEt_;p_{T}/#SigmaE_{T}", etOverSumEtPS.n, etOverSumEtPS.m, etOverSumEtPS.M);
0050 
0051   mex_VS_sumEt_ = book2D(
0052       b, "mex_VS_sumEt_", ";#SigmaE_{T} [GeV];p_{X} [GeV]", sumEt3PS.n, sumEt3PS.m, sumEt3PS.M, pxPS.n, pxPS.m, pxPS.M);
0053 }
0054 
0055 void METBenchmark::fillOne(const reco::MET &cand) {
0056   if (!isInRange(cand.pt(), cand.eta(), cand.phi()))
0057     return;
0058 
0059   pt_->Fill(cand.pt());
0060   pt2_->Fill(cand.pt());
0061   px_->Fill(cand.px());
0062   py_->Fill(cand.py());
0063   phi_->Fill(cand.phi());
0064   sumEt_->Fill(cand.sumEt());
0065   sumEt2_->Fill(cand.sumEt());
0066   if (cand.sumEt() > 3.0)
0067     etOverSumEt_->Fill(cand.pt() / cand.sumEt());
0068   mex_VS_sumEt_->Fill(cand.sumEt(), cand.px());
0069   mex_VS_sumEt_->Fill(cand.sumEt(), cand.py());
0070 }