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("filter('*CaloIdLTrackIdLIsoVL*TrackIso*Filter') + 2*filter('hltEle*WPTight*TrackIsoFilter*') + 4*filter('hltEle*WPLoose*TrackIsoFilter') + 8*filter('*OverlapFilterIsoEle*PFTau*')"),
33  qualityBitsDoc = cms.string("1 = CaloIdL_TrackIdL_IsoVL, 2 = WPLoose, 4 = WPTight, 8 = OverlapFilter PFTau"),
34  ),
35  cms.PSet(
36  name = cms.string("Photon (PixelMatch-vetoed e/gamma)"),
37  id = cms.int32(22),
38  sel = cms.string("type(92) && pt > 20 && coll('hltEgammaCandidates') && !filter('*PixelMatchFilter')"),
39  l1seed = cms.string("type(-98)"), l1deltaR = cms.double(0.3),
40  #l2seed = cms.string("type(92) && coll('')"), l2deltaR = cms.double(0.5),
41  qualityBits = cms.string("0"), qualityBitsDoc = cms.string(""),
42  ),
43  cms.PSet(
44  name = cms.string("Muon"),
45  id = cms.int32(13),
46  sel = cms.string("type(83) && pt > 5 && coll('hltIterL3MuonCandidates')"),
47  l1seed = cms.string("type(-81)"), l1deltaR = cms.double(0.5),
48  l2seed = cms.string("type(83) && coll('hltL2MuonCandidates')"), l2deltaR = cms.double(0.3),
49  qualityBits = cms.string("filter('*RelTrkIsoVVLFiltered0p4') + 2*filter('hltL3crIso*Filtered0p07') + 4*filter('*OverlapFilterIsoMu*PFTau*')"), qualityBitsDoc = cms.string("1 = TrkIsoVVL, 2 = Iso, 4 = OverlapFilter PFTau"),
50  ),
51  cms.PSet(
52  name = cms.string("Tau"),
53  id = cms.int32(15),
54  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
55  l1seed = cms.string("type(-100)"), l1deltaR = cms.double(0.3),
56  l2seed = cms.string("type(84) && coll('hltL2TauJetsL1IsoTauSeeded')"), l2deltaR = cms.double(0.3),
57  qualityBits = cms.string("filter('*LooseChargedIso*')+2*filter('*MediumChargedIso*')+4*filter('*TightChargedIso*')+8*filter('*TightOOSCPhotons*')+16*filter('hltL2TauIsoFilter')+32*filter('*OverlapFilterIsoMu*')+64*filter('*OverlapFilterIsoEle*')+128*filter('*L1HLTMatched*')+256*filter('*Dz02*')"), qualityBitsDoc = cms.string("1 = LooseChargedIso, 2 = MediumChargedIso, 4 = TightChargedIso, 8 = TightID OOSC photons, 16 = L2p5 pixel iso, 32 = OverlapFilter IsoMu, 64 = OverlapFilter IsoEle, 128 = L1-HLT matched, 256 = Dz"),
58  ),
59  cms.PSet(
60  name = cms.string("Jet"),
61  id = cms.int32(1),
62  sel = cms.string("type(85) && pt > 30 && (coll('hltAK4PFJetsCorrected') || coll('hltMatchedVBF*PFJets*PFTau*OverlapRemoval'))"),
63  l1seed = cms.string("type(-99)"), l1deltaR = cms.double(0.3),
64  l2seed = cms.string("type(85) && coll('hltAK4CaloJetsCorrectedIDPassed')"), l2deltaR = cms.double(0.3),
65  qualityBits = cms.string("filter('*CrossCleaned*LooseChargedIsoPFTau*')"), qualityBitsDoc = cms.string("1 = VBF cross-cleaned from loose iso PFTau"),
66  ),
67  cms.PSet(
68  name = cms.string("MET"),
69  id = cms.int32(2),
70  sel = cms.string("type(87) && pt > 30 && coll('hltPFMETProducer')"),
71  l1seed = cms.string("type(-87) && coll('L1ETM')"), l1deltaR = cms.double(9999),
72  l1seed_2 = cms.string("type(-87) && coll('L1ETMHF')"), l1deltaR_2 = cms.double(9999),
73  l2seed = cms.string("type( 87) && coll('hltMetClean')"), l2deltaR = cms.double(9999),
74  qualityBits = cms.string("0"), qualityBitsDoc = cms.string(""),
75  ),
76  cms.PSet(
77  name = cms.string("HT"),
78  id = cms.int32(3),
79  sel = cms.string("type(89) && pt > 100 && coll('hltPFHTJet30')"),
80  l1seed = cms.string("type(-89) && coll('L1HTT')"), l1deltaR = cms.double(9999),
81  l1seed_2 = cms.string("type(-89) && coll('L1HTTHF')"), l1deltaR_2 = cms.double(9999),
82  #l2seed = cms.string("type(89) && coll('hltHtMhtJet30')"), l2deltaR = cms.double(9999),
83  qualityBits = cms.string("0"), qualityBitsDoc = cms.string(""),
84  ),
85  cms.PSet(
86  name = cms.string("MHT"),
87  id = cms.int32(4),
88  sel = cms.string("type(90) && pt > 30 && coll('hltPFMHTTightID')"),
89  l1seed = cms.string("type(-90) && coll('L1HTM')"), l1deltaR = cms.double(9999),
90  l1seed_2 = cms.string("type(-90) && coll('L1HTMHF')"), l1deltaR_2 = cms.double(9999),
91  #l2seed = cms.string("type(90) && coll('hltHtMhtJet30')"), l2deltaR = cms.double(9999),
92  qualityBits = cms.string("0"), qualityBitsDoc = cms.string(""),
93  ),
94 
95  ),
96 )
97 
98 # ERA-dependent configuration
99 # Tune filter and collection names to 2016 HLT menus
100 # FIXME: check non-lepton objects and cross check leptons
101 selections80X = copy.deepcopy(triggerObjectTable.selections)
102 for sel in selections80X:
103  if sel.name=='Muon':
104  sel.sel = cms.string("type(83) && pt > 5 && (coll('hlt*L3MuonCandidates') || coll('hlt*TkMuonCands') || coll('hlt*TrkMuonCands'))")
105  sel.qualityBits = cms.string("filter('*RelTrkIso*Filtered0p4') + 2*filter('hltL3cr*IsoFiltered0p09') + 4*filter('*OverlapFilter*IsoMu*PFTau*') + 8*filter('hltL3f*IsoFiltered0p09')")
106  sel.qualityBitsDoc = cms.string("1 = TrkIsoVVL, 2 = Iso, 4 = OverlapFilter PFTau, 8 = IsoTkMu")
107  elif sel.name=='Tau':
108  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*') )")
109  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*')")
110  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")
111  elif sel.name=='Electron (PixelMatched e/gamma)':
112  #sel.sel = cms.string("type(92) && pt > 7 && coll('hltEgammaCandidates') && filter('*PixelMatchFilter')")
113  sel.qualityBits = cms.string("filter('*CaloIdLTrackIdLIsoVL*TrackIso*Filter') + 2*filter('hltEle*WPTight*TrackIsoFilter*') + 4*filter('hltEle*WPLoose*TrackIsoFilter') + 8*filter('*OverlapFilter*IsoEle*PFTau*')")
114  #sel.qualityBitsDoc = cms.string("1 = CaloIdL_TrackIdL_IsoVL, 2 = WPLoose, 4 = WPTight, 8 = OverlapFilter PFTau")
115 
116 run2_miniAOD_80XLegacy.toModify(
117  triggerObjectTable,
118  selections = selections80X
119 )
120 
121 triggerObjectTables = cms.Sequence( unpackedPatTrigger + triggerObjectTable )