Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-08-29 02:17:04

0001 import FWCore.ParameterSet.Config as cms
0002 from PhysicsTools.NanoAOD.common_cff import *
0003 from PhysicsTools.NanoAOD.electrons_cff import *
0004 from PhysicsTools.NanoAOD.electrons_cff import _eleVarsExtra
0005 from PhysicsTools.NanoAOD.photons_cff import *
0006 from PhysicsTools.NanoAOD.photons_cff import _phoVarsExtra
0007 from PhysicsTools.NanoAOD.NanoAODEDMEventContent_cff import *
0008 from PhysicsTools.NanoAOD.nanoDQM_cfi import nanoDQM
0009 from PhysicsTools.NanoAOD.nanoDQM_cff import _Photon_extra_plots, _Electron_extra_plots
0010 from PhysicsTools.NanoAOD.triggerObjects_cff import triggerObjectTable, mksel
0011 
0012 customElectronFilterBits = cms.PSet(
0013     doc = cms.string("PixelMatched e/gamma"), # this may also select photons!
0014     id = cms.int32(11),
0015     sel = cms.string("type(92) && pt > 7 && (coll('hltEgammaCandidates') || coll('hltEgammaCandidatesUnseeded')) && (filter('*PixelMatchFilter') || filter('*PixelMatchUnseededFilter'))"),
0016     l1seed = cms.string("type(-98)"),  l1deltaR = cms.double(0.3),
0017     skipObjectsNotPassingQualityBits = cms.bool(True),
0018     qualityBits = cms.VPSet(
0019         #HLT_Ele30_WPTight_Gsf
0020         mksel("filter('hltEGL1SingleEGOrFilter')","1e WPTight L1T match"), 
0021         mksel("filter('hltEG30L1SingleEGOrEtFilter')","1e WPTight Et"),
0022         mksel("filter('hltEle30WPTightClusterShapeFilter')","1e WPTight SigmaIeIe"),
0023         mksel("filter('hltEle30WPTightHEFilter')","1e WPTight HoE"),
0024         mksel("filter('hltEle30WPTightEcalIsoFilter')","1e WPTight ECAL Iso"),
0025         mksel("filter('hltEle30WPTightHcalIsoFilter')","1e WPTight HCAL Iso"),
0026         mksel("filter('hltEle30WPTightPixelMatchFilter')","1e WPTight Pixel match"),
0027         mksel("filter('hltEle30WPTightPMS2Filter')","1e WPTight S2"),
0028         mksel("filter('hltEle30WPTightGsfOneOEMinusOneOPFilter')","1e WPTight 1/E-1/p"),
0029         mksel("filter('hltEle30WPTightGsfMissingHitsFilter')","1e WPTight missing hits"),
0030         mksel("filter('hltEle30WPTightGsfDetaFilter')","1e WPTight DEta"),
0031         mksel("filter('hltEle30WPTightGsfDphiFilter')","1e WPTight DPhi"),
0032         mksel("filter('hltEle30WPTightGsfTrackIsoFilter')","1e WPTight Track Iso"),
0033         #HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL
0034         mksel("filter('hltEGL1SingleAndDoubleEGOrPairFilter')","2e L1T match"), 
0035         mksel("filter('hltEle23Ele12CaloIdLTrackIdLIsoVLTrackIsoLeg1Filter')","2e Track Iso Leg1"),
0036         mksel("filter('hltEle23Ele12CaloIdLTrackIdLIsoVLTrackIsoLeg2Filter')","2e Track Iso Leg2"),
0037         #HLT_DoubleEle33_CaloIdL_MW
0038         mksel("filter('hltEGL1SingleAndDoubleEGNonIsoOrWithEG26WithJetAndTauFilter')","2e (CaloIdL_MW) L1T match"), 
0039         mksel("filter('hltEle33CaloIdLPixelMatchFilter')","2e (CaloIdL_MW) Pixel match Leg1"),
0040         mksel("filter('hltEle33CaloIdLMWPMS2Filter')","2e (CaloIdL_MW) S2"),
0041         mksel("filter('hltDiEle33CaloIdLMWPMS2UnseededFilter')","2e (CaloIdL_MW unseeded) S2"),
0042         #HLT_Photon200
0043         mksel("filter('hltEG200HEFilter')","1e Photon200"),
0044         #HLT_Photon50EB
0045         mksel("filter('hltEG50EBEtFilter')","1e Photon50EB"),
0046         #HLT_Ele16_Ele12_Ele8_CaloIdL_TrackIdL
0047         mksel("filter('hltEle16Ele12Ele8CaloIdLTrackIdLDphiLeg3Filter')","3e Leg3"),
0048         #HLT_Mu12_TrkIsoVVL_Ele23_CaloIdL_TrackIdL_IsoVL (wildcarded as the name is likely going to change soon)
0049         mksel("filter('hltMu*TrkIsoVVLEle23CaloIdLTrackIdLIsoVLElectronlegTrackIsoFilter')","1mu-1e eLeg"),
0050         #HLT_Ele24_eta2p1_WPTight_Gsf_PNetTauhPFJet30_*_eta2p3_CrossL1 OR HLT_Ele24_eta2p1_WPTight_Gsf_LooseDeepTauPFTauHPS30_eta2p1_CrossL1
0051         mksel("filter('hltEle24erWPTightGsfTrackIsoFilterForTau')","1e-1tau eLeg"),
0052         #HLT_Ele115_CaloIdVT_GsfTrkIdT
0053         mksel("filter('hltEle115CaloIdVTGsfTrkIdTGsfDphiFilter')","1e high pT noIso"),
0054     )
0055 )
0056 
0057 customPhotonFilterBits = cms.PSet(
0058     id = cms.int32(22),
0059     sel = cms.string("type(92) && pt > 15 && coll('hltEgammaCandidates')"),
0060     l1seed = cms.string("type(-98)"),  l1deltaR = cms.double(0.3),
0061     skipObjectsNotPassingQualityBits = cms.bool(True),
0062     qualityBits = cms.VPSet(
0063         #HLT_Photon50EB
0064         mksel("filter('hltEG50EBEtFilter')","Photon50EB"),
0065         #HLT_Photon***
0066         mksel("filter('hltEG120HEFilter')","Photon120"),
0067         mksel("filter('hltEG150HEFilter')","Photon150"),
0068         mksel("filter('hltEG175HEFilter')","Photon175"),
0069         mksel("filter('hltEG200HEFilter')","Photon200"),
0070         #HLT_ECALHT800        
0071         mksel("filter('hltHtEcal800')","ECAL HT800"),
0072         #HLT_Photon110EB_TightID_TightIso
0073         mksel("filter('hltEG110EBTightIDTightIsoTrackIsoFilter')","Photon110EB Tight"),
0074         #HLT_Mu17_Photon30_IsoCaloId
0075         mksel("filter('hltMu17Photon30IsoCaloIdPhotonlegTrackIsoFilter')","1mu-1photon"),
0076         #HLT_Diphoton30_22_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass90/95 
0077         mksel("filter('hltEG30LR9Id85b90eHE12R9Id50b80eR9IdLastFilter')","diPhoton 30_22 R9ID"),
0078         mksel("filter('hltEG30LIso60CaloId15b35eHE12R9Id50b80eEcalIsoLastFilter')","diPhoton 30_22 ECALIso"),
0079         mksel("filter('hltEG22R9Id85b90eHE12R9Id50b80eR9UnseededLastFilter')","diPhoton 30_22 unseeded R9ID"),
0080         mksel("filter('hltEG22Iso60CaloId15b35eHE12R9Id50b80eTrackIsoUnseededLastFilter')","diPhoton 30_22 unseeded TrackIso"),
0081     )
0082 )
0083 
0084 def addExtraEGammaVarsCustomize(process):
0085     #photon
0086     process.finalPhotons.cut = cms.string("pt > 1 ")
0087     process.photonTable.variables.setValue(_phoVarsExtra.parameters_())
0088     process.triggerObjectTable.selections.Photon = customPhotonFilterBits
0089 
0090     if hasattr(process,'nanoDQM'):
0091       process.nanoDQM.vplots.Photon.plots = _Photon_extra_plots
0092 
0093     #electron
0094     process.finalElectrons.cut = cms.string("pt > 1 ")
0095     process.electronTable.variables.setValue(_eleVarsExtra.parameters_())
0096     process.triggerObjectTable.selections.Electron = customElectronFilterBits
0097 
0098     if hasattr(process,'nanoDQM'):
0099       process.nanoDQM.vplots.Electron.plots = _Electron_extra_plots
0100       
0101     return process