CMS 3D CMS Logo

PFBRECO_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # getting the ptrs
4 from RecoParticleFlow.PFProducer.pfLinker_cff import particleFlowPtrs
5 
8 pfPileUpIsoPFBRECO = pfPileUp.clone( PFCandidates = 'particleFlowPtrs' )
9 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
10 pp_on_AA.toModify(pfPileUpIsoPFBRECO, enable = False)
11 
12 pfNoPileUpIsoPFBRECO = pfNoPileUp.clone( topCollection = 'pfPileUpIsoPFBRECO',
13  bottomCollection = 'particleFlowPtrs')
14 pfNoPileUpIsoPFBRECOTask = cms.Task(
15  pfPileUpIsoPFBRECO,
16  pfNoPileUpIsoPFBRECO
17  )
18 pfNoPileUpIsoPFBRECOSequence = cms.Sequence(pfNoPileUpIsoPFBRECOTask)
19 
21 
22 pfPileUpPFBRECO = pfPileUp.clone( PFCandidates = 'particleFlowPtrs' )
23 pfNoPileUpPFBRECO = pfNoPileUp.clone( topCollection = 'pfPileUpPFBRECO',
24  bottomCollection = 'particleFlowPtrs')
25 pfNoPileUpPFBRECOTask = cms.Task(
26  pfPileUpPFBRECO,
27  pfNoPileUpPFBRECO
28  )
29 pfNoPileUpPFBRECOSequence = cms.Sequence(pfNoPileUpPFBRECOTask)
30 
32 pfAllNeutralHadronsPFBRECO = pfAllNeutralHadrons.clone( src = 'pfNoPileUpIsoPFBRECO' )
34 pfAllChargedHadronsPFBRECO = pfAllChargedHadrons.clone( src = 'pfNoPileUpIsoPFBRECO' )
36 pfAllPhotonsPFBRECO = pfAllPhotons.clone( src = 'pfNoPileUpIsoPFBRECO' )
38 pfAllMuonsPFBRECO = pfAllMuons.clone( src = 'pfNoPileUpPFBRECO' )
39 pfAllMuonsClonesPFBRECO = pfAllMuonsClones.clone( src = 'pfAllMuonsPFBRECO' )
41 pfAllElectronsPFBRECO = pfAllElectrons.clone( src = 'pfNoMuonPFBRECO' )
42 pfAllElectronsClonesPFBRECO = pfAllElectronsClones.clone( src = 'pfAllElectronsPFBRECO' )
44 pfAllChargedParticlesPFBRECO = pfAllChargedParticles.clone( src = 'pfNoPileUpIsoPFBRECO' )
46 pfAllNeutralHadronsAndPhotonsPFBRECO = pfAllNeutralHadronsAndPhotons.clone( src = 'pfNoPileUpIsoPFBRECO' )
47 pfPileUpAllChargedParticlesPFBRECO = pfAllChargedParticles.clone( src = 'pfPileUpIsoPFBRECO' )
48 pfSortByTypePFBRECOTask = cms.Task(
49  pfAllNeutralHadronsPFBRECO,
50  pfAllChargedHadronsPFBRECO,
51  pfAllPhotonsPFBRECO,
52  # charged hadrons , electrons , muons
53  pfAllChargedParticlesPFBRECO,
54  # same, but from pile up
55  pfPileUpAllChargedParticlesPFBRECO,
56  pfAllNeutralHadronsAndPhotonsPFBRECO
57 # ,
58 # pfAllElectronsPFBRECO,
59 # pfAllMuonsPFBRECO
60  )
61 pfSortByTypePFBRECOSequence = cms.Sequence(pfSortByTypePFBRECOTask)
62 
63 pfParticleSelectionPFBRECOTask = cms.Task(
64  pfNoPileUpIsoPFBRECOTask,
65  # In principle JME sequence should go here, but this is used in RECO
66  # in addition to here, and is used in the "first-step" PF process
67  # so needs to go later.
68  #pfNoPileUpJMETask ,
69  pfNoPileUpPFBRECOTask,
70  pfSortByTypePFBRECOTask
71  )
72 pfParticleSelectionPFBRECOSequence = cms.Sequence(pfParticleSelectionPFBRECOTask)
73 
75 pfSelectedPhotonsPFBRECO = pfSelectedPhotons.clone( src = 'pfAllPhotonsPFBRECO' )
78 pfIsolatedPhotonsPFBRECO = pfIsolatedPhotons.clone(
79  src = 'pfSelectedPhotonsPFBRECO',
80  isolationValueMapsCharged = ["phPFIsoValueCharged04PFIdPFBRECO"],
81  isolationValueMapsNeutral = ["phPFIsoValueNeutral04PFIdPFBRECO",
82  "phPFIsoValueGamma04PFIdPFBRECO"],
83  deltaBetaIsolationValueMap = 'phPFIsoValuePU04PFIdPFBRECO'
84 )
85 pfPhotonPFBRECOTask = cms.Task(
86  pfSelectedPhotonsPFBRECO ,
87  pfPhotonIsolationPFBRECOTask ,
88  # selecting isolated photons:
89  pfIsolatedPhotonsPFBRECO
90  )
91 pfPhotonPFBRECOSequence = cms.Sequence(pfPhotonPFBRECOTask)
92 
94 pfMuonsFromVertexPFBRECO = pfMuonsFromVertex.clone( src = 'pfAllMuonsPFBRECO' )
96 pfIsolatedMuonsPFBRECO = pfIsolatedMuons.clone( src = 'pfMuonsFromVertexPFBRECO' )
97 pfMuonsPFBRECO = pfIsolatedMuonsPFBRECO.clone(cut = "pt > 5 & muonRef.isAvailable()")
98 pfMuonPFBRECOTask = cms.Task(
99  pfAllMuonsPFBRECO ,
100  pfMuonsFromVertexPFBRECO ,
101  pfIsolatedMuonsPFBRECO,
102  pfMuonsPFBRECO
103  )
104 pfMuonPFBRECOSequence = cms.Sequence(pfMuonPFBRECOTask)
105 
107 pfElectronsFromVertexPFBRECO = pfElectronsFromVertex.clone( src = 'pfAllElectronsPFBRECO' )
109 pfIsolatedElectronsPFBRECO = pfIsolatedElectrons.clone( src = 'pfElectronsFromVertexPFBRECO' )
110 pfElectronsPFBRECO = pfIsolatedElectronsPFBRECO.clone( cut = " pt > 5 & gsfElectronRef.isAvailable() & gsfTrackRef.hitPattern().numberOfLostHits('MISSING_INNER_HITS')<2")
111 pfElectronPFBRECOTask = cms.Task(
112  pfAllElectronsPFBRECO ,
113  pfElectronsFromVertexPFBRECO ,
114  pfIsolatedElectronsPFBRECO ,
115  pfElectronsPFBRECO
116  )
117 pfElectronPFBRECOSequence = cms.Sequence(pfElectronPFBRECOTask)
118 
119 from CommonTools.ParticleFlow.Tools.jetTools import jetAlgo
120 pfJetsPFBRECO = jetAlgo('AK4')
121 pfJetsPFBRECO.src = 'pfNoElectronJMEPFBRECO'
122 pfJetsPtrsPFBRECO = cms.EDProducer("PFJetFwdPtrProducer",
123  src=cms.InputTag("pfJetsPFBRECO")
124  )
125 pfJetPFBRECOTask = cms.Task(
126  pfJetsPFBRECO ,
127  pfJetsPtrsPFBRECO
128  )
129 pfJetPFBRECOSequence = cms.Sequence(pfJetPFBRECOTask)
130 
132 
134 pfMETPFBRECO = pfMET.clone( srcJets = 'pfJetsPFBRECO' )
135 
136 
146 
147 # sequential top projection cleaning
149 pfNoMuonPFBRECO = pfNoMuon.clone( topCollection = 'pfIsolatedMuonsPFBRECO',
150  bottomCollection = 'pfNoPileUpPFBRECO' )
151 pfNoMuonJMEPFBRECO = pfNoMuonJME.clone( topCollection = 'pfIsolatedMuonsPFBRECO' )
153 pfNoElectronPFBRECO = pfNoElectron.clone( topCollection = 'pfIsolatedElectronsPFBRECO',
154  bottomCollection = 'pfNoMuonPFBRECO' )
155 pfNoElectronJMEPFBRECO = pfNoElectronJME.clone( topCollection = 'pfIsolatedElectronsPFBRECO',
156  bottomCollection = 'pfNoMuonJMEPFBRECO' )
157 pfNoElectronJMEClonesPFBRECO = pfNoElectronJMEClones.clone( src = 'pfNoElectronJMEPFBRECO' )
159 pfNoJetPFBRECO = pfNoJet.clone( topCollection = 'pfJetsPtrsPFBRECO',
160  bottomCollection = 'pfNoElectronJMEPFBRECO' )
162 pfNoTauPFBRECO = pfNoTau.clone ( bottomCollection = 'pfJetsPtrsPFBRECO' )
163 pfNoTauClonesPFBRECO = pfNoTauClones.clone ( src = 'pfNoTauPFBRECO' )
164 
165 # generator tools
167 
168 PFBRECOTask = cms.Task(
169  particleFlowPtrs ,
170  pfParticleSelectionPFBRECOTask ,
171  pfNoPileUpJMETask ,
172 # pfDeltaBetaWeightingPFBRECOTask ,
173  pfPhotonPFBRECOTask ,
174  pfMuonPFBRECOTask ,
175  pfNoMuonPFBRECO ,
176  pfNoMuonJMEPFBRECO ,
177  pfElectronPFBRECOTask ,
178  pfNoElectronPFBRECO ,
179  pfNoElectronJMEPFBRECO ,
180  pfNoElectronJMEClonesPFBRECO,
181  pfJetPFBRECOTask ,
182  pfNoJetPFBRECO ,
183  pfTauTask ,
184  pfNoTauPFBRECO ,
185  pfMETPFBRECO
186  )
187 PFBRECO = cms.Sequence(PFBRECOTask)
188