Skip to content
Merged
Show file tree
Hide file tree
Changes from 178 commits
Commits
Show all changes
185 commits
Select commit Hold shift + click to select a range
d06d7ef
aligining ch_update to master
anpicci Jun 6, 2024
09d07ae
first implementation of parsing selections defining a SR - only tried…
anpicci Jun 21, 2024
bfeb3b8
Uploading latest Tau SF functions
anpicci Apr 15, 2024
525e57d
Update topeft/modules/corrections.py
anpicci Apr 16, 2024
98d68e9
Addressing lint errors
anpicci Apr 16, 2024
b56cd5b
Addressing lint issues
anpicci Jun 7, 2024
3abbde7
Pin setuptools
bryates Jul 18, 2024
a3119fb
Checkout `pin-setuptools` on TopCoffea
bryates Jul 18, 2024
ef087c5
Back to topcoffea main
bryates Jul 18, 2024
36bc629
Modifying the code according to the results from the CI tests
anpicci Jul 30, 2024
179fe5f
adapt datacards_post_processing.py to ch_lst.json
Aug 5, 2024
4648e99
Merge branch 'ch_update_histeft' of github.com:TopEFT/topeft into ch_…
jlawrenc Aug 12, 2024
5dcb941
Update ch_lst json
jlawrenc Aug 12, 2024
9b4beaa
testing
anpicci Aug 13, 2024
e7c0536
Updates for CRs in processor and json, replacing deepthought with hac…
anpicci Aug 13, 2024
0e07153
Fixing some bugs in the analysis_processor
anpicci Aug 16, 2024
e9f2853
fixing channel json
anpicci Aug 19, 2024
2469d7e
fixing channel json
anpicci Aug 19, 2024
ac5ca64
Updated and working versions
anpicci Aug 19, 2024
1599a64
update ch_lst_test.json with 3loffZ split
Sep 12, 2024
7626c85
turn off 3loffZ split
Sep 12, 2024
afbcefc
Add tau channels
jlawrenc Sep 17, 2024
fca1433
update datacards_post_processing.py script for ch_lst_test.json
Sep 17, 2024
337efad
Change tau channels
jlawrenc Sep 18, 2024
11a37e8
Add taus to datacards_post_processing
jlawrenc Sep 18, 2024
01b8730
Addressing pylint errors
anpicci Sep 20, 2024
962befb
Addressing pylint errors
anpicci Sep 20, 2024
6c7c825
Addressing pylint errors
anpicci Sep 20, 2024
1df750e
add 3l-offZ-split channels in analysis_processor.py
Sep 20, 2024
eb438d2
Addressing Lint errors
anpicci Sep 20, 2024
f60dfc2
Merge branch 'master' into ch_update_histeft
anpicci Sep 20, 2024
7fb3855
Fixing TES/FES
anpicci Sep 20, 2024
62afb18
Addressing pylint errors
anpicci Sep 20, 2024
09bf1f5
recalling the correct branch for topcoffea
anpicci Sep 20, 2024
9f33977
Changes to tau run mode based on comments
jlawrenc Sep 20, 2024
d67994c
fix run_analysis issue
jlawrenc Sep 20, 2024
d61c2e7
Generalizing usage of lepton categories for weight_dict
anpicci Sep 25, 2024
f59d265
Address pylint issues
anpicci Sep 25, 2024
536c668
Add fwd region
bryates Nov 7, 2024
a8d2e3b
Remove `rebin`
bryates Nov 7, 2024
e66b5ef
Add `--fwd-flag` and copy LT
bryates Nov 25, 2024
32a6342
Propagate flags correctly
bryates Nov 26, 2024
9ee1b01
Actually use fwd flag
bryates Nov 26, 2024
223e7e8
Update missing parton script
bryates Dec 3, 2024
1a7f985
Some improvements
bryates Dec 3, 2024
0427eb5
Add `fwd` region to missing parton
bryates Dec 3, 2024
cb17788
Fix lint
bryates Dec 3, 2024
b5192e7
Use l1 for `fwd` not `tau`
bryates Dec 3, 2024
98a525e
Ignore specified variables
bryates Dec 3, 2024
a918a50
Revert
bryates Dec 3, 2024
d631d23
Ignore specified variables
bryates Dec 3, 2024
ca1bb60
edit dc post selection for 2lss_fwd lt
Dec 3, 2024
bca97ce
Merge pull request #444 from TopEFT/2lssfwdregions_ch-update
ywan2 Dec 3, 2024
dd4514f
minor update in fwd post dc
Dec 3, 2024
f55cd02
update run_analysis for command options
Dec 3, 2024
884b4cf
remove 2lss_4t_fwd regions
Dec 12, 2024
57f253b
Adding 3l fwd and 1j
bryates Dec 16, 2024
9975344
3l 1j for fwd only
bryates Dec 16, 2024
f41f139
Fix typos
bryates Dec 16, 2024
23df2fd
More typos
bryates Dec 16, 2024
38a5dd0
Fix `args.fwd_flag`
bryates Dec 16, 2024
bc4b058
Fix parentheses
bryates Dec 16, 2024
b74652a
More parentheses
bryates Dec 16, 2024
4946c2e
Bad comma in json
bryates Dec 16, 2024
cf3d83a
Use `jet_cat`
bryates Dec 16, 2024
71f658d
`=1j` in wrong selection
bryates Dec 16, 2024
290bdd0
Fix onZ 1j
bryates Dec 17, 2024
8768c2f
Simplify logic (fwd/~fwd called later)
bryates Dec 17, 2024
42407de
Updated plotting script, added explicit unblind flag
bryates Dec 17, 2024
101a2f9
Comment out entire rebin block
bryates Dec 17, 2024
db662a1
Fix typo in `2lss_fwd` channel names
bryates Dec 17, 2024
71d3485
Merge branch 'master' into ch_update_histeft
anpicci Dec 19, 2024
6f70518
addressing pylint errors
anpicci Dec 19, 2024
667bbf5
addressing pylint errors
anpicci Dec 19, 2024
bb39ce2
addressing pylint errors
anpicci Dec 19, 2024
f71c9cb
Addressing Brent's comments and first try to fix CI Analysis errors
anpicci Dec 19, 2024
9f240e0
addressing pylint errors
anpicci Dec 19, 2024
646476a
Fix CI Analysis errors
anpicci Dec 19, 2024
c30b64b
fix fwdjet masking
Dec 19, 2024
3a9ea09
include lt variable in analysis processor
Dec 19, 2024
b0840e5
add removed scalings post selection
Dec 20, 2024
d0ea771
Merge branch 'ch_update_histeft' into 3l_fwd
bryates Dec 20, 2024
aa6923e
change back 2lss 4t bin variable to lj0pt
Dec 20, 2024
043dfeb
Include 3l fwd
bryates Dec 20, 2024
c844e18
fixing 3l-offZ bug
anpicci Dec 20, 2024
7471d51
New jsons for including extensions in the same jsons as the original …
anpicci Dec 20, 2024
7afa64a
reverting some temporary additions
anpicci Dec 20, 2024
0d07c2c
Merge branch 'master' into ch_update_histeft
anpicci Dec 20, 2024
fa07ec7
pylint comments addressed
anpicci Dec 20, 2024
deb39a7
Merging master
bryates Jan 24, 2025
ee75727
Fix typo
bryates Jan 24, 2025
24a89ea
Just process fwd with flag
bryates Jan 25, 2025
64638b9
Plot 3l_fwd
bryates Jan 25, 2025
ee65e8c
Fix typo
bryates Jan 25, 2025
f81bc77
Merge branch 'master' into 3l_fwd
bryates Jan 27, 2025
d7bdf03
Improve logic
bryates Jan 27, 2025
2a07bd4
Formatting
bryates Jan 27, 2025
9eaee18
Add 3l fwd to missing parton script
bryates Jan 27, 2025
31e1831
Fix lint
bryates Jan 27, 2025
f52fb64
Add back central 3l with explicit no forward jet selection
bryates Jan 28, 2025
c41cef3
Json typo
bryates Jan 28, 2025
5bc16ff
3l_fwd missing parton
bryates Jan 28, 2025
1106f19
Fix missing parton file
bryates Jan 29, 2025
8447b06
Fwd jet counts as an extra jet
bryates Jan 29, 2025
0c90d3b
Draw systs on data-MC plots
bryates Jan 29, 2025
e528664
Remove 4l (same as TOP-22-006)
bryates Feb 4, 2025
467eaaf
Remove 3l fwd 2b (no events)
bryates Feb 4, 2025
72201af
Lint errors
bryates Feb 4, 2025
4a8f01c
More lint
bryates Feb 4, 2025
d4da919
Lint again
bryates Feb 4, 2025
39fd2a3
Bracket style (lint)
bryates Feb 4, 2025
d9e8f0f
Close braket no newline
bryates Feb 4, 2025
31a9e88
Remove explicit jet cuts on 3l 2b
bryates Feb 11, 2025
10d7d1c
json per file (good for condor)
bryates Feb 11, 2025
fb9eb48
Fix problems with tau run mode
jlawrenc Feb 11, 2025
9677d1e
Fix 3l lt
bryates Feb 12, 2025
d73d248
Check for 0 observations
bryates Feb 12, 2025
3a34217
Fix typo
bryates Feb 12, 2025
4f46046
Suppress grep message
bryates Feb 12, 2025
12b91c5
Skip 3l 1j in central region
bryates Feb 12, 2025
c2a65f6
Overflow error bands
bryates Feb 14, 2025
4a43b51
edit offZ division in ch_lst_test.json
Mar 6, 2025
86cebf9
update get_datacard_yields.py for 3lfwd
Mar 21, 2025
8ebdfb1
add bjet mask of at least 1b
Mar 25, 2025
6a4911c
Fix missing_parton/tau issue
jlawrenc Mar 26, 2025
518344f
add fwd upper eta cut and 3l 2b channels
Apr 14, 2025
6b3c899
add missing masking for central 3l
Apr 18, 2025
10c6de1
edit offZ masking and variable
Apr 28, 2025
bb21137
Update to Tau run Mode
May 20, 2025
1719f78
add tauFitter.py
May 21, 2025
93a9634
update datacards selection for combine analysis
Jun 11, 2025
3aa870a
Add 2los_1tau_CRs
Jul 7, 2025
4608fe4
Corrections to tau CRs
Jul 9, 2025
12a13b6
Update documentation on tauFitter.py
Jul 9, 2025
f0429e9
fixing json format
anpicci Jul 11, 2025
3c7b873
separating tau CRs from tau SRs; make make_cards compatible with neta…
anpicci Jul 11, 2025
72fd0c4
improving handling of cat dicts
anpicci Jul 11, 2025
fee4209
using ch_lst in place of ch_lst_test
anpicci Jul 14, 2025
a55406b
removing ch_lst_test
anpicci Jul 14, 2025
c90c050
fixing number of expected datacards for the tau analysis
anpicci Jul 14, 2025
af2087d
fixing flavor split for the 1l1tau CRs
anpicci Jul 15, 2025
b225975
fix 2lmm preselection definition
anpicci Jul 21, 2025
480997f
edit file path to skynet
Jul 25, 2025
021bf08
Merge branch 'master' into ch_update_histeft
anpicci Jul 31, 2025
3d8ca4c
re-removing ch_lst_test.json
anpicci Jul 31, 2025
e6d9870
Merge pull request #484 from anpicci/ch_update_histeft
anpicci Jul 31, 2025
0c7b6f8
Fix flake8 issues
anpicci Jul 31, 2025
1f8b771
Merge pull request #6 from anpicci/codex/fix-lint-errors-in-pr-482
anpicci Jul 31, 2025
9fcb8cf
Merge branch 'TopEFT:ch_update_histeft' into ch_update_histeft
anpicci Jul 31, 2025
e5d4312
Merge pull request #485 from anpicci/ch_update_histeft
anpicci Jul 31, 2025
79a5dea
Addressing Brent's comments
anpicci Aug 3, 2025
f981bbe
Merge branch 'ch_update_histeft' into ch_update_histeft
anpicci Aug 3, 2025
d1487bc
Merge pull request #488 from anpicci/ch_update_histeft
anpicci Aug 3, 2025
2ef87f4
fix unused variables
anpicci Aug 3, 2025
f3fd48a
Merge branch 'ch_update_histeft' into 65zxez-codex/fix-lint-errors-in…
anpicci Aug 3, 2025
a869723
Fix lint issues -- merge
anpicci Aug 3, 2025
728dcfb
other fixes
anpicci Aug 4, 2025
0c5ef2c
other fixes
anpicci Aug 4, 2025
0dd6c2b
possibly fixing an error with tmp
anpicci Aug 4, 2025
92ee249
possibly fixing an error with tmp
anpicci Aug 4, 2025
fe63cc2
Restore original Work Queue test
anpicci Aug 4, 2025
1495baa
Fix plotting escape warnings in analysis scripts
anpicci Aug 4, 2025
57b661a
Merge pull request #490 from anpicci/ch_update_histeft
anpicci Aug 4, 2025
1356450
adding SR category with offZ fwd max 4j
Aug 12, 2025
2888b8c
update datacard_post_processing accordingly
Aug 12, 2025
8330752
resolve conflicts
Aug 12, 2025
e8765b9
add fwd and tau integrated channels
Aug 12, 2025
9b3b513
update ch_lst.json integrating fwd and tau
Aug 26, 2025
5e1dcd5
add all categories to ch_lst
Aug 26, 2025
09df374
edit 2l fwd tau analysis
Aug 31, 2025
1342bb0
add in all contributions
Sep 10, 2025
993ebbc
update ch_lst
Sep 10, 2025
1a6c87e
edit files
Sep 23, 2025
c84878b
fix datacard
Sep 23, 2025
a35ac28
add file
Sep 23, 2025
f18ecde
fix lint
Sep 23, 2025
aef4c6a
fix Lint
Sep 23, 2025
47891cf
remove commented lines
Sep 24, 2025
7cec4fa
update all analysis setup
Sep 30, 2025
7aac706
uncomment filepath in run analysis
ywan2 Oct 28, 2025
9c05dad
remove lepton flav split
ywan2 Oct 31, 2025
067cca0
edit lambda plots
ywan2 Oct 31, 2025
237553e
minor fixes
ywan2 Oct 31, 2025
876249d
remove lines in plotting script
ywan2 Nov 5, 2025
7b29a49
edit plotting script
ywan2 Nov 5, 2025
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
43 changes: 30 additions & 13 deletions analysis/btagMCeff/btagMCeff.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ def __init__(self, samples):
jeta_axis = hist.axis.Regular(25, -2.5, 2.5, name="eta", label=r"Jet \eta (GeV)")
jaeta_axis = hist.axis.Variable([0, 1, 1.8, 2.4], name="abseta", label=r"Jet \eta (GeV)")
Flav_axis = hist.axis.StrCategory([], name="Flav", growth=True)
flav_axis = hist.axis.IntCategory([], name="flav", growth=True)
flav_axis = hist.axis.Regular(5, 0, 5, name="flav", label="jet flav")
wp_axis = hist.axis.StrCategory([], name="WP", growth=True)
self._accumulator = {
'jetpt' : hist.Hist(wp_axis, Flav_axis, jpt_axis),
'jeteta' : hist.Hist(wp_axis, Flav_axis, jeta_axis),
'jetpteta' : hist.Hist(wp_axis, Flav_axis, jpt_axis, jaeta_axis),
'jetptetaflav' : hist.Hist(wp_axis, jetpt_axis, jaeta_axis, flav_axis),
'jetptetaflav' : hist.Hist(wp_axis, jetpt_axis, flav_axis, jaeta_axis)
}

