Skip to content

feat: add sum of weights for BTA_ttbar workflow, fix typo in suball script and make basepath in BTA producers configurable #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8a671bf
Fix small bug in --isArray mode
mondalspandan Jan 16, 2025
246a041
doc: add the documentation of CommFW
Ming-Yan Jan 6, 2025
c8b03bd
Linting
mondalspandan Jan 16, 2025
cb10ee0
Add latest 2022 veto maps (summer22 instead of winter22)
mondalspandan Jan 16, 2025
21c8694
feat: add JEC/jetveto with files in jsonpog-intergration
Ming-Yan Jan 17, 2025
c5884ec
fix typo in suball script
philippgadow Jan 20, 2025
8c87a24
change to nodefaults channels to avoid dependency on anacond for ente…
philippgadow Jan 20, 2025
936fbb3
add sum of weights for variations in BTA_ttbar, make basepath configu…
philippgadow Jan 20, 2025
167a689
add protection if lhe and ps scale weights are not present in BTA_ttb…
philippgadow Jan 20, 2025
d5dc253
Merge branch 'spandan_dev_2501' of github.com:mondalspandan/BTVNanoCo…
philippgadow Jan 20, 2025
af54ec9
also transfer files without events for correctly keeping track of sum…
philippgadow Jan 21, 2025
a2ad076
doc: improve plot description
Ming-Yan Jan 20, 2025
8ee0ee6
doc: add correction description
Ming-Yan Jan 21, 2025
90bd9b4
add default gen unc.
Ming-Yan Jan 21, 2025
35550d4
fix: JEC unc
Ming-Yan Jan 21, 2025
70684b8
fix: uncertainties
Ming-Yan Jan 22, 2025
e28a1e2
add white/black list to suball
philippgadow Jan 23, 2025
d24987f
merge
philippgadow Jan 23, 2025
f3b4234
pre merge master
philippgadow Jan 23, 2025
7dcf7e3
merge with master
philippgadow Jan 23, 2025
85d65b3
update BTA_ttbar producer
philippgadow Jan 28, 2025
af9395d
Merge branch 'master' of github.com:cms-btv-pog/BTVNanoCommissioning …
philippgadow Jan 29, 2025
546bcc2
Merge branch 'master' of github.com:cms-btv-pog/BTVNanoCommissioning …
philippgadow Jan 31, 2025
0213f28
update BTA ttbar producer
philippgadow Feb 3, 2025
0a1f7c1
Merge branch 'master' of github.com:cms-btv-pog/BTVNanoCommissioning …
philippgadow Mar 5, 2025
a254d08
implement distinction for run 2 and run 3 MET
philippgadow Mar 10, 2025
777a5a9
format with black
philippgadow Mar 10, 2025
119eb42
remove DUST reference
philippgadow Mar 10, 2025
39ca4c2
fix run 2 vs run 3 MET selection
philippgadow Mar 10, 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
29 changes: 21 additions & 8 deletions scripts/suball.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def get_lumi_from_web(year):
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Mastering workflow submission")
parser = config_parser(parser)
paser = scaleout_parser(parser)
paser = debug_parser(parser)
parser = scaleout_parser(parser)
parser = debug_parser(parser)
parser.add_argument(
"-sc",
"--scheme",
Expand All @@ -74,6 +74,16 @@ def get_lumi_from_web(year):
required=True,
help="Input the campaign name for DAS to search appropriate campaigns, use in dataset construction , please do `data_camapgin,mc_campaign` split by `,`, e.g. `*Run2023D*Sep2023*,*Run3Summer23BPixNanoAODv12-130X*` ",
)
parser.add_argument(
"--whitelist_sites",
help="White list fot sites",
default=None,
)
parser.add_argument(
"--blacklist_sites",
help="Black list for sites",
default=None,
)
parser.add_argument("-v", "--version", default="", help="version postfix")
parser.add_argument(
"--local",
Expand Down Expand Up @@ -134,14 +144,15 @@ def get_lumi_from_web(year):
)
or args.overwrite
):
command = f"python scripts/fetch.py -c {args.campaign} --from_workflow {wf} --DAS_campaign {args.DAS_campaign} --year {args.year} {overwrite} --skipvalidation"
if args.whitelist_sites is not None:
command += f" --whitelist_sites {args.whitelist_sites}"
if args.blacklist_sites is not None:
command += f" --blacklist_sites {args.blacklist_sites}"
if args.debug:
print(
f"Creating MC dataset: python scripts/fetch.py -c {args.campaign} --from_workflow {wf} --DAS_campaign {args.DAS_campaign} --year {args.year} {overwrite} --skipvalidation"
)
print(f"Creating MC dataset: {command}")

