Skip to content

Commit

Permalink
merge branch master into branch feature/hh_morphing
Browse files Browse the repository at this point in the history
  • Loading branch information
nprouvost committed Dec 6, 2024
2 parents 9098ddf + 032f6fe commit e791bf2
Show file tree
Hide file tree
Showing 20 changed files with 1,099 additions and 159 deletions.
3 changes: 3 additions & 0 deletions hbt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# coding: utf-8

import law

from hbt.columnflow_patches import patch_all


law.contrib.load("pandas")

# apply cf patches once
patch_all()
9 changes: 6 additions & 3 deletions hbt/calibration/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@
# derive calibrators to add settings
jec_full = jec.derive("jec_full", cls_dict={"mc_only": True, "nominal_only": True})

# version of jer that uses the first random number from deterministic_seeds
deterministic_jer = jer.derive("deterministic_jer", cls_dict={"deterministic_seed_index": 0})


@calibrator(
uses={
mc_weight, jec_nominal, jec_full, jer, tec_nominal, tec, deterministic_seeds,
mc_weight, deterministic_seeds, jec_nominal, jec_full, deterministic_jer, tec_nominal, tec,
IF_RUN_2(met_phi),
},
produces={
mc_weight, jec_nominal, jec_full, jer, tec_nominal, tec, deterministic_seeds,
mc_weight, deterministic_seeds, jec_nominal, jec_full, deterministic_jer, tec_nominal, tec,
IF_RUN_2(met_phi),
},
)
Expand All @@ -40,7 +43,7 @@ def default(self: Calibrator, events: ak.Array, **kwargs) -> ak.Array:
events = self[jec_nominal](events, **kwargs)
else:
events = self[jec_full](events, **kwargs)
events = self[jer](events, **kwargs)
events = self[deterministic_jer](events, **kwargs)

if self.config_inst.campaign.x.run == 2:
events = self[met_phi](events, **kwargs)
Expand Down
73 changes: 51 additions & 22 deletions hbt/config/analysis_hbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,38 +87,67 @@ def factory(configs: od.UniqueObjectIndex):
# Run 2 configs
#

# 2016 HIPM (also known as APV or preVFP)
add_lazy_config(
campaign_module="cmsdb.campaigns.run2_2016_HIPM_nano_uhh_v12",
campaign_attr="campaign_run2_2016_HIPM_nano_uhh_v12",
config_name="run2_2016_HIPM_nano_uhh_v12",
config_id=1,
)
# 2016 HIPM (also known as APV or preVFP), TODO: campaign needs consistency and content check
# add_lazy_config(
# campaign_module="cmsdb.campaigns.run2_2016_HIPM_nano_uhh_v12",
# campaign_attr="campaign_run2_2016_HIPM_nano_uhh_v12",
# config_name="run2_2016_HIPM_nano_uhh_v12",
# config_id=1,
# )

# 2016 (also known postVFP), TODO: campaign needs consistency and content check
# add_lazy_config(
# campaign_module="cmsdb.campaigns.run2_2016_nano_uhh_v12",
# campaign_attr="campaign_run2_2016_nano_uhh_v12",
# config_name="run2_2016_nano_uhh_v12",
# config_id=2,
# )

# 2017, old nano version, TODO: needs re-processing
# add_lazy_config(
# campaign_module="cmsdb.campaigns.run2_2017_nano_uhh_v11",
# campaign_attr="campaign_run2_2017_nano_uhh_v11",
# config_name="run2_2017_nano_uhh_v11",
# config_id=3,
# )

# 2018, TODO: not processed yet
# add_lazy_config(
# campaign_module="cmsdb.campaigns.run2_2018_nano_uhh_v12",
# campaign_attr="campaign_run2_2018_nano_uhh_v12",
# config_name="run2_2018_nano_uhh_v12",
# config_id=4,
# )

#
# Run 3 configs
#

# 2016 (also known postVFP)
# 2022, preEE
add_lazy_config(
campaign_module="cmsdb.campaigns.run2_2016_nano_uhh_v12",
campaign_attr="campaign_run2_2016_nano_uhh_v12",
config_name="run2_2016_nano_uhh_v12",
config_id=2,
campaign_module="cmsdb.campaigns.run3_2022_preEE_nano_uhh_v12",
campaign_attr="campaign_run3_2022_preEE_nano_uhh_v12",
config_name="run3_2022_preEE",
config_id=5,
)

# 2017
# 2022, postEE
add_lazy_config(
campaign_module="cmsdb.campaigns.run2_2017_nano_uhh_v11",
campaign_attr="campaign_run2_2017_nano_uhh_v11",
config_name="run2_2017_nano_uhh_v11",
config_id=3,
campaign_module="cmsdb.campaigns.run3_2022_postEE_nano_uhh_v12",
campaign_attr="campaign_run3_2022_postEE_nano_uhh_v12",
config_name="run3_2022_postEE",
config_id=6,
)

#
# Run 3 configs
# sync configs
#

# 2022, preEE
add_lazy_config(
campaign_module="cmsdb.campaigns.run3_2022_preEE_nano_uhh_v12",
campaign_attr="campaign_run3_2022_preEE_nano_uhh_v12",
config_name="run3_2022_preEE",
config_id=5,
campaign_module="cmsdb.campaigns.run3_2022_preEE_nano_v12",
campaign_attr="campaign_run3_2022_preEE_nano_v12",
config_name="run3_2022_preEE_sync",
config_id=5001,
sync_mode=True,
)
Loading

0 comments on commit e791bf2

Please sign in to comment.