self._bjets = 0
@property
def accumulator(self):
return self._accumulator
Expand All @@ -51,6 +51,8 @@ def columns(self):

# Main function: run on a given dataset
def process(self, events):

events = events
# Dataset parameters
dataset = events.metadata['dataset']
year = self._samples[dataset]['year']
Expand All @@ -61,18 +63,30 @@ def process(self, events):
for d in datasets:
if d in dataset: dataset = dataset.split('_')[0]

is_run3 = False
if year.startswith("202"):
is_run3 = True
is_run2 = not is_run3

# Initialize objects
met = events.MET
e = events.Electron
mu = events.Muon
j = events.Jet

if is_run3:
leptonSelection = te_os.run3leptonselection()
jetsRho = events.Rho["fixedGridRhoFastjetAll"]
elif is_run2:
leptonSelection = te_os.run2leptonselection()
jetsRho = events.fixedGridRhoFastjetAll

# Muon selection
mu["conept"] = te_os.coneptMuon(mu.pt, mu.mvaTTHUL, mu.jetRelIso, mu.mediumId)
mu["conept"] = leptonSelection.coneptMuon(mu)
mu["btagDeepFlavB"] = ak.fill_none(mu.matched_jet.btagDeepFlavB, -99)
mu["isPres"] = te_os.isPresMuon(mu.dxy, mu.dz, mu.sip3d, mu.eta, mu.pt, mu.miniPFRelIso_all)
mu["isFO"] = te_os.isFOMuon(mu.pt, mu.conept, mu.btagDeepFlavB, mu.mvaTTHUL, mu.jetRelIso, year)
mu["isTight"]= te_os.tightSelMuon(mu.isFO, mu.mediumId, mu.mvaTTHUL)
mu["isPres"] = leptonSelection.isPresMuon(mu)
mu["isFO"] = leptonSelection.isFOMuon(mu, year)
mu["isTight"]= leptonSelection.tightSelMuon(mu)
mu['isGood'] = mu['isPres'] & mu['isTight']