os.system(
f"python scripts/fetch.py -c {args.campaign} --from_workflow {wf} --DAS_campaign {args.DAS_campaign} --year {args.year} {overwrite} --skipvalidation"
)
os.system(command)
if args.debug:
os.system(f"ls metadata/{args.campaign}/*.json")

Expand Down Expand Up @@ -179,6 +190,8 @@ def get_lumi_from_web(year):
"version",
"local",
"debug",
"whitelist_sites",
"blacklist_sites",
]:
continue
if key in [
Expand Down
3 changes: 2 additions & 1 deletion src/BTVNanoCommissioning/utils/correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ def JME_shifts(
## JEC variations
if not isRealData and systematic != False:
if systematic != "JERC_split":
## JEC variations
jesuncmap = correct_map["JME"][f"{jecname}_Total_AK4PFPuppi"]
jesunc = ak.unflatten(jesuncmap.evaluate(j.eta, j.pt), nj)
unc_jets, unc_met = {}, {}
Expand Down Expand Up @@ -823,7 +824,7 @@ def JME_shifts(
if "jetveto" in correct_map.keys():
jets = update(jets, {"veto": jetveto(jets, correct_map)})

if "Summer22" in campaign:
if "Summer22" in str(campaign):
jets = jets[jets.veto != 1]
shifts.insert(0, ({"Jet": jets, "MET": met}, None))
return shifts
Expand Down
6 changes: 4 additions & 2 deletions src/BTVNanoCommissioning/workflows/BTA_producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def __init__(
chunksize=75000,
addPFMuons=False, # BTA custom argument
addAllTracks=False, # BTA custom argument
base_file_path="root://eoscms.cern.ch//eos/cms/store/group/phys_btag/milee",
):
self._year = year
self._campaign = campaign
Expand All @@ -46,6 +47,7 @@ def __init__(
self.addPFMuons = addPFMuons
self.addAllTracks = addAllTracks
self.isSyst = isSyst
self.base_file_path = base_file_path

@property
def accumulator(self):
Expand All @@ -65,7 +67,7 @@ def process(self, events):
if self.isSyst:
fname = "systematic/" + fname
checkf = os.popen(
f"gfal-ls root://eoscms.cern.ch//eos/cms/store/group/phys_btag/milee/{dirname}/{self._campaign.replace('Run3','')}/{fname}"
f"gfal-ls {self.base_file_path}/{dirname}/{self._campaign.replace('Run3','')}/{fname}"
).read()
if len(checkf) > 0:
print("skip ", checkf)
Expand Down Expand Up @@ -1163,7 +1165,7 @@ def process_shift(self, events, shift_name):
output_root[bname] = ak.zip(b_nest)
fout["btagana/ttree"] = output_root
os.system(
f"xrdcp -p --silent {fname} root://eoscms.cern.ch//eos/cms/store/group/phys_btag/milee/{dirname}/{self._campaign.replace('Run3','')}/{fname}"
f"xrdcp -p --silent {fname} {self.base_file_path}/{dirname}/{self._campaign.replace('Run3','')}/{fname}"
)
os.system(f"rm {fname}")

Expand Down
Loading