CMS 3D CMS Logo

egamma_custom_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
4 from PhysicsTools.NanoAOD.electrons_cff import _eleVarsExtra
6 from PhysicsTools.NanoAOD.photons_cff import _phoVarsExtra
8 from PhysicsTools.NanoAOD.nanoDQM_cfi import nanoDQM
9 from PhysicsTools.NanoAOD.nanoDQM_cff import _Photon_extra_plots, _Electron_extra_plots
10 from PhysicsTools.NanoAOD.triggerObjects_cff import triggerObjectTable, mksel
11 
12 customElectronFilterBits = cms.PSet(
13  doc = cms.string("PixelMatched e/gamma"), # this may also select photons!
14  id = cms.int32(11),
15  sel = cms.string("type(92) && pt > 7 && (coll('hltEgammaCandidates') || coll('hltEgammaCandidatesUnseeded')) && (filter('*PixelMatchFilter') || filter('*PixelMatchUnseededFilter'))"),
16  l1seed = cms.string("type(-98)"), l1deltaR = cms.double(0.3),
17  skipObjectsNotPassingQualityBits = cms.bool(True),
18  qualityBits = cms.VPSet(
19  #HLT_Ele30_WPTight_Gsf
20  mksel("filter('hltEGL1SingleEGOrFilter')","1e WPTight L1T match"),
21  mksel("filter('hltEG30L1SingleEGOrEtFilter')","1e WPTight Et"),
22  mksel("filter('hltEle30WPTightClusterShapeFilter')","1e WPTight SigmaIeIe"),
23  mksel("filter('hltEle30WPTightHEFilter')","1e WPTight HoE"),
24  mksel("filter('hltEle30WPTightEcalIsoFilter')","1e WPTight ECAL Iso"),
25  mksel("filter('hltEle30WPTightHcalIsoFilter')","1e WPTight HCAL Iso"),
26  mksel("filter('hltEle30WPTightPixelMatchFilter')","1e WPTight Pixel match"),
27  mksel("filter('hltEle30WPTightPMS2Filter')","1e WPTight S2"),
28  mksel("filter('hltEle30WPTightGsfOneOEMinusOneOPFilter')","1e WPTight 1/E-1/p"),
29  mksel("filter('hltEle30WPTightGsfMissingHitsFilter')","1e WPTight missing hits"),
30  mksel("filter('hltEle30WPTightGsfDetaFilter')","1e WPTight DEta"),
31  mksel("filter('hltEle30WPTightGsfDphiFilter')","1e WPTight DPhi"),
32  mksel("filter('hltEle30WPTightGsfTrackIsoFilter')","1e WPTight Track Iso"),
33  #HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL
34  mksel("filter('hltEGL1SingleAndDoubleEGOrPairFilter')","2e L1T match"),
35  mksel("filter('hltEle23Ele12CaloIdLTrackIdLIsoVLTrackIsoLeg1Filter')","2e Track Iso Leg1"),
36  mksel("filter('hltEle23Ele12CaloIdLTrackIdLIsoVLTrackIsoLeg2Filter')","2e Track Iso Leg2"),
37  #HLT_DoubleEle33_CaloIdL_MW
38  mksel("filter('hltEGL1SingleAndDoubleEGNonIsoOrWithEG26WithJetAndTauFilter')","2e (CaloIdL_MW) L1T match"),
39  mksel("filter('hltEle33CaloIdLPixelMatchFilter')","2e (CaloIdL_MW) Pixel match Leg1"),
40  mksel("filter('hltEle33CaloIdLMWPMS2Filter')","2e (CaloIdL_MW) S2"),
41  mksel("filter('hltDiEle33CaloIdLMWPMS2UnseededFilter')","2e (CaloIdL_MW unseeded) S2"),
42  #HLT_Photon200
43  mksel("filter('hltEG200HEFilter')","1e Photon200"),
44  #HLT_Photon50EB
45  mksel("filter('hltEG50EBEtFilter')","1e Photon50EB"),
46  #HLT_Ele16_Ele12_Ele8_CaloIdL_TrackIdL
47  mksel("filter('hltEle16Ele12Ele8CaloIdLTrackIdLDphiLeg3Filter')","3e Leg3"),
48  #HLT_Mu12_TrkIsoVVL_Ele23_CaloIdL_TrackIdL_IsoVL (wildcarded as the name is likely going to change soon)
49  mksel("filter('hltMu*TrkIsoVVLEle23CaloIdLTrackIdLIsoVLElectronlegTrackIsoFilter')","1mu-1e eLeg"),
50  #HLT_Ele24_eta2p1_WPTight_Gsf_PNetTauhPFJet30_*_eta2p3_CrossL1 OR HLT_Ele24_eta2p1_WPTight_Gsf_LooseDeepTauPFTauHPS30_eta2p1_CrossL1
51  mksel("filter('hltEle24erWPTightGsfTrackIsoFilterForTau')","1e-1tau eLeg"),
52  #HLT_Ele115_CaloIdVT_GsfTrkIdT
53  mksel("filter('hltEle115CaloIdVTGsfTrkIdTGsfDphiFilter')","1e high pT noIso"),
54  )
55 )
56 
57 customPhotonFilterBits = cms.PSet(
58  id = cms.int32(22),
59  sel = cms.string("type(92) && pt > 15 && coll('hltEgammaCandidates')"),
60  l1seed = cms.string("type(-98)"), l1deltaR = cms.double(0.3),
61  skipObjectsNotPassingQualityBits = cms.bool(True),
62  qualityBits = cms.VPSet(
63  #HLT_Photon50EB
64  mksel("filter('hltEG50EBEtFilter')","Photon50EB"),
65  #HLT_Photon***
66  mksel("filter('hltEG120HEFilter')","Photon120"),
67  mksel("filter('hltEG150HEFilter')","Photon150"),
68  mksel("filter('hltEG175HEFilter')","Photon175"),
69  mksel("filter('hltEG200HEFilter')","Photon200"),
70  #HLT_ECALHT800
71  mksel("filter('hltHtEcal800')","ECAL HT800"),
72  #HLT_Photon110EB_TightID_TightIso
73  mksel("filter('hltEG110EBTightIDTightIsoTrackIsoFilter')","Photon110EB Tight"),
74  #HLT_Mu17_Photon30_IsoCaloId
75  mksel("filter('hltMu17Photon30IsoCaloIdPhotonlegTrackIsoFilter')","1mu-1photon"),
76  #HLT_Diphoton30_22_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass90/95
77  mksel("filter('hltEG30LR9Id85b90eHE12R9Id50b80eR9IdLastFilter')","diPhoton 30_22 R9ID"),
78  mksel("filter('hltEG30LIso60CaloId15b35eHE12R9Id50b80eEcalIsoLastFilter')","diPhoton 30_22 ECALIso"),
79  mksel("filter('hltEG22R9Id85b90eHE12R9Id50b80eR9UnseededLastFilter')","diPhoton 30_22 unseeded R9ID"),
80  mksel("filter('hltEG22Iso60CaloId15b35eHE12R9Id50b80eTrackIsoUnseededLastFilter')","diPhoton 30_22 unseeded TrackIso"),
81  )
82 )
83 
85  #photon
86  process.photonTable.variables.setValue(_phoVarsExtra.parameters_())
87  process.triggerObjectTable.selections.Photon = customPhotonFilterBits
88  if process.nanoDQM:
89  process.nanoDQM.vplots.Photon.plots = _Photon_extra_plots
90  #electron
91  process.electronTable.variables.setValue(_eleVarsExtra.parameters_())
92  process.triggerObjectTable.selections.Electron = customElectronFilterBits
93  if process.nanoDQM:
94  process.nanoDQM.vplots.Electron.plots = _Electron_extra_plots
95 
96  return process
def addExtraEGammaVarsCustomize(process)
def mksel(selection, doc=None, bit=None)