Skip to content

Commit

Permalink
fix and include new trigger bits for taus
Browse files Browse the repository at this point in the history
Adding Era change for 2016/7/8 trigger bits

Code cleanup

Code Formatting Change
  • Loading branch information
mbluj authored and Ksavva1021 committed Dec 1, 2023
1 parent 3d2f2f8 commit a5ca143
Showing 1 changed file with 54 additions and 20 deletions.
74 changes: 54 additions & 20 deletions PhysicsTools/NanoAOD/python/triggerObjects_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,31 +129,38 @@ def AND(tokens):
),
Tau = cms.PSet(
id = cms.int32(15),
sel = cms.string("type(84) && pt > 5 && coll('*Tau*') && ( filter('*LooseChargedIso*') || filter('*MediumChargedIso*') || filter('*DeepTau*') || filter('*TightChargedIso*') || filter('*TightOOSCPhotons*') || filter('hltL2TauIsoFilter') || filter('*OverlapFilterIsoMu*') || filter('*OverlapFilterIsoEle*') || filter('*L1HLTMatched*') || filter('*Dz02*') || filter('*DoublePFTau*') || filter('*SinglePFTau*') || filter('hlt*SelectedPFTau') || filter('*DisplPFTau*') )"), #All trigger objects from a Tau collection + passing at least one filter
sel = cms.string("type(84) && pt > 5 && coll('*Tau*') && ( filter('*Loose*') || filter('*Medium*') || filter('*Tight*') || filter('*DeepTau*') || filter('*ChargedIso*') || filter('hltL2Tau*IsoFilter*') || filter('hltL2TauTagNNFilter*') || filter('*OverlapFilter*') || filter('*DisplPFTau*') || filter('*VBFIsoTau*') || filter('*Monitoring*') || filter('*DoublePFTau*') || filter('*SingleTau*') || filter('hlt*SelectedPFTau') || filter('*ETau*') || filter('*MuTau*') )"), #All trigger objects from a Tau collection + passing at least one filter
l1seed = cms.string("type(-100)"), l1deltaR = cms.double(0.3),
l2seed = cms.string("type(84) && coll('hltL2TauJetsL1IsoTauSeeded')"), l2deltaR = cms.double(0.3),
skipObjectsNotPassingQualityBits = cms.bool(True),
qualityBits = cms.VPSet(
mksel("filter('*LooseChargedIso*')","LooseChargedIso"),
mksel("filter('*MediumChargedIso*')","MediumChargedIso"),
mksel("filter('*TightChargedIso*')","TightChargedIso"),
mksel("filter('*DeepTau*')","DeepTau"),
mksel("filter('*TightOOSCPhotons*')","TightID OOSC photons"),
mksel("filter('*Loose*')","Loose"),
mksel("filter('*Medium*')","Medium"),
mksel("filter('*Tight*')","Tight"),
mksel("filter('*DeepTau*')","DeepTau no spec WP"),
mksel("filter('*ChargedIso*')","ChargedIso"),
mksel("filter('*Hps*')","HPS"),
mksel("filter('hlt*DoublePFTau*TrackPt1*ChargedIsolation*Dz02*')","charged iso di-tau"),
mksel("filter('hlt*DoublePFTau*DeepTau*L1HLTMatched')","deeptau di-tau"),
mksel("filter('hlt*OverlapFilterIsoEle*WPTightGsf*PFTau*')","e-tau"),
mksel("filter('hlt*OverlapFilterIsoMu*PFTau*')","mu-tau"),
mksel("filter('hlt*SelectedPFTau*L1HLTMatched')","single-tau/tau+MET"),
mksel("filter('hlt*DoublePFTau*TrackPt1*ChargedIso*')","run 2 VBF+ditau"),
mksel("filter('hlt*DoublePFTau*Track*ChargedIso*AgainstMuon')","run 3 VBF+ditau"),
mksel("filter('hltHpsSinglePFTau*HLTMatched')","run 3 double PF jets + ditau"),
mksel("filter('*ETau*')","e-tau inside filter"),
mksel("filter('*MuTau*')","mu-tau inside filter"),
mksel("filter('*SingleTau*')","single-tau inside filter"),
mksel("filter('hltMatchedVBFIsoTau*')","VBF matching"),
mksel("filter('hlt*DoublePFTau*L1HLTMatched')","di-tau"),
mksel("filter('hltHpsOverlapFilterIsoEle*WPTightGsf*PFTau*')","e-tau"),
mksel("filter('hltHpsOverlapFilterIsoMu*PFTau*')","mu-tau"),
mksel("filter('hltHpsOverlapFilterDeepTauDoublePFTau*PFJet*')","di-tau + PFJet"),
mksel("filter('hlt*Double*ChargedIsoDisplPFTau*Dxy*')","Displaced Tau"),
mksel("filter('hltHpsOverlapFilterDisplacedEle*DisplPFTau*')","e-tau displaced"),
mksel("filter('hltHpsOverlapFilterDisplacedMu*DisplPFTau*')","mu-tau displaced"),
mksel("filter('hlt*Double*ChargedIsoDisplPFTau*')","di-tau displaced"),
mksel("filter('*Monitoring')","Monitoring"),
mksel("filter('*Reg')","regional paths"),
mksel("filter('*L1Seeded')","L1 seeded paths"),
mksel("filter('*1Prong')","1 prong tau paths")
mksel("filter('*MonitoringForVBFIsoTau')","MonitoringForVBFIsoTau"),
mksel("filter('hltHpsOverlapFilterDeepTauPFTau*PFJet*')","'Monitoring di-tau + PFJet"),
mksel("filter('hltHpsOverlapFilterIsoMu*MediumChargedIsoDisplTau*')","'Monitoring muTau displaced"),
mksel("filter('*OneProng*')","OneProng"),
mksel("filter('*2*DiJetCorr*')","DiJetCorr"),
mksel("filter('*OverlapFilter*')","OverlapFilter"),
mksel("filter('*Dxy*')","Dxy"),
mksel("filter('*L1HLTMatched')","MatchL1HLT"),
mksel("filter('*L1Seeded')","MatchL1HLT"),
)
),
BoostedTau = cms.PSet(
Expand Down Expand Up @@ -220,7 +227,7 @@ def AND(tokens):
mksel("coll('hltAK8PFSoftDropJets230')"), #4, present if nothing else below is fired, otherwise 12, 20, 28, 52, 60
mksel(["hltAK8SinglePFJets230SoftDropMass40BTagParticleNetBB0p35",
"hltAK8SinglePFJets250SoftDropMass40BTagParticleNetBB0p35",
"hltAK8SinglePFJets275SoftDropMass40BTagParticleNetBB0p35"]), # 12 if nothing below is fired, #28 if also "hltAK8DoublePFJetSDModMass30", #60 if also "hltAK8DoublePFJetSDModMass50"
"hltAK8SinglePFJets275SoftDropMass40BTagParticleNetBB0p35"]), # 12 if nothing below is fired, #28 if also "hltAK8DoublePFJetSDModMass30", #60 if also "hltAK8DoublePFJetSDModMass50"
mksel(["hltAK8DoublePFJetSDModMass30"]), # 16 if onthing else (except #1), 20 if also #4, 28 if also #12
mksel(["hltAK8DoublePFJetSDModMass50"]), # 48 if also (obviously) "hltAK8DoublePFJetSDModMass30", 52 if also #4, #60 if all above
)
Expand Down Expand Up @@ -294,6 +301,33 @@ def AND(tokens):
)
)

