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  ),
51  # secondary GSF tracks are also turned off
52  #cms.PSet( importerName = cms.string("GSFTrackImporter"),
53  # source = cms.InputTag("pfTrackElec:Secondary"),
54  # gsfsAreSecondary = cms.bool(True),
55  # superClustersArePF = cms.bool(True) ),
56  # to properly set SC based links you need to run ECAL importer
57  # after you've imported all SCs to the block
58  cms.PSet( importerName = cms.string("ECALClusterImporter"),
59  source = cms.InputTag("particleFlowClusterECAL"),
60  BCtoPFCMap = cms.InputTag('particleFlowSuperClusterECAL:PFClusterAssociationEBEE') ),
61  cms.PSet( importerName = cms.string("GenericClusterImporter"),
62  source = cms.InputTag("particleFlowClusterHCAL") ),
63  cms.PSet( importerName = cms.string("GenericClusterImporter"),
64  source = cms.InputTag("particleFlowBadHcalPseudoCluster") ),
65  cms.PSet( importerName = cms.string("GenericClusterImporter"),
66  source = cms.InputTag("particleFlowClusterHO") ),
67  cms.PSet( importerName = cms.string("GenericClusterImporter"),
68  source = cms.InputTag("particleFlowClusterHF") ),
69  cms.PSet( importerName = cms.string("GenericClusterImporter"),
70  source = cms.InputTag("particleFlowClusterPS") ),
71 
72  ),
73 
74  #linking definitions
75  # you can find a list of all available linkers in:
76  # plugins/linkers
77  # see : plugins/kdtrees for available KDTree Types
78  # to enable a KDTree for a linking pair, write a KDTree linker
79  # and set useKDTree = True in the linker PSet
80  #order does not matter here since we are defining a lookup table
81  linkDefinitions = cms.VPSet(
82  cms.PSet( linkerName = cms.string("PreshowerAndECALLinker"),
83  linkType = cms.string("PS1:ECAL"),
84  useKDTree = cms.bool(True) ),
85  cms.PSet( linkerName = cms.string("PreshowerAndECALLinker"),
86  linkType = cms.string("PS2:ECAL"),
87  useKDTree = cms.bool(True) ),
88  cms.PSet( linkerName = cms.string("TrackAndECALLinker"),
89  linkType = cms.string("TRACK:ECAL"),
90  useKDTree = cms.bool(True) ),
91  cms.PSet( linkerName = cms.string("TrackAndHCALLinker"),
92  linkType = cms.string("TRACK:HCAL"),
93  useKDTree = cms.bool(True),
94  trajectoryLayerEntrance = cms.string("HCALEntrance"),
95  trajectoryLayerExit = cms.string("HCALExit")),
96  cms.PSet( linkerName = cms.string("TrackAndHOLinker"),
97  linkType = cms.string("TRACK:HO"),
98  useKDTree = cms.bool(False) ),
99  cms.PSet( linkerName = cms.string("ECALAndHCALLinker"),
100  linkType = cms.string("ECAL:HCAL"),
101  useKDTree = cms.bool(False) ),
102  cms.PSet( linkerName = cms.string("HCALAndHOLinker"),
103  linkType = cms.string("HCAL:HO"),
104  useKDTree = cms.bool(False) ),
105  cms.PSet( linkerName = cms.string("HFEMAndHFHADLinker"),
106  linkType = cms.string("HFEM:HFHAD"),
107  useKDTree = cms.bool(False) ),
108  cms.PSet( linkerName = cms.string("TrackAndTrackLinker"),
109  linkType = cms.string("TRACK:TRACK"),
110  useKDTree = cms.bool(False) ),
111  cms.PSet( linkerName = cms.string("ECALAndECALLinker"),
112  linkType = cms.string("ECAL:ECAL"),
113  useKDTree = cms.bool(False) ),
114  cms.PSet( linkerName = cms.string("GSFAndECALLinker"),
115  linkType = cms.string("GSF:ECAL"),
116  useKDTree = cms.bool(False) ),
117  cms.PSet( linkerName = cms.string("TrackAndGSFLinker"),
118  linkType = cms.string("TRACK:GSF"),
119  useKDTree = cms.bool(False),
120  useConvertedBrems = cms.bool(True) ),
121  cms.PSet( linkerName = cms.string("GSFAndBREMLinker"),
122  linkType = cms.string("GSF:BREM"),
123  useKDTree = cms.bool(False) ),
124  cms.PSet( linkerName = cms.string("GSFAndGSFLinker"),
125  linkType = cms.string("GSF:GSF"),
126  useKDTree = cms.bool(False) ),
127  cms.PSet( linkerName = cms.string("ECALAndBREMLinker"),
128  linkType = cms.string("ECAL:BREM"),
129  useKDTree = cms.bool(False) ),
130  cms.PSet( linkerName = cms.string("GSFAndHCALLinker"),
131  linkType = cms.string("GSF:HCAL"),
132  useKDTree = cms.bool(False) ),
133  cms.PSet( linkerName = cms.string("HCALAndBREMLinker"),
134  linkType = cms.string("HCAL:BREM"),
135  useKDTree = cms.bool(False) ),
136  cms.PSet( linkerName = cms.string("SCAndECALLinker"),
137  linkType = cms.string("SC:ECAL"),
138  useKDTree = cms.bool(False),
139  SuperClusterMatchByRef = cms.bool(True) )
140  )
141 )
142 
143 for imp in particleFlowBlock.elementImporters:
144  if imp.importerName.value() == "SuperClusterImporter":
145  _scImporter = imp
146 
147 from Configuration.ProcessModifiers.egamma_lowPt_exclusive_cff import egamma_lowPt_exclusive
148 egamma_lowPt_exclusive.toModify(_scImporter,
149  minSuperClusterPt = 1.0,
150  minPTforBypass = 0.0)
151 
153  ret = []
154  for i, pset in enumerate(particleFlowBlock.elementImporters):
155  if pset.importerName.value() == name:
156  ret.append(i)
157  return ret
158 
159 
160 from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
161 # kill tracks in the HGCal
162 _insertGeneralTracksImporter = {}
163 for idx in _findIndicesByModule('GeneralTracksImporter'):
164  _insertGeneralTracksImporter[idx] = dict(
165  importerName = cms.string('GeneralTracksImporterWithVeto'),
166  veto = cms.InputTag('hgcalTrackCollection:TracksInHGCal')
167  )
168 phase2_hgcal.toModify(
169  particleFlowBlock,
170  elementImporters = _insertGeneralTracksImporter
171 )
172 
189 
190 from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
191 _addTrackHFLinks = particleFlowBlock.linkDefinitions.copy()
192 _addTrackHFLinks.append(
193  cms.PSet( linkerName = cms.string("TrackAndHCALLinker"),
194  linkType = cms.string("TRACK:HFEM"),
195  useKDTree = cms.bool(True),
196  trajectoryLayerEntrance = cms.string("VFcalEntrance"),
197  trajectoryLayerExit = cms.string(""))
198  )
199 _addTrackHFLinks.append(
200  cms.PSet( linkerName = cms.string("TrackAndHCALLinker"),
201  linkType = cms.string("TRACK:HFHAD"),
202  useKDTree = cms.bool(True),
203  trajectoryLayerEntrance = cms.string("VFcalEntrance"),
204  trajectoryLayerExit = cms.string(""))
205 )
206 phase2_tracker.toModify(
207  particleFlowBlock,
208  linkDefinitions = _addTrackHFLinks
209 )
210 
211 from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
212 _addTiming = particleFlowBlock.elementImporters.copy()
213 _addTiming.append( cms.PSet( importerName = cms.string("TrackTimingImporter"),
214  timeValueMap = cms.InputTag("trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModel"),
215  timeErrorMap = cms.InputTag("trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModelResolution"),
216  timeValueMapGsf = cms.InputTag("gsfTrackTimeValueMapProducer:electronGsfTracksConfigurableFlatResolutionModel"),
217  timeErrorMapGsf = cms.InputTag("gsfTrackTimeValueMapProducer:electronGsfTracksConfigurableFlatResolutionModelResolution")
218  )
219  )
220 
221 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
222 _addTimingLayer = particleFlowBlock.elementImporters.copy()
223 _addTimingLayer.append( cms.PSet( importerName = cms.string("TrackTimingImporter"),
224  timeValueMap = cms.InputTag("tofPID:t0"),
225  timeErrorMap = cms.InputTag("tofPID:sigmat0"),
226  timeQualityMap = cms.InputTag("mtdTrackQualityMVA:mtdQualMVA"),
227  timeQualityThreshold = cms.double(0.5),
228  #this will cause no time to be set for gsf tracks
229  #(since this is not available for the fullsim/reconstruction yet)
230  #*TODO* update when gsf times are available
231  timeValueMapGsf = cms.InputTag("tofPID:t0"),
232  timeErrorMapGsf = cms.InputTag("tofPID:sigmat0"),
233  timeQualityMapGsf = cms.InputTag("mtdTrackQualityMVA:mtdQualMVA"),
234  )
235  )
236 
237 phase2_timing.toModify(
238  particleFlowBlock,
239  elementImporters = _addTiming
240 )
241 
242 phase2_timing_layer.toModify(
243  particleFlowBlock,
244  elementImporters = _addTimingLayer
245 )
particleFlowBlock_cfi._findIndicesByModule
def _findIndicesByModule(name)
Definition: particleFlowBlock_cfi.py:152