Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
01db77b
ZZ compiles
uhussain Aug 21, 2019
e3e83b7
Working as expected - validated with 2016 signal file
uhussain Aug 21, 2019
594311c
ZZSelector running but makeComposite function not working
uhussain Aug 26, 2019
69ddef6
Make sure file is open before writing
kdlong Aug 27, 2019
b036f9a
Ok this works...
kdlong Aug 27, 2019
5ee02b9
ZZ4l Full Run 2 up and running
uhussain Aug 28, 2019
5ad4461
Adding master version of selectorbase
kdlong Aug 28, 2019
bc9fba9
Fix some missing things for ZZ
kdlong Aug 28, 2019
a435bf3
latest tmp branch
uhussain Aug 28, 2019
ba6b5ff
Add syst hists to 1D map
kdlong Aug 28, 2019
47ba0a1
Merge branch 'temp' into fromUsamaWithSelectorBase
kdlong Aug 28, 2019
57924c3
Merge pull request #1 from kdlong/fromUsamaWithSelectorBase
uhussain Aug 28, 2019
f1fcee7
Merge branch 'fromUsamaWithSelectorBase' of github.com:kdlong/VVAnaly…
kdlong Aug 28, 2019
4534c7b
ZZBackground Selector not working
uhussain Aug 28, 2019
ae7e69e
Add option for background estimation
kdlong Aug 29, 2019
9b2a39d
Call proper load branches function in background selector
kdlong Aug 29, 2019
14deb02
Merge my combine refactoring stuff
kdlong Aug 30, 2019
c387f35
Restore ZZ addition for EWK file names
kdlong Aug 30, 2019
a3a0a05
Merge pull request #3 from kdlong/fromUsama
uhussain Aug 30, 2019
79cfb96
What are these changes
uhussain Aug 30, 2019
8c12beb
concluding merge
uhussain Aug 30, 2019
99f745d
Temporary masks to uncertainties, theory hists added
kdlong Aug 30, 2019
a28f4ce
Kind of working with scale histograms
kdlong Sep 2, 2019
afb817d
Latest Selector code
uhussain Sep 2, 2019
1e0e0bf
Trying to debug scale weights
kdlong Sep 2, 2019
10132ad
Merge branch 'temp' into fromUsamaCombine
kdlong Sep 2, 2019
7de6647
Merge remote-tracking branch 'usama/temp' into fromUsamaCombine
kdlong Sep 2, 2019
2bd1f72
Set weight_info after isMC_ has already been set
kdlong Sep 2, 2019
986aa22
Merge branch 'fromUsamaCombine' of github.com:kdlong/VVAnalysis into …
kdlong Sep 2, 2019
9914b80
Latest stuff
uhussain Sep 2, 2019
8b62d49
Adding syst hists to histmap handled elsewhere
kdlong Sep 2, 2019
391dbdd
Merge pull request #4 from kdlong/fromUsamaCombine
uhussain Sep 2, 2019
0b21335
ConfigJobs version
uhussain Sep 2, 2019
42c8e7a
Update ZZ cards to work for full Run II
kdlong Sep 3, 2019
4dbb5d5
All updates
uhussain Sep 5, 2019
b39ba2a
Merge branch 'temp' into fromUsamaCombine
uhussain Sep 9, 2019
7747147
Merge pull request #5 from kdlong/fromUsamaCombine
uhussain Sep 9, 2019
60636c9
Some degree of PDF uncertainties
kdlong Sep 8, 2019
458aee1
Add ZGen scipts, trying Hessian uncertainty
kdlong Sep 9, 2019
989aec5
Add PDF hists to ZZ
kdlong Sep 9, 2019
9685170
Merge branch 'fromUsamaCombine' of github.com:kdlong/VVAnalysis into …
kdlong Sep 9, 2019
6e44378
Added ZZEWK signal to the templates
uhussain Sep 9, 2019
838c59f
Merge branch 'temp' into fromUsamaCombine
uhussain Sep 9, 2019
1932919
Merge pull request #6 from kdlong/fromUsamaCombine
uhussain Sep 9, 2019
856cde1
local changes to setupZZCombine
uhussain Sep 9, 2019
36711f2
Fixing conflicts
uhussain Sep 9, 2019
ba2d341
Fake Rate stuff not working
uhussain Sep 12, 2019
90462d0
PU files for 3 years
uhussain Sep 13, 2019
5e847af
GenSelector working by itself but not in parallel
uhussain Sep 16, 2019
08692a1
commands to run
uhussain Sep 16, 2019
8fc115c
Reset datasets to remove unwanted ones, e.g., data for Gen
kdlong Sep 16, 2019
9d7126a
Fix mistakes in cleardatasets
kdlong Sep 16, 2019
51bd9f1
All latest changes
uhussain Sep 16, 2019
1cd3cd3
Merge remote-tracking branch 'usama/temp' into fromUsama
kdlong Sep 16, 2019
30d1474
Clear datasets before setting
kdlong Sep 16, 2019
2703ca6
I think it's at least all running and combining
kdlong Sep 16, 2019
567db53
Don't include WZ in EW files, still not sure what's up with zzjj
kdlong Sep 16, 2019
be24f98
Merge pull request #7 from kdlong/fromUsama
uhussain Sep 17, 2019
dcffd76
New SFs and 6 distributions we want to unfold are ZZMass,ZZPt, ZPt, l…
uhussain Sep 23, 2019
6b755cd
setting systematics zero for background selector
uhussain Sep 23, 2019
2e6d364
still trying
uhussain Sep 23, 2019
731e6e3
makes sense
uhussain Sep 23, 2019
a5ed417
no extra histograms
uhussain Sep 23, 2019
0120ce9
All the updates in fake rate selectors, scale factors etc
uhussain Oct 11, 2019
23abfd4
Commiting all the bash scripts
uhussain Oct 11, 2019
2a2acf8
updating config files etc
uhussain Oct 30, 2019
53476b8
selector changes
uhussain Nov 1, 2019
b4e3c39
what changes in combine templates
uhussain Nov 1, 2019
f70f973
All the template changes
uhussain Nov 1, 2019
014ae9e
Making temp branch which is most up-to-date selector branch as master
uhussain Nov 1, 2019
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
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "PileupWeights"]
path = PileupWeights
url = ssh://git@gitlab.cern.ch:7999/ncsmith/PileupWeights.git
286 changes: 286 additions & 0 deletions ConfigureJobs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,286 @@
import datetime
import UserInput
import fnmatch
import glob
import os
import json
import array
import string
import configparser

