Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 23:30:52

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 particleFlowBlock = cms.EDProducer(
0004     "PFBlockProducer",
0005     # verbosity
0006     verbose = cms.untracked.bool(False),
0007     # Debug flag
0008     debug = cms.untracked.bool(False),
0009 
0010     #define what we are importing into particle flow
0011     #from the various subdetectors
0012     # importers are executed in the order they are defined here!!!
0013     #order matters for some modules (it is pointed out where this is important)
0014     # you can find a list of all available importers in:
0015     #  plugins/importers
0016     elementImporters = cms.VPSet(
0017         cms.PSet( importerName = cms.string("GSFTrackImporter"),
0018                   source = cms.InputTag("pfTrackElec"),
0019                   gsfsAreSecondary = cms.bool(False),
0020                   superClustersArePF = cms.bool(True) ),
0021         cms.PSet( importerName = cms.string("ConvBremTrackImporter"),
0022                   source = cms.InputTag("pfTrackElec"),
0023                   vetoEndcap = cms.bool(False)),
0024         cms.PSet( importerName = cms.string("SuperClusterImporter"),
0025                   source_eb = cms.InputTag("particleFlowSuperClusterECAL:particleFlowSuperClusterECALBarrel"),
0026                   source_ee = cms.InputTag("particleFlowSuperClusterECAL:particleFlowSuperClusterECALEndcapWithPreshower"),
0027                   source_towers = cms.InputTag("towerMaker"),
0028                   maximumHoverE = cms.double(0.5),
0029                   minSuperClusterPt = cms.double(10.0),
0030                   minPTforBypass = cms.double(100.0),
0031                   superClustersArePF = cms.bool(True) ),
0032         cms.PSet( importerName = cms.string("ConversionTrackImporter"),
0033                   source = cms.InputTag("pfConversions"),
0034                   vetoEndcap = cms.bool(False)),
0035         # V0's not actually used in particle flow block building so far
0036         #cms.PSet( importerName = cms.string("V0TrackImporter"),
0037         #          source = cms.InputTag("pfV0"),
0038         #          vetoEndcap = cms.bool(False)),
0039         #NuclearInteraction's also come in Loose and VeryLoose varieties
0040         cms.PSet( importerName = cms.string("NuclearInteractionTrackImporter"),
0041                   source = cms.InputTag("pfDisplacedTrackerVertex"),
0042                   vetoEndcap = cms.bool(False)),
0043         #for best timing GeneralTracksImporter should come after
0044         # all secondary track importers
0045         cms.PSet( importerName = cms.string("GeneralTracksImporter"),
0046                   source = cms.InputTag("pfTrack"),
0047                   vetoEndcap = cms.bool(False),
0048                   muonSrc = cms.InputTag("muons1stStep"),
0049           trackQuality = cms.string("highPurity"),
0050                   cleanBadConvertedBrems = cms.bool(True),
0051                   useIterativeTracking = cms.bool(True),
0052                   DPtOverPtCuts_byTrackAlgo = cms.vdouble(10.0,10.0,10.0,
0053                                                            10.0,10.0,5.0),
0054                   NHitCuts_byTrackAlgo = cms.vuint32(3,3,3,3,3,3),
0055                   muonMaxDPtOPt = cms.double(1)
0056                   ),
0057         # secondary GSF tracks are also turned off
0058         #cms.PSet( importerName = cms.string("GSFTrackImporter"),
0059         #          source = cms.InputTag("pfTrackElec:Secondary"),
0060         #          gsfsAreSecondary = cms.bool(True),
0061         #          superClustersArePF = cms.bool(True) ),
0062         # to properly set SC based links you need to run ECAL importer
0063         # after you've imported all SCs to the block
0064         cms.PSet( importerName = cms.string("ECALClusterImporter"),
0065                   source = cms.InputTag("particleFlowClusterECAL"),
0066                   BCtoPFCMap = cms.InputTag('particleFlowSuperClusterECAL:PFClusterAssociationEBEE') ),
0067         cms.PSet( importerName = cms.string("GenericClusterImporter"),
0068                   source = cms.InputTag("particleFlowClusterHCAL") ),
0069         cms.PSet( importerName = cms.string("GenericClusterImporter"),
0070                   source = cms.InputTag("particleFlowBadHcalPseudoCluster") ),
0071         cms.PSet( importerName = cms.string("GenericClusterImporter"),
0072                   source = cms.InputTag("particleFlowClusterHO") ),
0073         cms.PSet( importerName = cms.string("GenericClusterImporter"),
0074                   source = cms.InputTag("particleFlowClusterHF") ),
0075         cms.PSet( importerName = cms.string("GenericClusterImporter"),
0076                   source = cms.InputTag("particleFlowClusterPS") ),
0077         ),
0078 
0079     #linking definitions
0080     # you can find a list of all available linkers in:
0081     #  plugins/linkers
0082     # see : plugins/kdtrees for available KDTree Types
0083     # to enable a KDTree for a linking pair, write a KDTree linker
0084     # and set useKDTree = True in the linker PSet
0085     #order does not matter here since we are defining a lookup table
0086     linkDefinitions = cms.VPSet(
0087         cms.PSet( linkerName = cms.string("PreshowerAndECALLinker"),
0088                   linkType   = cms.string("PS1:ECAL"),
0089                   useKDTree  = cms.bool(True) ),
0090         cms.PSet( linkerName = cms.string("PreshowerAndECALLinker"),
0091                   linkType   = cms.string("PS2:ECAL"),
0092                   useKDTree  = cms.bool(True) ),
0093         cms.PSet( linkerName = cms.string("TrackAndECALLinker"),
0094                   linkType   = cms.string("TRACK:ECAL"),
0095                   useKDTree  = cms.bool(True) ),
0096         cms.PSet( linkerName = cms.string("TrackAndHCALLinker"),
0097                   linkType   = cms.string("TRACK:HCAL"),
0098                   useKDTree  = cms.bool(True),
0099                   trajectoryLayerEntrance = cms.string("HCALEntrance"),
0100                   trajectoryLayerExit = cms.string("HCALExit"),
0101                   nMaxHcalLinksPerTrack = cms.int32(1) # the max hcal links per track (negative values: no restriction)
0102         ),
0103         cms.PSet( linkerName = cms.string("TrackAndHOLinker"),
0104                   linkType   = cms.string("TRACK:HO"),
0105                   useKDTree  = cms.bool(False) ),
0106         cms.PSet( linkerName = cms.string("ECALAndHCALLinker"),
0107                   linkType   = cms.string("ECAL:HCAL"),
0108                   minAbsEtaEcal = cms.double(2.5),
0109                   useKDTree  = cms.bool(False) ),
0110         cms.PSet( linkerName = cms.string("HCALAndHOLinker"),
0111                   linkType   = cms.string("HCAL:HO"),
0112                   useKDTree  = cms.bool(False) ),
0113         cms.PSet( linkerName = cms.string("HFEMAndHFHADLinker"),
0114                   linkType   = cms.string("HFEM:HFHAD"),
0115                   useKDTree  = cms.bool(False) ),
0116         cms.PSet( linkerName = cms.string("TrackAndTrackLinker"),
0117                   linkType   = cms.string("TRACK:TRACK"),
0118                   useKDTree  = cms.bool(False) ),
0119         cms.PSet( linkerName = cms.string("ECALAndECALLinker"),
0120                   linkType   = cms.string("ECAL:ECAL"),
0121                   useKDTree  = cms.bool(False) ),
0122         cms.PSet( linkerName = cms.string("GSFAndECALLinker"),
0123                   linkType   = cms.string("GSF:ECAL"),
0124                   useKDTree  = cms.bool(False) ),
0125         cms.PSet( linkerName = cms.string("TrackAndGSFLinker"),
0126                   linkType   = cms.string("TRACK:GSF"),
0127                   useKDTree  = cms.bool(False),
0128                   useConvertedBrems = cms.bool(True) ),
0129         cms.PSet( linkerName = cms.string("GSFAndBREMLinker"),
0130                   linkType   = cms.string("GSF:BREM"),
0131                   useKDTree  = cms.bool(False) ),
0132         cms.PSet( linkerName = cms.string("GSFAndGSFLinker"),
0133                   linkType   = cms.string("GSF:GSF"),
0134                   useKDTree  = cms.bool(False) ),
0135         cms.PSet( linkerName = cms.string("ECALAndBREMLinker"),
0136                   linkType   = cms.string("ECAL:BREM"),
0137                   useKDTree  = cms.bool(False) ),
0138         cms.PSet( linkerName = cms.string("GSFAndHCALLinker"),
0139                   linkType   = cms.string("GSF:HCAL"),
0140                   useKDTree  = cms.bool(False) ),
0141         cms.PSet( linkerName = cms.string("HCALAndBREMLinker"),
0142                   linkType   = cms.string("HCAL:BREM"),
0143                   useKDTree  = cms.bool(False) ),
0144         cms.PSet( linkerName = cms.string("SCAndECALLinker"),
0145                   linkType   = cms.string("SC:ECAL"),
0146                   useKDTree  = cms.bool(False),
0147                   SuperClusterMatchByRef = cms.bool(True) )
0148         )
0149 )
0150 
0151 for imp in particleFlowBlock.elementImporters:
0152   if imp.importerName.value() == "SuperClusterImporter":
0153     _scImporter = imp
0154 
0155 from Configuration.ProcessModifiers.egamma_lowPt_exclusive_cff import egamma_lowPt_exclusive
0156 egamma_lowPt_exclusive.toModify(_scImporter,
0157                                 minSuperClusterPt = 1.0,
0158                                 minPTforBypass = 0.0)
0159 
0160 #
0161 # kill pfTICL tracks
0162 def _findIndicesByModule(name):
0163    ret = []
0164    for i, pset in enumerate(particleFlowBlock.elementImporters):
0165         if pset.importerName.value() == name:
0166             ret.append(i)
0167    return ret
0168 
0169 from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
0170 _insertTrackImportersWithVeto = {}
0171 _trackImporters = ['GeneralTracksImporter','ConvBremTrackImporter',
0172                    'ConversionTrackImporter','NuclearInteractionTrackImporter']
0173 for importer in _trackImporters:
0174   for idx in _findIndicesByModule(importer):
0175     _insertTrackImportersWithVeto[idx] = dict(
0176       vetoEndcap = True,
0177       vetoMode = cms.uint32(2), # pfTICL candidate list
0178       vetoSrc = cms.InputTag("pfTICL")
0179     )
0180 phase2_hgcal.toModify(
0181     particleFlowBlock,
0182     elementImporters = _insertTrackImportersWithVeto
0183 )
0184 
0185 #
0186 # append track-HF linkers
0187 from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
0188 _addTrackHFLinks = particleFlowBlock.linkDefinitions.copy()
0189 _addTrackHFLinks.append(
0190   cms.PSet( linkerName = cms.string("TrackAndHCALLinker"),
0191             linkType   = cms.string("TRACK:HFEM"),
0192             useKDTree  = cms.bool(True),
0193             trajectoryLayerEntrance = cms.string("VFcalEntrance"),
0194             trajectoryLayerExit = cms.string(""),
0195             nMaxHcalLinksPerTrack = cms.int32(-1) # Keep all track-HFEM links
0196           )
0197 )
0198 _addTrackHFLinks.append(
0199   cms.PSet( linkerName = cms.string("TrackAndHCALLinker"),
0200             linkType   = cms.string("TRACK:HFHAD"),
0201             useKDTree  = cms.bool(True),
0202             trajectoryLayerEntrance = cms.string("VFcalEntrance"),
0203             trajectoryLayerExit = cms.string(""),
0204             nMaxHcalLinksPerTrack = cms.int32(-1) # Keep all track-HFHAD links for now
0205           )
0206 )
0207 phase2_tracker.toModify(
0208     particleFlowBlock,
0209     linkDefinitions = _addTrackHFLinks
0210 )
0211 
0212 #
0213 # for precision timing
0214 from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
0215 _addTiming = particleFlowBlock.elementImporters.copy()
0216 _addTiming.append( cms.PSet( importerName = cms.string("TrackTimingImporter"),
0217                              timeValueMap = cms.InputTag("trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModel"),
0218                              timeErrorMap = cms.InputTag("trackTimeValueMapProducer:generalTracksConfigurableFlatResolutionModelResolution"),
0219                              timeValueMapGsf = cms.InputTag("gsfTrackTimeValueMapProducer:electronGsfTracksConfigurableFlatResolutionModel"),
0220                              timeErrorMapGsf = cms.InputTag("gsfTrackTimeValueMapProducer:electronGsfTracksConfigurableFlatResolutionModelResolution")
0221                              )
0222                    )
0223 
0224 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
0225 _addTimingLayer = particleFlowBlock.elementImporters.copy()
0226 _addTimingLayer.append( cms.PSet( importerName = cms.string("TrackTimingImporter"),
0227                              timeValueMap = cms.InputTag("tofPID:t0"),
0228                              timeErrorMap = cms.InputTag("tofPID:sigmat0"),
0229                              timeQualityMap = cms.InputTag("mtdTrackQualityMVA:mtdQualMVA"),
0230                              timeQualityThreshold = cms.double(0.5),
0231                              #this will cause no time to be set for gsf tracks
0232                              #(since this is not available for the fullsim/reconstruction yet)
0233                              #*TODO* update when gsf times are available
0234                              timeValueMapGsf = cms.InputTag("tofPID:t0"),
0235                              timeErrorMapGsf = cms.InputTag("tofPID:sigmat0"),
0236                              timeQualityMapGsf = cms.InputTag("mtdTrackQualityMVA:mtdQualMVA"),
0237                              )
0238                    )
0239 
0240 phase2_timing.toModify(
0241     particleFlowBlock,
0242     elementImporters = _addTiming
0243 )
0244 
0245 phase2_timing_layer.toModify(
0246     particleFlowBlock,
0247     elementImporters = _addTimingLayer
0248 )