File indexing completed on 2024-04-06 12:33:26
0001 import FWCore.ParameterSet.Config as cms
0002
0003 from RecoLocalTracker.Configuration.RecoLocalTracker_cff import *
0004 from SimGeneral.TrackingAnalysis.simHitTPAssociation_cfi import *
0005 from SimTracker.TrackerHitAssociation.tpClusterProducer_cfi import *
0006 from SimTracker.TrackAssociatorProducers.quickTrackAssociatorByHits_cfi import *
0007 from RecoTracker.TransientTrackingRecHit.TTRHBuilders_cff import *
0008 from RecoLocalTracker.SiPixelRecHits.PixelCPEGeneric_cfi import *
0009 from RecoLocalTracker.Phase2TrackerRecHits.Phase2TrackerRecHits_cfi import *
0010 from Geometry.TrackerNumberingBuilder.trackerTopology_cfi import *
0011
0012 from Validation.RecoTrack.trackingNtuple_cfi import *
0013 from Validation.RecoTrack.TrackValidation_cff import *
0014 from SimGeneral.TrackingAnalysis.trackingParticleNumberOfLayersProducer_cff import *
0015 import Validation.RecoTrack.TrackValidation_cff as _TrackValidation_cff
0016
0017 _includeHits = True
0018
0019
0020 _includeSeeds = True
0021
0022
0023 _includeMVA = True
0024
0025
0026 _includeTrackingParticles = True
0027
0028
0029 from CommonTools.RecoAlgos.trackingParticleRefSelector_cfi import trackingParticleRefSelector as _trackingParticleRefSelector
0030 trackingParticlesIntime = _trackingParticleRefSelector.clone(
0031 signalOnly = False,
0032 intimeOnly = True,
0033 chargedOnly = False,
0034 tip = 1e5,
0035 lip = 1e5,
0036 minRapidity = -10,
0037 maxRapidity = 10,
0038 ptMin = 0,
0039 )
0040 trackingNtuple.trackingParticles = "trackingParticlesIntime"
0041 trackingNtuple.trackingParticlesRef = True
0042 trackingNtuple.includeAllHits = _includeHits
0043 trackingNtuple.includeSeeds = _includeSeeds
0044 trackingNtuple.includeMVA = _includeMVA
0045 trackingNtuple.includeTrackingParticles = _includeTrackingParticles
0046
0047 def _filterForNtuple(lst):
0048 ret = []
0049 for item in lst:
0050 if "PreSplitting" in item:
0051 continue
0052 if "SeedsA" in item and item.replace("SeedsA", "SeedsB") in lst:
0053 ret.append(item.replace("SeedsA", "Seeds"))
0054 continue
0055 if "SeedsB" in item:
0056 continue
0057 if "SeedsPair" in item and item.replace("SeedsPair", "SeedsTripl") in lst:
0058 ret.append(item.replace("SeedsPair", "Seeds"))
0059 continue
0060 if "SeedsTripl" in item:
0061 continue
0062 ret.append(item)
0063 return ret
0064 _seedProducers = _filterForNtuple(_TrackValidation_cff._seedProducers)
0065 _seedProducers_trackingPhase1 = _filterForNtuple(_TrackValidation_cff._seedProducers_trackingPhase1)
0066 _seedProducers_trackingPhase2PU140 = _filterForNtuple(_TrackValidation_cff._seedProducers_trackingPhase2PU140)
0067
0068 (_seedSelectors, trackingNtupleSeedSelectors) = _TrackValidation_cff._addSeedToTrackProducers(_seedProducers, globals())
0069 (_seedSelectors_trackingPhase1, _trackingNtupleSeedSelectors_trackingPhase1) = _TrackValidation_cff._addSeedToTrackProducers(_seedProducers_trackingPhase1, globals())
0070 (_seedSelectors_trackingPhase2PU140, _trackingNtupleSeedSelectors_trackingPhase2PU140) = _TrackValidation_cff._addSeedToTrackProducers(_seedProducers_trackingPhase2PU140, globals())
0071 from Configuration.Eras.Modifier_trackingPhase1_cff import trackingPhase1
0072 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
0073 trackingPhase1.toReplaceWith(trackingNtupleSeedSelectors, _trackingNtupleSeedSelectors_trackingPhase1)
0074 trackingPhase2PU140.toReplaceWith(trackingNtupleSeedSelectors, _trackingNtupleSeedSelectors_trackingPhase2PU140)
0075
0076 trackingNtuple.seedTracks = _seedSelectors
0077 trackingPhase1.toModify(trackingNtuple, seedTracks = _seedSelectors_trackingPhase1)
0078 trackingPhase2PU140.toModify(trackingNtuple, seedTracks = _seedSelectors_trackingPhase2PU140)
0079
0080 def _seedProdToTrackCands(name):
0081 return name.replace("seedTracks", "").replace("Seeds", "TrackCandidates")
0082 trackingNtuple.trackCandidates = [_seedProdToTrackCands(i) for i in _seedProducers]
0083 trackingPhase1.toModify(trackingNtuple, trackCandidates=[_seedProdToTrackCands(i) for i in _seedProducers_trackingPhase1])
0084 trackingPhase2PU140.toModify(trackingNtuple, trackCandidates=[_seedProdToTrackCands(i) for i in _seedProducers_trackingPhase2PU140])
0085
0086 trackingNtupleTask = cms.Task()
0087
0088 if _includeHits:
0089 trackingNtupleTask.add(siPixelRecHits, siStripMatchedRecHits)
0090 _phase2_trackingNtupleTask = trackingNtupleTask.copy()
0091 _phase2_trackingNtupleTask.remove(siStripMatchedRecHits)
0092 _phase2_trackingNtupleTask.add(siPhase2RecHits)
0093 trackingPhase2PU140.toReplaceWith(trackingNtupleTask, _phase2_trackingNtupleTask)
0094
0095 if _includeSeeds:
0096 trackingNtupleTask.add(trackingNtupleSeedSelectors)
0097
0098 trackingNtupleTask.add(
0099
0100 trackingParticlesIntime,
0101 simHitTPAssocProducer,
0102 tpClusterProducer,
0103 quickTrackAssociatorByHits,
0104 trackingParticleNumberOfLayersProducer
0105 )
0106
0107 trackingNtupleSequence = cms.Sequence(trackingNtuple, trackingNtupleTask)
0108
0109 trackingPhase2PU140.toModify(trackingNtuple,
0110 pixelDigiSimLink = cms.untracked.InputTag('simSiPixelDigis', "Pixel"),
0111 stripDigiSimLink = cms.untracked.InputTag(''),
0112 phase2OTSimLink = cms.untracked.InputTag('simSiPixelDigis', "Tracker")
0113 )