def get2DBinning(xvar="mjj", yvar="etajj", analysis='WZ'):
#return (array.array('d', [500, 1000,1500, 2000, 2500]),
# [0, 150, 300, 450] # for MT(WZ)
# return (array.array('d', [500, 1000, 1350, 1750, 2000, 2500]),
xbinning = []
ybinning = []
if xvar == "mjj":
xbinning = array.array('d', [500, 1000,1500, 2000, 2500])
#xbinning = array.array('d', [500, 1000, 1350, 1750, 2500])

if yvar == 'etajj':
ybinning = [2.5, 4, 5, 20]
#if yvar == 'etajj':
# ybinning = [2.5, 4, 5.5, 20]
elif yvar == 'dRjj':
ybinning = [0, 5, 6, 20]
return (xbinning, ybinning)

def getChannels(analysis='ZZ'):
if analysis == 'ZZ':
return ["eeee", "eemm", "mmee", "mmmm"]
def getManagerPath():
config = configparser.ConfigParser()
config.read_file(open("Templates/config.%s" % os.environ["USER"]))
if "dataset_manager_path" not in config['Setup']:
raise ValueError("dataset_manager_path not specified in config file Template/config.%s"
% os.environ["USER"])
return config['Setup']['dataset_manager_path'] + "/"
def getCombinePath():
config = configparser.ConfigParser()
config.read_file(open("Templates/config.%s" % os.environ["USER"]))
if "combine_path" not in config['Setup']:
raise ValueError("dataset_manager_path not specified in config file Template/config.%s"
% os.environ["USER"])
return config['Setup']['combine_path'] + "/"
def getListOfEWKFilenames():
return [
#"wz3lnu-amcnlo",#old 2018 ntuples
"wz3lnu-powheg",#New 2018 ntuples
# Use jet binned WZ samples for subtraction by default
#"wz3lnu-mgmlm-0j",
#"wz3lnu-mgmlm-1j",
#"wz3lnu-mgmlm-2j",
#"wz3lnu-mgmlm-3j",
#"wlljj-ewk",
"zz4l-powheg",
#"zz4ljj-ewk",
#"zz2l2vjj-ewk",
#"tzq",
#"ttz",
#"ttw",
#"zzz",
#"wwz",
#"www",
#"ww",
#"zg",
"ggZZ4e",
"ggZZ4m",
"ggZZ4t",
"ggZZ2e2mu",
"ggZZ2e2tau",
"ggZZ2mu2tau",
]

