Skip to content

Commit

Permalink
merge master branch into v12_2016_post
Browse files Browse the repository at this point in the history
  • Loading branch information
nprouvost committed Dec 14, 2023
2 parents ec0cf72 + d83fb08 commit cc68557
Show file tree
Hide file tree
Showing 10 changed files with 260 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/lint_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
python -c "from cmsdb.campaigns.run2_2017_nano_uhh_v11 import *"
python -c "from cmsdb.campaigns.run2_2018_nano_uhh_v11 import *"
python -c "from cmsdb.campaigns.run2_2016_nano_uhh_v12 import *"
python -c "from cmsdb.campaigns.run2_2017_JMEnano_v9 import *"
python -c "from cmsdb.campaigns.run2_2018_JMEnano_v9 import *"
python -c "from cmsdb.campaigns.run3_2022_preEE_nano_v11 import *"
python -c "from cmsdb.campaigns.run3_2022_postEE_nano_v11 import *"
32 changes: 32 additions & 0 deletions cmsdb/campaigns/run2_2017_JMEnano_v9/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# coding: utf-8

"""
Common, analysis independent definition of the 2017 data-taking campaign
with datasets at NanoAOD tier in version 9.
See https://python-order.readthedocs.io/en/latest/quickstart.html#analysis-campaign-and-config.
Dataset ids are identical to those in DAS (https://cmsweb.cern.ch/das).
"""

from order import Campaign


#
# campaign
#

campaign_run2_2017_JMEnano_v9 = Campaign(
name="run2_2017_JMEnano_v9",
id=220201,
ecm=13,
bx=25,
aux={
"year": 2017,
"tier": "NanoAOD",
"version": "9",
},
)

# trailing imports to load datasets
import cmsdb.campaigns.run2_2017_JMEnano_v9.data # noqa
import cmsdb.campaigns.run2_2017_JMEnano_v9.qcd # noqa
88 changes: 88 additions & 0 deletions cmsdb/campaigns/run2_2017_JMEnano_v9/data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# coding: utf-8

"""
CMS datasets from the 2017 data-taking campaign
"""

import cmsdb.processes as procs
from cmsdb.campaigns.run2_2017_JMEnano_v9 import campaign_run2_2017_JMEnano_v9 as cpn


#
# DiJet
#

cpn.add_dataset(
name="data_jetht_b",
id=14260759, # from das
is_data=True,
processes=[procs.data_jetht],
keys=[
"/JetHT/Run2017B-UL2017_MiniAODv2_JMENanoAODv9-v1/NANOAOD",
],
n_files=96,
n_events=63043590,
aux={
"era": "B",
},
)

cpn.add_dataset(
name="data_jetht_c",
id=14260769,
is_data=True,
processes=[procs.data_jetht],
keys=[
"/JetHT/Run2017C-UL2017_MiniAODv2_JMENanoAODv9-v1/NANOAOD",
],
n_files=158,
n_events=96264601,
aux={
"era": "C",
},
)

cpn.add_dataset(
name="data_jetht_d",
id=14260518,
is_data=True,
processes=[procs.data_jetht],
keys=[
"/JetHT/Run2017D-UL2017_MiniAODv2_JMENanoAODv9-v1/NANOAOD",
],
n_files=89,
n_events=46145204,
aux={
"era": "D",
},
)

cpn.add_dataset(
name="data_jetht_e",
id=14260363,
is_data=True,
processes=[procs.data_jetht],
keys=[
"/JetHT/Run2017E-UL2017_MiniAODv2_JMENanoAODv9-v1/NANOAOD",
],
n_files=148,
n_events=89630771,
aux={
"era": "E",
},
)

cpn.add_dataset(
name="data_jetht_f",
id=14260621,
is_data=True,
processes=[procs.data_jetht],
keys=[
"/JetHT/Run2017F-UL2017_MiniAODv2_JMENanoAODv9-v1/NANOAOD",
],
n_files=228,
n_events=115429972,
aux={
"era": "F",
},
)
117 changes: 117 additions & 0 deletions cmsdb/campaigns/run2_2017_JMEnano_v9/qcd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# coding: utf-8

"""
QCD datasets for the 2017 data-taking campaign
"""

import cmsdb.processes as procs
from cmsdb.campaigns.run2_2017_JMEnano_v9 import campaign_run2_2017_JMEnano_v9 as cpn


#
# QCD HT-binned
#

# HT-binned samples

generator = "TuneCP5_PSWeights_13TeV-madgraph-pythia8"
cmssw = "106X_mc2017_realistic_v9-v1"

cpn.add_dataset(
name="qcd_ht50to100_madgraph",
id=14281497,
processes=[procs.qcd_ht50to100],
keys=[
f"/QCD_HT50to100_{generator}/RunIISummer20UL17NanoAODv9-20UL17JMENano_{cmssw}/NANOAODSIM",
],
n_files=52,
n_events=26129826,
)

cpn.add_dataset(
name="qcd_ht100to200_madgraph",
id=14300506,
processes=[procs.qcd_ht100to200],
keys=[
f"/QCD_HT100to200_{generator}/RunIISummer20UL17NanoAODv9-20UL17JMENano_{cmssw}/NANOAODSIM",
],
n_files=99,
n_events=54705747,
)