leading_mu = mu[ak.argmax(mu.pt,axis=-1,keepdims=True)]
Expand All @@ -83,11 +97,12 @@ def process(self, events):

# Electron selection
e["idEmu"] = te_os.ttH_idEmu_cuts_E3(e.hoe, e.eta, e.deltaEtaSC, e.eInvMinusPInv, e.sieie)
e["conept"] = te_os.coneptElec(e.pt, e.mvaTTHUL, e.jetRelIso)
e["conept"] = leptonSelection.coneptElec(e)
e["btagDeepFlavB"] = ak.fill_none(e.matched_jet.btagDeepFlavB, -99)
e["isPres"] = te_os.isPresElec(e.pt, e.eta, e.dxy, e.dz, e.miniPFRelIso_all, e.sip3d, getattr(e,"mvaFall17V2noIso_WPL"))
e["isFO"] = te_os.isFOElec(e.pt, e.conept, e.btagDeepFlavB, e.idEmu, e.convVeto, e.lostHits, e.mvaTTHUL, e.jetRelIso, e.mvaFall17V2noIso_WP90, year)
e["isTight"] = te_os.tightSelElec(e.isFO, e.mvaTTHUL)
e["isPres"] = leptonSelection.isPresElec(e)
e["isFO"] = leptonSelection.isFOElec(e, year)
e["isTight"] = leptonSelection.tightSelElec(e)
e["isLooseE"] = leptonSelection.isLooseElec(e)
e['isClean'] = te_os.isClean(e, mu, drmin=0.05)
e['isGood'] = e['isPres'] & e['isTight'] & e['isClean']

