CMS 3D CMS Logo

patCandidates_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
12 
13 
14 patCandidateSummary = cms.EDAnalyzer("CandidateSummaryTable",
15  logName = cms.untracked.string("patCandidates|PATSummaryTables"),
16  candidates = cms.VInputTag(
17  cms.InputTag("patElectrons"),
18  cms.InputTag("patLowPtElectrons"),
19  cms.InputTag("patMuons"),
20  cms.InputTag("patDisplacedMuons"),
21  cms.InputTag("patTaus"),
22  cms.InputTag("patPhotons"),
23  cms.InputTag("patOOTPhotons"),
24  cms.InputTag("patJets"),
25  cms.InputTag("patMETs"),
26  )
27 )
28 
29 patCandidatesTask = cms.Task(
30  makePatElectronsTask,
31  makePatLowPtElectronsTask,
32  makePatMuonsTask,
33  makePatDisplacedMuonsTask,
34  makePatTausTask,
35  makePatPhotonsTask,
36  makePatOOTPhotonsTask,
37  makePatJetsTask,
38  makePatMETsTask
39 )
40 
41 _patCandidatesTask = patCandidatesTask.copy()
42 _patCandidatesTask.remove(makePatOOTPhotonsTask)
43 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
44 pp_on_AA.toReplaceWith(patCandidatesTask, _patCandidatesTask)
45 pp_on_AA.toModify(patCandidateSummary.candidates, func = lambda list: list.remove(cms.InputTag("patOOTPhotons")) )
46 
47 from Configuration.Eras.Modifier_run2_miniAOD_94XFall17_cff import run2_miniAOD_94XFall17
48 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
49 _mAOD = (run2_miniAOD_94XFall17 | run2_miniAOD_80XLegacy)
50 (pp_on_AA | _mAOD).toReplaceWith(patCandidatesTask,
51  patCandidatesTask.copyAndExclude([makePatLowPtElectronsTask]))
52 (pp_on_AA | _mAOD).toModify(patCandidateSummary.candidates,
53  func = lambda list: list.remove(cms.InputTag("patLowPtElectrons")) )
54 
55 from Configuration.ProcessModifiers.run2_miniAOD_UL_cff import run2_miniAOD_UL
56 from Configuration.Eras.Era_Run2_2016_HIPM_cff import Run2_2016_HIPM
57 (pp_on_AA | _mAOD | run2_miniAOD_UL | Run2_2016_HIPM).toReplaceWith(patCandidatesTask,
58  patCandidatesTask.copyAndExclude([makePatDisplacedMuonsTask]))
59 (pp_on_AA | _mAOD | run2_miniAOD_UL | Run2_2016_HIPM).toModify(patCandidateSummary.candidates,
60  func = lambda list: list.remove(cms.InputTag("patDisplacedMuons")) )
61 
62 from Configuration.Eras.Modifier_fastSim_cff import fastSim
63 fastSim.toReplaceWith(patCandidatesTask, patCandidatesTask.copyAndExclude([makePatDisplacedMuonsTask]))
64 
65 patCandidates = cms.Sequence(patCandidateSummary, patCandidatesTask)
66