CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/DQMOffline/PFTau/src/METBenchmark.cc

Go to the documentation of this file.
00001 #include "DQMOffline/PFTau/interface/METBenchmark.h"
00002 
00003 #include "DataFormats/METReco/interface/MET.h"
00004 
00005 
00006 #include "DQMServices/Core/interface/MonitorElement.h"
00007 #include "DQMServices/Core/interface/DQMStore.h"
00008 
00009 #include <TROOT.h>
00010 #include <TFile.h>
00011 #include <TH1.h>
00012 #include <TH2.h>
00013 
00014 
00015 using namespace std;
00016 
00017 
00018 
00019 METBenchmark::~METBenchmark() {}
00020 
00021 
00022 void METBenchmark::setup() {
00023 
00024   //std::cout << "FL: METBenchmark.cc: start setup()" << std::endl;
00025 
00026   PhaseSpace ptPS(100,0,200);
00027   PhaseSpace pt2PS(100,0,7000);
00028   PhaseSpace pxPS(100,-100.,100);
00029   PhaseSpace phiPS(50, -3.1416, 3.1416);
00030   PhaseSpace sumEtPS(100, 0, 3000);
00031   PhaseSpace sumEt2PS(100, 0, 7000);
00032   PhaseSpace sumEt3PS(50, 0, 200);
00033   PhaseSpace etOverSumEtPS(100, 0.0, 1.0);
00034 
00035   switch(mode_) {
00036   case DQMOFFLINE:
00037     ptPS = PhaseSpace(200, 0, 200);
00038     pxPS = PhaseSpace(200,-100.,100);
00039     sumEtPS = PhaseSpace(200, 0, 200);
00040     break;
00041   default:
00042     break;
00043   }
00044 
00045   pt_ = book1D("pt_", "pt_;p_{T} [GeV]", ptPS.n, ptPS.m, ptPS.M);
00046   pt2_ = book1D("pt2_", "pt2_;p_{T} [GeV]", pt2PS.n, pt2PS.m, pt2PS.M);
00047   px_ = book1D("px_", "px_;p_{X} [GeV]", pxPS.n, pxPS.m, pxPS.M);
00048   py_ = book1D("py_", "py_;p_{Y} [GeV]", pxPS.n, pxPS.m, pxPS.M);
00049 
00050   // might want to increase the number of bins, to match the size of the ECAL crystals
00051   phi_ = book1D("phi_", "phi_;#phi", phiPS.n, phiPS.m, phiPS.M);
00052   sumEt_ = book1D("sumEt_", "sumEt_;#SigmaE_{T} [GeV]", sumEtPS.n, sumEtPS.m, sumEtPS.M);
00053   sumEt2_ = book1D("sumEt2_", "sumEt2_;#SigmaE_{T} [GeV]", sumEt2PS.n, sumEt2PS.m, sumEt2PS.M);
00054   etOverSumEt_ = book1D("etOverSumEt_", "etOverSumEt_;p_{T}/#SigmaE_{T}", etOverSumEtPS.n, etOverSumEtPS.m, etOverSumEtPS.M);
00055 
00056   mex_VS_sumEt_= book2D("mex_VS_sumEt_", 
00057                         ";#SigmaE_{T} [GeV];p_{X} [GeV]",
00058                         sumEt3PS.n, sumEt3PS.m, sumEt3PS.M,
00059                         pxPS.n, pxPS.m, pxPS.M );
00060 }
00061 
00062 
00063 void METBenchmark::fillOne(const reco::MET& cand) {
00064 
00065   if( !isInRange(cand.pt(), cand.eta(), cand.phi() ) ) return;
00066 
00067   pt_->Fill( cand.pt() );
00068   pt2_->Fill( cand.pt() );
00069   px_->Fill( cand.px() );
00070   py_->Fill( cand.py() );
00071   phi_->Fill( cand.phi() );
00072   sumEt_->Fill( cand.sumEt() );
00073   sumEt2_->Fill( cand.sumEt() );
00074   if (cand.sumEt()>3.0) etOverSumEt_->Fill( cand.pt()/cand.sumEt() );
00075   mex_VS_sumEt_->Fill( cand.sumEt(), cand.px() );
00076   mex_VS_sumEt_->Fill( cand.sumEt(), cand.py() );
00077 }