Expand All @@ -110,9 +125,11 @@ def process(self, events):
# Jet selection

jetptname = 'pt_nom' if hasattr(j, 'pt_nom') else 'pt'
j["isGood"] = tc_os.is_tight_jet(getattr(j, jetptname), j.eta, j.jetId, pt_cut=30., eta_cut=get_te_param("eta_j_cut"), id_cut=get_te_param("jet_id_cut"))
j["isGood"] = tc_os.is_tight_jet(getattr(j, jetptname), j.eta, j.jetId, pt_cut=30., eta_cut=get_te_param("eta_j_cut"), id_cut=0)
j['isClean'] = te_os.isClean(j, e, drmin=0.4)& te_os.isClean(j, mu, drmin=0.4)
goodJets = j[(j.isClean)&(j.isGood)]
goodJets = goodJets[(goodJets.partonFlavour != 0)]

njets = ak.num(goodJets)
ht = ak.sum(goodJets.pt,axis=-1)
j0 = goodJets[ak.argmax(goodJets.pt,axis=-1,keepdims=True)]
Expand Down Expand Up @@ -150,7 +167,6 @@ def process(self, events):

return hout


def postprocess(self, accumulator):
return accumulator

Expand All @@ -160,3 +176,4 @@ def postprocess(self, accumulator):
samples = load(outpath+'samples.coffea')
topprocessor = AnalysisProcessor(samples)


Loading