From 5a8e2533d9caa5a13de72fc41cc4a8e1abd16952 Mon Sep 17 00:00:00 2001 From: Alexander Gude Date: Sat, 3 May 2014 16:56:48 -0500 Subject: [PATCH] Add a Base Weight and a Full Weight histogram Base Weight is the ZFinderEvent.event_weight of the event, while the Full Weight is the fully propagated weight including all the cuts up to that point. --- ZFinder/Event/interface/ZFinderPlotter.h | 2 ++ ZFinder/Event/src/ZFinderPlotter.cc | 25 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/ZFinder/Event/interface/ZFinderPlotter.h b/ZFinder/Event/interface/ZFinderPlotter.h index 0bb5cdc..cf231b8 100644 --- a/ZFinder/Event/interface/ZFinderPlotter.h +++ b/ZFinder/Event/interface/ZFinderPlotter.h @@ -45,6 +45,8 @@ namespace zf { TH1D* phistar_; TH1D* pileup_; TH1D* nelectrons_; + TH1D* baseweights_; + TH1D* fullweights_; // Use the MC or reco data const bool USE_MC_; diff --git a/ZFinder/Event/src/ZFinderPlotter.cc b/ZFinder/Event/src/ZFinderPlotter.cc index 653e93a..6559623 100644 --- a/ZFinder/Event/src/ZFinderPlotter.cc +++ b/ZFinder/Event/src/ZFinderPlotter.cc @@ -113,6 +113,18 @@ namespace zf { nelectrons_ = tdir.make(nelectrons_name.c_str(), nelectrons_name.c_str(), 10, 0., 10.); nelectrons_->GetXaxis()->SetTitle("N_{e}"); nelectrons_->GetYaxis()->SetTitle("Events"); + + // baseweights + const std::string baseweights_name = "Base Weight"; + baseweights_ = tdir.make(baseweights_name.c_str(), baseweights_name.c_str(), 500, 0., 5.); + baseweights_->GetXaxis()->SetTitle("Weight"); + baseweights_->GetYaxis()->SetTitle("Events"); + + // baseweights + const std::string fullweights_name = "Full Weight"; + fullweights_ = tdir.make(fullweights_name.c_str(), fullweights_name.c_str(), 500, 0., 5.); + fullweights_->GetXaxis()->SetTitle("Weight"); + fullweights_->GetYaxis()->SetTitle("Events"); } void ZFinderPlotter::Fill( @@ -192,6 +204,9 @@ namespace zf { pileup_->Fill(zf_event.truth_vert.num, EVENT_WEIGHT); nelectrons_->Fill(2, EVENT_WEIGHT); // We only ever grab the two electrons from the Z } + // Event weights, they are of course, unweighted + baseweights_->Fill(zf_event.event_weight); + fullweights_->Fill(EVENT_WEIGHT); } void ZFinderPlotter::Print(const std::string& basename) { @@ -275,5 +290,15 @@ namespace zf { TCanvas* nelectronsC = new TCanvas(nelectronsStr.c_str(), nelectronsStr.c_str(), X_SIZE, Y_SIZE); nelectrons_->Draw(); nelectronsC->Print((nelectronsStr+".png").c_str()); + + std::string baseweightsStr = basename + "_baseweights"; + TCanvas* baseweightsC = new TCanvas(baseweightsStr.c_str(), baseweightsStr.c_str(), X_SIZE, Y_SIZE); + baseweights_->Draw(); + baseweightsC->Print((baseweightsStr+".png").c_str()); + + std::string fullweightsStr = basename + "_fullweights"; + TCanvas* fullweightsC = new TCanvas(fullweightsStr.c_str(), fullweightsStr.c_str(), X_SIZE, Y_SIZE); + fullweights_->Draw(); + fullweightsC->Print((fullweightsStr+".png").c_str()); } } // namespace zf