Skip to content

Commit

Permalink
Merge branch 'sync_updates' of github.com:uhh-cms/hh2bbtautau into sy…
Browse files Browse the repository at this point in the history
…nc_updates
  • Loading branch information
aalvesan committed Dec 6, 2024
2 parents dc0f736 + 7948003 commit 98c8ff9
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 81 deletions.
10 changes: 10 additions & 0 deletions hbt/categorization/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ def cat_tautau(self: Categorizer, events: ak.Array, **kwargs) -> tuple[ak.Array,
return events, events.channel_id == self.config_inst.channels.n.tautau.id


@categorizer(uses={"channel_id"})
def cat_mumu(self: Categorizer, events: ak.Array, **kwargs) -> tuple[ak.Array, ak.Array]:
return events, events.channel_id == self.config_inst.channels.n.mumu.id


@categorizer(uses={"channel_id"})
def cat_emu(self: Categorizer, events: ak.Array, **kwargs) -> tuple[ak.Array, ak.Array]:
return events, events.channel_id == self.config_inst.channels.n.emu.id


#
# QCD regions
#
Expand Down
3 changes: 3 additions & 0 deletions hbt/config/categories.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ def kwargs_fn(categories):
}

create_category_combinations(config, categories, name_fn, kwargs_fn)

add_category(config, name="mumu", id=4, selection="cat_mumu", label=r"$\mu\mu$")
add_category(config, name="emu", id=5, selection="cat_emu", label=r"$e\mu$")
4 changes: 2 additions & 2 deletions hbt/config/configs_hbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,9 @@ def if_era(

# add tags to datasets
if dataset.name.startswith("data_e_"):
dataset.add_tag({"etau", "emu"})
dataset.add_tag({"etau", "emu_from_e"})
if dataset.name.startswith("data_mu_"):
dataset.add_tag({"mutau", "emu", "mumu"})
dataset.add_tag({"mutau", "emu_from_mu", "mumu"})
if dataset.name.startswith("data_tau_"):
dataset.add_tag({"tautau"})
if dataset.name.startswith("tt_"):
Expand Down
76 changes: 41 additions & 35 deletions hbt/config/triggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,14 +805,15 @@ def add_triggers_2022(config: od.Config) -> None:
pdg_id=11,
# min_pt=31.0,
# filter names:
# hltEle30WPTightGsfTrackIsoFilter
# hltEle30WPTightGsfTrackIsoFilter (WPTightTrackIso)
trigger_bits=2,
),
],
applies_to_dataset=(
lambda dataset_inst: dataset_inst.is_mc or
dataset_inst.has_tag("etau") or
dataset_inst.has_tag("emu")
dataset_inst.has_tag("emu_from_e") or
dataset_inst.has_tag("emu_from_mu")
),
tags={"single_trigger", "single_e", "channel_e_tau"},
),
Expand All @@ -835,7 +836,8 @@ def add_triggers_2022(config: od.Config) -> None:
applies_to_dataset=(
lambda dataset_inst: dataset_inst.is_mc or
dataset_inst.has_tag("mutau") or
dataset_inst.has_tag("emu") or
dataset_inst.has_tag("emu_from_e") or
dataset_inst.has_tag("emu_from_mu") or
dataset_inst.has_tag("mumu")
),
tags={"single_trigger", "single_mu", "channel_mu_tau"},
Expand All @@ -852,23 +854,21 @@ def add_triggers_2022(config: od.Config) -> None:
pdg_id=11,
# min_pt=25.0,
# filter names:
# hltOverlapFilterIsoEle24IsoTau30WPTightGsfCaloJet5 # TODO Twiki has no matches
# hltHpsOverlapFilterIsoEle24WPTightGsfLooseETauWPDeepTauPFTau30 (OverlapFilter) # TODO Twiki sugests 8 + 64 # noqa
trigger_bits=8,
# hltHpsOverlapFilterIsoEle24WPTightGsfLooseETauWPDeepTauPFTau30 (DeepTau + OverlapFilter) # TODO Twiki sugests 8 + 64, but 64 not enough? # noqa
trigger_bits=8 + 64,
),
TriggerLeg(
pdg_id=15,
# min_pt=35.0,
# filter names:
# (DeepTau + HPS) # TODO Twiki sugests 8 + 32 + 256
# (DeepTau + HPS + Overlap) # TODO Twiki sugests 8 + 32 + 256
# hltHpsOverlapFilterIsoEle24WPTightGsfLooseETauWPDeepTauPFTau30
trigger_bits=8 + 32,
trigger_bits=8 + 32 + 256,
),
],
applies_to_dataset=(
lambda dataset_inst: dataset_inst.is_mc or
dataset_inst.has_tag("etau") or
dataset_inst.has_tag("emu")
dataset_inst.has_tag("etau")
),
tags={"cross_trigger", "cross_e_tau", "channel_e_tau"},
),
Expand All @@ -886,22 +886,20 @@ def add_triggers_2022(config: od.Config) -> None:
# filter names:
# hltL3crIsoBigORMu18erTauXXer2p1L1f0L2f10QL3f20QL3trkIsoFiltered # TODO Twiki sugests 2
# hltHpsOverlapFilterIsoMu20LooseMuTauWPDeepTauPFTau27L1Seeded (OverlapFilter PFTau) # TODO Twiki sugests 4 + 64 # noqa
trigger_bits=4,
trigger_bits=4 + 64,
),
TriggerLeg(
pdg_id=15,
# min_pt=32.0,
# filter names:
# (DeepTau + HPS) # TODO Twiki sugests 8 + 32 + 512 + 262144
# (DeepTau + HPS + Overlap + L1Seeded) # TODO Twiki sugests 8 + 32 + 512 + 262144
# hltHpsOverlapFilterIsoMu20LooseMuTauWPDeepTauPFTau27L1Seeded
trigger_bits=8 + 32,
trigger_bits=8 + 32 + 512 + 262144,
),
],
applies_to_dataset=(
lambda dataset_inst: dataset_inst.is_mc or
dataset_inst.has_tag("mutau") or
dataset_inst.has_tag("emu") or
dataset_inst.has_tag("mumu")
dataset_inst.has_tag("mutau")
),
tags={"cross_trigger", "cross_mu_tau", "channel_mu_tau"},
),
Expand All @@ -917,15 +915,15 @@ def add_triggers_2022(config: od.Config) -> None:
pdg_id=15,
# min_pt=40.0,
# filter names:
# hltHpsDoublePFTau35MediumDitauWPDeepTauDz02 (Deeptau + HPS)
trigger_bits=8 + 32,
# hltHpsDoublePFTau35MediumDitauWPDeepTauL1HLTMatched (Deeptau + HPS + DeepTauDiTau)
trigger_bits=8 + 32 + 128,
),
TriggerLeg(
pdg_id=15,
# min_pt=40.0,
# filter names:
# hltHpsDoublePFTau35MediumDitauWPDeepTauDz02 (Deeptau + HPS)
trigger_bits=8 + 32,
# hltHpsDoublePFTau35MediumDitauWPDeepTauL1HLTMatched (Deeptau + HPS + DeepTauDiTau)
trigger_bits=8 + 32 + 128,
),
],
applies_to_dataset=(
Expand All @@ -947,14 +945,14 @@ def add_triggers_2022(config: od.Config) -> None:
# min_pt=25.0,
# filter names:
# (DeepTau + HPS + run 3 VBF+ditau) # TODO Twiki sugests 8
# hltMatchedVBFOnePFJet2CrossCleanedFromDoubleMediumDeepTauDitauWPPFTauHPS20
# hltHpsDoublePFTau20TrackDeepTauDitauWPForVBFIsoTau
trigger_bits=8 + 32 + 4096,
),
TriggerLeg(
pdg_id=15,
# min_pt=25.0,
# filter names:
# hltMatchedVBFOnePFJet2CrossCleanedFromDoubleMediumDeepTauDitauWPPFTauHPS20
# hltHpsDoublePFTau20TrackDeepTauDitauWPForVBFIsoTau
trigger_bits=8 + 32 + 4096,
),
# additional leg infos for vbf jets
Expand All @@ -964,14 +962,20 @@ def add_triggers_2022(config: od.Config) -> None:
# filter names:
# The filters are applied to the lepton
# Taking the loosest filter for the Jets with the pt cut
trigger_bits=1,

