Skip to content

Commit

Permalink
Merge pull request #15 from kit-cn-cms/dev_lea
Browse files Browse the repository at this point in the history
Dev lea
  • Loading branch information
leareuter authored Nov 23, 2018
2 parents 15bb932 + a292612 commit 0589eeb
Show file tree
Hide file tree
Showing 9 changed files with 757 additions and 644 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ repo for object-oriented datacard maker
Writes Datacards

Current structure:
- src/datacardMaker.py: Wrapper to automatically create data cards from category/process/systematic objects
- src/datacardMaker.py: Wrapper to automatically create data cards from analysis objects
- src/analysisObject.py: Container for categoryObjects
- src/categoryObject.py: Object for categories that contains processes
- src/processObject.py: Object for process (e.g. ttH_hbb), contains uncertainties corresponding to the process
- src/systematicObject.py: object for nuisance parameters (e.g. bgnorm_ttbarPlusBBbar)
Expand Down
4 changes: 0 additions & 4 deletions base/identificationLogic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from sys import exit
class identificationLogic(object):
"""
The identificationLogic class is meant to handle all logic concerning
Expand Down Expand Up @@ -150,9 +149,6 @@ def insert_channel(self, channel_name, base_key):
print "-"*130, "\nDEBUG: key after channel insertion:", s
print "-"*130
return s
else:
print "UPS"
exit(0)
return base_key

def insert_process(self, process_name, base_key):
Expand Down
11 changes: 10 additions & 1 deletion base/valueConventions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class valueConventions(object):
def __init__(self):

print "Initializing valueConventions"
self._allowed_types = ["lnN", "shape"]
self._debug = 99

def isfloat(self, value):
try:
Expand All @@ -34,4 +36,11 @@ def is_good_systval(self, value):
is_good = all(self.isfloat(v) for v in totest)
if not is_good:
print "Given value not suitable for an uncertainty in a datacard!"
return is_good
return is_good

def is_allowed_type(self, typ):
if typ in self._allowed_types:
return True
if self._debug >= 99:
print "ERROR: Uncertainty type '%s' is not allowed"
return False
8 changes: 4 additions & 4 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# datacardMaker src
classes for object-oriented datacard maker

- datacardMaker.py: Wrapper to automatically create data cards from category/process/systematic objects
- a datacard maker object is able to have multiple categories with multiple processes with corresponding systematics
- datacardMaker.py: Wrapper to automatically create data cards from analysis objects
- write Datacard with write_datacard()
- analysisObject.py: Container for categoryObjects
- an analysis object is able to have multiple categories with multiple processes with corresponding systematics
- uses category, process and systematic objects
- add category with add_category()
- write Datacard with write_datacard()
- read Datacard with load_from_file()
- categoryObject.py: object for categories
- a category has multiple processes with a number of systematic uncertainties
- categoryObject knows generic keys for files and histogram names for data and uncertainties
Expand Down
Loading

0 comments on commit 0589eeb

Please sign in to comment.