diff --git a/hbt/calibration/default.py b/hbt/calibration/default.py index 6f1b567..83a2387 100644 --- a/hbt/calibration/default.py +++ b/hbt/calibration/default.py @@ -9,7 +9,7 @@ from columnflow.calibration.cms.jets import jec, jec_nominal, jer from columnflow.calibration.cms.tau import tec, tec_nominal from columnflow.production.cms.mc_weight import mc_weight -from columnflow.production.cms.seeds import deterministic_seeds +from columnflow.production.cms.seeds import deterministic_event_seeds, deterministic_jet_seeds from columnflow.util import maybe_import from hbt.util import IF_RUN_2 @@ -20,25 +20,36 @@ # derive calibrators to add settings jec_full = jec.derive("jec_full", cls_dict={"mc_only": True, "nominal_only": True}) +# remove GenPart.pt from object_count_columns, this column differs between central and custom Nano + +custom_deterministic_event_seeds = deterministic_event_seeds.derive( + "custom_deterministic_event_seeds", + cls_dict={"object_count_columns": [ + route for route in deterministic_event_seeds.object_count_columns + if route != "GenPart.pt" + ]}, + +) # version of jer that uses the first random number from deterministic_seeds -deterministic_jer = jer.derive("deterministic_jer", cls_dict={"deterministic_seed_index": 0}) +deterministic_jer = jer.derive("deterministic_jer", cls_dict={"deterministic_seed_index": 1}) @calibrator( uses={ - mc_weight, deterministic_seeds, jec_nominal, jec_full, deterministic_jer, tec_nominal, tec, - IF_RUN_2(met_phi), + mc_weight, custom_deterministic_event_seeds, deterministic_jet_seeds, jec_nominal, jec_full, + deterministic_jer, tec_nominal, tec, IF_RUN_2(met_phi), }, produces={ - mc_weight, deterministic_seeds, jec_nominal, jec_full, deterministic_jer, tec_nominal, tec, - IF_RUN_2(met_phi), + mc_weight, custom_deterministic_event_seeds, deterministic_jet_seeds, jec_nominal, jec_full, + deterministic_jer, tec_nominal, tec, IF_RUN_2(met_phi), }, ) def default(self: Calibrator, events: ak.Array, **kwargs) -> ak.Array: if self.dataset_inst.is_mc: events = self[mc_weight](events, **kwargs) - events = self[deterministic_seeds](events, **kwargs) + events = self[custom_deterministic_event_seeds](events, **kwargs) + events = self[deterministic_jet_seeds](events, **kwargs) if self.dataset_inst.is_data or not self.global_shift_inst.is_nominal: events = self[jec_nominal](events, **kwargs) else: