Skip to content

Commit

Permalink
Addressing Brent's comments and first try to fix CI Analysis errors
Browse files Browse the repository at this point in the history
  • Loading branch information
anpicci committed Dec 19, 2024
1 parent bb39ce2 commit f71c9cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
run: |
mkdir dir_for_topcoffea
cd dir_for_topcoffea
git clone https://github.com/TopEFT/topcoffea.git --branch ch_update
git clone https://github.com/TopEFT/topcoffea.git
cd topcoffea
conda run -n coffea-env pip install -e .
cd ../..
Expand Down
18 changes: 10 additions & 8 deletions analysis/topeft_run2/analysis_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(self, samples, wc_names_lst=[], hist_lst=None, ecut_threshold=None,
self._samples = samples
self._wc_names_lst = wc_names_lst
self._dtype = dtype
self._offZ_split = offZ_split
self.3l_offZ_split = offZ_split
self.tau_h_analysis = tau_h_analysis
self.fwd_analysis = fwd_analysis

Expand Down Expand Up @@ -592,7 +592,7 @@ def process(self, events):
select_cat_dict = json.load(ch_json_test)

# This dictionary keeps track of which selections go with which SR categories
if self._offZ_split:
if self.3l_offZ_split:
import_sr_cat_dict = select_cat_dict["OFFZ_SPLIT_CH_LST_SR"]
elif self.tau_h_analysis:
import_sr_cat_dict = select_cat_dict["TAU_CH_LST_SR"]
Expand Down Expand Up @@ -657,9 +657,11 @@ def process(self, events):

# Get mask for events that have two sf os leps close to z peak
sfosz_3l_OnZ_mask = tc_es.get_Z_peak_mask(l_fo_conept_sorted_padded[:,0:3],pt_window=10.0)
sfosz_3l_OffZ_mask = ~sfosz_3l_OnZ_mask
sfosz_3l_OffZ_low_mask = tc_es.get_off_Z_mask_low(l_fo_conept_sorted_padded[:,0:3],pt_window=0.0)
sfosz_3l_OffZ_any_mask = tc_es.get_any_sfos_pair(l_fo_conept_sorted_padded[:,0:3])
if self.3l_offZ_split:
sfosz_3l_OffZ_low_mask = tc_es.get_off_Z_mask_low(l_fo_conept_sorted_padded[:,0:3],pt_window=0.0)
sfosz_3l_OffZ_any_mask = tc_es.get_any_sfos_pair(l_fo_conept_sorted_padded[:,0:3])
else:
sfosz_3l_OffZ_mask = ~sfosz_3l_OnZ_mask
sfosz_2l_mask = tc_es.get_Z_peak_mask(l_fo_conept_sorted_padded[:,0:2],pt_window=10.0)
sfasz_2l_mask = tc_es.get_Z_peak_mask(l_fo_conept_sorted_padded[:,0:2],pt_window=30.0,flavor="as") # Any sign (do not enforce ss or os here)
if self.tau_h_analysis:
Expand Down Expand Up @@ -739,7 +741,7 @@ def process(self, events):
preselections.add("3l_m", (events.is3l & pass_trg & charge3l_m))
preselections.add("3l_onZ", (sfosz_3l_OnZ_mask))

if self._offZ_split:
if self.3l_offZ_split:
preselections.add("3l_offZ_low", (sfosz_3l_OffZ_mask & sfosz_3l_OffZ_any_mask & sfosz_3l_OffZ_low_mask))
preselections.add("3l_offZ_high", (sfosz_3l_OffZ_mask & sfosz_3l_OffZ_any_mask & ~sfosz_3l_OffZ_low_mask))
preselections.add("3l_offZ_none", (sfosz_3l_OffZ_mask & ~sfosz_3l_OffZ_any_mask))
Expand Down Expand Up @@ -837,7 +839,7 @@ def process(self, events):
ptz = te_es.get_Z_pt(l_fo_conept_sorted_padded[:,0:3],10.0)
if self.tau_h_analysis:
ptz_wtau = (l0+tau0).pt
if self._offZ_split:
if self.3l_offZ_split:
ptz = te_es.get_ll_pt(l_fo_conept_sorted_padded[:,0:3],10.0)
# Leading (b+l) pair pt
bjetsl = goodJets[isBtagJetsLoose][ak.argsort(goodJets[isBtagJetsLoose].pt, axis=-1, ascending=False)]
Expand Down Expand Up @@ -1072,7 +1074,7 @@ def process(self, events):
# Skip histos that are not defined (or not relevant) to given categories
if ((("j0" in dense_axis_name) and ("lj0pt" not in dense_axis_name)) & (("CRZ" in ch_name) or ("CRflip" in ch_name))): continue
if ((("j0" in dense_axis_name) and ("lj0pt" not in dense_axis_name)) & ("0j" in ch_name)): continue
if self._offZ_split:
if self.3l_offZ_split:
if (("ptz" in dense_axis_name) & ("onZ" not in lep_chan) & ("offZ_high" not in lep_chan) & ("offZ_low" not in lep_chan)):continue
elif self.tau_h_analysis:
if (("ptz" in dense_axis_name) and ("onZ" not in lep_chan)): continue
Expand Down

0 comments on commit f71c9cb

Please sign in to comment.