Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-07-03 00:42:42

0001 import FWCore.ParameterSet.Config as cms
0002 from HeterogeneousCore.AlpakaCore.functions import *
0003 
0004 from RecoLocalTracker.SiStripRecHitConverter.StripCPEfromTrackAngle_cfi import *
0005 from RecoLocalTracker.SiStripRecHitConverter.SiStripRecHitMatcher_cfi import *
0006 from RecoTracker.TransientTrackingRecHit.TransientTrackingRecHitBuilder_cfi import *
0007 import RecoTracker.TransientTrackingRecHit.TransientTrackingRecHitBuilder_cfi
0008 myTTRHBuilderWithoutAngle = RecoTracker.TransientTrackingRecHit.TransientTrackingRecHitBuilder_cfi.ttrhbwr.clone(
0009     StripCPE = 'Fake',
0010     ComponentName = 'PixelTTRHBuilderWithoutAngle'
0011 )
0012 from RecoTracker.TkSeedingLayers.PixelLayerTriplets_cfi import *
0013 from RecoTracker.TkSeedingLayers.TTRHBuilderWithoutAngle4PixelTriplets_cfi import *
0014 from RecoTracker.PixelTrackFitting.pixelFitterByHelixProjections_cfi import pixelFitterByHelixProjections
0015 from RecoTracker.PixelTrackFitting.pixelNtupletsFitter_cfi import pixelNtupletsFitter
0016 from RecoTracker.PixelTrackFitting.pixelTrackFilterByKinematics_cfi import pixelTrackFilterByKinematics
0017 from RecoTracker.PixelTrackFitting.pixelTrackCleanerBySharedHits_cfi import pixelTrackCleanerBySharedHits
0018 from RecoTracker.PixelTrackFitting.pixelTracks_cfi import pixelTracks as _pixelTracks
0019 from RecoTracker.TkTrackingRegions.globalTrackingRegion_cfi import globalTrackingRegion as _globalTrackingRegion
0020 from RecoTracker.TkTrackingRegions.globalTrackingRegionFromBeamSpot_cfi import globalTrackingRegionFromBeamSpot as _globalTrackingRegionFromBeamSpot
0021 from RecoTracker.TkHitPairs.hitPairEDProducer_cfi import hitPairEDProducer as _hitPairEDProducer
0022 from RecoTracker.PixelSeeding.pixelTripletHLTEDProducer_cfi import pixelTripletHLTEDProducer as _pixelTripletHLTEDProducer
0023 from RecoTracker.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi import *
0024 import RecoTracker.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi
0025 from RecoTracker.FinalTrackSelectors.trackAlgoPriorityOrder_cfi import trackAlgoPriorityOrder
0026 
0027 # Eras
0028 from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU
0029 from Configuration.Eras.Modifier_run3_common_cff import run3_common
0030 
0031 # seeding layers
0032 from RecoTracker.IterativeTracking.InitialStep_cff import initialStepSeedLayers, initialStepHitDoublets, _initialStepCAHitQuadruplets
0033 
0034 # TrackingRegion
0035 pixelTracksTrackingRegions = _globalTrackingRegion.clone()
0036 trackingLowPU.toReplaceWith(pixelTracksTrackingRegions, _globalTrackingRegionFromBeamSpot.clone())
0037 
0038 
0039 # Pixel quadruplets tracking
0040 pixelTracksSeedLayers = initialStepSeedLayers.clone(
0041     BPix = dict(HitProducer = "siPixelRecHitsPreSplitting"),
0042     FPix = dict(HitProducer = "siPixelRecHitsPreSplitting")
0043 )
0044 
0045 pixelTracksHitDoublets = initialStepHitDoublets.clone(
0046     clusterCheck = "",
0047     seedingLayers = "pixelTracksSeedLayers",
0048     trackingRegions = "pixelTracksTrackingRegions"
0049 )
0050 
0051 pixelTracksHitQuadruplets = _initialStepCAHitQuadruplets.clone(
0052     doublets = "pixelTracksHitDoublets",
0053     SeedComparitorPSet = dict(clusterShapeCacheSrc = 'siPixelClusterShapeCachePreSplitting')
0054 )
0055 
0056 pixelTracks = _pixelTracks.clone(
0057     SeedingHitSets = "pixelTracksHitQuadruplets"
0058 )
0059 
0060 pixelTracksTask = cms.Task(
0061     pixelTracksTrackingRegions,
0062     pixelFitterByHelixProjections,
0063     pixelTrackFilterByKinematics,
0064     pixelTracksSeedLayers,
0065     pixelTracksHitDoublets,
0066     pixelTracksHitQuadruplets,
0067     pixelTracks
0068 )
0069 
0070 pixelTracksSequence = cms.Sequence(pixelTracksTask)
0071 
0072 
0073 # Pixel triplets for trackingLowPU
0074 pixelTracksHitTriplets = _pixelTripletHLTEDProducer.clone(
0075     doublets = "pixelTracksHitDoublets",
0076     produceSeedingHitSets = True,
0077     SeedComparitorPSet = RecoTracker.PixelLowPtUtilities.LowPtClusterShapeSeedComparitor_cfi.LowPtClusterShapeSeedComparitor.clone(
0078         clusterShapeCacheSrc = "siPixelClusterShapeCachePreSplitting"
0079     )
0080 )
0081 
0082 trackingLowPU.toModify(pixelTracks,
0083     SeedingHitSets = "pixelTracksHitTriplets"
0084 )
0085 
0086 _pixelTracksTask_lowPU = pixelTracksTask.copy()
0087 _pixelTracksTask_lowPU.replace(pixelTracksHitQuadruplets, pixelTracksHitTriplets)
0088 trackingLowPU.toReplaceWith(pixelTracksTask, _pixelTracksTask_lowPU)
0089 
0090 # Phase 2 modifier
0091 from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
0092 # HIon modifiers
0093 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
0094 
0095 ######################################################################
0096 
0097 ### Alpaka Pixel Track Reco
0098 
0099 from Configuration.ProcessModifiers.alpaka_cff import alpaka
0100 
0101 # pixel tracks SoA producer on the device
0102 from RecoTracker.PixelSeeding.caHitNtupletAlpakaPhase1_cfi import caHitNtupletAlpakaPhase1 as _pixelTracksAlpakaPhase1
0103 from RecoTracker.PixelSeeding.caHitNtupletAlpakaPhase2_cfi import caHitNtupletAlpakaPhase2 as _pixelTracksAlpakaPhase2
0104 from RecoTracker.PixelSeeding.caHitNtupletAlpakaHIonPhase1_cfi import caHitNtupletAlpakaHIonPhase1 as _pixelTracksAlpakaHIonPhase1
0105 
0106 pixelTracksAlpaka = _pixelTracksAlpakaPhase1.clone(
0107     avgHitsPerTrack    = 4.6,      
0108     avgCellsPerHit     = 13,
0109     avgCellsPerCell    = 0.0268, 
0110     avgTracksPerCell   = 0.0123, 
0111     maxNumberOfDoublets = str(512*1024),    # could be lowered to 315k, keeping the same for a fair comparison with master
0112     maxNumberOfTuples   = str(32 * 1024),   # this couul be much lower (2.1k, these are quads)
0113 )
0114 phase2_tracker.toReplaceWith(pixelTracksAlpaka,_pixelTracksAlpakaPhase2.clone())
0115 phase2_tracker.toModify(pixelTracksAlpaka,
0116     maxNumberOfDoublets = str(5*512*1024),
0117     maxNumberOfTuples = str(256 * 1024),
0118     avgHitsPerTrack = 7.0,
0119     avgCellsPerHit = 6,
0120     avgCellsPerCell = 0.151,
0121     avgTracksPerCell = 0.040,
0122     cellPtCut = 0.85,
0123     cellZ0Cut = 7.5,
0124     minYsizeB1 = 25,
0125     minYsizeB2 = 15,
0126     maxDYsize12 = 12,
0127     maxDYsize = 10,
0128     maxDYPred = 20,
0129 )
0130 
0131 
0132 (pp_on_AA & ~phase2_tracker).toModify(pixelTracksAlpaka,
0133     maxNumberOfDoublets = str(6 * 512 *1024),   # this could be 2.3M
0134     maxNumberOfTuples = str(256 * 1024),        # this could be 4.7
0135     avgHitsPerTrack = 5.0,
0136     avgCellsPerHit = 40,
0137     avgCellsPerCell = 0.07,                     # with maxNumberOfDoublets ~= 3.14M; 0.02  for HLT HI on 2024 HI Data 
0138     avgTracksPerCell = 0.03,                    # with maxNumberOfDoublets ~= 3.14M; 0.005 for HLT HI on 2024 HI Data
0139     cellPtCut = 0.5,                            # setup currenlty used @ HLT (was 0.0) 
0140     cellZ0Cut = 8.0,                            # setup currenlty used @ HLT (was 10.0) 
0141 )
0142 
0143 # pixel tracks SoA producer on the cpu, for validation
0144 pixelTracksAlpakaSerial = makeSerialClone(pixelTracksAlpaka,
0145     pixelRecHitSrc = 'siPixelRecHitsPreSplittingAlpakaSerial'
0146 )
0147 
0148 # legacy pixel tracks from SoA
0149 from  RecoTracker.PixelTrackFitting.pixelTrackProducerFromSoAAlpaka_cfi import pixelTrackProducerFromSoAAlpaka as _pixelTrackProducerFromSoAAlpaka
0150 
0151 (alpaka).toReplaceWith(pixelTracks, _pixelTrackProducerFromSoAAlpaka.clone(
0152     pixelRecHitLegacySrc = "siPixelRecHitsPreSplitting",
0153 ))
0154 
0155 alpaka.toReplaceWith(pixelTracksTask, cms.Task(
0156     # Build the pixel ntuplets and the pixel tracks in SoA format with alpaka on the device
0157     pixelTracksAlpaka,
0158     # Build the pixel ntuplets and the pixel tracks in SoA format with alpaka on the cpu (if requested by the validation)
0159     pixelTracksAlpakaSerial,
0160     # Convert the pixel tracks from SoA to legacy format
0161     pixelTracks)
0162 )