CMS 3D CMS Logo

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