CMS 3D CMS Logo

selectedPatCandidates_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
11 #from PhysicsTools.PatAlgos.producersLayer1.hemisphereProducer_cfi import *
12 
13 # One module to count objects
14 selectedPatCandidateSummary = cms.EDAnalyzer("CandidateSummaryTable",
15  logName = cms.untracked.string("selectedPatCanddiates|PATSummaryTables"),
16  candidates = cms.VInputTag(
17  cms.InputTag("selectedPatElectrons"),
18  cms.InputTag("selectedPatLowPtElectrons"),
19  cms.InputTag("selectedPatMuons"),
20  cms.InputTag("selectedPatDisplacedMuons"),
21  cms.InputTag("selectedPatTaus"),
22  cms.InputTag("selectedPatPhotons"),
23  cms.InputTag("selectedPatOOTPhotons"),
24  cms.InputTag("selectedPatJets"),
25  )
26 )
27 
28 selectedPatCandidatesTask = cms.Task(
29  selectedPatElectrons,
30  selectedPatLowPtElectrons,
31  selectedPatMuons,
32  selectedPatDisplacedMuons,
33  selectedPatTaus,
34  selectedPatPhotons,
35  selectedPatOOTPhotons,
36  selectedPatJets
37 )
38 
39 selectedPatCandidates = cms.Sequence(selectedPatCandidateSummary, selectedPatCandidatesTask)
40 
41 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
42 pp_on_AA.toReplaceWith(selectedPatCandidatesTask, selectedPatCandidatesTask.copyAndExclude([selectedPatOOTPhotons]))
43 pp_on_AA.toModify(selectedPatCandidateSummary.candidates, func = lambda list: list.remove(cms.InputTag("selectedPatOOTPhotons")) )
44 
45 from Configuration.Eras.Modifier_run2_miniAOD_94XFall17_cff import run2_miniAOD_94XFall17
46 from Configuration.Eras.Modifier_run2_miniAOD_80XLegacy_cff import run2_miniAOD_80XLegacy
47 _mAOD = (run2_miniAOD_94XFall17 | run2_miniAOD_80XLegacy)
48 (pp_on_AA | _mAOD).toReplaceWith(selectedPatCandidatesTask,
49  selectedPatCandidatesTask.copyAndExclude([selectedPatLowPtElectrons]))
50 (pp_on_AA | _mAOD).toModify(selectedPatCandidateSummary.candidates,
51  func = lambda list: list.remove(cms.InputTag("selectedPatLowPtElectrons")) )
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 | _mAOD | run2_miniAOD_UL | Run2_2016_HIPM).toReplaceWith(selectedPatCandidatesTask,
56  selectedPatCandidatesTask.copyAndExclude([selectedPatDisplacedMuons]))
57 (pp_on_AA | _mAOD | run2_miniAOD_UL | Run2_2016_HIPM).toModify(selectedPatCandidateSummary.candidates,
58  func = lambda list: list.remove(cms.InputTag("selectedPatDisplacedMuons")) )
59 
60 from Configuration.Eras.Modifier_fastSim_cff import fastSim
61 fastSim.toReplaceWith(selectedPatCandidatesTask, selectedPatCandidatesTask.copyAndExclude([selectedPatDisplacedMuons]))