CMS 3D CMS Logo

triggerObjects_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
3 import copy
4 
5 unpackedPatTrigger = cms.EDProducer("PATTriggerObjectStandAloneUnpacker",
6  patTriggerObjectsStandAlone = cms.InputTag('slimmedPatTrigger'),
7  triggerResults = cms.InputTag('TriggerResults::HLT'),
8  unpackFilterLabels = cms.bool(True)
9 )
10 # ERA-dependent configuration
11 run2_miniAOD_80XLegacy.toModify(
12  unpackedPatTrigger,
13  patTriggerObjectsStandAlone = "selectedPatTrigger",
14  unpackFilterLabels = False
15 )
16 
17 triggerObjectTable = cms.EDProducer("TriggerObjectTableProducer",
18  name= cms.string("TrigObj"),
19  src = cms.InputTag("unpackedPatTrigger"),
20  l1EG = cms.InputTag("caloStage2Digis","EGamma"),
21  l1Sum = cms.InputTag("caloStage2Digis","EtSum"),
22  l1Jet = cms.InputTag("caloStage2Digis","Jet"),
23  l1Muon = cms.InputTag("gmtStage2Digis","Muon"),
24  l1Tau = cms.InputTag("caloStage2Digis","Tau"),
25  selections = cms.VPSet(
26  cms.PSet(
27  name = cms.string("Electron (PixelMatched e/gamma)"), # this selects also photons for the moment!
28  id = cms.int32(11),
29  sel = cms.string("type(92) && pt > 7 && coll('hltEgammaCandidates') && filter('*PixelMatchFilter')"),
30  l1seed = cms.string("type(-98)"), l1deltaR = cms.double(0.3),
31  #l2seed = cms.string("type(92) && coll('')"), l2deltaR = cms.double(0.5),
32  qualityBits = cms.string(
33  "filter('*CaloIdLTrackIdLIsoVL*TrackIso*Filter') + " \
34  "2*filter('hltEle*WPTight*TrackIsoFilter*') + " \
35  "4*filter('hltEle*WPLoose*TrackIsoFilter') + " \
36  "8*filter('*OverlapFilterIsoEle*PFTau*') + " \
37  "16*filter('hltEle*Ele*CaloIdLTrackIdLIsoVL*Filter') + " \
38  "32*filter('hltMu*TrkIsoVVL*Ele*CaloIdLTrackIdLIsoVL*Filter*') + " \
39  "64*filter('*OverlapFilterIsoEle*PFTau*') + " \
40  "128*filter('hltEle*Ele*Ele*CaloIdLTrackIdLDphiLeg*Filter') + " \
41  "256*max(filter('hltL3fL1Mu*DoubleEG*Filtered*'),filter('hltMu*DiEle*CaloIdLTrackIdLElectronleg*Filter')) + " \
42  "512*max(filter('hltL3fL1DoubleMu*EG*Filter*'),filter('hltDiMu*Ele*CaloIdLTrackIdLElectronleg*Filter'))"),
43  qualityBitsDoc = cms.string("1 = CaloIdL_TrackIdL_IsoVL, 2 = 1e (WPTight), 4 = 1e (WPLoose), 8 = OverlapFilter PFTau, 16 = 2e, 32 = 1e-1mu, 64 = 1e-1tau, 128 = 3e, 256 = 2e-1mu, 512 = 1e-2mu"),
44  ),
45  cms.PSet(
46  name = cms.string("Photon (PixelMatch-vetoed e/gamma)"),
47  id = cms.int32(22),
48  sel = cms.string("type(92) && pt > 20 && coll('hltEgammaCandidates') && !filter('*PixelMatchFilter')"),
49  l1seed = cms.string("type(-98)"), l1deltaR = cms.double(0.3),
50  #l2seed = cms.string("type(92) && coll('')"), l2deltaR = cms.double(0.5),
51  qualityBits = cms.string("0"), qualityBitsDoc = cms.string(""),
52  ),
53  cms.PSet(
54  name = cms.string("Muon"),
55  id = cms.int32(13),
56  sel = cms.string("type(83) && pt > 5 && coll('hltIterL3MuonCandidates')"),
57  l1seed = cms.string("type(-81)"), l1deltaR = cms.double(0.5),
58  l2seed = cms.string("type(83) && coll('hltL2MuonCandidates')"), l2deltaR = cms.double(0.3),
59  qualityBits = cms.string(
60  "filter('*RelTrkIsoVVLFiltered0p4') + " \
61  "2*filter('hltL3crIso*Filtered0p07') + " \
62  "4*filter('*OverlapFilterIsoMu*PFTau*') + " \
63  "8*max(filter('hltL3crIsoL1*SingleMu*Filtered0p07'),filter('hltL3crIsoL1sMu*Filtered0p07')) + " \
64  "16*filter('hltDiMuon*Filtered*') + " \
65  "32*filter('hltMu*TrkIsoVVL*Ele*CaloIdLTrackIdLIsoVL*Filter*') + " \
66  "64*filter('hltOverlapFilterIsoMu*PFTau*') + " \
67  "128*filter('hltL3fL1TripleMu*') + " \
68  "256*max(filter('hltL3fL1DoubleMu*EG*Filtered*'),filter('hltDiMu*Ele*CaloIdLTrackIdLElectronleg*Filter')) + " \
69  "512*max(filter('hltL3fL1Mu*DoubleEG*Filtered*'),filter('hltMu*DiEle*CaloIdLTrackIdLElectronleg*Filter'))"),
70  qualityBitsDoc = cms.string("1 = TrkIsoVVL, 2 = Iso, 4 = OverlapFilter PFTau, 8 = 1mu, 16 = 2mu, 32 = 1mu-1e, 64 = 1mu-1tau, 128 = 3mu, 256 = 2mu-1e, 512 =1mu-2e"),
71  ),
72  cms.PSet(
73  name = cms.string("Tau"),
74  id = cms.int32(15),
75  sel = cms.string("type(84) && pt > 5 && coll('*Tau*') && ( filter('*LooseChargedIso*') || filter('*MediumChargedIso*') || filter('*TightChargedIso*') || filter('*TightOOSCPhotons*') || filter('hltL2TauIsoFilter') || filter('*OverlapFilterIsoMu*') || filter('*OverlapFilterIsoEle*') || filter('*L1HLTMatched*') || filter('*Dz02*') )"), #All trigger objects from a Tau collection + passing at least one filter
76  l1seed = cms.string("type(-100)"), l1deltaR = cms.double(0.3),
77  l2seed = cms.string("type(84) && coll('hltL2TauJetsL1IsoTauSeeded')"), l2deltaR = cms.double(0.3),
78  qualityBits = cms.string(
79  "filter('*LooseChargedIso*') + " \
80  "2*filter('*MediumChargedIso*') + " \
81  "4*filter('*TightChargedIso*') + " \
82  "8*filter('*TightOOSCPhotons*') + " \
83  "16*filter('*Hps*') + " \
84  "32*filter('hltSelectedPFTau*MediumChargedIsolationL1HLTMatched*') + " \
85  "64*filter('hltDoublePFTau*TrackPt1*ChargedIsolation*Dz02Reg') + " \
86  "128*filter('hltOverlapFilterIsoEle*PFTau*') + " \
87  "256*filter('hltOverlapFilterIsoMu*PFTau*') + " \
88  "512*filter('hltDoublePFTau*TrackPt1*ChargedIsolation*')"),
89  qualityBitsDoc = cms.string("1 = LooseChargedIso, 2 = MediumChargedIso, 4 = TightChargedIso, 8 = TightID OOSC photons, 16 = HPS, 32 = single-tau + tau+MET, 64 = di-tau, 128 = e-tau, 256 = mu-tau, 512 = VBF+di-tau"),
90  ),
91  cms.PSet(
92  name = cms.string("Jet"),
93  id = cms.int32(1),
94  sel = cms.string("type(85) && pt > 30 && (coll('hltAK4PFJetsCorrected') || coll('hltMatchedVBF*PFJets*PFTau*OverlapRemoval'))"),
95  l1seed = cms.string("type(-99)"), l1deltaR = cms.double(0.3),
96  l2seed = cms.string("type(85) && coll('hltAK4CaloJetsCorrectedIDPassed')"), l2deltaR = cms.double(0.3),
97  qualityBits = cms.string("filter('*CrossCleaned*LooseChargedIsoPFTau*')"), qualityBitsDoc = cms.string("1 = VBF cross-cleaned from loose iso PFTau"),
98  ),
99  cms.PSet(
100  name = cms.string("FatJet"),
101  id = cms.int32(6),
102  sel = cms.string("type(85) && pt > 120 && coll('hltAK8PFJetsCorrected')"),
103  l1seed = cms.string("type(-99)"), l1deltaR = cms.double(0.3),
104  l2seed = cms.string("type(85) && coll('hltAK8CaloJetsCorrectedIDPassed')"), l2deltaR = cms.double(0.3),
105  qualityBits = cms.string("0"), qualityBitsDoc = cms.string(""),
106  ),
107  cms.PSet(
108  name = cms.string("MET"),
109  id = cms.int32(2),
110  sel = cms.string("type(87) && pt > 30 && coll('hltPFMETProducer')"),
111  l1seed = cms.string("type(-87) && coll('L1ETM')"), l1deltaR = cms.double(9999),
112  l1seed_2 = cms.string("type(-87) && coll('L1ETMHF')"), l1deltaR_2 = cms.double(9999),
113  l2seed = cms.string("type( 87) && coll('hltMetClean')"), l2deltaR = cms.double(9999),
114  qualityBits = cms.string("0"), qualityBitsDoc = cms.string(""),
115  ),
116  cms.PSet(
117  name = cms.string("HT"),
118  id = cms.int32(3),
119  sel = cms.string("type(89) && pt > 100 && coll('hltPFHTJet30')"),
120  l1seed = cms.string("type(-89) && coll('L1HTT')"), l1deltaR = cms.double(9999),
121  l1seed_2 = cms.string("type(-89) && coll('L1HTTHF')"), l1deltaR_2 = cms.double(9999),
122  #l2seed = cms.string("type(89) && coll('hltHtMhtJet30')"), l2deltaR = cms.double(9999),
123  qualityBits = cms.string("0"), qualityBitsDoc = cms.string(""),
124  ),
125  cms.PSet(
126  name = cms.string("MHT"),
127  id = cms.int32(4),
128  sel = cms.string("type(90) && pt > 30 && coll('hltPFMHTTightID')"),
129  l1seed = cms.string("type(-90) && coll('L1HTM')"), l1deltaR = cms.double(9999),
130  l1seed_2 = cms.string("type(-90) && coll('L1HTMHF')"), l1deltaR_2 = cms.double(9999),
131  #l2seed = cms.string("type(90) && coll('hltHtMhtJet30')"), l2deltaR = cms.double(9999),
132  qualityBits = cms.string("0"), qualityBitsDoc = cms.string(""),
133  ),
134 
135  ),
136 )
137 
138 # ERA-dependent configuration
139 # Tune filter and collection names to 2016 HLT menus
140 # FIXME: check non-lepton objects and cross check leptons
141 selections80X = copy.deepcopy(triggerObjectTable.selections)
142 for sel in selections80X:
143  if sel.name=='Muon':
144  sel.sel = cms.string("type(83) && pt > 5 && (coll('hlt*L3MuonCandidates') || coll('hlt*TkMuonCands') || coll('hlt*TrkMuonCands'))")
145  sel.qualityBits = cms.string("filter('*RelTrkIso*Filtered0p4') + 2*filter('hltL3cr*IsoFiltered0p09') + 4*filter('*OverlapFilter*IsoMu*PFTau*') + 8*filter('hltL3f*IsoFiltered0p09')")
146  sel.qualityBitsDoc = cms.string("1 = TrkIsoVVL, 2 = Iso, 4 = OverlapFilter PFTau, 8 = IsoTkMu")
147  elif sel.name=='Tau':
148  sel.sel = cms.string("type(84) && pt > 5 && coll('*Tau*') && ( filter('*LooseIso*') || filter('*MediumIso*') || filter('*MediumComb*Iso*') || filter('hltL2TauIsoFilter') || filter('*OverlapFilter*IsoMu*') || filter('*OverlapFilter*IsoEle*') || filter('*L1HLTMatched*') || filter('*Dz02*') )")
149  sel.qualityBits = cms.string("(filter('*LooseIso*')-filter('*VLooseIso*'))+2*filter('*Medium*Iso*')+4*filter('*VLooseIso*')+8*0+16*filter('hltL2TauIsoFilter')+32*filter('*OverlapFilter*IsoMu*')+64*filter('*OverlapFilter*IsoEle*')+128*filter('*L1HLTMatched*')+256*filter('*Dz02*')")
150  sel.qualityBitsDoc = cms.string("1 = LooseIso, 2 = Medium(Comb)Iso, 4 = VLooseIso, 8 = None, 16 = L2p5 pixel iso, 32 = OverlapFilter IsoMu, 64 = OverlapFilter IsoEle, 128 = L1-HLT matched, 256 = Dz")
151  elif sel.name=='Electron (PixelMatched e/gamma)':
152  #sel.sel = cms.string("type(92) && pt > 7 && coll('hltEgammaCandidates') && filter('*PixelMatchFilter')")
153  sel.qualityBits = cms.string("filter('*CaloIdLTrackIdLIsoVL*TrackIso*Filter') + 2*filter('hltEle*WPTight*TrackIsoFilter*') + 4*filter('hltEle*WPLoose*TrackIsoFilter') + 8*filter('*OverlapFilter*IsoEle*PFTau*')")
154  #sel.qualityBitsDoc = cms.string("1 = CaloIdL_TrackIdL_IsoVL, 2 = WPLoose, 4 = WPTight, 8 = OverlapFilter PFTau")
155 
156 run2_miniAOD_80XLegacy.toModify(
157  triggerObjectTable,
158  selections = selections80X
159 )
160 
161 triggerObjectTables = cms.Sequence( unpackedPatTrigger + triggerObjectTable )