Skip to content

Commit

Permalink
flow argument added to make_scaling() (#59)
Browse files Browse the repository at this point in the history
* make_scaling function added

* make_scaling function added

* make_scaling function added

* make_scaling function added

* make_scaling function added

* fixed post  conditional

* removed whitespace

* removed whitespace

* loop fixed

* exception added for bsm with no sm

* artifact elif removed

* np.ogrid implementation

* fixed bug when wc_list is not called

* fixed make_scaling bug for empty bins

* whitespace removed

* bug fix after merge conflicts

* Added flow argument to make_scaling function

* conflict resolved

* changes to main merged
  • Loading branch information
emcgrady authored Feb 7, 2025
1 parent c9c144e commit a05465d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion topcoffea/modules/histEFT.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def __reduce__(self):
),
)

def make_scaling(self, wc_list=None):
def make_scaling(self, flow='show', wc_list=None):
"""
returns np.Array of scaling for scalings.json with the interference model list with flow bins
----------
Expand All @@ -342,6 +342,12 @@ def make_scaling(self, wc_list=None):
step += 1
else:
scaling[:,i] /= 2
if flow=='sum':
scaling[-2] += scaling[-1]
scaling[1] += scaling[0]
scaling = scaling[1:-1]
elif flow !='show':
raise Exception(f'Invalid flow options {flow} selected! Please select from "show" or "sum".')
mask = scaling[:,0] != 0
scaling[mask,:] = scaling[mask,:]/np.expand_dims(scaling[mask,0], 1) #divide by sm
return scaling
Expand Down

0 comments on commit a05465d

Please sign in to comment.