Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import FWCore.ParameterSet.Config as cms

hltPhase2PixelTrackTorchHighPuritySelector = cms.EDProducer('PixelTrackTorchHighPuritySelector@alpaka',
pixelTrackSrc = cms.InputTag('hltPhase2PixelTracksSoA'),
maxNumberOfTracks = cms.int32(2*60*1024),
maxPreselectedTracks = cms.int32(9_984),
minNumberOfHits = cms.int32(0),
avgHitsPerTrack = cms.int32(8),
minimumTrackQuality = cms.string('tight'),
model = cms.FileInPath('RecoTracker/FinalTrackSelectors/data/PixelTrackTorchHighPuritySelector/pixel_track_classifier_FP16.pt'),
scoreThreshold = cms.double(0.4),
batchSize = cms.int32(4_992)
)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import FWCore.ParameterSet.Config as cms

hltPhase2PixelTracks = cms.EDProducer("TrackCollectionFilterCloner",
copyExtras = cms.untracked.bool(True),
copyTrajectories = cms.untracked.bool(False),
minQuality = cms.string('highPurity'),
originalMVAVals = cms.InputTag("hltPhase2PixelTracksCutClassifier","MVAValues"),
originalQualVals = cms.InputTag("hltPhase2PixelTracksCutClassifier","QualityMasks"),
originalSource = cms.InputTag("hltPhase2PixelTracksCAExtension")
hltPhase2PixelTracks = cms.EDProducer("PixelTrackProducerFromSoAAlpaka",
beamSpot = cms.InputTag("hltOnlineBeamSpot"),
minNumberOfHits = cms.int32(0),
minQuality = cms.string('tight'),
pixelRecHitLegacySrc = cms.InputTag("hltSiPixelRecHits"),
trackSrc = cms.InputTag("hltPhase2PixelTrackTorchHighPuritySelector"),
outerTrackerRecHitSrc = cms.InputTag("hltSiPhase2RecHits"),
outerTrackerRecHitSoAConverterSrc = cms.InputTag("hltPhase2OtRecHitsSoA"),
useOTExtension = cms.bool(True),
requireQuadsFromConsecutiveLayers = cms.bool(False)
)

from Configuration.ProcessModifiers.hltPhase2LegacyTracking_cff import hltPhase2LegacyTracking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,11 @@
refToPSet_ = cms.string('pSetPvClusterComparerForIT')
),
PtMin = cms.double(1.0),
# Even though pixel tracks with a highPurity ID, i.e. hltPhase2PixelTracks,
# are used in other tracking modules, the pixel tracks without an ID,
# i.e. hltPhase2PixelTracksCAExtension, are used here.
# This avoids a circular dependency, as the highPurity ID requires a vertex,
# while also providing satisfactory physics performance.
# To be improved with a DNN-based highPurity ID that does not depend on vertices.
TrackCollection = cms.InputTag("hltPhase2PixelTracksCAExtension"),
TrackCollection = cms.InputTag("hltPhase2PixelTracks"),
UseError = cms.bool(True),
Verbosity = cms.int32(0),
WtAverage = cms.bool(True),
ZOffset = cms.double(5.0),
ZSeparation = cms.double(0.005),
beamSpot = cms.InputTag("hltOnlineBeamSpot")
)