# maybe hltMatchedVBFTwoPFJets2CrossCleanedFromDoubleMediumDeepTauDitauWPPFTauHPS20?
# (VBF cross-cleaned from medium deeptau PFTau)
trigger_bits=262144,
),
TriggerLeg(
pdg_id=1,
# min_pt=40.0,
# filter names:
# The filters are applied to the lepton
trigger_bits=1,

# maybe hltMatchedVBFTwoPFJets2CrossCleanedFromDoubleMediumDeepTauDitauWPPFTauHPS20?
# (VBF cross-cleaned from medium deeptau PFTau)
trigger_bits=262144,
),
],
applies_to_dataset=(
Expand Down Expand Up @@ -1011,24 +1015,27 @@ def add_triggers_2022(config: od.Config) -> None:
pdg_id=15,
# min_pt=35.0,
# filter names:
# (TightOOSCPhotons + di-tau + PFJet) # TODO Twiki sugests 8 + 32 + 16384
# (DeepTau + Hps + ditau+PFJet) # TODO Twiki sugests 8 + 32 + 16384
# hltHpsOverlapFilterDeepTauDoublePFTau30PFJet60
trigger_bits=16 + 16384,
trigger_bits=8 + 32 + 16384,
),
TriggerLeg(
pdg_id=15,
# min_pt=35.0,
# filter names:
# hltHpsOverlapFilterDeepTauDoublePFTau30PFJet60
trigger_bits=16 + 16384,
trigger_bits=8 + 32 + 16384,
),
TriggerLeg(
pdg_id=1,
# min_pt=65.0,
# filter names:
# Filters are applied to the leptons
# Taking the loosest filter for the Jets with the pt cut
trigger_bits=1,

# hltHpsOverlapFilterDeepTauDoublePFTau30PFJet60
# (DoubleTau + Jet) -> 17
trigger_bits=131072,
),
],
applies_to_dataset=(
Expand Down Expand Up @@ -1064,7 +1071,8 @@ def add_triggers_2023(config: od.Config) -> None:
applies_to_dataset=(
lambda dataset_inst: dataset_inst.is_mc or
dataset_inst.has_tag("etau") or
dataset_inst.has_tag("emu")
dataset_inst.has_tag("emu_from_e") or
dataset_inst.has_tag("emu_from_mu")
),
tags={"single_trigger", "single_e", "channel_e_tau"},
),
Expand All @@ -1087,7 +1095,8 @@ def add_triggers_2023(config: od.Config) -> None:
applies_to_dataset=(
lambda dataset_inst: dataset_inst.is_mc or
dataset_inst.has_tag("mutau") or
dataset_inst.has_tag("emu") or
dataset_inst.has_tag("emu_from_e") or
dataset_inst.has_tag("emu_from_mu") or
dataset_inst.has_tag("mumu")
),
tags={"single_trigger", "single_mu", "channel_mu_tau"},
Expand Down Expand Up @@ -1119,8 +1128,7 @@ def add_triggers_2023(config: od.Config) -> None:
],
applies_to_dataset=(
lambda dataset_inst: dataset_inst.is_mc or
dataset_inst.has_tag("etau") or
dataset_inst.has_tag("emu")
dataset_inst.has_tag("etau")
),
tags={"cross_trigger", "cross_e_tau", "channel_e_tau"},
),
Expand Down Expand Up @@ -1151,9 +1159,7 @@ def add_triggers_2023(config: od.Config) -> None:
],
applies_to_dataset=(
lambda dataset_inst: dataset_inst.is_mc or
dataset_inst.has_tag("mutau") or
dataset_inst.has_tag("emu") or
dataset_inst.has_tag("mumu")
dataset_inst.has_tag("mutau")
),
tags={"cross_trigger", "cross_mu_tau", "channel_mu_tau"},
),
Expand Down
Loading

0 comments on commit 98c8ff9

Please sign in to comment.