Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in plotting barelep-only observables #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Templates/config.kdlong
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Setup]
user = kdlong
analysis = WZ
dataset_manager_path = /afs/hep.wisc.edu/home/%(user)s/work
combine_path = %(dataset_manager_path)s/HiggsCombine/CMSSW_8_1_0/src/HiggsAnalysis/CombinedLimit
output_path = /nfs_scratch/%(user)s/%(analysis)sAnalysisData
fakeRate_output = %(output_path)s/FakesRates
hist_output = %(output_path)s/HistFiles
combine_output = %(output_path)s/CombineData
2 changes: 1 addition & 1 deletion Templates/config.kelong
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Setup]
user = kelong
analysis = ZGen
dataset_manager_path = /afs/cern.ch/user/k/%(user)s/work
dataset_manager_path = ~/work
dataset_manager_name = AnalysisDatasetManager
combine_path = %(dataset_manager_path)s/HiggsCombine/CMSSW_8_1_0/src/HiggsAnalysis/CombinedLimit
output_path = /eos/user/k/%(user)s/%(analysis)sAnalysisData
Expand Down
2 changes: 1 addition & 1 deletion Utilities/python/ConfigureJobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def getManagerPath():
if "dataset_manager_path" not in config['Setup']:
raise ValueError("dataset_manager_path not specified in config file %s"
% config_name)
return config['Setup']['dataset_manager_path'] + "/"
return os.path.expanduser(config['Setup']['dataset_manager_path']) + "/"

def getCombinePath():
config = configparser.ConfigParser()
Expand Down
15 changes: 9 additions & 6 deletions src/WGenSelector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,11 @@ void WGenSelector::FillHistogramsByName(Long64_t entry, std::string& toAppend, S
if (variation.first == BareLeptons) {
//ponerse las pilas, the (variation.first == BareLeptons) refraining the histograms to fill
ratio_mass /= wCand.mass();
SafeHistFill(histMap1D_, "Ratio_Wmass", channel_, variation.first, ratio_mass, weight);
SafeHistFill(histMap1D_, concatenateNames("nGammaAssoc",toAppend), channel_, variation.first, photons.size(), weight);
// Call the channel central just to avoid appending the name "barelep".
// These histograms should only be built for the barelepton case, should be understood that they always refer
// to the barlep channel implicitly
SafeHistFill(histMap1D_, "Ratio_Wmass", channel_, Central, ratio_mass, weight);
SafeHistFill(histMap1D_, concatenateNames("nGammaAssoc",toAppend), channel_, Central, photons.size(), weight);

auto compareByPt = [](const reco::GenParticle& a, const reco::GenParticle& b) { return a.pt() < b.pt(); };
auto compareByDRLead = [lep] (const reco::GenParticle& a, const reco::GenParticle& b) {
Expand All @@ -356,9 +359,9 @@ void WGenSelector::FillHistogramsByName(Long64_t entry, std::string& toAppend, S



SafeHistFill(histMap1D_, "dRlgamma_minassoc", channel_, variation.first, photons.size() > 0 ? reco::deltaR(*gclose, lep) : 0., weight);
SafeHistFill(histMap1D_, "dRlgamma_maxptassoc", channel_, variation.first, photons.size() > 0 ? reco::deltaR(*maxPtg, lep) : 0., weight);
SafeHistFill(histMap1D_, "ptg_closeassoc", channel_, variation.first, photons.size() > 0 ? gclose->pt() : 0., weight);
SafeHistFill(histMap1D_, "ptgmax_assoc", channel_, variation.first, photons.size() > 0 ? maxPtg->pt() : 0., weight);
SafeHistFill(histMap1D_, "dRlgamma_minassoc", channel_, Central, photons.size() > 0 ? reco::deltaR(*gclose, lep) : 0., weight);
SafeHistFill(histMap1D_, "dRlgamma_maxptassoc", channel_, Central, photons.size() > 0 ? reco::deltaR(*maxPtg, lep) : 0., weight);
SafeHistFill(histMap1D_, "ptg_closeassoc", channel_, Central, photons.size() > 0 ? gclose->pt() : 0., weight);
SafeHistFill(histMap1D_, "ptgmax_assoc", channel_, Central, photons.size() > 0 ? maxPtg->pt() : 0., weight);
}
}