Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:27:30

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