CMS 3D CMS Logo

particleFlowBlock_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 from RecoParticleFlow.PFProducer.modules import PFBlockProducer
4 particleFlowBlock = PFBlockProducer()
5 
6 for imp in particleFlowBlock.elementImporters:
7  if imp.importerName.value() == "SuperClusterImporter":
8  _scImporter = imp
9 
10 from Configuration.ProcessModifiers.egamma_lowPt_exclusive_cff import egamma_lowPt_exclusive
11 egamma_lowPt_exclusive.toModify(_scImporter,
12  minSuperClusterPt = 1.0,
13  minPTforBypass = 0.0)
14 
15 #
16 # kill pfTICL tracks
18  ret = []
19  for i, pset in enumerate(particleFlowBlock.elementImporters):
20  if pset.importerName.value() == name:
21  ret.append(i)
22  return ret
23 
24 from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
25 _insertTrackImportersWithVeto = {}
26 _trackImporters = ['GeneralTracksImporter','ConvBremTrackImporter',
27  'ConversionTrackImporter','NuclearInteractionTrackImporter']
28 for importer in _trackImporters:
29  for idx in _findIndicesByModule(importer):
30  _insertTrackImportersWithVeto[idx] = dict(
31  vetoEndcap = True,
32  vetoMode = cms.uint32(2), # pfTICL candidate list
33  vetoSrc = cms.InputTag("pfTICL")
34  )
35 phase2_hgcal.toModify(
36  particleFlowBlock,
37  elementImporters = _insertTrackImportersWithVeto
38 )
39 
40 #
41 # append track-HF linkers
42 from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
43 _addTrackHFLinks = particleFlowBlock.linkDefinitions.copy()
44 _addTrackHFLinks.append(
45  cms.PSet( linkerName = cms.string("TrackAndHCALLinker"),
46  linkType = cms.string("TRACK:HFEM"),
47  useKDTree = cms.bool(True),
48  trajectoryLayerEntrance = cms.string("VFcalEntrance"),
49  trajectoryLayerExit = cms.string(""),
50  nMaxHcalLinksPerTrack = cms.int32(-1) # Keep all track-HFEM links
51  )
52 )
53 _addTrackHFLinks.append(
54  cms.PSet( linkerName = cms.string("TrackAndHCALLinker"),
55  linkType = cms.string("TRACK:HFHAD"),
56  useKDTree = cms.bool(True),
57  trajectoryLayerEntrance = cms.string("VFcalEntrance"),
58  trajectoryLayerExit = cms.string(""),
59  nMaxHcalLinksPerTrack = cms.int32(-1) # Keep all track-HFHAD links for now
60  )
61 )
62 phase2_tracker.toModify(
63  particleFlowBlock,
64  linkDefinitions = _addTrackHFLinks
65 )
66 
67 #
68 # for precision timing
69 from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
70 _addTiming = particleFlowBlock.elementImporters.copy()
71 _addTiming.append( cms.PSet( importerName = cms.string("TrackTimingImporter"),
72  useTimeQuality = cms.bool(False),
73  timeValueMap = cms.InputTag("trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModel"),
74  timeErrorMap = cms.InputTag("trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModelResolution"),
75  timeValueMapGsf = cms.InputTag("gsfTrackTimeValueMapProducer:electronGsfTracksConfigurableFlatResolutionModel"),
76  timeErrorMapGsf = cms.InputTag("gsfTrackTimeValueMapProducer:electronGsfTracksConfigurableFlatResolutionModelResolution")
77  )
78  )
79 
80 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
81 _addTimingLayer = particleFlowBlock.elementImporters.copy()
82 _addTimingLayer.append( cms.PSet( importerName = cms.string("TrackTimingImporter"),
83  timeValueMap = cms.InputTag("tofPID:t0"),
84  timeErrorMap = cms.InputTag("tofPID:sigmat0"),
85  useTimeQuality = cms.bool(True),
86  timeQualityMap = cms.InputTag("mtdTrackQualityMVA:mtdQualMVA"),
87  timeQualityThreshold = cms.double(0.5),
88  #this will cause no time to be set for gsf tracks
89  #(since this is not available for the fullsim/reconstruction yet)
90  #*TODO* update when gsf times are available
91  timeValueMapGsf = cms.InputTag("tofPID:t0"),
92  timeErrorMapGsf = cms.InputTag("tofPID:sigmat0"),
93  timeQualityMapGsf = cms.InputTag("mtdTrackQualityMVA:mtdQualMVA"),
94  )
95  )
96 
97 phase2_timing.toModify(
98  particleFlowBlock,
99  elementImporters = _addTiming
100 )
101 
102 phase2_timing_layer.toModify(
103  particleFlowBlock,
104  elementImporters = _addTimingLayer
105 )
106 
107 #--- Use DB conditions for cuts&seeds for Run3 and phase2
108 from Configuration.Eras.Modifier_hcalPfCutsFromDB_cff import hcalPfCutsFromDB
109 hcalPfCutsFromDB.toModify( _scImporter,
110  usePFThresholdsFromDB = True)