CMS 3D CMS Logo

RecoParticleFlow_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 
5 #from RecoParticleFlow.PFTracking.particleFlowTrackWithDisplacedVertex_cff import *
6 
9 
14 #from RecoParticleFlow.PFProducer.pfGsfElectronCiCSelector_cff import *
16 
18 
20 
23 
25 fixedGridRhoFastjetAllTmp = fixedGridRhoFastjetAll.clone(pfCandidatesTag = "particleFlowTmp")
26 
27 particleFlowTmpTask = cms.Task(particleFlowTmp)
28 particleFlowTmpSeq = cms.Sequence(particleFlowTmpTask)
29 
30 particleFlowRecoTask = cms.Task( particleFlowTrackWithDisplacedVertexTask,
31 # pfGsfElectronCiCSelectionSequence,
32  pfGsfElectronMVASelectionTask,
33  particleFlowBlock,
34  particleFlowEGammaFullTask,
35  particleFlowTmpTask,
36  fixedGridRhoFastjetAllTmp,
37  particleFlowTmpPtrs,
38  particleFlowEGammaFinalTask,
39  pfParticleSelectionTask )
40 particleFlowReco = cms.Sequence(particleFlowRecoTask)
41 
42 particleFlowLinksTask = cms.Task( particleFlow, particleFlowPtrs, chargedHadronPFTrackIsolation, particleBasedIsolationTask)
43 particleFlowLinks = cms.Sequence(particleFlowLinksTask)
44 
45 #
46 # for phase 2
47 particleFlowTmpBarrel = particleFlowTmp.clone()
48 _phase2_hgcal_particleFlowTmp = cms.EDProducer(
49  "PFCandidateListMerger",
50  src = cms.VInputTag("particleFlowTmpBarrel",
51  "pfTICL")
52 
53 )
54 
55 from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
56 phase2_hgcal.toReplaceWith( particleFlowTmp, _phase2_hgcal_particleFlowTmp )
57 phase2_hgcal.toModify(
58  particleFlowTmpBarrel,
59  vetoEndcap = True
60  # If true, PF(Muon)Algo will ignore muon candidates incorporated via pfTICL
61  # in addMissingMuons. This will prevent potential double-counting.
62 )
63 
64 #
65 # for simPF
70 
71 _phase2_hgcal_simPFTask = cms.Task( pfTrack ,
72  hgcalTrackCollection ,
73  tpClusterProducer ,
74  quickTrackAssociatorByHits ,
75  simPFProducer )
76 _phase2_hgcal_simPFSequence = cms.Sequence(_phase2_hgcal_simPFTask)
77 
78 _phase2_hgcal_particleFlowRecoTask = cms.Task( _phase2_hgcal_simPFTask , particleFlowRecoTask.copy() )
79 _phase2_hgcal_particleFlowRecoTask.replace( particleFlowTmpTask, cms.Task( particleFlowTmpBarrel, particleFlowTmp ) )
80 
81 phase2_hgcal.toReplaceWith( particleFlowRecoTask, _phase2_hgcal_particleFlowRecoTask )
82 
83 #
84 # for heavy ion
85 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
86 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
87 
88 for e in [pp_on_XeXe_2017, pp_on_AA]:
89  e.toModify(particleFlowDisplacedVertexCandidate,
90  tracksSelectorParameters = dict(pt_min = 999999.0,
91  nChi2_max = 0.0,
92  pt_min_prim = 999999.0,
93  dxy = 999999.0)
94  )
95 
96  e.toModify(particleFlowBlock, useNuclear = cms.bool(False))
97 
98  e.toModify(pfNoPileUpIso, enable = cms.bool(False))
99  e.toModify(pfPileUpIso, enable = cms.bool(False))
100  e.toModify(pfNoPileUp, enable = cms.bool(False))
101  e.toModify(pfPileUp, enable = cms.bool(False))
102 
103 #
104 # for MLPF
105 from Configuration.ProcessModifiers.mlpf_cff import mlpf
106 from RecoParticleFlow.PFProducer.mlpfProducer_cfi import mlpfProducer
107 
108 _mlpfTask = cms.Task(mlpfProducer, particleFlowRecoTask.copy())
109 
110 mlpf.toReplaceWith(particleFlowRecoTask, _mlpfTask)
111 
112 #
113 # switch from pfTICL to simPF
114 def _findIndicesByModule(process,name):
115  ret = []
116  if hasattr(process,'particleFlowBlock'):
117  for i, pset in enumerate(process.particleFlowBlock.elementImporters):
118  if pset.importerName.value() == name:
119  ret.append(i)
120  return ret
121 
122 from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
123 def replaceTICLwithSimPF(process):
124  if hasattr(process,'particleFlowTmp'):
125  process.particleFlowTmp.src = ['particleFlowTmpBarrel', 'simPFProducer']
126 
127  if hasattr(process,'particleFlowTmpBarrel'):
128  process.particleFlowTmpBarrel.vetoEndcap = False
129 
130  _insertTrackImportersWithVeto = {}
131  _trackImporters = ['GeneralTracksImporter','ConvBremTrackImporter',
132  'ConversionTrackImporter','NuclearInteractionTrackImporter']
133  for importer in _trackImporters:
134  for idx in _findIndicesByModule(process,importer):
135  _insertTrackImportersWithVeto[idx] = dict(
136  vetoMode = cms.uint32(0), # HGCal-region PFTrack list for simPF
137  vetoSrc = cms.InputTag('hgcalTrackCollection:TracksInHGCal')
138  )
139  phase2_hgcal.toModify(
140  process.particleFlowBlock,
141  elementImporters = _insertTrackImportersWithVeto
142  )
143 
144  return process
pfParticleSelection_cff
fixedGridRhoProducerFastjet_cfi
RecoParticleFlow_cff._findIndicesByModule
def _findIndicesByModule(process, name)
Definition: RecoParticleFlow_cff.py:114
pfLinker_cff
hgcalTrackCollection_cfi
simPFProducer_cff
particleFlowBlock_cff
particleFlow_cff
pfElectronTranslator_cff
particleFlowSimParticle_cff
RecoParticleFlow_cff.replaceTICLwithSimPF
def replaceTICLwithSimPF(process)
Definition: RecoParticleFlow_cff.py:123
tpClusterProducer_cfi
pfPhotonTranslator_cff
particleFlowTrack_cff
quickTrackAssociatorByHits_cfi
particleBasedIsoProducer_cff
pfGsfElectronMVASelector_cff
chargedHadronPFTrackIsolation_cfi
particleFlowEGamma_cff