diff --git a/[refs] b/[refs] index 52bd5003e0678..5aafe1384a193 100644 --- a/[refs] +++ b/[refs] @@ -1,3 +1,3 @@ --- refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e -"refs/heads/CMSSW_7_1_X": e4cd4e5081bd6fae2370f1dae9fc58586828ef39 +"refs/heads/CMSSW_7_1_X": c9bd21f0ac70a7da6b892874d6bbb5f14a5f8764 diff --git a/trunk/DQMOffline/PFTau/interface/MatchMETBenchmark.h b/trunk/DQMOffline/PFTau/interface/MatchMETBenchmark.h new file mode 100644 index 0000000000000..310cf9498a14b --- /dev/null +++ b/trunk/DQMOffline/PFTau/interface/MatchMETBenchmark.h @@ -0,0 +1,42 @@ +#ifndef RecoParticleFlow_Benchmark_MatchMETBenchmark_h +#define RecoParticleFlow_Benchmark_MatchMETBenchmark_h + +#include "DQMOffline/PFTau/interface/Benchmark.h" + +#include "DataFormats/Candidate/interface/CandidateFwd.h" +#include "DataFormats/Candidate/interface/Candidate.h" + +#include "DataFormats/METReco/interface/METFwd.h" + +#include + +class MatchMETBenchmark : public Benchmark { + + public: + + MatchMETBenchmark(Mode mode) : Benchmark(mode) {} + virtual ~MatchMETBenchmark(); + + /// book histograms + void setup(); + + /// fill histograms with a given particle + void fillOne( const reco::MET& candidate, + const reco::MET& matchedCandidate ); + + + protected: + + TH2F* delta_et_Over_et_VS_et_; + TH2F* delta_et_VS_et_; + TH2F* delta_phi_VS_et_; + TH1F* delta_ex_; + TH2F* RecEt_VS_TrueEt_; + TH2F* delta_set_VS_set_; + TH2F* delta_set_Over_set_VS_set_; + TH2F* delta_ex_VS_set_; + TH2F* RecSet_Over_TrueSet_VS_TrueSet_; + +}; + +#endif diff --git a/trunk/DQMOffline/PFTau/src/MatchMETBenchmark.cc b/trunk/DQMOffline/PFTau/src/MatchMETBenchmark.cc new file mode 100644 index 0000000000000..3038a37cbb2e3 --- /dev/null +++ b/trunk/DQMOffline/PFTau/src/MatchMETBenchmark.cc @@ -0,0 +1,113 @@ +#include "DQMOffline/PFTau/interface/MatchMETBenchmark.h" +#include "DataFormats/METReco/interface/MET.h" +#include "DataFormats/Candidate/interface/Candidate.h" + +// #include "DQMServices/Core/interface/MonitorElement.h" +// #include "DQMServices/Core/interface/DQMStore.h" + +#include +#include +#include +#include + +using namespace std; + +MatchMETBenchmark::~MatchMETBenchmark() {} + +void MatchMETBenchmark::setup() { + + PhaseSpace ptPS; + PhaseSpace dptOvptPS; + PhaseSpace dptPS; + PhaseSpace dphiPS; + PhaseSpace setPS; + PhaseSpace dsetPS; + PhaseSpace setOvsetPS; + + switch(mode_) { + case VALIDATION: + ptPS = PhaseSpace(100,0,1000); + dptOvptPS = PhaseSpace( 200, -1, 1); + dphiPS = PhaseSpace( 100, -3.2, 3.2); + dptPS = PhaseSpace( 100, -500, 500); + setPS = PhaseSpace( 300, 0.0, 3000); + dsetPS = PhaseSpace( 300, 0.-1000, 1000); + setOvsetPS = PhaseSpace( 500,0., 2.); + break; + case DQMOFFLINE: + default: + ptPS = PhaseSpace(50,0,200); + dptOvptPS = PhaseSpace( 50, -1, 1); + dphiPS = PhaseSpace( 50, -3.2, 3.2); + dptPS = PhaseSpace( 50, -500, 500); + setPS = PhaseSpace( 50, 0.0, 3000); + dsetPS = PhaseSpace( 50, -1000.0, 1000); + setOvsetPS = PhaseSpace( 100,0., 2.); + break; + } + + //float ptBins[11] = {0, 1, 2, 5, 10, 20, 50, 100, 200, 400, 1000}; + + delta_et_Over_et_VS_et_ = book2D("delta_et_Over_et_VS_et_", + ";ME_{T, true} (GeV);#DeltaME_{T}/ME_{T}", + ptPS.n, ptPS.m, ptPS.M, + dptOvptPS.n, dptOvptPS.m, dptOvptPS.M ); + + delta_et_VS_et_ = book2D("delta_et_VS_et_", + ";ME_{T, true} (GeV);#DeltaME_{T}", + ptPS.n, ptPS.m, ptPS.M, + dptPS.n, dptPS.m, dptPS.M ); + + delta_phi_VS_et_ = book2D("delta_phi_VS_et_", + ";ME_{T, true} (GeV);#Delta#phi", + ptPS.n, ptPS.m, ptPS.M, + dphiPS.n, dphiPS.m, dphiPS.M ); + + delta_ex_ = book1D("delta_ex_", + "#DeltaME_{X}", + ptPS.n, -ptPS.M, ptPS.M ); + + RecEt_VS_TrueEt_ = book2D("RecEt_VS_TrueEt_", + ";ME_{T, true} (GeV);ME_{T}", + ptPS.n, ptPS.m, ptPS.M, + ptPS.n, ptPS.m, ptPS.M ); + + delta_set_VS_set_ = book2D("delta_set_VS_set_", + ";SE_{T, true} (GeV);#DeltaSE_{T}", + setPS.n, setPS.m, setPS.M, + dsetPS.n, dsetPS.m, dsetPS.M ); + + delta_set_Over_set_VS_set_ = book2D("delta_set_Over_set_VS_set_", + ";SE_{T, true} (GeV);#DeltaSE_{T}/SE_{T}", + setPS.n, setPS.m, setPS.M, + dptOvptPS.n, dptOvptPS.m, dptOvptPS.M ); + + delta_ex_VS_set_ = book2D("delta_ex_VS_set_", + ";SE_{T, true} (GeV);#DeltaE_{X}", + setPS.n, setPS.m, setPS.M, + ptPS.n, -ptPS.M, ptPS.M ); + + RecSet_Over_TrueSet_VS_TrueSet_ = book2D("RecSet_Over_TrueSet_VS_TrueSet_", + ";SE_{T, true} (GeV);SE_{T}/SE_{T}", + setPS.n, setPS.m, setPS.M, + setOvsetPS.n, setOvsetPS.m, setOvsetPS.M ); +} + +void MatchMETBenchmark::fillOne(const reco::MET& cand, + const reco::MET& matchedCand) { + + if( !isInRange(cand.pt(), cand.eta(), cand.phi() ) ) return; + + if ( matchedCand.pt()>0.001 ) delta_et_Over_et_VS_et_->Fill( matchedCand.pt(), (cand.pt() - matchedCand.pt())/matchedCand.pt() ); + delta_et_VS_et_->Fill( matchedCand.pt(), cand.pt() - matchedCand.pt() ); + delta_phi_VS_et_->Fill( matchedCand.pt(), cand.phi() - matchedCand.phi() ); + delta_ex_->Fill(cand.px()-matchedCand.px()); + delta_ex_->Fill(cand.py()-matchedCand.py()); + RecEt_VS_TrueEt_->Fill(matchedCand.pt(),cand.pt()); + delta_set_VS_set_->Fill(matchedCand.sumEt(),cand.sumEt()-matchedCand.sumEt()); + if ( matchedCand.sumEt()>0.001 ) delta_set_Over_set_VS_set_->Fill(matchedCand.sumEt(),(cand.sumEt()-matchedCand.sumEt())/matchedCand.sumEt()); + delta_ex_VS_set_->Fill(matchedCand.sumEt(),cand.px()-matchedCand.px()); + delta_ex_VS_set_->Fill(matchedCand.sumEt(),cand.py()-matchedCand.py()); + if ( matchedCand.sumEt()>0.001 ) RecSet_Over_TrueSet_VS_TrueSet_->Fill(matchedCand.sumEt(),cand.sumEt()/matchedCand.sumEt()); + +}