CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/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 pxPS(100,-100.,100);
00028   PhaseSpace phiPS(50, -3.1416, 3.1416);
00029   PhaseSpace sumEtPS(100, 0, 3000);
00030 
00031   switch(mode_) {
00032   case DQMOFFLINE:
00033     ptPS = PhaseSpace(100, 0, 3000);
00034     break;
00035   default:
00036     break;
00037   }
00038 
00039   pt_ = book1D("pt_", "pt_;p_{T} (GeV)", ptPS.n, ptPS.m, ptPS.M);
00040   px_ = book1D("px_", "px_;p_{X} (GeV)", pxPS.n, pxPS.m, pxPS.M);
00041 
00042   // might want to increase the number of bins, to match the size of the ECAL crystals
00043   phi_ = book1D("phi_", "phi_;#phi", phiPS.n, phiPS.m, phiPS.M);
00044   sumEt_ = book1D("sumEt_", "sumEt_;#sumE_{T}", sumEtPS.n, sumEtPS.m, sumEtPS.M);
00045 }
00046 
00047 
00048 void METBenchmark::fillOne(const reco::MET& cand) {
00049 
00050   if( !isInRange(cand.pt(), cand.eta(), cand.phi() ) ) return;
00051 
00052   pt_->Fill( cand.pt() );
00053   px_->Fill( cand.px() );
00054   px_->Fill( cand.py() );
00055   phi_->Fill( cand.phi() );
00056   sumEt_->Fill( cand.sumEt() );
00057 }