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  cleanBadConvertedBrems = cms.bool(True),
45  useIterativeTracking = cms.bool(True),
46  maxDPtOPt = cms.double(1.),
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  cms.PSet( linkerName = cms.string("TrackAndHOLinker"),
95  linkType = cms.string("TRACK:HO"),
96  useKDTree = cms.bool(False) ),
97  cms.PSet( linkerName = cms.string("ECALAndHCALLinker"),
98  linkType = cms.string("ECAL:HCAL"),
99  useKDTree = cms.bool(False) ),
100  cms.PSet( linkerName = cms.string("HCALAndHOLinker"),
101  linkType = cms.string("HCAL:HO"),
102  useKDTree = cms.bool(False) ),
103  cms.PSet( linkerName = cms.string("HFEMAndHFHADLinker"),
104  linkType = cms.string("HFEM:HFHAD"),
105  useKDTree = cms.bool(False) ),
106  cms.PSet( linkerName = cms.string("TrackAndTrackLinker"),
107  linkType = cms.string("TRACK:TRACK"),
108  useKDTree = cms.bool(False) ),
109  cms.PSet( linkerName = cms.string("ECALAndECALLinker"),
110  linkType = cms.string("ECAL:ECAL"),
111  useKDTree = cms.bool(False) ),
112  cms.PSet( linkerName = cms.string("GSFAndECALLinker"),
113  linkType = cms.string("GSF:ECAL"),
114  useKDTree = cms.bool(False) ),
115  cms.PSet( linkerName = cms.string("TrackAndGSFLinker"),
116  linkType = cms.string("TRACK:GSF"),
117  useKDTree = cms.bool(False),
118  useConvertedBrems = cms.bool(True) ),
119  cms.PSet( linkerName = cms.string("GSFAndBREMLinker"),# here
120  linkType = cms.string("GSF:BREM"),
121  useKDTree = cms.bool(False) ),
122  cms.PSet( linkerName = cms.string("GSFAndGSFLinker"),
123  linkType = cms.string("GSF:GSF"),
124  useKDTree = cms.bool(False) ),
125  cms.PSet( linkerName = cms.string("ECALAndBREMLinker"),
126  linkType = cms.string("ECAL:BREM"),
127  useKDTree = cms.bool(False) ),
128  cms.PSet( linkerName = cms.string("GSFAndHCALLinker"),
129  linkType = cms.string("GSF:HCAL"),
130  useKDTree = cms.bool(False) ),
131  cms.PSet( linkerName = cms.string("HCALAndBREMLinker"),
132  linkType = cms.string("HCAL:BREM"),
133  useKDTree = cms.bool(False) ),
134  cms.PSet( linkerName = cms.string("SCAndECALLinker"),
135  linkType = cms.string("SC:ECAL"),
136  useKDTree = cms.bool(False),
137  SuperClusterMatchByRef = cms.bool(True) )
138  )
139 )
140 
142  ret = []
143  for i, pset in enumerate(particleFlowBlock.elementImporters):
144  if pset.importerName.value() == name:
145  ret.append(i)
146  return ret
147 
148 from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
149 # kill tracks in the HGCal
150 _insertGeneralTracksImporter = {}
151 for idx in _findIndicesByModule('GeneralTracksImporter'):
152  _insertGeneralTracksImporter[idx] = dict(
153  importerName = cms.string('GeneralTracksImporterWithVeto'),
154  veto = cms.InputTag('hgcalTrackCollection:TracksInHGCal')
155  )
156 phase2_hgcal.toModify(
157  particleFlowBlock,
158  elementImporters = _insertGeneralTracksImporter
159 )
160 ### for later
161 #_phase2_hgcal_Linkers.append(
162 # cms.PSet( linkerName = cms.string("SCAndHGCalLinker"),
163 # linkType = cms.string("SC:HGCAL"),
164 # useKDTree = cms.bool(False),
165 # SuperClusterMatchByRef = cms.bool(True) )
166 #)
167 #_phase2_hgcal_Linkers.append(
168 # cms.PSet( linkerName = cms.string("HGCalAndBREMLinker"),
169 # linkType = cms.string("HGCAL:BREM"),
170 # useKDTree = cms.bool(False) )
171 #)
172 #_phase2_hgcal_Linkers.append(
173 # cms.PSet( linkerName = cms.string("GSFAndHGCalLinker"),
174 # linkType = cms.string("GSF:HGCAL"),
175 # useKDTree = cms.bool(False) )
176 #)
177 
178 
179 from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
180 _addTiming = particleFlowBlock.elementImporters.copy()
181 _addTiming.append( cms.PSet( importerName = cms.string("TrackTimingImporter"),
182  timeValueMap = cms.InputTag("trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModel"),
183  timeErrorMap = cms.InputTag("trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModelResolution"),
184  timeValueMapGsf = cms.InputTag("gsfTrackTimeValueMapProducer:electronGsfTracksConfigurableFlatResolutionModel"),
185  timeErrorMapGsf = cms.InputTag("gsfTrackTimeValueMapProducer:electronGsfTracksConfigurableFlatResolutionModelResolution")
186  )
187  )
188 
189 phase2_timing.toModify(
190  particleFlowBlock,
191  elementImporters = _addTiming
192 )