Skip to content

Commit

Permalink
Merge pull request #71 from jjacob/master
Browse files Browse the repository at this point in the history
Reinstating 1GeV bins in unfolding analyser (still excluded 1GeV 2D resp...
  • Loading branch information
kreczko committed Nov 1, 2013
2 parents ddfb2f3 + b64e1eb commit cfc86e6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 36 deletions.
71 changes: 36 additions & 35 deletions plugins/UnfoldingAnalyser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ UnfoldingAnalyser::UnfoldingAnalyser(const edm::ParameterSet& iConfig) :
fake_(), //
contamination_in_gen_variable_(), //
contamination_in_reco_variable_(), //
response_(), //
response_without_fakes_(), //
// response_(), //
// response_without_fakes_(), //
//
truth_asym_bins_(), //
measured_asym_bins_(), //
Expand Down Expand Up @@ -97,24 +97,25 @@ void UnfoldingAnalyser::beginJob() {
throw edm::Exception(edm::errors::Configuration, "TFile Service is not registered in cfg file");
}
//cout << "This is not how you debug" << endl;
// truth_ =
// fs->make < TH1F
// > ("truth", TString("True distribution;GEN(" + variable_under_analysis_ + ");# Events"), variable_n_bins_, variable_min_, variable_max_);
// measured_ =
// fs->make < TH1F
// > ("measured", TString("Measured distribution;RECO(" + variable_under_analysis_ + ");# Events"), variable_n_bins_, variable_min_, variable_max_);
// fake_ =
// fs->make < TH1F
// > ("fake", TString("background distribution;RECO(" + variable_under_analysis_ + ");# Events"), variable_n_bins_, variable_min_, variable_max_);
// contamination_in_gen_variable_ =
// fs->make < TH1F
// > ("contamination_inGenMET", TString(
// "background distribution;GEN(" + variable_under_analysis_ + ");# Events"), variable_n_bins_, variable_min_, variable_max_);
// contamination_in_reco_variable_ =
// fs->make < TH1F
// > ("contamination_inRecoMET", TString(
// "background distribution;RECO(" + variable_under_analysis_ + ");# Events"), variable_n_bins_, variable_min_, variable_max_);
//
//histograms with 1 GeV binning
truth_ =
fs->make < TH1F
> ("truth", TString("True distribution;GEN(" + variable_under_analysis_ + ");# Events"), variable_n_bins_, variable_min_, variable_max_);
measured_ =
fs->make < TH1F
> ("measured", TString("Measured distribution;RECO(" + variable_under_analysis_ + ");# Events"), variable_n_bins_, variable_min_, variable_max_);
fake_ =
fs->make < TH1F
> ("fake", TString("background distribution;RECO(" + variable_under_analysis_ + ");# Events"), variable_n_bins_, variable_min_, variable_max_);
contamination_in_gen_variable_ =
fs->make < TH1F
> ("contamination_inGenMET", TString(
"background distribution;GEN(" + variable_under_analysis_ + ");# Events"), variable_n_bins_, variable_min_, variable_max_);
contamination_in_reco_variable_ =
fs->make < TH1F
> ("contamination_inRecoMET", TString(
"background distribution;RECO(" + variable_under_analysis_ + ");# Events"), variable_n_bins_, variable_min_, variable_max_);

// response_ =
// fs->make < TH2F
// > ("response", TString(
Expand Down Expand Up @@ -157,11 +158,11 @@ void UnfoldingAnalyser::beginJob() {
"response;RECO(" + variable_under_analysis_ + ");GEN(" + variable_under_analysis_ + ")"), n_asym_bins, METBinEdges, n_asym_bins, METBinEdges);

//cout << "Well, you could use 'scram b' as a compiler on your machine within an IDE" << endl;
// truth_->Sumw2();
// measured_->Sumw2();
// fake_->Sumw2();
// contamination_in_gen_variable_->Sumw2();
// contamination_in_reco_variable_->Sumw2();
truth_->Sumw2();
measured_->Sumw2();
fake_->Sumw2();
contamination_in_gen_variable_->Sumw2();
contamination_in_reco_variable_->Sumw2();
// response_->Sumw2();
// response_without_fakes_->Sumw2();

