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 from RecoEgamma.EgammaIsolationAlgos.superclusValueMapProducer_cfi import superclusValueMaps
12 
13 customElectronFilterBits = cms.PSet(
14  doc = cms.string("PixelMatched e/gamma"), # this may also select photons!
15  id = cms.int32(11),
16  sel = cms.string("type(92) && pt > 7 && (coll('hltEgammaCandidates') || coll('hltEgammaCandidatesUnseeded')) && (filter('*PixelMatchFilter') || filter('*PixelMatchUnseededFilter'))"),
17  l1seed = cms.string("type(-98)"), l1deltaR = cms.double(0.3),
18  skipObjectsNotPassingQualityBits = cms.bool(True),
19  qualityBits = cms.VPSet(
20  #HLT_Ele30_WPTight_Gsf
21  mksel("filter('hltEGL1SingleEGOrFilter')","1e WPTight L1T match"),
22  mksel("filter('hltEG30L1SingleEGOrEtFilter')","1e WPTight Et"),
23  mksel("filter('hltEle30WPTightClusterShapeFilter')","1e WPTight SigmaIeIe"),
24  mksel("filter('hltEle30WPTightHEFilter')","1e WPTight HoE"),
25  mksel("filter('hltEle30WPTightEcalIsoFilter')","1e WPTight ECAL Iso"),
26  mksel("filter('hltEle30WPTightHcalIsoFilter')","1e WPTight HCAL Iso"),
27  mksel("filter('hltEle30WPTightPixelMatchFilter')","1e WPTight Pixel match"),
28  mksel("filter('hltEle30WPTightPMS2Filter')","1e WPTight S2"),
29  mksel("filter('hltEle30WPTightGsfOneOEMinusOneOPFilter')","1e WPTight 1/E-1/p"),
30  mksel("filter('hltEle30WPTightGsfMissingHitsFilter')","1e WPTight missing hits"),
31  mksel("filter('hltEle30WPTightGsfDetaFilter')","1e WPTight DEta"),
32  mksel("filter('hltEle30WPTightGsfDphiFilter')","1e WPTight DPhi"),
33  mksel("filter('hltEle30WPTightGsfTrackIsoFilter')","1e WPTight Track Iso"),
34  #HLT_Ele23_Ele12_CaloIdL_TrackIdL_IsoVL
35  mksel("filter('hltEGL1SingleAndDoubleEGOrPairFilter')","2e L1T match"),
36  mksel("filter('hltEle23Ele12CaloIdLTrackIdLIsoVLTrackIsoLeg1Filter')","2e Track Iso Leg1"),
37  mksel("filter('hltEle23Ele12CaloIdLTrackIdLIsoVLTrackIsoLeg2Filter')","2e Track Iso Leg2"),
38  #HLT_DoubleEle33_CaloIdL_MW
39  mksel("filter('hltEGL1SingleAndDoubleEGNonIsoOrWithEG26WithJetAndTauFilter')","2e (CaloIdL_MW) L1T match"),
40  mksel("filter('hltEle33CaloIdLPixelMatchFilter')","2e (CaloIdL_MW) Pixel match Leg1"),
41  mksel("filter('hltEle33CaloIdLMWPMS2Filter')","2e (CaloIdL_MW) S2"),
42  mksel("filter('hltDiEle33CaloIdLMWPMS2UnseededFilter')","2e (CaloIdL_MW unseeded) S2"),
43  #HLT_Photon200
44  mksel("filter('hltEG200HEFilter')","1e Photon200"),
45  #HLT_Photon50EB
46  mksel("filter('hltEG50EBEtFilter')","1e Photon50EB"),
47  #HLT_Ele16_Ele12_Ele8_CaloIdL_TrackIdL
48  mksel("filter('hltEle16Ele12Ele8CaloIdLTrackIdLDphiLeg3Filter')","3e Leg3"),
49  #HLT_Mu12_TrkIsoVVL_Ele23_CaloIdL_TrackIdL_IsoVL (wildcarded as the name is likely going to change soon)
50  mksel("filter('hltMu*TrkIsoVVLEle23CaloIdLTrackIdLIsoVLElectronlegTrackIsoFilter')","1mu-1e eLeg"),
51  #HLT_Ele24_eta2p1_WPTight_Gsf_PNetTauhPFJet30_*_eta2p3_CrossL1 OR HLT_Ele24_eta2p1_WPTight_Gsf_LooseDeepTauPFTauHPS30_eta2p1_CrossL1
52  mksel("filter('hltEle24erWPTightGsfTrackIsoFilterForTau')","1e-1tau eLeg"),
53  #HLT_Ele115_CaloIdVT_GsfTrkIdT
54  mksel("filter('hltEle115CaloIdVTGsfTrkIdTGsfDphiFilter')","1e high pT noIso"),
55  )
56 )
57 
58 customPhotonFilterBits = cms.PSet(
59  id = cms.int32(22),
60  sel = cms.string("type(92) && pt > 15 && coll('hltEgammaCandidates')"),
61  l1seed = cms.string("type(-98)"), l1deltaR = cms.double(0.3),
62  skipObjectsNotPassingQualityBits = cms.bool(True),
63  qualityBits = cms.VPSet(
64  #HLT_Photon50EB
65  mksel("filter('hltEG50EBEtFilter')","Photon50EB"),
66  #HLT_Photon***
67  mksel("filter('hltEG120HEFilter')","Photon120"),
68  mksel("filter('hltEG150HEFilter')","Photon150"),
69  mksel("filter('hltEG175HEFilter')","Photon175"),
70  mksel("filter('hltEG200HEFilter')","Photon200"),
71  #HLT_ECALHT800
72  mksel("filter('hltHtEcal800')","ECAL HT800"),
73  #HLT_Photon110EB_TightID_TightIso
74  mksel("filter('hltEG110EBTightIDTightIsoTrackIsoFilter')","Photon110EB Tight"),
75  #HLT_Mu17_Photon30_IsoCaloId
76  mksel("filter('hltMu17Photon30IsoCaloIdPhotonlegTrackIsoFilter')","1mu-1photon"),
77  #HLT_Diphoton30_22_R9Id_OR_IsoCaloId_AND_HE_R9Id_Mass90/95
78  mksel("filter('hltEG30LR9Id85b90eHE12R9Id50b80eR9IdLastFilter')","diPhoton 30_22 R9ID"),
79  mksel("filter('hltEG30LIso60CaloId15b35eHE12R9Id50b80eEcalIsoLastFilter')","diPhoton 30_22 ECALIso"),
80  mksel("filter('hltEG22R9Id85b90eHE12R9Id50b80eR9UnseededLastFilter')","diPhoton 30_22 unseeded R9ID"),
81  mksel("filter('hltEG22Iso60CaloId15b35eHE12R9Id50b80eTrackIsoUnseededLastFilter')","diPhoton 30_22 unseeded TrackIso"),
82  )
83 )
84 
85 superclusterTable = cms.EDProducer("SimpleSuperclusterFlatTableProducer",
86  src = cms.InputTag("reducedEgamma","reducedSuperClusters"),
87  name = cms.string("Supercluster"),
88  doc = cms.string("Supercluster collection"),
89  variables = cms.PSet(
90  energy = Var("energy()",float,doc="supercluster energy",precision=10),
91  eta = Var("eta()",float,doc="supercluster eta",precision=10),
92  phi = Var("phi()",float,doc="supercluster phi",precision=10),
93  rawEnergy = Var("rawEnergy()",float,doc="sum of basic clusters energy",precision=10),
94  preshowerEnergy = Var("preshowerEnergy()",float,doc="sum of energy in preshower",precision=10),
95  etaWidth = Var("etaWidth()",float,doc="supercluster eta width",precision=10),
96  phiWidth = Var("etaWidth()",float,doc="supercluster phi width",precision=10),
97  seedClusEnergy = Var("seed().energy()",float,doc="seed cluster energy",precision=10),
98  seedClusterEta = Var("seed().eta()",float,doc="seed cluster eta",precision=10),
99  seedClusterPhi = Var("seed().phi()",float,doc="seed cluster phi",precision=10),
100  ),
101  externalVariables = cms.PSet(
102  trkIso = ExtVar("superclusValueMaps:superclusTkIso",float,doc="supercluster track iso within 0.06 < dR < 0.4 & |dEta| > 0.03",precision=10),
103  )
104 )
105 
107  #photon
108  process.photonTable.variables.setValue(_phoVarsExtra.parameters_())
109  process.triggerObjectTable.selections.Photon = customPhotonFilterBits
110  if process.nanoDQM:
111  process.nanoDQM.vplots.Photon.plots = _Photon_extra_plots
112  #electron
113  process.electronTable.variables.setValue(_eleVarsExtra.parameters_())
114  process.triggerObjectTable.selections.Electron = customElectronFilterBits
115  if process.nanoDQM:
116  process.nanoDQM.vplots.Electron.plots = _Electron_extra_plots
117 
118  #superCluster
119  process.superclusValueMaps = superclusValueMaps
120  process.superclusterTable = superclusterTable
121 
122  process.superclusterTask = cms.Task(process.superclusValueMaps)
123  process.superclusterTask.add(process.superclusterTable)
124  process.nanoTableTaskCommon.add(process.superclusterTask)
125 
126  return process
def Var(expr, valtype, doc=None, precision=-1, lazyEval=False)
Definition: common_cff.py:17
def ExtVar(tag, valtype, doc=None, precision=-1)
Definition: common_cff.py:28
def addExtraEGammaVarsCustomize(process)
def mksel(selection, doc=None, bit=None)