_run2_2017_2018_tau_filters = [
mksel("filter('*LooseChargedIso*')","LooseChargedIso"),
mksel("filter('*MediumChargedIso*')","MediumChargedIso"),
mksel("filter('*TightChargedIso*')","TightChargedIso"),
mksel("filter('*DeepTau*')","DeepTau"),
mksel("filter('*TightOOSCPhotons*')","TightID OOSC photons"),
mksel("filter('*Hps*')","HPS"),
mksel("filter('hlt*DoublePFTau*TrackPt1*ChargedIsolation*Dz02*')","charged iso di-tau"),
mksel("filter('hlt*DoublePFTau*DeepTau*L1HLTMatched')","deeptau di-tau"),
mksel("filter('hlt*OverlapFilterIsoEle*WPTightGsf*PFTau*')","e-tau"),
mksel("filter('hlt*OverlapFilterIsoMu*PFTau*')","mu-tau"),
mksel("filter('hlt*SelectedPFTau*L1HLTMatched')","single-tau/tau+MET"),
mksel("filter('hlt*DoublePFTau*TrackPt1*ChargedIso*')","run 2 VBF+ditau"),
mksel("filter('hlt*DoublePFTau*Track*ChargedIso*AgainstMuon')","run 3 VBF+ditau"),
mksel("filter('hltHpsSinglePFTau*HLTMatched')","run 3 double PF jets + ditau"),
mksel("filter('hltHpsOverlapFilterDeepTauDoublePFTau*PFJet*')","di-tau + PFJet"),
mksel("filter('hlt*Double*ChargedIsoDisplPFTau*Dxy*')","Displaced Tau"),
mksel("filter('*Monitoring')","Monitoring"),
mksel("filter('*Reg')","regional paths"),
mksel("filter('*L1Seeded')","L1 seeded paths"),
mksel("filter('*1Prong')","1 prong tau paths")
]
(run2_HLTconditions_2017 | run2_HLTconditions_2018).toModify(
triggerObjectTable.selections.Tau,
sel = "type(84) && pt > 5 && coll('*Tau*') && ( filter('*LooseChargedIso*') || filter('*MediumChargedIso*') || filter('*DeepTau*') || filter('*TightChargedIso*') || filter('*TightOOSCPhotons*') || filter('hltL2TauIsoFilter') || filter('*OverlapFilterIsoMu*') || filter('*OverlapFilterIsoEle*') || filter('*L1HLTMatched*') || filter('*Dz02*') || filter('*DoublePFTau*') || filter('*SinglePFTau*') || filter('hlt*SelectedPFTau') || filter('*DisplPFTau*') )",
qualityBits = cms.VPSet(_run2_2017_2018_tau_filters)
)
_run2_HLTconditions = run2_HLTconditions_2016 | run2_HLTconditions_2017 | run2_HLTconditions_2018

_run2_2016_jet_filters = [
Expand Down Expand Up @@ -344,7 +378,7 @@ def AND(tokens):
DataEraECAL = cms.string("UL2016postVFP"),
DataEraMuon = cms.string("2016postVFP")
)
#Next line is for UL2017 maps
#Next line is for UL2017 maps
run2_jme_2017.toModify(
prefiringweight,
DataEraECAL = cms.string("UL2017BtoF"),
Expand Down

0 comments on commit a5ca143

Please sign in to comment.