CMS 3D CMS Logo

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