def getListOfEWK():
return [
"zz4l-powheg",
"ggZZ4e",
"ggZZ4m",
"ggZZ4t",
"ggZZ2e2mu",
"ggZZ2e2tau",
"ggZZ2mu2tau",
]
def getListOfDYFilenames():
return[
"DYJetsToLL_M10to50",
"DYJetsToLLM-50",
]
def getListOfNonpromptFilenames():
return ["tt-lep",
"tt-jets",
#"st-schan",
#"st-tchan-t",
#"st-tchan-tbar",
#"st-tw",
#"st-tbarw",
##"DYm50",
#"DYm50-1j",
#"DYm50-2j",
#"DYm50-3j",
#"DYm50-4j",
]
def getListOfHZZFilenames():
return ["ggHZZ",
"vbfHZZ",
"ttH_HToZZ_4L",
"WminusHToZZ",
"WplusHToZZ",
"ZHToZZ_4L"
]
def getListOfggZZFilenames():
return ["ggZZ4e",
"ggZZ4m",
"ggZZ4t",
"ggZZ2e2mu",
"ggZZ2e2tau",
"ggZZ2mu2tau"
]
def getJobName(sample_name, analysis, selection, version):
date = '{:%Y-%m-%d}'.format(datetime.date.today())
selection = selection.replace(";",",")
selections = selection.split(",")
selection_name = "To".join([selections[0],selections[-1]]) \
if len(selections) > 1 else selections[0]
return '-'.join([date, sample_name, analysis, selection_name,
("v%s" % version) if version.isdigit() else version])
def getNumberAndSizeOfLocalFiles(path_to_files):
file_list = glob.glob(path_to_files)
return (len(file_list), sum([os.path.getsize(f)/1000000 for f in file_list]))
def getNumberAndSizeOfHDFSFiles(file_path):
file_info = []
for line in out.splitlines():
split = line.split()
if len(split) != 9:
continue
file_info.append(float(split[4].rstrip("mkg")))
return (0,0) if len(file_info) == 0 else (len(file_info), sum(file_info))
def getListOfHDFSFiles(file_path):
try:
out = subprocess.check_output(["hdfs", "dfs", "-ls", file_path.replace("/hdfs", "")])
except subprocess.CalledProcessError as error:
logging.warning(error)
return []
files = []
for line in out.splitlines():
split = line.split(" ", 1)
if len(split) != 2:
continue
elif "root" in split[1]:
files.append("/"+split[1])
return files
def getListOfFiles(filelist, selection, manager_path=""):
if manager_path is "":
manager_path = getManagerPath()
data_path = "%s/ZZ4lRun2DatasetManager/FileInfo" % manager_path
data_info = UserInput.readAllJson("/".join([data_path, "%s.json" % "data/*"]))
mc_info = UserInput.readAllJson("/".join([data_path, "%s.json" % "montecarlo/*"]))
valid_names = data_info.keys() + mc_info.keys()
names = []
for name in filelist:
if "ZZ4l2016" in name:
dataset_file = manager_path + \
"ZZ4lRun2DatasetManager/FileInfo/ZZ4l2016/%s.json" % selection
allnames = json.load(open(dataset_file)).keys()
print allnames
if "nodata" in name:
nodata = [x for x in allnames if "data" not in x]
names += nodata
elif "data" in name:
names += [x for x in allnames if "data" in x]
else:
names += allnames
elif "ZZ4l2017" in name:
dataset_file = manager_path + \
"ZZ4lRun2DatasetManager/FileInfo/ZZ4l2017/%s.json" % selection
allnames = json.load(open(dataset_file)).keys()
print allnames
if "nodata" in name:
nodata = [x for x in allnames if "data" not in x]
names += nodata
elif "data" in name:
names += [x for x in allnames if "data" in x]
else:
names += allnames
elif "ZZ4l2018" in name:
dataset_file = manager_path + \
"ZZ4lRun2DatasetManager/FileInfo/ZZ4l2018/%s.json" % selection
allnames = json.load(open(dataset_file)).keys()
print allnames
if "nodata" in name:
nodata = [x for x in allnames if "data" not in x]
names += nodata
elif "data" in name:
names += [x for x in allnames if "data" in x]
else:
names += allnames
elif "*" in name:
names += fnmatch.filter(valid_names, name)
else:
if name.split("__")[0] not in valid_names:
print "%s is not a valid name" % name
continue
names += [name]
return [str(i) for i in names]
def fillTemplatedFile(template_file_name, out_file_name, template_dict):
with open(template_file_name, "r") as templateFile:
source = string.Template(templateFile.read())
result = source.substitute(template_dict)
with open(out_file_name, "w") as outFile:
outFile.write(result)
def getListOfFilesWithXSec(filelist, manager_path=""):
if manager_path is "":
manager_path = getManagerPath()
data_path = "%s/ZZ4lRun2DatasetManager/FileInfo" % manager_path
files = getListOfFiles(filelist, "ntuples", manager_path)
#files = getListOfFiles(filelist, "2018Data", manager_path)
mc_info = UserInput.readAllJson("/".join([data_path, "%s.json" % "montecarlo/*"]))
info = {}
for file_name in files:
if "data" in file_name:
info.update({file_name : 1})
else:
file_info = mc_info[file_name.split("__")[0]]
kfac = file_info["kfactor"] if "kfactor" in file_info.keys() else 1
info.update({file_name : file_info["cross_section"]*kfac})
return info
def getPreviousStep(selection, analysis):
selection_map = {}
if analysis == "ZZ4l2016":
selection_map = { "ntuples" : "ntuples",
"preselection" : "ntuples",
"4lCRBase" : "ntuples"
}
elif analysis == "ZplusL2016":
selection_map = { "ntuples": "ntuples",
"ZplusLBase" : "ntuples"
}
elif analysis == "ZZ4l2017":
selection_map = { "ntuples" : "ntuples",
"preselection" : "ntuples",
"4lCRBase" : "ntuples"
}
elif analysis == "ZplusL2017":
selection_map = { "ntuples": "ntuples",
"ZplusLBase" : "ntuples"
}
elif analysis == "ZZ4l2018":
selection_map = { "ntuples" : "ntuples",
"preselection" : "ntuples",
"4lCRBase" : "ntuples"
}
elif analysis == "ZplusL2018":
selection_map = { "ntuples": "ntuples",
"ZplusLBase" : "ntuples"
}
selection = selection.replace(";",",")
first_selection = selection.split(",")[0].strip()
if first_selection not in selection_map.keys():
if "preselection" in first_selection:
first_selection = "preselection"
else:
raise ValueError("Invalid selection '%s'. Valid selections are:"
"%s" % (first_selection, selection_map.keys()))
return selection_map[first_selection]
def getInputFilesPath(sample_name, selection, analysis, manager_path=""):
if manager_path is "":
manager_path = getManagerPath()
data_path = "%s/ZZ4lRun2DatasetManager/FileInfo" % manager_path
input_file_name = "/".join([data_path, analysis, "%s.json" %
selection])
input_files = UserInput.readJson(input_file_name)
if sample_name not in input_files.keys():
raise ValueError("Invalid input file %s. Input file must correspond"
" to a definition in %s" % (sample_name, input_file_name))
filename = input_files[sample_name]['file_path']
return filename
def getCutsJsonName(selection, analysis):
return "/".join(["Cuts", analysis, selection + ".json"])
def getTriggerName(sample_name, analysis, selection):
trigger_names = ["MuonEG", "DoubleMuon", "DoubleEG", "SingleMuon", "SingleElectron"]
if "data" in sample_name and getPreviousStep(selection, analysis) == "ntuples":
for name in trigger_names:
if name in sample_name:
return "-t " + name
return "-t MonteCarlo"
1 change: 0 additions & 1 deletion PileupWeights
Submodule PileupWeights deleted from 5edbb4
Binary file added PileupWeights16/PU_Central.root
Binary file not shown.
Binary file added PileupWeights16/PU_minBiasDOWN.root
Binary file not shown.
Binary file added PileupWeights16/PU_minBiasUP.root
Binary file not shown.
Binary file added PileupWeights17/PU_Central.root
Binary file not shown.
Binary file added PileupWeights17/PU_minBiasDOWN.root
Binary file not shown.
Binary file added PileupWeights17/PU_minBiasUP.root
Binary file not shown.
Binary file added PileupWeights18/PU_Central.root
Binary file not shown.
Binary file added PileupWeights18/PU_minBiasDOWN.root
Binary file not shown.
Binary file added PileupWeights18/PU_minBiasUP.root
Binary file not shown.
Loading