from Configuration.ProcessModifiers.hltPhase2LegacyTracking_cff import hltPhase2LegacyTracking
hltPhase2LegacyTracking.toModify(hltPhase2PixelVertices,
TrackCollection = "hltPhase2PixelTracks"
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
from ..modules.hltPhase2OtRecHitsSoA_cfi import hltPhase2OtRecHitsSoA
from ..modules.hltPhase2PixelRecHitsExtendedSoA_cfi import hltPhase2PixelRecHitsExtendedSoA
from ..modules.hltPhase2PixelTracks_cfi import hltPhase2PixelTracks
from ..modules.hltPhase2PixelTracksCAExtension_cfi import hltPhase2PixelTracksCAExtension
from ..modules.hltPhase2PixelTracksCutClassifier_cfi import hltPhase2PixelTracksCutClassifier
from ..modules.hltPhase2PixelTracksSoA_cfi import hltPhase2PixelTracksSoA
from ..modules.hltPhase2PixelTrackTorchHighPuritySelector_cfi import hltPhase2PixelTrackTorchHighPuritySelector
from ..modules.hltPhase2PixelVertices_cfi import hltPhase2PixelVertices
#from ..modules.hltPhase2PixelVerticesSoA_cfi import hltPhase2PixelVerticesSoA
from ..modules.hltPhase2SiPixelClustersSoA_cfi import hltPhase2SiPixelClustersSoA
Expand All @@ -25,7 +24,6 @@
from ..modules.hltSiPixelRecHits_cfi import hltSiPixelRecHits
from ..modules.hltSiPhase2Clusters_cfi import hltSiPhase2Clusters
from ..modules.hltSiPhase2RecHits_cfi import hltSiPhase2RecHits

from ..sequences.HLTBeginSequence_cfi import *
from ..sequences.HLTEndSequence_cfi import *

Expand All @@ -44,10 +42,9 @@

HLTPixelTrackingSequence = cms.Sequence(
hltPhase2PixelTracksSoA
+ hltPhase2PixelTracksCAExtension
+ hltPhase2PixelVertices
+ hltPhase2PixelTracksCutClassifier
+ hltPhase2PixelTrackTorchHighPuritySelector
+ hltPhase2PixelTracks
+ hltPhase2PixelVertices
#+ hltExtendedPhase2PixelVerticesSoA # not yet ready
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
from ..modules.hltPhase2PixelTrackFilterByKinematics_cfi import hltPhase2PixelTrackFilterByKinematics
from ..modules.hltPhase2PixelTracks_cfi import hltPhase2PixelTracks
from ..modules.hltPhase2PixelTracksAndHighPtStepTrackingRegions_cfi import hltPhase2PixelTracksAndHighPtStepTrackingRegions
from ..modules.hltPhase2PixelTracksCAExtension_cfi import hltPhase2PixelTracksCAExtension
from ..modules.hltPhase2PixelTracksCutClassifier_cfi import hltPhase2PixelTracksCutClassifier
from ..modules.hltPhase2PixelTracksHitDoublets_cfi import hltPhase2PixelTracksHitDoublets
from ..modules.hltPhase2PixelTracksHitSeeds_cfi import hltPhase2PixelTracksHitSeeds
from ..modules.hltPhase2PixelTracksSeedLayers_cfi import hltPhase2PixelTracksSeedLayers
from ..modules.hltPhase2PixelTracksSoA_cfi import hltPhase2PixelTracksSoA
from ..modules.hltPhase2PixelTrackTorchHighPuritySelector_cfi import hltPhase2PixelTrackTorchHighPuritySelector
from ..modules.hltPhase2PixelVertices_cfi import *
from ..sequences.HLTPhase2PixelVertexingSequence_cfi import *
from ..sequences.HLTBeamSpotSequence_cfi import HLTBeamSpotSequence
Expand All @@ -24,29 +23,24 @@
+hltPhase2OtRecHitsSoA
+hltPhase2PixelRecHitsExtendedSoA
+hltPhase2PixelTracksSoA
+hltPhase2PixelTracksCAExtension
+HLTPhase2PixelVertexingSequence
+hltPhase2PixelTracksCutClassifier
+hltPhase2PixelTrackTorchHighPuritySelector
+hltPhase2PixelTracks
+HLTPhase2PixelVertexingSequence
)


# Empty sequence as a placeholder to be filled when alpakaValidationHLT is active
HLTPhase2PixelTracksAndVerticesSequenceSerialSync = cms.Sequence()

hltPhase2PixelTracksSoASerialSync = makeSerialClone(hltPhase2PixelTracksSoA)
hltPhase2PixelTracksCAExtensionSerialSync = hltPhase2PixelTracksCAExtension.clone(
trackSrc = "hltPhase2PixelTracksSoASerialSync"
)
hltPhase2PixelTracksCutClassifierSerialSync = hltPhase2PixelTracksCutClassifier.clone(
src = "hltPhase2PixelTracksCAExtensionSerialSync",
vertices = "hltPhase2PixelVerticesSerialSync"
hltPhase2PixelTrackTorchHighPuritySelectorSerialSync = makeSerialClone(
hltPhase2PixelTrackTorchHighPuritySelector.clone(
pixelTrackSrc = cms.InputTag("hltPhase2PixelTracksSoASerialSync")
)
)
hltPhase2PixelTracksSerialSync = hltPhase2PixelTracks.clone(
originalMVAVals = cms.InputTag("hltPhase2PixelTracksCutClassifierSerialSync","MVAValues"),
originalQualVals = cms.InputTag("hltPhase2PixelTracksCutClassifierSerialSync","QualityMasks"),
originalSource = cms.InputTag("hltPhase2PixelTracksCAExtensionSerialSync")
trackSrc = cms.InputTag("hltPhase2PixelTrackTorchHighPuritySelectorSerialSync")
)

# Sequence for CPU vs. GPU validation, to be kept in sync with default sequence
from Configuration.ProcessModifiers.alpakaValidationHLT_cff import alpakaValidationHLT
alpakaValidationHLT.toReplaceWith(HLTPhase2PixelTracksAndVerticesSequenceSerialSync,
Expand All @@ -58,10 +52,9 @@
+hltPhase2OtRecHitsSoA
+hltPhase2PixelRecHitsExtendedSoA
+hltPhase2PixelTracksSoASerialSync
+hltPhase2PixelTracksCAExtensionSerialSync
+HLTPhase2PixelVertexingSequenceSerialSync
+hltPhase2PixelTracksCutClassifierSerialSync
+hltPhase2PixelTrackTorchHighPuritySelectorSerialSync
+hltPhase2PixelTracksSerialSync
+HLTPhase2PixelVertexingSequenceSerialSync
)
)

Expand All @@ -74,10 +67,9 @@
+hltPhase2OtRecHitsSoA
+hltPhase2PixelRecHitsExtendedSoA
+hltPhase2PixelTracksSoA
+hltPhase2PixelTracksCAExtension
+HLTPhase2PixelVertexingSequence
+hltPhase2PixelTracksCutClassifier
+hltPhase2PixelTrackTorchHighPuritySelector
+hltPhase2PixelTracks
+HLTPhase2PixelVertexingSequence
+hltPhase2TrimmedPixelVertices
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
HLTPhase2PixelVertexingSequenceSerialSync = cms.Sequence()

hltPhase2PixelVerticesSerialSync = hltPhase2PixelVertices.clone(
TrackCollection = "hltPhase2PixelTracksCAExtensionSerialSync"
TrackCollection = "hltPhase2PixelTracksSerialSync"
)
# Serial sequence for CPU vs. GPU validation, to be kept in sync with default sequence
from Configuration.ProcessModifiers.alpakaValidationHLT_cff import alpakaValidationHLT
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import FWCore.ParameterSet.Config as cms

PyTorchService = cms.Service("PyTorchService")
1 change: 1 addition & 0 deletions HLTrigger/Configuration/python/HLT_75e33_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@
fragment.load("HLTrigger/Configuration/HLT_75e33/services/FastTimerService_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/services/MessageLogger_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/services/ThroughputService_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/services/PyTorchService_cfi")

fragment.schedule = cms.Schedule(*[

Expand Down
1 change: 1 addition & 0 deletions HLTrigger/Configuration/python/HLT_75e33_timing_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@
fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTVertexRecoSequence_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/services/FastTimerService_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/services/ThroughputService_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/services/PyTorchService_cfi")

fragment.schedule = cms.Schedule(*[

Expand Down
1 change: 1 addition & 0 deletions HLTrigger/Configuration/python/HLT_NGTScouting_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTVertexRecoSequence_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/services/FastTimerService_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/services/ThroughputService_cfi")
fragment.load("HLTrigger/Configuration/HLT_75e33/services/PyTorchService_cfi")

fragment.schedule = cms.Schedule(*[
fragment.DST_PFScouting,
Expand Down
32 changes: 32 additions & 0 deletions RecoTracker/FinalTrackSelectors/interface/PixelTrackFeaturesSoA.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#ifndef RecoTracker_FinalTrackSelectors_PixelTrackFeaturesSoA_h
#define RecoTracker_FinalTrackSelectors_PixelTrackFeaturesSoA_h

#include "DataFormats/SoATemplate/interface/SoALayout.h"

GENERATE_SOA_LAYOUT(PixelTrackFeaturesSoALayout,
SOA_COLUMN(float, chi2),
SOA_COLUMN(float, dzError),
SOA_COLUMN(float, dxyError),
SOA_COLUMN(float, eta),
SOA_COLUMN(float, nHits),
SOA_COLUMN(float, phi),
SOA_COLUMN(float, phiError),
SOA_COLUMN(float, pt),
SOA_COLUMN(float, qOverPtError),
SOA_COLUMN(float, dzBS),
SOA_COLUMN(float, dxyBS),
SOA_COLUMN(float, nLayers),
SOA_COLUMN(float, cotThetaError),
SOA_COLUMN(float, covCotThetaDz),
SOA_COLUMN(float, covDxyQOverPt),
SOA_COLUMN(float, covPhiDxy),
SOA_COLUMN(float, covPhiQOverPt));

using PixelTrackFeaturesSoA = PixelTrackFeaturesSoALayout<>;

// Define the SoA layout for track scores (output)
GENERATE_SOA_LAYOUT(PixelTrackScoresSoALayout, SOA_COLUMN(float, score))

using PixelTrackScoresSoA = PixelTrackScoresSoALayout<>;

#endif
15 changes: 15 additions & 0 deletions RecoTracker/FinalTrackSelectors/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,18 @@
<library file="*.cc" name="RecoTrackerFinalTrackSelectorsPlugins">
<flags EDM_PLUGIN="1"/>
</library>

<library file="alpaka/*.cc" name="RecoTrackerFinalTrackSelectorsAlpakaPlugins">
<use name="alpaka"/>
<use name="xtd"/>
<use name="HeterogeneousCore/AlpakaCore"/>
<use name="HeterogeneousCore/AlpakaInterface"/>
<use name="PhysicsTools/PyTorchAlpaka"/>
<use name="pytorch"/>
<use name="pytorch-cuda"/>

<flags ALPAKA_BACKENDS="cuda"/>
<flags ALPAKA_BACKENDS="serial"/>
<flags EDM_PLUGIN="1"/>
<flags remove="1">ofast-flag</flags>
</library>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef RecoTracker_FinalTrackSelectors_alpaka_PixelTrackFeaturesDeviceCollection_h
#define RecoTracker_FinalTrackSelectors_alpaka_PixelTrackFeaturesDeviceCollection_h

#include "HeterogeneousCore/AlpakaInterface/interface/config.h"
#include "DataFormats/Portable/interface/alpaka/PortableCollection.h"
#include "RecoTracker/FinalTrackSelectors/interface/PixelTrackFeaturesSoA.h"

namespace ALPAKA_ACCELERATOR_NAMESPACE {
using PixelTrackScoresOnDevice = PortableCollection<PixelTrackScoresSoA>;
using PixelTrackFeaturesOnDevice = PortableCollection<PixelTrackFeaturesSoA>;
} // namespace ALPAKA_ACCELERATOR_NAMESPACE

#endif
Loading