Expand Down Expand Up @@ -211,14 +212,14 @@ void UnfoldingAnalyser::analyze(const edm::Event& iEvent, const edm::EventSetup&
if (do_electron_channel_) {
if (is_semileptonic_electron) {
//PU weight only (no btag-weight) as no b-tagging is applied
//truth_->Fill(gen_variable, puWeight);
truth_->Fill(gen_variable, puWeight);
truth_asym_bins_->Fill(gen_variable, puWeight);
}

if (passes_selection) {
float reco_variable(get_reco_variable(iEvent));

//measured_->Fill(reco_variable, weight);
measured_->Fill(reco_variable, weight);
measured_asym_bins_->Fill(reco_variable, weight);
//response_->Fill(reco_variable, gen_variable, weight);
response_asym_bins_->Fill(reco_variable, gen_variable, weight);
Expand All @@ -227,13 +228,13 @@ void UnfoldingAnalyser::analyze(const edm::Event& iEvent, const edm::EventSetup&
//response_without_fakes_->Fill(reco_variable, gen_variable, weight);
response_without_fakes_asym_bins_->Fill(reco_variable, gen_variable, weight);
} else {
//fake_->Fill(reco_variable, weight);
fake_->Fill(reco_variable, weight);
fake_asym_bins_->Fill(reco_variable, weight);
//contamination from other ttbar processes
if (is_fully_hadronic || is_dileptonic || is_semileptonic_tau || is_semileptonic_muon) {
//contamination_in_reco_variable_->Fill(reco_variable, weight);
contamination_in_reco_variable_->Fill(reco_variable, weight);
contamination_asym_bins_in_reco_variable_->Fill(reco_variable, weight);
//contamination_in_gen_variable_->Fill(gen_variable, weight);
contamination_in_gen_variable_->Fill(gen_variable, weight);
contamination_asym_bins_in_gen_variable_->Fill(gen_variable, weight);
}
}
Expand All @@ -243,7 +244,7 @@ void UnfoldingAnalyser::analyze(const edm::Event& iEvent, const edm::EventSetup&
} else { //muon channel
if (is_semileptonic_muon) {
//PU weight only (no btag-weight) as no b-tagging is applied
//truth_->Fill(gen_variable, puWeight);
truth_->Fill(gen_variable, puWeight);
truth_asym_bins_->Fill(gen_variable, puWeight);
}

Expand All @@ -254,7 +255,7 @@ void UnfoldingAnalyser::analyze(const edm::Event& iEvent, const edm::EventSetup&

weight *= muonCorrection;

//measured_->Fill(reco_variable, weight);
measured_->Fill(reco_variable, weight);
measured_asym_bins_->Fill(reco_variable, weight);
//response_->Fill(reco_variable, gen_variable, weight);
response_asym_bins_->Fill(reco_variable, gen_variable, weight);
Expand All @@ -263,12 +264,12 @@ void UnfoldingAnalyser::analyze(const edm::Event& iEvent, const edm::EventSetup&
//response_without_fakes_->Fill(reco_variable, gen_variable, weight);
response_without_fakes_asym_bins_->Fill(reco_variable, gen_variable, weight);
} else {
//fake_->Fill(reco_variable, weight);
fake_->Fill(reco_variable, weight);
fake_asym_bins_->Fill(reco_variable, weight);
if (is_fully_hadronic || is_dileptonic || is_semileptonic_tau || is_semileptonic_electron) {
//contamination_in_reco_variable_->Fill(reco_variable, weight);
contamination_in_reco_variable_->Fill(reco_variable, weight);
contamination_asym_bins_in_reco_variable_->Fill(reco_variable, weight);
//contamination_in_gen_variable_->Fill(gen_variable, weight);
contamination_in_gen_variable_->Fill(gen_variable, weight);
contamination_asym_bins_in_gen_variable_->Fill(gen_variable, weight);
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/UnfoldingAnalyser.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class UnfoldingAnalyser: public edm::EDAnalyzer {
// - fill fake (1D)
//histograms with 1 GeV binning
TH1F* truth_, *measured_, *fake_, *contamination_in_gen_variable_, *contamination_in_reco_variable_;
TH2F* response_, *response_without_fakes_;
// TH2F* response_, *response_without_fakes_;
//histograms with analysis binning: [0,25,45,70,100, inf]
TH1F* truth_asym_bins_, *measured_asym_bins_, *fake_asym_bins_, *contamination_asym_bins_in_gen_variable_,
*contamination_asym_bins_in_reco_variable_;
Expand Down

0 comments on commit cfc86e6

Please sign in to comment.