cpn.add_dataset(
name="qcd_ht200to300_madgraph",
id=14289012,
processes=[procs.qcd_ht200to300],
keys=[
f"/QCD_HT200to300_{generator}/RunIISummer20UL17NanoAODv9-20UL17JMENano_{cmssw}/NANOAODSIM",
],
n_files=85,
n_events=42679193,
)

cpn.add_dataset(
name="qcd_ht300to500_madgraph",
id=14288347,
processes=[procs.qcd_ht300to500],
keys=[
f"/QCD_HT300to500_{generator}/RunIISummer20UL17NanoAODv9-20UL17JMENano_{cmssw}/NANOAODSIM",
],
n_files=94,
n_events=43589739,
)

cpn.add_dataset(
name="qcd_ht500to700_madgraph",
id=14279003,
processes=[procs.qcd_ht500to700],
keys=[
f"/QCD_HT500to700_{generator}/RunIISummer20UL17NanoAODv9-20UL17JMENano_{cmssw}/NANOAODSIM",
],
n_files=85,
n_events=36082941,
)

cpn.add_dataset(
name="qcd_ht700to1000_madgraph",
id=14281356,
processes=[procs.qcd_ht700to1000],
keys=[
f"/QCD_HT700to1000_{generator}/RunIISummer20UL17NanoAODv9-20UL17JMENano_{cmssw}/NANOAODSIM",
],
n_files=84,
n_events=32788396,
)

cpn.add_dataset(
name="qcd_ht1000to1500_madgraph",
id=14296775,
processes=[procs.qcd_ht1000to1500],
keys=[
f"/QCD_HT1000to1500_{generator}/RunIISummer20UL17NanoAODv9-20UL17JMENano_{cmssw}/NANOAODSIM",
],
n_files=65,
n_events=10256089,
)

cpn.add_dataset(
name="qcd_ht1500to2000_madgraph",
id=14270490,
processes=[procs.qcd_ht1500to2000],
keys=[
f"/QCD_HT1500to2000_{generator}/RunIISummer20UL17NanoAODv9-20UL17JMENano_{cmssw}/NANOAODSIM",
],
n_files=43,
n_events=7540039,
)

cpn.add_dataset(
name="qcd_ht2000_madgraph",
id=14296752,
processes=[procs.qcd_ht2000],
keys=[
f"/QCD_HT2000toInf_{generator}/RunIISummer20UL17NanoAODv9-20UL17JMENano_{cmssw}/NANOAODSIM",
],
n_files=38,
n_events=4055223,
)
2 changes: 1 addition & 1 deletion cmsdb/campaigns/run2_2018_JMEnano_v9/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

campaign_run2_2018_JMEnano_v9 = Campaign(
name="run2_2018_JMEnano_v9",
id=220181,
id=220191,
ecm=13,
bx=25,
aux={
Expand Down
2 changes: 1 addition & 1 deletion cmsdb/campaigns/run2_2018_JMEnano_v9/qcd.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
QCD datasets for the 2017 data-taking campaign
QCD datasets for the 2018 data-taking campaign
"""

import cmsdb.processes as procs
Expand Down
2 changes: 1 addition & 1 deletion cmsdb/processes/hh2bbtautau.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@
)

graviton_hh_ggf_bbtautau_m3000 = graviton_hh_ggf_bbtautau.add_process(
name="hh_ggf_graviton_bbtautau_m3000",
name="graviton_hh_ggf_bbtautau_m3000",
id=24125,
xsecs={13: Number(0.1)}, # TODO
)
Expand Down
2 changes: 1 addition & 1 deletion cmsdb/processes/hh2bbww.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@
)

graviton_hh_ggf_bbww_m3000 = graviton_hh_ggf_bbww.add_process(
name="hh_ggf_graviton_bbww_m3000",
name="graviton_hh_ggf_bbww_m3000",
id=24225,
xsecs={13: Number(0.1)}, # TODO
)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
scinum>=1.4.6
scinum~=2.0.2
order>=2.1.4
19 changes: 17 additions & 2 deletions scripts/get_das_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@
import law


def convert_to_desired_structure(data: dict) -> str:
return f"""cpn.add_dataset(
name="PLACEHOLDER",
id={data['dataset_id']}
processes=[procs.PLACEHOLDER],
keys=[
{data['name']}, # noqa
],
n_files={data['nfiles']},
n_events={data['nevents']},
)"""


def print_das_info(das_strings: list[str], keys_of_interest: tuple | None = None):
for das_string in das_strings:
# set default keys of interest
Expand All @@ -38,7 +51,6 @@ def print_das_info(das_strings: list[str], keys_of_interest: tuple | None = None
infos = json.loads(out)
for info in infos:
dataset_name = info.get("dataset", [])[0].get("name", "")
# print(dataset_name) # keep for debugging purpose
datasets.append(dataset_name)

for dataset in datasets:
Expand All @@ -63,7 +75,10 @@ def print_das_info(das_strings: list[str], keys_of_interest: tuple | None = None
elif "filesummaries" in info["das"]["services"][0]:
info_of_interest["nfiles"] = dataset_info.get("nfiles", "")
info_of_interest["nevents"] = dataset_info.get("nevents", "")
print(json.dumps(info_of_interest, indent=4))

desired_output = convert_to_desired_structure(info_of_interest)
print(desired_output)
print()


if __name__ == "__main__":
Expand Down

0 comments on commit cc68557

Please sign in to comment.