CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
particleFlowBlock_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 particleFlowBlock = cms.EDProducer(
4  "PFBlockProducer",
5  # verbosity
6  verbose = cms.untracked.bool(False),
7  # Debug flag
8  debug = cms.untracked.bool(False),
9 
10  #define what we are importing into particle flow
11  #from the various subdetectors
12  # importers are executed in the order they are defined here!!!
13  #order matters for some modules (it is pointed out where this is important)
14  # you can find a list of all available importers in:
15  # plugins/importers
16  elementImporters = cms.VPSet(
17  cms.PSet( importerName = cms.string("GSFTrackImporter"),
18  source = cms.InputTag("pfTrackElec"),
19  gsfsAreSecondary = cms.bool(False),
20  superClustersArePF = cms.bool(True) ),
21  cms.PSet( importerName = cms.string("ConvBremTrackImporter"),
22  source = cms.InputTag("pfTrackElec"),
23  vetoEndcap = cms.bool(False)),
24  cms.PSet( importerName = cms.string("SuperClusterImporter"),
25  source_eb = cms.InputTag("particleFlowSuperClusterECAL:particleFlowSuperClusterECALBarrel"),
26  source_ee = cms.InputTag("particleFlowSuperClusterECAL:particleFlowSuperClusterECALEndcapWithPreshower"),
27  source_towers = cms.InputTag("towerMaker"),
28  maximumHoverE = cms.double(0.5),
29  minSuperClusterPt = cms.double(10.0),
30  minPTforBypass = cms.double(100.0),
31  superClustersArePF = cms.bool(True) ),
32  cms.PSet( importerName = cms.string("ConversionTrackImporter"),
33  source = cms.InputTag("pfConversions"),
34  vetoEndcap = cms.bool(False)),
35  # V0's not actually used in particle flow block building so far
36  #cms.PSet( importerName = cms.string("V0TrackImporter"),
37  # source = cms.InputTag("pfV0"),
38  # vetoEndcap = cms.bool(False)),
39  #NuclearInteraction's also come in Loose and VeryLoose varieties
40  cms.PSet( importerName = cms.string("NuclearInteractionTrackImporter"),
41  source = cms.InputTag("pfDisplacedTrackerVertex"),
42  vetoEndcap = cms.bool(False)),
43  #for best timing GeneralTracksImporter should come after
44  # all secondary track importers
45  cms.PSet( importerName = cms.string("GeneralTracksImporter"),
46  source = cms.InputTag("pfTrack"),
47  vetoEndcap = cms.bool(False),
48  muonSrc = cms.InputTag("muons1stStep"),
49  trackQuality = cms.string("highPurity"),
50  cleanBadConvertedBrems = cms.bool(True),
51  useIterativeTracking = cms.bool(True),
52  DPtOverPtCuts_byTrackAlgo = cms.vdouble(10.0,10.0,10.0,
53  10.0,10.0,5.0),
54  NHitCuts_byTrackAlgo = cms.vuint32(3,3,3,3,3,3),
55  muonMaxDPtOPt = cms.double(1)
56  ),
57  # secondary GSF tracks are also turned off
58  #cms.PSet( importerName = cms.string("GSFTrackImporter"),
59  # source = cms.InputTag("pfTrackElec:Secondary"),
60  # gsfsAreSecondary = cms.bool(True),
61  # superClustersArePF = cms.bool(True) ),
62  # to properly set SC based links you need to run ECAL importer
63  # after you've imported all SCs to the block
64  cms.PSet( importerName = cms.string("ECALClusterImporter"),
65  source = cms.InputTag("particleFlowClusterECAL"),
66  BCtoPFCMap = cms.InputTag('particleFlowSuperClusterECAL:PFClusterAssociationEBEE') ),
67  cms.PSet( importerName = cms.string("GenericClusterImporter"),
68  source = cms.InputTag("particleFlowClusterHCAL") ),
69  cms.PSet( importerName = cms.string("GenericClusterImporter"),
70  source = cms.InputTag("particleFlowBadHcalPseudoCluster") ),
71  cms.PSet( importerName = cms.string("GenericClusterImporter"),
72  source = cms.InputTag("particleFlowClusterHO") ),
73  cms.PSet( importerName = cms.string("GenericClusterImporter"),
74  source = cms.InputTag("particleFlowClusterHF") ),
75  cms.PSet( importerName = cms.string("GenericClusterImporter"),
76  source = cms.InputTag("particleFlowClusterPS") ),
77  ),
78 
79  #linking definitions
80  # you can find a list of all available linkers in:
81  # plugins/linkers
82  # see : plugins/kdtrees for available KDTree Types
83  # to enable a KDTree for a linking pair, write a KDTree linker
84  # and set useKDTree = True in the linker PSet
85  #order does not matter here since we are defining a lookup table
86  linkDefinitions = cms.VPSet(
87  cms.PSet( linkerName = cms.string("PreshowerAndECALLinker"),
88  linkType = cms.string("PS1:ECAL"),
89  useKDTree = cms.bool(True) ),
90  cms.PSet( linkerName = cms.string("PreshowerAndECALLinker"),
91  linkType = cms.string("PS2:ECAL"),
92  useKDTree = cms.bool(True) ),
93  cms.PSet( linkerName = cms.string("TrackAndECALLinker"),
94  linkType = cms.string("TRACK:ECAL"),
95  useKDTree = cms.bool(True) ),
96  cms.PSet( linkerName = cms.string("TrackAndHCALLinker"),
97  linkType = cms.string("TRACK:HCAL"),
98  useKDTree = cms.bool(True),
99  trajectoryLayerEntrance = cms.string("HCALEntrance"),
100  trajectoryLayerExit = cms.string("HCALExit"),
101  nMaxHcalLinksPerTrack = cms.int32(1) # the max hcal links per track (negative values: no restriction)
102  ),
103  cms.PSet( linkerName = cms.string("TrackAndHOLinker"),
104  linkType = cms.string("TRACK:HO"),
105  useKDTree = cms.bool(False) ),
106  cms.PSet( linkerName = cms.string("ECALAndHCALLinker"),
107  linkType = cms.string("ECAL:HCAL"),
108  minAbsEtaEcal = cms.double(2.5),
109  useKDTree = cms.bool(False) ),
110  cms.PSet( linkerName = cms.string("HCALAndHOLinker"),
111  linkType = cms.string("HCAL:HO"),
112  useKDTree = cms.bool(False) ),
113  cms.PSet( linkerName = cms.string("HFEMAndHFHADLinker"),
114  linkType = cms.string("HFEM:HFHAD"),
115  useKDTree = cms.bool(False) ),
116  cms.PSet( linkerName = cms.string("TrackAndTrackLinker"),
117  linkType = cms.string("TRACK:TRACK"),
118  useKDTree = cms.bool(False) ),
119  cms.PSet( linkerName = cms.string("ECALAndECALLinker"),
120  linkType = cms.string("ECAL:ECAL"),
121  useKDTree = cms.bool(False) ),
122  cms.PSet( linkerName = cms.string("GSFAndECALLinker"),
123  linkType = cms.string("GSF:ECAL"),
124  useKDTree = cms.bool(False) ),
125  cms.PSet( linkerName = cms.string("TrackAndGSFLinker"),
126  linkType = cms.string("TRACK:GSF"),
127  useKDTree = cms.bool(False),
128  useConvertedBrems = cms.bool(True) ),
129  cms.PSet( linkerName = cms.string("GSFAndBREMLinker"),
130  linkType = cms.string("GSF:BREM"),
131  useKDTree = cms.bool(False) ),
132  cms.PSet( linkerName = cms.string("GSFAndGSFLinker"),
133  linkType = cms.string("GSF:GSF"),
134  useKDTree = cms.bool(False) ),
135  cms.PSet( linkerName = cms.string("ECALAndBREMLinker"),
136  linkType = cms.string("ECAL:BREM"),
137  useKDTree = cms.bool(False) ),
138  cms.PSet( linkerName = cms.string("GSFAndHCALLinker"),
139  linkType = cms.string("GSF:HCAL"),
140  useKDTree = cms.bool(False) ),
141  cms.PSet( linkerName = cms.string("HCALAndBREMLinker"),
142  linkType = cms.string("HCAL:BREM"),
143  useKDTree = cms.bool(False) ),
144  cms.PSet( linkerName = cms.string("SCAndECALLinker"),
145  linkType = cms.string("SC:ECAL"),
146  useKDTree = cms.bool(False),
147  SuperClusterMatchByRef = cms.bool(True) )
148  )
149 )
150 
151 for imp in particleFlowBlock.elementImporters:
152  if imp.importerName.value() == "SuperClusterImporter":
153  _scImporter = imp
154 
155 from Configuration.ProcessModifiers.egamma_lowPt_exclusive_cff import egamma_lowPt_exclusive
156 egamma_lowPt_exclusive.toModify(_scImporter,
157  minSuperClusterPt = 1.0,
158  minPTforBypass = 0.0)
159 
160 #
161 # kill pfTICL tracks
163  ret = []
164  for i, pset in enumerate(particleFlowBlock.elementImporters):
165  if pset.importerName.value() == name:
166  ret.append(i)
167  return ret
168 
169 from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
170 _insertTrackImportersWithVeto = {}
171 _trackImporters = ['GeneralTracksImporter','ConvBremTrackImporter',
172  'ConversionTrackImporter','NuclearInteractionTrackImporter']
173 for importer in _trackImporters:
174  for idx in _findIndicesByModule(importer):
175  _insertTrackImportersWithVeto[idx] = dict(
176  vetoEndcap = True,
177  vetoMode = cms.uint32(2), # pfTICL candidate list
178  vetoSrc = cms.InputTag("pfTICL")
179  )
180 phase2_hgcal.toModify(
181  particleFlowBlock,
182  elementImporters = _insertTrackImportersWithVeto
183 )
184 
185 #
186 # append track-HF linkers
187 from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
188 _addTrackHFLinks = particleFlowBlock.linkDefinitions.copy()
189 _addTrackHFLinks.append(
190  cms.PSet( linkerName = cms.string("TrackAndHCALLinker"),
191  linkType = cms.string("TRACK:HFEM"),
192  useKDTree = cms.bool(True),
193  trajectoryLayerEntrance = cms.string("VFcalEntrance"),
194  trajectoryLayerExit = cms.string(""),
195  nMaxHcalLinksPerTrack = cms.int32(-1) # Keep all track-HFEM links
196  )
197 )
198 _addTrackHFLinks.append(
199  cms.PSet( linkerName = cms.string("TrackAndHCALLinker"),
200  linkType = cms.string("TRACK:HFHAD"),
201  useKDTree = cms.bool(True),
202  trajectoryLayerEntrance = cms.string("VFcalEntrance"),
203  trajectoryLayerExit = cms.string(""),
204  nMaxHcalLinksPerTrack = cms.int32(-1) # Keep all track-HFHAD links for now
205  )
206 )
207 phase2_tracker.toModify(
208  particleFlowBlock,
209  linkDefinitions = _addTrackHFLinks
210 )
211 
212 #
213 # for precision timing
214 from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
215 _addTiming = particleFlowBlock.elementImporters.copy()
216 _addTiming.append( cms.PSet( importerName = cms.string("TrackTimingImporter"),
217  timeValueMap = cms.InputTag("trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModel"),
218  timeErrorMap = cms.InputTag("trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModelResolution"),
219  timeValueMapGsf = cms.InputTag("gsfTrackTimeValueMapProducer:electronGsfTracksConfigurableFlatResolutionModel"),
220  timeErrorMapGsf = cms.InputTag("gsfTrackTimeValueMapProducer:electronGsfTracksConfigurableFlatResolutionModelResolution")
221  )
222  )
223 
224 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
225 _addTimingLayer = particleFlowBlock.elementImporters.copy()
226 _addTimingLayer.append( cms.PSet( importerName = cms.string("TrackTimingImporter"),
227  timeValueMap = cms.InputTag("tofPID:t0"),
228  timeErrorMap = cms.InputTag("tofPID:sigmat0"),
229  timeQualityMap = cms.InputTag("mtdTrackQualityMVA:mtdQualMVA"),
230  timeQualityThreshold = cms.double(0.5),
231  #this will cause no time to be set for gsf tracks
232  #(since this is not available for the fullsim/reconstruction yet)
233  #*TODO* update when gsf times are available
234  timeValueMapGsf = cms.InputTag("tofPID:t0"),
235  timeErrorMapGsf = cms.InputTag("tofPID:sigmat0"),
236  timeQualityMapGsf = cms.InputTag("mtdTrackQualityMVA:mtdQualMVA"),
237  )
238  )
239 
240 phase2_timing.toModify(
241  particleFlowBlock,
242  elementImporters = _addTiming
243 )
244 
245 phase2_timing_layer.toModify(
246  particleFlowBlock,
247  elementImporters = _addTimingLayer
248 )