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 (pp_on_AA).toReplaceWith(
48  patCandidatesTask,
49  patCandidatesTask.copyAndExclude([makePatLowPtElectronsTask])).toModify(
50  patCandidateSummary.candidates,
51  func = lambda list: list.remove(cms.InputTag("patLowPtElectrons")) )
52 
53 from Configuration.ProcessModifiers.run2_miniAOD_UL_cff import run2_miniAOD_UL
54 from Configuration.Eras.Era_Run2_2016_HIPM_cff import Run2_2016_HIPM
55 (pp_on_AA | run2_miniAOD_UL | Run2_2016_HIPM).toReplaceWith(
56  patCandidatesTask,
57  patCandidatesTask.copyAndExclude([makePatDisplacedMuonsTask])).toModify(
58  patCandidateSummary.candidates,
59  func = lambda list: list.remove(cms.InputTag("patDisplacedMuons")) )
60 
61 from Configuration.Eras.Modifier_fastSim_cff import fastSim
62 fastSim.toReplaceWith(patCandidatesTask, patCandidatesTask.copyAndExclude([makePatDisplacedMuonsTask]))
63 
64 patCandidates = cms.Sequence(patCandidateSummary, patCandidatesTask)
65