Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions Benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ FireHydrant Benchmarks
Some benchmark tasks completed with ffNtuples with [Coffea](https://github.com/CoffeaTeam/coffea).

1. [x] Plot leptonJets multiplicity of all events.
2. [ ] Plot leading and subleading leptonJet pair deltaPhi for *mXX-100_mA-0p25* signals.
3. [ ] Matching leptonJets with gen dark photons (pid=32) by `deltaRCut=0.3`, overlay matched and unmatched leptonJets pT distribution for *mXX-100_mA-0p25* signals.
4. [ ] Overlay leading and subleading leptonJet pair invariant mass for *all* signals, in [0, 200] GeV and [0, 1200] GeV range.
5. [ ] **Trigger efficiency** | Plot the efficiency of logical OR of [DoubleL2Mu triggers](../FireHydrant/Tools/trigger.py) wrt. the pT of subleading displacedStandAloneMuons which satisfied the condition that *|eta|<2.4 && #stations>1 && normalized Chi2<10*.
2. [x] Plot leading and subleading leptonJet pair deltaPhi for *mXX-100_mA-0p25_lxy-300* signals.
3. [x] Matching leptonJets with gen dark photons (pid=32) by `deltaRCut=0.3`, overlay matched and unmatched leptonJets pT distribution for *mXX-100_mA-0p25_lxy-300* signals.
4. [x] Overlay leading and subleading leptonJet pair invariant mass for *all* signals, in [0, 200] GeV and [0, 1200] GeV range.
5. [x] **Trigger efficiency** | Plot the efficiency of logical OR of [DoubleL2Mu triggers](../FireHydrant/Tools/trigger.py) wrt. the pT of subleading displacedStandAloneMuons which satisfied the condition that *|eta|<2.4 && #stations>1 && normalized Chi2<10*.


### Info
Expand Down
18 changes: 9 additions & 9 deletions Benchmarks/benchmark-0.ipynb

Large diffs are not rendered by default.

169 changes: 169 additions & 0 deletions Benchmarks/benchmark-1.ipynb

Large diffs are not rendered by default.

174 changes: 174 additions & 0 deletions Benchmarks/benchmark-2.ipynb

Large diffs are not rendered by default.

181 changes: 181 additions & 0 deletions Benchmarks/benchmark-3.ipynb

Large diffs are not rendered by default.

202 changes: 202 additions & 0 deletions Benchmarks/benchmark-4.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion FireHydrant/Tools/trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"HLT_DoubleL2Mu23NoVtx_2Cha_CosmicSeed_NoL2Matched",
"HLT_DoubleL2Mu25NoVtx_2Cha_Eta2p4",
"HLT_DoubleL2Mu25NoVtx_2Cha_CosmicSeed_Eta2p4",
]
]
1,260 changes: 1,260 additions & 0 deletions Notebooks/Data/DataOnly/TriggerEfficiency_data.ipynb

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions Notebooks/Data/Samples/generate_singleMu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python
"""generate data sample list, until proper sample management tool show up.
"""
import json
import concurrent.futures
import uproot
from FireHydrant.Tools.commonhelpers import eosls, eosfindfile

# This is control region events.
EOSPATHS = dict(
A="/store/user/pimeloni/ffNtuple4trigger/2018/SingleMuon/Run2018A-17Sep2018-v2/190903_170031",
B="/store/user/pimeloni/ffNtuple4trigger/2018/SingleMuon/Run2018B-17Sep2018-v1/190903_170117",
C="/store/user/pimeloni/ffNtuple4trigger/2018/SingleMuon/Run2018C-17Sep2018-v1/190903_170204",
D="/store/user/pimeloni/ffNtuple4trigger/2018/SingleMuon/Run2018D-22Jan2019-v2/190903_170249",
)
REDIRECTOR = "root://cmseos.fnal.gov/"

if __name__ == "__main__":

datasets = {k: eosfindfile(v) for k, v in EOSPATHS.items()}#json.load(open("trigger_data.json"))
with open("trigger_data.json", "w") as outf:
outf.write(json.dumps(datasets, indent=4))



77 changes: 77 additions & 0 deletions Notebooks/Data/Samples/generate_singleMu_nonempty.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/usr/bin/env python
"""generate data sample list, until proper sample management tool show up.
"""
import json
import concurrent.futures
import uproot
from FireHydrant.Tools.commonhelpers import eosls, eosfindfile





# This is control region events with L1 triggers and no pt cut
'''
EOSPATHS = dict(
A="store/user/pimeloni/SIDM/ffNtuple4trigger/2018/SingleMuon/Run2018A-17Sep2018-v2/190903_170031",
B="store/user/pimeloni/SIDM/ffNtuple4trigger/2018/SingleMuon/Run2018B-17Sep2018-v1/190903_170117",
C="store/user/pimeloni/SIDM/ffNtuple4trigger/2018/SingleMuon/Run2018C-17Sep2018-v1/190903_170204",
D="store/user/pimeloni/SIDM/ffNtuple4trigger/2018/SingleMuon/Run2018D-22Jan2019-v2/190903_170249",
)
REDIRECTOR = "root://cmseos.fnal.gov/"
'''





# This is control region events.

EOSPATHS = dict(
A="/store/user/pimeloni/ffNtuple4trigger/2018/SingleMuon/Run2018A-17Sep2018-v2/190903_170031",
B="/store/user/pimeloni/ffNtuple4trigger/2018/SingleMuon/Run2018B-17Sep2018-v1/190903_170117",
C="/store/user/pimeloni/ffNtuple4trigger/2018/SingleMuon/Run2018C-17Sep2018-v1/190903_170204",
D="/store/user/pimeloni/ffNtuple4trigger/2018/SingleMuon/Run2018D-22Jan2019-v2/190903_170249",
)
REDIRECTOR = "root://cmseos.fnal.gov/"


def remove_empty_file(filepath):
"""given a file, if the tree has non-zero number of events, return filepath"""
f_ = uproot.open(filepath)
key_ = f_.allkeys(filtername=lambda k: k.endswith(b"ffNtuple"))
if key_ and uproot.open(filepath)[key_[0]].numentries != 0:
return filepath
else:
return None


def remove_empty_files(filelist):
"""given a list of files, return all files with a tree of non-zero number of events"""
cleanlist = []
with concurrent.futures.ProcessPoolExecutor(max_workers=12) as executor:
futures = {executor.submit(remove_empty_file, f): f for f in filelist}
for future in concurrent.futures.as_completed(futures):
filename = futures[future]
try:
res = future.result()
if res:
cleanlist.append(res)
except Exception as e:
print(f">> Fail to get numEvents for {filename}\n{str(e)}")
return cleanlist



if __name__ == "__main__":

"""parse all background files, remove empty tree files"""
datasets = {k: eosfindfile(v) for k, v in EOSPATHS.items()}#json.load(open("trigger_data.json"))
for group in datasets:
files = datasets[group]
datasets[group] = remove_empty_files(files)
with open("trigger_data_nonempty_no_pt_cut.json", "w") as outf:
outf.write(json.dumps(datasets, indent=4))



Loading