diff --git a/Configuration/ProcessModifiers/python/ngtScouting_cff.py b/Configuration/ProcessModifiers/python/ngtScouting_cff.py index 05282b9df9748..3f8c626c0f9d9 100644 --- a/Configuration/ProcessModifiers/python/ngtScouting_cff.py +++ b/Configuration/ProcessModifiers/python/ngtScouting_cff.py @@ -1,5 +1,4 @@ import FWCore.ParameterSet.Config as cms -# This modifier is for running ngt scouting menu validation - +# This modifier is for running ngt scouting menu ngtScouting = cms.Modifier() diff --git a/Configuration/ProcessModifiers/python/phase2CAExtension_cff.py b/Configuration/ProcessModifiers/python/phase2CAExtension_cff.py new file mode 100644 index 0000000000000..27e7927fcd922 --- /dev/null +++ b/Configuration/ProcessModifiers/python/phase2CAExtension_cff.py @@ -0,0 +1,4 @@ +import FWCore.ParameterSet.Config as cms + +# This modifiers enables the extension of the Pixel CA algorithm to the first 3 layers of the Outer Tracker +phase2CAExtension = cms.Modifier() diff --git a/Configuration/ProcessModifiers/python/phase2LegacyPixelTracks_cff.py b/Configuration/ProcessModifiers/python/phase2LegacyPixelTracks_cff.py new file mode 100644 index 0000000000000..90132f1f27f78 --- /dev/null +++ b/Configuration/ProcessModifiers/python/phase2LegacyPixelTracks_cff.py @@ -0,0 +1,4 @@ +import FWCore.ParameterSet.Config as cms + +# This modifiers reverts the Pixel Tracking in the HLT Phase-2 to the Legacy algorithm from Run-2 +phase2LegacyPixelTracks = cms.Modifier() diff --git a/Configuration/PyReleaseValidation/README.md b/Configuration/PyReleaseValidation/README.md index 0314b1f914a66..2cecf09dcc40a 100644 --- a/Configuration/PyReleaseValidation/README.md +++ b/Configuration/PyReleaseValidation/README.md @@ -56,6 +56,7 @@ The offsets currently in use are: * 0.75: HLT phase-2 timing menu * 0.7501: HLT phase-2 tracking-only menu * 0.751: HLT phase-2 timing menu Alpaka variant +* 0.7511: HLT phase-2 timing menu, with PixelTracks CA Extension * 0.752: HLT phase-2 timing menu ticl_v5 variant * 0.753: HLT phase-2 timing menu Alpaka, single tracking iteration variant * 0.754: HLT phase-2 timing menu Alpaka, single tracking iteration, LST building variant @@ -66,10 +67,13 @@ The offsets currently in use are: * 0.757: HLT phase-2 timing menu Alpaka, single tracking iteration, LST seeding + CKF building variant * 0.758 HLT phase-2 timing menu ticl_barrel variant * 0.759: HLT phase-2 timing menu, with NANO:@Phase2HLT +* 0.76: HLT phase-2 reduced menu, with DIGI step * 0.77: HLT phase-2 NGT Scouting menu -* 0.771: HLT phase-2 NGT Scouting menu, Alpaka, TICL-v5, TICL-Barrel +* 0.771: HLT phase-2 NGT Scouting menu, Alpaka, TICL-v5, TICL-Barrel, CA Extension * 0.772: HLT phase-2 NGT Scouting menu, with NANO:@NGTScouting * 0.773: HLT phase-2 NGT Scouting menu, with NANO:@NGTScoutingVal +* 0.774: HLT phase-2 NGT Scouting menu Alpaka variant, with PixelTracks CA Extension as GeneralTracks +* 0.775: HLT phase-2 NGT Scouting menu Alpaka variant, with Pixeltracks CA Extension + LST T5s as GeneralTracks * 0.778 L3 Tracker Muons reconstruction Outside-In first, HLT Muon NanoAOD * 0.78: Complete L1 workflow * 0.781: Complete L1 workflow, producing FEVT and NANO output L1/P2GT objects diff --git a/Configuration/PyReleaseValidation/python/relval_Run4.py b/Configuration/PyReleaseValidation/python/relval_Run4.py index 72cb5788f3f82..7eba060d1f6c2 100644 --- a/Configuration/PyReleaseValidation/python/relval_Run4.py +++ b/Configuration/PyReleaseValidation/python/relval_Run4.py @@ -70,6 +70,7 @@ # Phase-2 HLT tests numWFIB.extend([prefixDet+34.7501])# HLTTrackingOnly75e33 numWFIB.extend([prefixDet+34.751]) # HLTTiming75e33, alpaka +numWFIB.extend([prefixDet+34.7511])# HLTTiming75e33, phase2CAExtension numWFIB.extend([prefixDet+34.752]) # HLTTiming75e33, ticl_v5 numWFIB.extend([prefixDet+34.753]) # HLTTiming75e33, alpaka,singleIterPatatrack numWFIB.extend([prefixDet+34.754]) # HLTTiming75e33, alpaka,singleIterPatatrack,trackingLST @@ -84,6 +85,8 @@ numWFIB.extend([prefixDet+34.771]) # NGTScouting + alpaka + TICL-v5 + TICL-Barrel numWFIB.extend([prefixDet+34.772]) # NGTScouting + NANO numWFIB.extend([prefixDet+34.773]) # NGTScouting + NANO (including validation) +numWFIB.extend([prefixDet+34.774]) # NGTScouting + Phase2CAExtension as GeneneralTracks +numWFIB.extend([prefixDet+34.775]) # NGTScouting + Phase2CAExtension&LSTT5 as GeneralTracks for numWF in numWFIB: workflows[numWF] = _upgrade_workflows[numWF] diff --git a/Configuration/PyReleaseValidation/python/relval_gpu.py b/Configuration/PyReleaseValidation/python/relval_gpu.py index 109e8f18b5f67..cf106a7e19b1f 100644 --- a/Configuration/PyReleaseValidation/python/relval_gpu.py +++ b/Configuration/PyReleaseValidation/python/relval_gpu.py @@ -35,14 +35,14 @@ # Alpaka pixel-only quadruplets: Single Nu E10 with PU: any backend # mc Run4 # no PU -# Alpaka pixel-only: TTbar: quadruplets any backend, any backend vs cpu validation, profiling, triplets +# Alpaka pixel-only: TTbar: quadruplets any backend, CA Extension any backend, any backend vs cpu validation, profiling, triplets # Alpaka ECAL-only development: TTbar: any backend # Alpaka pixel-only: Single Nu E10: any backend # Alpaka LST-only: TTbar: TRK-only w/ 2 iterations and LST building on any backend # Alpaka HLTTiming75e33: TTbar: any backend # Alpaka HLTTiming75e33: Single Nu E10: any backend # with PU -# Alpaka pixel-only: TTbar: quadruplets any backend, any backend vs cpu validation, profiling +# Alpaka pixel-only: TTbar: quadruplets any backend, CA Extension any backend, any backend vs cpu validation, profiling # Alpaka LST-only: TTbar: TRK-only w/ 2 iterations and LST building on any backend # Alpaka HLTTiming75e33: TTbar: any backend numWFIB = [ @@ -72,7 +72,7 @@ 17061.402, # Run4, Alpaka-based noPU - 29634.402, 29634.403, 29634.404, 29634.406, + 29634.402, 29634.4021, 29634.403, 29634.404, 29634.406, 29634.612, 29661.402, 29634.704, @@ -80,7 +80,7 @@ 29661.751, # Run4, Alpaka-based PU - 29834.402, 29834.403, 29834.404, + 29834.402, 29834.4021, 29834.403, 29834.404, 29834.704, 29834.751, ] diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index 14899a3b4c967..8d3e8f0dd5811 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -1519,6 +1519,28 @@ def setup_(self, step, stepName, stepDict, k, properties): offset = 0.402, ) + +# Pixel-only quadruplets with CA Extension workflow running on GPU (optional) +# - Pixel-only with CA Extension reconstruction with Alpaka, with DQM and validation +# - harvesting + +upgradeWFs['PatatrackPixelOnlyAlpakaCAExtension'] = PatatrackWorkflow( + digi = { + '--procModifiers': 'alpaka,phase2CAExtension', + '--customise' : 'HeterogeneousCore/AlpakaServices/customiseAlpakaServiceMemoryFilling.customiseAlpakaServiceMemoryFilling', + }, + reco = { + '-s': 'RAW2DIGI:RawToDigi_pixelOnly,RECO:reconstruction_pixelTrackingOnly,VALIDATION:@pixelTrackingOnlyValidation,DQM:@pixelTrackingOnlyDQM', + '--procModifiers': 'alpaka,phase2CAExtension', + '--customise' : 'HeterogeneousCore/AlpakaServices/customiseAlpakaServiceMemoryFilling.customiseAlpakaServiceMemoryFilling', + }, + harvest = { + '-s': 'HARVESTING:@trackingOnlyValidation+@pixelTrackingOnlyDQM' + }, + suffix = 'Patatrack_PixelOnlyAlpakaCAExtension', + offset = 0.4021, +) + # Pixel-only quadruplets workflow running on GPU (optional) # - Pixel-only reconstruction with Alpaka, with standard and CPUvsGPU DQM and validation # - harvesting for CPUvsGPU validation @@ -2014,6 +2036,19 @@ def condition(self, fragment, stepList, key, hasHarvest): '-s':'HARVESTING:@hltValidation' } +upgradeWFs['HLTTiming75e33CAExtension'] = deepcopy(upgradeWFs['HLTTiming75e33']) +upgradeWFs['HLTTiming75e33CAExtension'].suffix = '_HLT75e33TimingCAExtension' +upgradeWFs['HLTTiming75e33CAExtension'].offset = 0.7511 +upgradeWFs['HLTTiming75e33CAExtension'].step2 = { + '-s':'DIGI:pdigi_valid,L1TrackTrigger,L1,L1P2GT,DIGI2RAW,HLT:75e33_timing,VALIDATION:@hltValidation', + '--procModifiers': 'phase2CAExtension', + '--datatier':'GEN-SIM-DIGI-RAW,DQMIO', + '--eventcontent':'FEVTDEBUGHLT,DQMIO' +} +upgradeWFs['HLTTiming75e33CAExtension'].step3 = { + '-s':'HARVESTING:@hltValidation' +} + class UpgradeWorkflow_HLTPhase2_WithNano(UpgradeWorkflow): def setup_(self, step, stepName, stepDict, k, properties): # skip RECO, ALCA and HLT @@ -2121,7 +2156,7 @@ def setup_(self, step, stepName, stepDict, k, properties): else: stepDict[stepName][k] = merge([stepDict[step][k]]) def condition(self, fragment, stepList, key, hasHarvest): - return fragment=="TTbar_14TeV" and 'Run4' in key + return (fragment=="TTbar_14TeV" or fragment=="SingleMuPt15Eta0p_0p4") and 'Run4' in key upgradeWFs['NGTScouting'] = UpgradeWorkflow_NGTScouting( steps = [ 'Reco', @@ -2160,12 +2195,38 @@ def condition(self, fragment, stepList, key, hasHarvest): upgradeWFs['NGTScoutingAll'].offset = 0.771 upgradeWFs['NGTScoutingAll'].step2 = { '-s':'DIGI:pdigi_valid,L1TrackTrigger,L1,L1P2GT,DIGI2RAW,HLT:NGTScouting,VALIDATION:@hltValidation', - '--procModifiers': 'ngtScouting,alpaka,ticl_v5,ticl_barrel', + '--procModifiers': 'ngtScouting,alpaka,ticl_v5,ticl_barrel,phase2CAExtension', '--datatier':'GEN-SIM-DIGI-RAW,DQMIO', '--eventcontent':'FEVTDEBUGHLT,DQMIO' } upgradeWFs['NGTScoutingAll'].step3 = { '--procModifiers': 'ngtScouting,alpaka,ticl_v5,ticl_barrel', + '-s':'HARVESTING:@hltValidation' +} + +upgradeWFs['NGTScoutingCAExtensionPixelOnly'] = deepcopy(upgradeWFs['NGTScouting']) +upgradeWFs['NGTScoutingCAExtensionPixelOnly'].suffix = '_NGTScoutingCAExtensionPixelOnly' +upgradeWFs['NGTScoutingCAExtensionPixelOnly'].offset = 0.774 +upgradeWFs['NGTScoutingCAExtensionPixelOnly'].step2 = { + '-s':'DIGI:pdigi_valid,L1TrackTrigger,L1,L1P2GT,DIGI2RAW,HLT:NGTScouting,VALIDATION:@hltValidation', + '--procModifiers': 'ngtScouting,phase2CAExtension', + '--datatier':'GEN-SIM-DIGI-RAW,DQMIO', + '--eventcontent':'FEVTDEBUGHLT,DQMIO' +} +upgradeWFs['NGTScoutingCAExtensionPixelOnly'].step3 = { + '-s':'HARVESTING:@hltValidation' +} + +upgradeWFs['NGTScoutingCAExtensionMergeT5'] = deepcopy(upgradeWFs['NGTScouting']) +upgradeWFs['NGTScoutingCAExtensionMergeT5'].suffix = '_NGTScoutingCAExtensionMergeT5' +upgradeWFs['NGTScoutingCAExtensionMergeT5'].offset = 0.775 +upgradeWFs['NGTScoutingCAExtensionMergeT5'].step2 = { + '-s':'DIGI:pdigi_valid,L1TrackTrigger,L1,L1P2GT,DIGI2RAW,HLT:75e33_timing,VALIDATION:@hltValidation', + '--procModifiers': 'ngtScouting,phase2CAExtension,trackingLST', + '--datatier':'GEN-SIM-DIGI-RAW,DQMIO', + '--eventcontent':'FEVTDEBUGHLT,DQMIO' +} +upgradeWFs['NGTScoutingCAExtensionMergeT5'].step3 = { '-s':'HARVESTING:@hltValidation' } diff --git a/Configuration/PyReleaseValidation/scripts/runTheMatrix.py b/Configuration/PyReleaseValidation/scripts/runTheMatrix.py index 0a2995bcf7b1a..a9a323a82be65 100755 --- a/Configuration/PyReleaseValidation/scripts/runTheMatrix.py +++ b/Configuration/PyReleaseValidation/scripts/runTheMatrix.py @@ -158,6 +158,7 @@ def runSelected(opt): 'ph2_hlt' : [29634.75, # HLT phase-2 timing menu 29634.7501, # HLT phase-2 tracking-only menu 29634.751, # HLT phase-2 timing menu Alpaka variant + 29634.7511, # HLT phase-2 timing menu Phase2CAExtension variant 29634.752, # HLT phase-2 timing menu ticl_v5 variant 29634.753, # HLT phase-2 timing menu Alpaka, single tracking iteration variant 29634.754, # HLT phase-2 timing menu Alpaka, single tracking iteration, LST building variant @@ -169,9 +170,11 @@ def runSelected(opt): 29634.758, # HLT phase-2 timing menu ticl_barrel variant 29634.759, # HLT phase-2 timing menu Alpaka, single tracking iteration, LST seeding + CKF building variant 29634.77, # HLT phase-2 NGT Scouting menu - 29634.771, # HLT phase-2 NGT Scouting menu, Alpaka, TICL-v5, TICL-Barrel + 29634.771, # HLT phase-2 NGT Scouting menu, Alpaka, TICL-v5, TICL-Barrel, CA Extension 29634.772, # HLT phase-2 NGT Scouting menu, with NANO:@NGTScouting - 29634.773] # HLT phase-2 NGT Scouting menu, with NANO:@NGTScoutingVal + 29634.773, # HLT phase-2 NGT Scouting menu, with NANO:@NGTScoutingVal + 29634.774, # HLT phase-2 NGT Scouting menu, Phase2CAExtension as GeneralTracks + 29634.775], # HLT phase-2 NGT Scouting menu, Phase2CAExtension&LSTT5 as GeneralTracks } predefinedSet['limited'] = ( diff --git a/DataFormats/SiPixelClusterSoA/interface/ClusteringConstants.h b/DataFormats/SiPixelClusterSoA/interface/ClusteringConstants.h index 810b58042557f..18ea3220bbcf7 100644 --- a/DataFormats/SiPixelClusterSoA/interface/ClusteringConstants.h +++ b/DataFormats/SiPixelClusterSoA/interface/ClusteringConstants.h @@ -23,7 +23,8 @@ namespace pixelClustering { constexpr uint16_t clusterThresholdPhase2OtherLayers = 4000; constexpr uint32_t maxNumDigis = 3 * 256 * 1024; // @PU=200 µ=530k σ=50k this is >4σ away - constexpr uint16_t maxNumModules = 5000; // This is an upperlimit taking into account D110 has 4000 modules + constexpr uint16_t maxNumModules = 4000 + 2872; // This is an upper limit taking into account D110 has 4000 modules + // plus 3 layers of OT for CA Extension constexpr int32_t maxNumClustersPerModules = maxHitsInModule(); constexpr uint16_t invalidModuleId = std::numeric_limits::max() - 1; diff --git a/DataFormats/SoATemplate/README.md b/DataFormats/SoATemplate/README.md index 8269eee950c2d..f42631cff3562 100644 --- a/DataFormats/SoATemplate/README.md +++ b/DataFormats/SoATemplate/README.md @@ -46,13 +46,14 @@ This view can point to data belonging to different SoAs and thus not contiguous ## Descriptor -The nested class `ConstDescriptor` can only be instantiated passing a `View` or a `ConstView` and provides access to -each column through a `std::tuple...>`. This class should be considered an internal implementation detail, +The nested class `ConstDescriptor` can only be instantiated passing a `View` or a `ConstView` and provides access to columns +and related information. This class should be considered an internal implementation detail, used solely by the SoA and EDM frameworks for performing heterogeneous memory operations. It is used to implement the `deepCopy` from a `View` referencing different memory buffers, as shown in [`PortableHostCollection`](../../DataFormats/Portable/README.md#portablehostCollection) and [`PortableDeviceCollection`](../../DataFormats/Portable/README.md#portabledeviceCollection) sections. -It should likely not be used for other purposes. +More specifically, it provides access to the each column through a `std::tuple...>` accessible via `descriptor.buff` +as well as the types of the columns via a `std::tuple` accessible via `descriptor.columnTypes`. ## Metadata subclass diff --git a/DataFormats/SoATemplate/interface/SoALayout.h b/DataFormats/SoATemplate/interface/SoALayout.h index 5a7eb1aa2a75c..1bcbfdde47c59 100644 --- a/DataFormats/SoATemplate/interface/SoALayout.h +++ b/DataFormats/SoATemplate/interface/SoALayout.h @@ -204,6 +204,16 @@ namespace cms::soa { BOOST_PP_EMPTY(), \ BOOST_PP_EXPAND(_ASSIGN_SPAN_TO_COLUMNS_IMPL TYPE_NAME)) +#define _DECLARE_COLUMN_TYPE_IMPL(VALUE_TYPE, CPP_TYPE, NAME, ARGS) \ + BOOST_PP_IF(BOOST_PP_GREATER(VALUE_TYPE, _VALUE_LAST_COLUMN_TYPE), \ + BOOST_PP_EMPTY(), \ + (cms::soa::SoAColumnType::BOOST_PP_IF( \ + BOOST_PP_EQUAL(VALUE_TYPE, _VALUE_TYPE_SCALAR), \ + scalar, \ + BOOST_PP_IF(BOOST_PP_EQUAL(VALUE_TYPE, _VALUE_TYPE_COLUMN), column, eigen)))) + +#define _DECLARE_COLUMN_TYPE(R, DATA, TYPE_NAME) BOOST_PP_EXPAND(_DECLARE_COLUMN_TYPE_IMPL TYPE_NAME) + // clang-format off #define _DECLARE_MEMBER_TRIVIAL_CONSTRUCTION_IMPL(VALUE_TYPE, CPP_TYPE, NAME, ARGS) \ _SWITCH_ON_TYPE(VALUE_TYPE, \ @@ -1684,6 +1694,8 @@ _SWITCH_ON_TYPE(VALUE_TYPE, : buff{ _ITERATE_ON_ALL_COMMA(_ASSIGN_SPAN_TO_COLUMNS, ~, __VA_ARGS__)} {} \ \ std::tuple<_ITERATE_ON_ALL_COMMA(_DECLARE_CONST_DESCRIPTOR_SPANS, ~, __VA_ARGS__)> buff; \ + static constexpr std::array> columnTypes = {{ \ + _ITERATE_ON_ALL_COMMA(_DECLARE_COLUMN_TYPE, ~, __VA_ARGS__)}}; \ static constexpr size_type num_cols = std::tuple_size>::value; \ }; \ @@ -1696,6 +1708,8 @@ _SWITCH_ON_TYPE(VALUE_TYPE, : buff{ _ITERATE_ON_ALL_COMMA(_ASSIGN_SPAN_TO_COLUMNS, ~, __VA_ARGS__)} {} \ \ std::tuple<_ITERATE_ON_ALL_COMMA(_DECLARE_DESCRIPTOR_SPANS, ~, __VA_ARGS__)> buff; \ + static constexpr std::array> columnTypes = {{ \ + _ITERATE_ON_ALL_COMMA(_DECLARE_COLUMN_TYPE, ~, __VA_ARGS__)}}; \ static constexpr size_type num_cols = std::tuple_size>::value; \ }; \ diff --git a/DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h b/DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h index 8d9a65f69d67c..f8489c603a3bf 100644 --- a/DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h +++ b/DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h @@ -1,6 +1,8 @@ #ifndef DataFormats_TrackSoA_interface_alpaka_TrackUtilities_h #define DataFormats_TrackSoA_interface_alpaka_TrackUtilities_h +//#define NTUPLE_FIT_DEBUG + #include #include #include @@ -43,7 +45,9 @@ namespace pixelTrack { (std::abs(reco::zip(tracks, it)) < region.maxZip); } - ALPAKA_FN_ACC ALPAKA_FN_INLINE bool strictCut(const TrackSoAConstView &tracks, int it) const { + ALPAKA_FN_ACC ALPAKA_FN_INLINE bool strictCut(const TrackSoAConstView &tracks, + [[maybe_unused]] int nHits, + int it) const { auto roughLog = [](float x) { // max diff [0.5,12] at 1.25 0.16143 // average diff 0.0662998 @@ -83,6 +87,8 @@ namespace pixelTrack { using TrackSoAConstView = reco::TrackSoAConstView; float maxChi2; + float maxChi2TripletsOrQuadruplets; + float maxChi2Quintuplets; float minPt; float maxTip; float maxZip; @@ -91,11 +97,20 @@ namespace pixelTrack { return (std::abs(reco::tip(tracks, it)) < maxTip) and (tracks.pt(it) > minPt) and (std::abs(reco::zip(tracks, it)) < maxZip); } - ALPAKA_FN_ACC ALPAKA_FN_INLINE bool strictCut(const TrackSoAConstView &tracks, int it) const { + ALPAKA_FN_ACC ALPAKA_FN_INLINE bool strictCut(const TrackSoAConstView &tracks, int nHits, int it) const { + if (nHits <= 4) { + return tracks.chi2(it) >= maxChi2TripletsOrQuadruplets; + } + if (nHits == 5) { + return tracks.chi2(it) >= maxChi2Quintuplets; + } return tracks.chi2(it) >= maxChi2; } }; + // mark tracks that were skipped in the indToEdm map in SoA to legacy conversion + constexpr uint32_t skippedTrack = std::numeric_limits::max(); + } // namespace pixelTrack #endif // DataFormats_TrackSoA_interface_alpaka_TrackUtilities_h diff --git a/DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h b/DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h index 6750a42334bcb..cb567f565f6c6 100644 --- a/DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h +++ b/DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h @@ -16,6 +16,7 @@ #include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" #include "HeterogeneousCore/AlpakaInterface/interface/CopyToDevice.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" +#include "HeterogeneousCore/AlpakaInterface/interface/concepts.h" namespace ALPAKA_ACCELERATOR_NAMESPACE::reco { @@ -57,7 +58,7 @@ namespace cms::alpakatools { template <> struct CopyToDevice<::reco::TrackingRecHitHost> { - template + template static auto copyAsync(TQueue& queue, reco::TrackingRecHitHost const& hostData) { using TDevice = typename alpaka::trait::DevType::type; diff --git a/Geometry/CommonTopologies/interface/SimplePixelTopology.h b/Geometry/CommonTopologies/interface/SimplePixelTopology.h index c68ef516b2cbf..165346aa28c0e 100644 --- a/Geometry/CommonTopologies/interface/SimplePixelTopology.h +++ b/Geometry/CommonTopologies/interface/SimplePixelTopology.h @@ -8,10 +8,6 @@ namespace pixelTopology { - constexpr auto maxNumberOfLadders = 160; - constexpr uint8_t maxLayers = 28; - constexpr uint8_t maxPairs = 64; - // TODO // Once CUDA is dropped this could be wrapped in #ifdef CA_TRIPLETS_HOLE // see DataFormats/TrackingRecHitSoa/interface/TrackingRecHitSoA.h @@ -139,6 +135,7 @@ namespace phase1PixelTopology { constexpr uint32_t numberOfLayers = 10; constexpr int nPairs = 13 + 2 + 4; constexpr uint16_t numberOfModules = 1856; + constexpr int nStartingPairs = 3; // number of layer pairs to start Ntuplet-building from constexpr uint32_t maxNumClustersPerModules = 1024; @@ -165,6 +162,8 @@ namespace phase1PixelTopology { 4, 6, 7, 9 // Jumping Forward (19) }; + HOST_DEVICE_CONSTANT uint8_t startingPairs[nStartingPairs] = {0, 1, 2}; + HOST_DEVICE_CONSTANT int16_t phicuts[nPairs]{phi0p05, phi0p07, phi0p07, @@ -184,11 +183,21 @@ namespace phase1PixelTopology { phi0p05, phi0p05, phi0p05}; - HOST_DEVICE_CONSTANT float minz[nPairs] = { + HOST_DEVICE_CONSTANT float minInner[nPairs] = { -20., 0., -30., -22., 10., -30., -70., -70., -22., 15., -30, -70., -70., -20., -22., 0, -30., -70., -70.}; - HOST_DEVICE_CONSTANT float maxz[nPairs] = { + HOST_DEVICE_CONSTANT float maxInner[nPairs] = { 20., 30., 0., 22., 30., -10., 70., 70., 22., 30., -15., 70., 70., 20., 22., 30., 0., 70., 70.}; - HOST_DEVICE_CONSTANT float maxr[nPairs] = { + HOST_DEVICE_CONSTANT float minOuter[nPairs] = { + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100}; + HOST_DEVICE_CONSTANT float maxOuter[nPairs] = { + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}; + HOST_DEVICE_CONSTANT float minDZ[nPairs] = { + -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100}; + HOST_DEVICE_CONSTANT float maxDZ[nPairs] = { + 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}; + HOST_DEVICE_CONSTANT float ptCuts[nPairs] = { + 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5}; + HOST_DEVICE_CONSTANT float maxDR[nPairs] = { 20., 9., 9., 20., 7., 7., 5., 5., 20., 6., 6., 5., 5., 20., 20., 9., 9., 9., 9.}; HOST_DEVICE_CONSTANT float dcaCuts[numberOfLayers] = {0.15, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25}; @@ -196,6 +205,12 @@ namespace phase1PixelTopology { HOST_DEVICE_CONSTANT float thetaCuts[numberOfLayers] = { 0.002, 0.002, 0.002, 0.002, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003}; + // ------------------------------------------------------------------------------------------------------- + // Deprecated arrays only used in the CUDA version (values have no meaning in alpaka): + + // The layerStart array is only used in the CUDA version (which supports only the non-extended CA). + // In the alpaka version of the CA the array is built in globalBeginRun from the geometry directly + // and the values here become irrelevant. static constexpr uint32_t layerStart[numberOfLayers + 1] = {0, 96, 320, @@ -207,105 +222,255 @@ namespace phase1PixelTopology { 1632, 1744, // negative endcap numberOfModules}; + HOST_DEVICE_CONSTANT float minz[nPairs] = { + -20., 0., -30., -22., 10., -30., -70., -70., -22., 15., -30, -70., -70., -20., -22., 0, -30., -70., -70.}; + HOST_DEVICE_CONSTANT float maxz[nPairs] = { + 20., 30., 0., 22., 30., -10., 70., 70., 22., 30., -15., 70., 70., 20., 22., 30., 0., 70., 70.}; + HOST_DEVICE_CONSTANT float maxr[nPairs] = { + 20., 9., 9., 20., 7., 7., 5., 5., 20., 6., 6., 5., 5., 20., 20., 9., 9., 9., 9.}; } // namespace phase1PixelTopology namespace phase2PixelTopology { - using pixelTopology::phi0p05; - using pixelTopology::phi0p06; - using pixelTopology::phi0p07; - using pixelTopology::phi0p09; + // The parameters set here include the extension of the CA to the first 3 barrel layers of the OT. + // This incorporates therefore the general set for Phase-2 and builds the basis for both CA configurations (with or without OT extension). + // The layer pairs are ordered in such a way that the OT extended pairs are at the end of the arrays. So one can get the non-extended config by + // chopping off the last elements. + // The actual implementation of the splitting in these two configs is done below by having two separate structs in the pixelTopology namespace: + // - pixelTopology::Phase2 -> no OT extension + // - pixelTopology::Phase2OT -> with OT extension + + constexpr uint32_t nLayersPix = 28; // pixel layers + constexpr uint32_t nLayersOT = 3; // considered OT layers + constexpr uint32_t nLayersTot = nLayersPix + nLayersOT; // total number of layers for extended CA + + constexpr int nPairsPix = 57; // pixel only layer pairs + constexpr int nPairsOT = 16; // layer pairs with OT layers + constexpr int nPairsTot = nPairsPix + nPairsOT; // total number of layer pairs for extended CA - constexpr uint32_t numberOfLayers = 28; - constexpr int nPairs = 23 + 6 + 14 + 8 + 4; // include far forward layer pairs - constexpr uint16_t numberOfModules = 4000; + constexpr uint16_t nModulesPix = 4000; // pixel modules + constexpr uint16_t nModulesOT = 2872; // considered OT modules + constexpr uint16_t nModulesTot = nModulesPix + nModulesOT; // total number of modules for extended CA + constexpr int nStartingPairs = 24; // number of layer pairs to start Ntuplet-building from + + constexpr uint16_t numberOfModules = nModulesPix; constexpr uint32_t maxNumClustersPerModules = 1024; - HOST_DEVICE_CONSTANT uint8_t layerPairs[2 * nPairs] = { + HOST_DEVICE_CONSTANT uint8_t layerPairs[2 * nPairsTot] = { + 0, 1, 0, 2, 0, 4, 0, 5, 0, 16, 0, 17, // starting on BPIX1 (6) + 1, 2, 1, 3, 1, 4, 1, 5, 1, 16, 1, 17, // starting on BPIX2 (12) + 2, 3, 2, 4, 2, 16, // starting on BPIX3 (15) + 4, 5, 4, 6, 5, 6, 5, 7, 6, 7, 6, 8, 7, 8, // forward endcap (22) + 7, 9, 8, 9, 8, 10, 9, 10, 9, 11, 10, 11, 10, 12, // forward endcap (29) + 11, 12, 11, 13, 11, 14, 11, 15, 12, 13, 13, 14, 14, 15, // forward endcap (36) + 16, 17, 16, 18, 17, 18, 17, 19, 18, 19, 18, 20, 19, 20, // backward endcap (43) + 19, 21, 20, 21, 20, 22, 21, 22, 21, 23, 22, 23, 22, 24, // backward endcap (50) + 23, 24, 23, 25, 23, 26, 23, 27, 24, 25, 25, 26, 26, 27, // backward endcap (57) + + 2, 28, 2, 28, 2, 28, 3, 28, // barrel to OT (61) + 4, 28, 5, 28, 6, 28, 7, 28, 8, 28, // forward endcap to OT (66) + 16, 28, 17, 28, 18, 28, 19, 28, 20, 28, // backward endcap to OT (71) + 28, 29, 29, 30 // OT to OT (73) + }; - 0, 1, 0, 4, 0, 16, // BPIX1 (3) - 1, 2, 1, 4, 1, 16, // BPIX2 (6) - 2, 3, 2, 4, 2, 16, // BPIX3 & Forward (9) + HOST_DEVICE_CONSTANT uint8_t startingPairs[nStartingPairs] = {0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, + 19, 21, 23, 25, 27, 36, 38, 40, 42, 44, 46, 48}; + + HOST_DEVICE_CONSTANT int16_t phicuts[nPairsTot]{ + 350, 600, 450, 522, 450, 522, // BPIX1 + 400, 650, 500, 730, 500, 730, // BPIX2 + 350, 400, 400, // BPIX3 + 300, 522, 300, 522, 250, 522, 250, // forward endcap + 522, 250, 522, 300, 522, 240, 650, // forward endcap + 300, 200, 220, 250, 250, 250, 250, // forward endcap + 300, 522, 300, 522, 250, 522, 250, // backward endcap + 522, 250, 522, 300, 522, 240, 650, // backward endcap + 300, 200, 220, 250, 250, 250, 250, // backward endcap + + 1200, 1200, 1200, 1000, // barrel to OT + 1000, 1000, 1000, 1000, 850, // forward endcap to OT + 1000, 1000, 1000, 1000, 1000, // backward endcap to OT + 1100, 1250 // OT to OT + }; - 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, // POS (16) - 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, // NEG (23) + HOST_DEVICE_CONSTANT float minInner[nPairsTot] = { + -17, -14, 4, 7, -10000, -10000, // BPIX1 + -17, -15, 6, 9, -10000, -10000, // BPIX2 + -18, 11, -10000, // BPIX3 + 0, 0, 0, 0, 0, 0, 0, // forward endcap + 0, 0, 0, 0, 0, 0, 12, // forward endcap + 0, 0, 0, 0, 0, 0, 0, // forward endcap + 0, 0, 0, 0, 0, 0, 0, // backward endcap + 0, 0, 0, 0, 0, 0, 12, // backward endcap + 0, 0, 0, 0, 0, 0, 0, // backward endcap + + -10, -20, 10, -20, // barrel to O + 11, 11, 11, 11, 0, // forward end + 11, 11, 11, 11, 0, // backward en + -1200, -1200 // OT to OT + }; - 0, 2, 0, 5, 0, 17, 0, 6, 0, 18, // BPIX1 Jump (28) - 1, 3, 1, 5, 1, 17, 1, 6, 1, 18, // BPIX2 Jump (33) + HOST_DEVICE_CONSTANT float maxInner[nPairsTot] = { + 17, 14, 10000, 10000, -4, -7, // BPIX1 + 17, 15, 10000, 10000, -6, -9, // BPIX2 + 18, 10000, -11, // BPIX3 + 14, 14, 13, 13, 13, 13, 13, // forward endcap + 13, 13, 13, 13, 13, 13, 16, // forward endcap + 16, 6, 4, 6, 22, 22, 22, // forward endcap + 14, 14, 13, 13, 13, 13, 13, // backward endcap + 13, 13, 13, 13, 13, 13, 16, // backward endcap + 16, 6, 4, 6, 22, 22, 22, // backward endcap + + 10, -10, 20, 20, // barrel to OT + 10000, 10000, 10000, 10000, 10000, // forward endcap to OT + 10000, 10000, 10000, 10000, 10000, // backward endcap to OT + 1200, 1200 // OT to OT + }; - 11, 12, 12, 13, 13, 14, 14, 15, // Late POS (37) - 23, 24, 24, 25, 25, 26, 26, 27, // Late NEG (41) + HOST_DEVICE_CONSTANT float minOuter[nPairsTot] = { + -10000, -10000, 0, 0, 0, 0, // BPIX1 + -10000, -10000, 6, 6, 6, 6, // BPIX2 + -10000, 11, 11, // BPIX3 + 3, 3, 3, 3, 3, 3, 3, // forward endcap + 3, 3, 3, 4, 4, 3, 20, // forward endcap + 6, 0, 0, 0, 7, 7, 7, // forward endcap + 3, 3, 3, 3, 3, 3, 3, // backward endcap + 3, 3, 3, 4, 4, 3, 20, // backward endcap + 6, 0, 0, 0, 7, 7, 7, // backward endcap + + -30, -50, 25, -45, // barrel to OT + 30, 40, 55, 70, 80, // forward endcap to OT + -57, -70, -95, -110, -10000, // backward endcap to OT + -10000, -10000 // OT to OT + }; - 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10, 12, // POS Jump (48) - 16, 18, 17, 19, 18, 20, 19, 21, 20, 22, 21, 23, 22, 24, // NEG Jump (55) + HOST_DEVICE_CONSTANT float maxOuter[nPairsTot] = { + 10000, 10000, 10, 10000, 10, 10000, // BPIX1 + 10000, 10000, 10000, 10000, 10000, 10000, // BPIX2 + 10000, 10000, 10000, // BPIX3 + 10000, 10000, 10000, 10000, 10000, 10000, 10000, // forward endcap + 10000, 10000, 10000, 10000, 10000, 10000, 10000, // forward endcap + 21, 7, 7, 10000, 10000, 10000, 10000, // forward endcap + 10000, 10000, 10000, 10000, 10000, 10000, 10000, // backward endcap + 10000, 10000, 10000, 10000, 10000, 10000, 10000, // backward endcap + 21, 7, 7, 10000, 10000, 10000, 10000, // backward endcap + + 30, -25, 50, 45, // barrel to OT + 57, 80, 95, 110, 10000, // forward endcap to OT + -30, -40, -55, -70, -80, // backward endcap to OT + 10000, 10000 // OT to OT }; - HOST_DEVICE_CONSTANT uint32_t layerStart[numberOfLayers + 1] = {0, - 216, - 432, - 612, // Barrel - 864, - 972, - 1080, - 1188, - 1296, - 1404, - 1512, - 1620, - 1728, - 1904, - 2080, - 2256, // Fp - 2432, - 2540, - 2648, - 2756, - 2864, - 2972, - 3080, - 3188, - 3296, - 3472, - 3648, - 3824, // Np - numberOfModules}; - - HOST_DEVICE_CONSTANT int16_t phicuts[nPairs]{ - phi0p05, phi0p05, phi0p05, phi0p06, phi0p07, phi0p07, phi0p06, phi0p07, phi0p07, phi0p05, phi0p05, - phi0p05, phi0p05, phi0p05, phi0p05, phi0p05, phi0p05, phi0p05, phi0p05, phi0p05, phi0p05, phi0p05, - phi0p05, phi0p05, phi0p05, phi0p05, phi0p05, phi0p05, phi0p05, phi0p07, phi0p07, phi0p07, phi0p07, - phi0p07, phi0p07, phi0p07, phi0p07, phi0p07, phi0p07, phi0p07, phi0p07, phi0p07, phi0p07, phi0p07, - phi0p07, phi0p07, phi0p07, phi0p05, phi0p05, phi0p05, phi0p05, phi0p05, phi0p05, phi0p05, phi0p05}; + HOST_DEVICE_CONSTANT float maxDR[nPairsTot] = { + 5.0, 10.0, 8.0, 5.0, 8.0, 5.0, // BPIX1 + 7.0, 10.0, 8.0, 10.0, 8.0, 10.0, // BPIX2 + 7.0, 7.0, 7.0, // BPIX3 + 4.5, 9.0, 4.5, 9.0, 4.5, 9.0, 4.5, // forward endcap + 8.0, 4.0, 8.0, 4.5, 8.0, 4.0, 10.0, // forward endcap + 5.0, 3.0, 3.0, 4.0, 4.0, 4.0, 3.5, // forward endcap + 4.5, 9.0, 4.5, 9.0, 4.5, 9.0, 4.5, // backward endcap + 8.0, 4.0, 8.0, 4.5, 8.0, 4.0, 10.0, // backward endcap + 5.0, 3.0, 3.0, 4.0, 4.0, 4.0, 3.5, // backward endcap + + 10000.0, 10000.0, 10000.0, 10000.0, // barrel to OT + 16.0, 16.0, 16.0, 16.0, 14.0, // forward endcap to OT + 16.0, 16.0, 16.0, 16.0, 14.0, // backward endcap to OT + 10000.0, 10000.0 // OT to OT + }; - HOST_DEVICE_CONSTANT float minz[nPairs] = { + HOST_DEVICE_CONSTANT float minDZ[nPairsTot] = { + -16.0, -16.0, 0.0, 0.0, -25.0, -25.0, // BPIX1 + -13.0, -15.0, 0.0, 0.0, -19.0, -21.0, // BPIX2 + -9.0, 0.0, -13.0, // BPIX3 + -10000, -10000, -10000, -10000, -10000, -10000, -10000, // forward endcap + -10000, -10000, -10000, -10000, -10000, -10000, -10000, // forward endcap + -10000, -10000, -10000, -10000, -10000, -10000, -10000, // forward endcap + -10000, -10000, -10000, -10000, -10000, -10000, -10000, // backward endcap + -10000, -10000, -10000, -10000, -10000, -10000, -10000, // backward endcap + -10000, -10000, -10000, -10000, -10000, -10000, -10000, // backward endcap + + -15.0, -35.0, 10.0, -22.0, // barrel to OT + 5.0, -10.0, 5.0, 15.0, 25.0, // forward endcap to OT + -32.5, -50.0, -50.0, -70.0, -70.0, // backward endcap to OT + -50.0, -40.0 // OT to OT + }; + + HOST_DEVICE_CONSTANT float maxDZ[nPairsTot] = { + 16.0, 16.0, 25.0, 25.0, 0.0, 0.0, // BPIX1 + 13.0, 15.0, 19.0, 21.0, 0.0, 0.0, // BPIX2 + 9.0, 13.0, 0.0, // BPIX3 + 10000, 10000, 10000, 10000, 10000, 10000, 10000, // forward endcap + 10000, 10000, 10000, 10000, 10000, 10000, 10000, // forward endcap + 10000, 10000, 10000, 10000, 10000, 10000, 10000, // forward endcap + 10000, 10000, 10000, 10000, 10000, 10000, 10000, // backward endcap + 10000, 10000, 10000, 10000, 10000, 10000, 10000, // backward endcap + 10000, 10000, 10000, 10000, 10000, 10000, 10000, // backward endcap + + 15.0, -10.0, 35.0, 22.0, // barrel to OT + 32.5, 50.0, 50.0, 70.0, 70.0, // forward endcap to OT + -5.0, -10.0, -5.0, -15.0, -25.0, // backward endcap to OT + 50.0, 40.0 // OT to OT + }; + + HOST_DEVICE_CONSTANT float ptCuts[nPairsTot] = { + 0.85, 0.85, 0.85, 0.85, 0.85, 0.85, // BPIX1 + 0.85, 0.85, 0.85, 0.85, 0.85, 0.85, // BPIX2 + 0.85, 0.85, 0.85, // BPIX3 + 0.85, 0.85, 0.85, 0.85, 0.85, 0.85, 0.85, // forward endcap + 0.85, 0.85, 0.85, 0.85, 0.85, 0.85, 0.85, // forward endcap + 0.85, 0.85, 0.85, 0.85, 0.85, 0.85, 0.85, // forward endcap + 0.85, 0.85, 0.85, 0.85, 0.85, 0.85, 0.85, // backward endcap + 0.85, 0.85, 0.85, 0.85, 0.85, 0.85, 0.85, // backward endcap + 0.85, 0.85, 0.85, 0.85, 0.85, 0.85, 0.85, // backward endcap + + 2.00, 0.85, 0.85, 0.85, // barrel to OT + 0.85, 0.85, 0.85, 0.85, 0.85, // forward endcap to OT + 0.85, 0.85, 0.85, 0.85, 0.85, // backward endcap to OT + 0.85, 0.85 // OT to OT + }; + + HOST_DEVICE_CONSTANT float dcaCuts[nLayersTot] = { + 0.15, //BPix1 + 0.25, 0.20, 0.20, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, + 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, // Pixel layers + 0.10, 0.10, 0.10 // OT layers + }; + + HOST_DEVICE_CONSTANT float thetaCuts[nLayersTot] = { + 0.002, 0.002, 0.002, 0.002, // BPix + 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, + 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, // Pixel layers + 0.003, 0.003, 0.003 // OT layers + }; + + // ------------------------------------------------------------------------------------------------------- + // Deprecated arrays only used in the CUDA version (values have no meaning in alpaka or anywhere else): + + // The layerStart array is only used in the CUDA version (which supports only the non-extended CA). + // In the alpaka version of the CA the array is built in globalBeginRun from the geometry directly + // and the values here become irrelevant. + HOST_DEVICE_CONSTANT uint32_t layerStart[nLayersPix + 1] = { + 0, 216, 432, 612, // Barrel + 864, 972, 1080, 1188, 1296, 1404, 1512, 1620, 1728, 1904, 2080, 2256, // Fp + 2432, 2540, 2648, 2756, 2864, 2972, 3080, 3188, 3296, 3472, 3648, 3824, nModulesPix}; // Np + HOST_DEVICE_CONSTANT float minz[nPairsTot] = { -16.0, 4.0, -22.0, -17.0, 6.0, -22.0, -18.0, 11.0, -22.0, 23.0, 30.0, 39.0, 50.0, 65.0, 82.0, 109.0, -28.0, -35.0, -44.0, -55.0, -70.0, -87.0, -113.0, -16., 7.0, -22.0, 11.0, -22.0, -17.0, 9.0, -22.0, 13.0, -22.0, 137.0, 173.0, 199.0, 229.0, -142.0, -177.0, -203.0, -233.0, 23.0, 30.0, 39.0, 50.0, 65.0, 82.0, 109.0, -28.0, -35.0, -44.0, -55.0, -70.0, -87.0, -113.0}; - HOST_DEVICE_CONSTANT float maxz[nPairs] = { + HOST_DEVICE_CONSTANT float maxz[nPairsTot] = { 17.0, 22.0, -4.0, 17.0, 22.0, -6.0, 18.0, 22.0, -11.0, 28.0, 35.0, 44.0, 55.0, 70.0, 87.0, 113.0, -23.0, -30.0, -39.0, -50.0, -65.0, -82.0, -109.0, 17.0, 22.0, -7.0, 22.0, -10.0, 17.0, 22.0, -9.0, 22.0, -13.0, 142.0, 177.0, 203.0, 233.0, -137.0, -173.0, -199.0, -229.0, 28.0, 35.0, 44.0, 55.0, 70.0, 87.0, 113.0, -23.0, -30.0, -39.0, -50.0, -65.0, -82.0, -109.0}; - HOST_DEVICE_CONSTANT float maxr[nPairs] = {5.0, 5.0, 5.0, 7.0, 8.0, 8.0, 7.0, 7.0, 7.0, 6.0, 6.0, 6.0, 6.0, 5.0, - 6.0, 5.0, 6.0, 6.0, 6.0, 6.0, 5.0, 6.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, - 5.0, 8.0, 8.0, 8.0, 8.0, 6.0, 5.0, 5.0, 5.0, 6.0, 5.0, 5.0, 5.0, 9.0, - 9.0, 9.0, 8.0, 8.0, 8.0, 11.0, 9.0, 9.0, 9.0, 8.0, 8.0, 8.0, 11.0}; - - HOST_DEVICE_CONSTANT float dcaCuts[numberOfLayers] = {0.15, //BPix1 - 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, - 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, - 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25}; - - HOST_DEVICE_CONSTANT float thetaCuts[numberOfLayers] = {0.002, 0.002, 0.002, 0.002, // BPix - 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, - 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, - 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003}; - + HOST_DEVICE_CONSTANT float maxr[nPairsTot] = {5.0, 5.0, 5.0, 7.0, 8.0, 8.0, 7.0, 7.0, 7.0, 6.0, 6.0, 6.0, 6.0, 5.0, + 6.0, 5.0, 6.0, 6.0, 6.0, 6.0, 5.0, 6.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, + 5.0, 8.0, 8.0, 8.0, 8.0, 6.0, 5.0, 5.0, 5.0, 6.0, 5.0, 5.0, 5.0, 9.0, + 9.0, 9.0, 8.0, 8.0, 8.0, 11.0, 9.0, 9.0, 9.0, 8.0, 8.0, 8.0, 11.0}; } // namespace phase2PixelTopology namespace phase1HIonPixelTopology { @@ -358,14 +523,17 @@ namespace pixelTopology { static constexpr uint32_t avgHitsPerTrack = 7; static constexpr uint32_t maxCellsPerHit = 256; static constexpr uint32_t avgTracksPerHit = 10; - static constexpr uint32_t maxNumberOfTuples = 256 * 1024; + static constexpr uint32_t maxNumberOfTuples = 60 * 1024; // this is well above thanks to maxNumberOfTuples static constexpr uint32_t maxHitsForContainers = avgHitsPerTrack * maxNumberOfTuples; - static constexpr uint32_t maxNumberOfDoublets = 5 * 512 * 1024; + static constexpr uint32_t maxNumberOfDoublets = 6 * 512 * 1024; static constexpr uint32_t maxNumOfActiveDoublets = maxNumberOfDoublets / 8; static constexpr uint32_t maxNumberOfQuadruplets = maxNumberOfTuples; static constexpr uint32_t maxDepth = 12; - static constexpr uint32_t numberOfLayers = 28; + static constexpr uint32_t numberOfLayers = phase2PixelTopology::nLayersPix; + static constexpr float avgCellsPerHit = 12.; + static constexpr float avgCellsPerCell = 0.151; + static constexpr float avgTracksPerCell = 0.04; static constexpr uint32_t maxSizeCluster = 2047; @@ -399,14 +567,12 @@ namespace pixelTopology { static constexpr float dzdrFact = 8 * 0.0285 / 0.015; // from dz/dr to "DY" static constexpr int nPairsMinimal = 33; - static constexpr int nPairsFarForwards = nPairsMinimal + 8; // include barrel "jumping" layer pairs - static constexpr int nPairs = phase2PixelTopology::nPairs; // include far forward layer pairs - - static constexpr int maxDYsize12 = 12; - static constexpr int maxDYsize = 10; - static constexpr int maxDYPred = 20; + static constexpr int nPairsFarForwards = nPairsMinimal + 8; // include barrel "jumping" layer pairs + static constexpr int nPairs = phase2PixelTopology::nPairsPix; // include far forward layer pairs + static constexpr int nPairsForQuadruplets = nPairs; + static constexpr int nStartingPairs = phase2PixelTopology::nStartingPairs; - static constexpr uint16_t numberOfModules = phase2PixelTopology::numberOfModules; + static constexpr uint16_t numberOfModules = phase2PixelTopology::nModulesPix; // 1000 bins < 1024 bins (10 bits) must be: // - < 32*32 (warpSize*warpSize for block prefix scan for CUDA) @@ -428,19 +594,65 @@ namespace pixelTopology { static constexpr char const *nameModifier = "Phase2"; - static constexpr uint32_t const *layerStart = phase2PixelTopology::layerStart; - static constexpr float const *minz = phase2PixelTopology::minz; - static constexpr float const *maxz = phase2PixelTopology::maxz; - static constexpr float const *maxr = phase2PixelTopology::maxr; - - static constexpr uint8_t const *layerPairs = phase2PixelTopology::layerPairs; - static constexpr int16_t const *phicuts = phase2PixelTopology::phicuts; + static constexpr uint32_t const *layerStart = phase2PixelTopology::layerStart; // only for CUDA static constexpr inline bool isBigPixX(uint16_t px) { return false; } static constexpr inline bool isBigPixY(uint16_t py) { return false; } static constexpr inline uint16_t localX(uint16_t px) { return px; } static constexpr inline uint16_t localY(uint16_t py) { return py; } + + // ---------------------------------------- + // CA cut / geometry parameters + // ---------------------------------------- + static constexpr uint8_t const *layerPairs = phase2PixelTopology::layerPairs; + static constexpr uint8_t const *startingPairs = phase2PixelTopology::startingPairs; + // scalar parameters (doublet building) + static constexpr int minYsizeB1 = 20; + static constexpr int minYsizeB2 = 18; + static constexpr int maxDYsize12 = 12; + static constexpr int maxDYsize = 10; + static constexpr int maxDYPred = 24; + static constexpr float cellZ0Cut = 12.5; + // vector parameters (doublet building) + static constexpr float const *minInner = phase2PixelTopology::minInner; + static constexpr float const *maxInner = phase2PixelTopology::maxInner; + static constexpr float const *minOuter = phase2PixelTopology::minOuter; + static constexpr float const *maxOuter = phase2PixelTopology::maxOuter; + static constexpr float const *maxDR = phase2PixelTopology::maxDR; + static constexpr float const *minDZ = phase2PixelTopology::minDZ; + static constexpr float const *maxDZ = phase2PixelTopology::maxDZ; + static constexpr int16_t const *phicuts = phase2PixelTopology::phicuts; + static constexpr float const *ptCuts = phase2PixelTopology::ptCuts; + // scalar parameters (doublet linking) + // p [GeV/c] = B [T] * R [m] * 0.3 (factor from conversion from J to GeV and q = e = 1.6 * 10e-19 C) + // 87 cm/GeV = 1/(3.8T * 0.3) + static constexpr float hardCurvCut = 0.01425; // corresponds to 800 MeV in 3.8T. + // vector parameters (doublet linking) + static constexpr float const *thetaCuts = phase2PixelTopology::thetaCuts; + static constexpr float const *dcaCuts = phase2PixelTopology::dcaCuts; + // Deprecated arrays only used in the CUDA version + static constexpr float const *minz = phase2PixelTopology::minz; + static constexpr float const *maxz = phase2PixelTopology::maxz; + static constexpr float const *maxr = phase2PixelTopology::maxr; + // ---------------------------------------- + }; + + struct Phase2OT : public Phase2 { + static constexpr int nPairs = phase2PixelTopology::nPairsTot; + static constexpr int nPairsForQuadruplets = nPairs; + static constexpr uint32_t numberOfLayers = phase2PixelTopology::nLayersTot; // pixel layers + OT barrel layers + static constexpr uint16_t numberOfModules = phase2PixelTopology::nModulesTot; // pixel modules + OT barrel modules + + static constexpr uint32_t maxNumberOfTuples = 2 * 60 * 1024; + // this is well above thanks to maxNumberOfTuples + static constexpr uint32_t maxHitsForContainers = avgHitsPerTrack * maxNumberOfTuples; + static constexpr uint32_t maxNumberOfDoublets = 12 * 512 * 1024; + static constexpr uint32_t maxNumOfActiveDoublets = maxNumberOfDoublets / 8; + static constexpr uint32_t maxNumberOfQuadruplets = maxNumberOfTuples; + static constexpr float avgCellsPerHit = 17.; + static constexpr float avgCellsPerCell = 0.5; + static constexpr float avgTracksPerCell = 0.09; }; struct Phase1 { @@ -463,6 +675,9 @@ namespace pixelTopology { static constexpr uint32_t maxNumberOfQuadruplets = maxNumberOfTuples; static constexpr uint32_t maxDepth = 6; static constexpr uint32_t numberOfLayers = 10; + static constexpr float avgCellsPerHit = 25.; + static constexpr float avgCellsPerCell = 2.; + static constexpr float avgTracksPerCell = 1.; static constexpr uint32_t maxSizeCluster = 1023; @@ -498,10 +713,7 @@ namespace pixelTopology { static constexpr int nPairsForQuadruplets = 13; // quadruplets require hits in all layers static constexpr int nPairsForTriplets = nPairsForQuadruplets + 2; // include barrel "jumping" layer pairs static constexpr int nPairs = nPairsForTriplets + 4; // include forward "jumping" layer pairs - - static constexpr int maxDYsize12 = 28; - static constexpr int maxDYsize = 20; - static constexpr int maxDYPred = 20; + static constexpr int nStartingPairs = phase1PixelTopology::nStartingPairs; static constexpr uint16_t numberOfModules = phase1PixelTopology::numberOfModules; @@ -530,14 +742,6 @@ namespace pixelTopology { static constexpr char const *nameModifier = ""; - static constexpr uint32_t const *layerStart = phase1PixelTopology::layerStart; - static constexpr float const *minz = phase1PixelTopology::minz; - static constexpr float const *maxz = phase1PixelTopology::maxz; - static constexpr float const *maxr = phase1PixelTopology::maxr; - - static constexpr uint8_t const *layerPairs = phase1PixelTopology::layerPairs; - static constexpr int16_t const *phicuts = phase1PixelTopology::phicuts; - static constexpr inline bool isEdgeX(uint16_t px) { return (px == 0) | (px == lastRowInModule); } static constexpr inline bool isEdgeY(uint16_t py) { return (py == 0) | (py == lastColInModule); } @@ -572,6 +776,43 @@ namespace pixelTopology { shift += 1; return py + shift; } + + static constexpr uint32_t const *layerStart = phase1PixelTopology::layerStart; + + // ---------------------------------------- + // CA cut / geometry parameters + // ---------------------------------------- + static constexpr uint8_t const *layerPairs = phase1PixelTopology::layerPairs; + static constexpr uint8_t const *startingPairs = phase1PixelTopology::startingPairs; + // scalar parameters (doublet building) + static constexpr int minYsizeB1 = 1; + static constexpr int minYsizeB2 = 1; + static constexpr int maxDYsize12 = 28; + static constexpr int maxDYsize = 20; + static constexpr int maxDYPred = 20; + static constexpr float cellZ0Cut = 12.5; + // vector parameters (doublet building) + static constexpr float const *minInner = phase1PixelTopology::minInner; + static constexpr float const *maxInner = phase1PixelTopology::maxInner; + static constexpr float const *minOuter = phase1PixelTopology::minOuter; + static constexpr float const *maxOuter = phase1PixelTopology::maxOuter; + static constexpr float const *maxDR = phase1PixelTopology::maxDR; + static constexpr float const *minDZ = phase1PixelTopology::minDZ; + static constexpr float const *maxDZ = phase1PixelTopology::maxDZ; + static constexpr int16_t const *phicuts = phase1PixelTopology::phicuts; + static constexpr float const *ptCuts = phase1PixelTopology::ptCuts; + // scalar parameters (doublet linking) + // p [GeV/c] = B [T] * R [m] * 0.3 (factor from conversion from J to GeV and q = e = 1.6 * 10e-19 C) + // 87 cm/GeV = 1/(3.8T * 0.3) + static constexpr float hardCurvCut = 1.f / (0.35 * 87.f); // corresponds to 350 MeV in 3.8T. + // vector parameters (doublet linking) + static constexpr float const *thetaCuts = phase1PixelTopology::thetaCuts; + static constexpr float const *dcaCuts = phase1PixelTopology::dcaCuts; + // Deprecated arrays only used in the CUDA version + static constexpr float const *minz = phase1PixelTopology::minz; + static constexpr float const *maxz = phase1PixelTopology::maxz; + static constexpr float const *maxr = phase1PixelTopology::maxr; + // ---------------------------------------- }; struct HIonPhase1 : public Phase1 { @@ -599,6 +840,11 @@ namespace pixelTopology { static constexpr uint32_t maxHitsInModule = phase1HIonPixelTopology::maxNumClustersPerModules; static constexpr char const *nameModifier = "HIonPhase1"; + + // specified vector cuts for HIon + static constexpr int16_t const *phicuts = phase1PixelTopology::phicuts; + static constexpr float const *thetaCuts = phase1PixelTopology::thetaCuts; + static constexpr float const *dcaCuts = phase1PixelTopology::dcaCuts; }; template diff --git a/HLTrigger/Configuration/python/HLT_75e33/eventsetup/hltESPPixelCPEFastParams_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/eventsetup/hltESPPixelCPEFastParams_cfi.py index 8b6277a6eef9c..1206aac723fd0 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/eventsetup/hltESPPixelCPEFastParams_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/eventsetup/hltESPPixelCPEFastParams_cfi.py @@ -1,12 +1,7 @@ import FWCore.ParameterSet.Config as cms -def _addProcessPixelCPEFastParamsPhase2(process): - process.hltESPPixelCPEFastParamsPhase2 = cms.ESProducer('PixelCPEFastParamsESProducerAlpakaPhase2@alpaka', - ComponentName = cms.string("PixelCPEFastParamsPhase2"), - appendToDataLabel = cms.string(''), - alpaka = cms.untracked.PSet(backend = cms.untracked.string('') - ) +hltESPPixelCPEFastParamsPhase2 = cms.ESProducer('PixelCPEFastParamsESProducerAlpakaPhase2@alpaka', + ComponentName = cms.string("PixelCPEFastParamsPhase2"), + appendToDataLabel = cms.string(''), + alpaka = cms.untracked.PSet(backend = cms.untracked.string('')) ) - -from Configuration.ProcessModifiers.alpaka_cff import alpaka -modifyConfigurationForAlpakaPixelCPEFastParamsPhase2_ = alpaka.makeProcessModifier(_addProcessPixelCPEFastParamsPhase2) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltGeneralTracks_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltGeneralTracks_cfi.py index d0b69845d1bd1..0c5a539c4417d 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltGeneralTracks_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltGeneralTracks_cfi.py @@ -34,10 +34,7 @@ hasSelector = [0], indivShareFrac = [1.0], selectedTrackQuals = ["hltInitialStepTrackSelectionHighPurity"], - setsToMerge = [cms.PSet( - pQual = cms.bool(True), - tLists = cms.vint32(0) - )] + setsToMerge = {0: dict(pQual=True, tLists=[0,1])} ) (singleIterPatatrack & ~trackingLST & ~seedingLST).toReplaceWith(hltGeneralTracks, _hltGeneralTracksSingleIterPatatrack) @@ -47,10 +44,7 @@ hasSelector = [0,0,0,0], indivShareFrac = [0.1,0.1,0.1,0.1], selectedTrackQuals = ["hltInitialStepTrackSelectionHighPuritypTTCLST", "hltInitialStepTrackSelectionHighPuritypLSTCLST", "hltInitialStepTracksT5TCLST", "hltHighPtTripletStepTrackSelectionHighPurity"], - setsToMerge = [cms.PSet( - pQual = cms.bool(True), - tLists = cms.vint32(0,1,2,3) - )] + setsToMerge = {0: dict(pQual=True, tLists=[0,1,2,3])} ) (~singleIterPatatrack & trackingLST & ~seedingLST).toReplaceWith(hltGeneralTracks, _hltGeneralTracksLST) @@ -60,10 +54,7 @@ hasSelector = [0,0,0], indivShareFrac = [0.1,0.1,0.1], selectedTrackQuals = ["hltInitialStepTrackSelectionHighPuritypTTCLST", "hltInitialStepTrackSelectionHighPuritypLSTCLST", "hltInitialStepTracksT5TCLST"], - setsToMerge = [cms.PSet( - pQual = cms.bool(True), - tLists = cms.vint32(0,1,2) - )] + setsToMerge = {0: dict(pQual=True, tLists=[0,1,2])} ) (singleIterPatatrack & trackingLST & ~seedingLST).toReplaceWith(hltGeneralTracks, _hltGeneralTracksSingleIterPatatrackLST) @@ -73,11 +64,8 @@ hasSelector = [0,0,0], indivShareFrac = [0.1,0.1,0.1], selectedTrackQuals = ["hltInitialStepTrackSelectionHighPuritypTTCLST", "hltInitialStepTracksT5TCLST", "hltHighPtTripletStepTrackSelectionHighPuritypLSTCLST"], - setsToMerge = [cms.PSet( - pQual = cms.bool(True), - tLists = cms.vint32(0,1,2) - )] - ) + setsToMerge = {0: dict(pQual=True, tLists=[0,1,2])} +) (~singleIterPatatrack & trackingLST & seedingLST).toReplaceWith(hltGeneralTracks, _hltGeneralTracksLSTSeeding) @@ -85,3 +73,17 @@ TrackProducers = ["hltInitialStepTracks"], selectedTrackQuals = ["hltInitialStepTracks"]) (singleIterPatatrack & trackingLST & seedingLST).toReplaceWith(hltGeneralTracks, _hltGeneralTracksSingleIterPatatrack) + +from Configuration.ProcessModifiers.ngtScouting_cff import ngtScouting +from ..modules.hltPhase2PixelTracks_cfi import * +_hltGeneralTracksNGTScoutingLST = hltGeneralTracks.clone( + TrackProducers = ["hltPhase2PixelTracks", "hltInitialStepTracksT5TCLST"], + hasSelector = [0,0], + indivShareFrac = [0.1,0.1], + selectedTrackQuals = ["hltPhase2PixelTracks", "hltInitialStepTracksT5TCLST"], + setsToMerge = {0: dict(pQual=True, tLists=[0,1])} +) + +(ngtScouting & ~trackingLST).toReplaceWith(hltGeneralTracks, hltPhase2PixelTracks) + +(ngtScouting & trackingLST).toReplaceWith(hltGeneralTracks, _hltGeneralTracksNGTScoutingLST) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepSeeds_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepSeeds_cfi.py index 923d5e5bb9c3e..e910b06ff091f 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepSeeds_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltInitialStepSeeds_cfi.py @@ -12,11 +12,18 @@ useEventsWithNoVertex = cms.bool(True), usePV = cms.bool(False), useProtoTrackKinematics = cms.bool(False), - includeFourthHit = cms.bool(False) + includeFourthHit = cms.bool(False), + removeOTRechits = cms.bool(False) ) from Configuration.ProcessModifiers.trackingLST_cff import trackingLST trackingLST.toModify(hltInitialStepSeeds, includeFourthHit = True) +from Configuration.ProcessModifiers.phase2CAExtension_cff import phase2CAExtension +(phase2CAExtension & trackingLST).toModify(hltInitialStepSeeds, removeOTRechits = True) + +from Configuration.ProcessModifiers.ngtScouting_cff import ngtScouting +ngtScouting.toModify(hltInitialStepSeeds, removeOTRechits = True) + from Configuration.ProcessModifiers.phase2_hlt_vertexTrimming_cff import phase2_hlt_vertexTrimming phase2_hlt_vertexTrimming.toModify(hltInitialStepSeeds, InputVertexCollection = "hltPhase2TrimmedPixelVertices") diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltInputLST_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltInputLST_cfi.py index c5b871213485b..1ddc0caafda62 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltInputLST_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltInputLST_cfi.py @@ -19,3 +19,10 @@ from Configuration.ProcessModifiers.singleIterPatatrack_cff import singleIterPatatrack singleIterPatatrack.toReplaceWith(hltInputLST, _hltInputLSTSingleIterPatatrack) + +_hltInputLSTNGTScouting = hltInputLST.clone( + seedTracks = ['hltInitialStepSeedTracksLST'] +) + +from Configuration.ProcessModifiers.ngtScouting_cff import ngtScouting +ngtScouting.toReplaceWith(hltInputLST, _hltInputLSTNGTScouting ) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2OtRecHitsSoA_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2OtRecHitsSoA_cfi.py new file mode 100644 index 0000000000000..8b12845f7df2c --- /dev/null +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2OtRecHitsSoA_cfi.py @@ -0,0 +1,11 @@ +import FWCore.ParameterSet.Config as cms + +hltPhase2OtRecHitsSoA = cms.EDProducer('Phase2OTRecHitsSoAConverter@alpaka', + pixelRecHitSoASource = cms.InputTag('hltPhase2SiPixelRecHitsSoA'), + otRecHitSource = cms.InputTag('hltSiPhase2RecHits'), + beamSpot = cms.InputTag('hltOnlineBeamSpot'), + mightGet = cms.optional.untracked.vstring, + alpaka = cms.untracked.PSet( + backend = cms.untracked.string('') + ) +) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelRecHitsExtendedSoA_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelRecHitsExtendedSoA_cfi.py new file mode 100644 index 0000000000000..03ff7477d0db8 --- /dev/null +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelRecHitsExtendedSoA_cfi.py @@ -0,0 +1,10 @@ +import FWCore.ParameterSet.Config as cms + +hltPhase2PixelRecHitsExtendedSoA = cms.EDProducer('SiPixelRecHitExtendedAlpaka@alpaka', + pixelRecHitsSoA = cms.InputTag('hltPhase2SiPixelRecHitsSoA'), + trackerRecHitsSoA = cms.InputTag('hltPhase2OtRecHitsSoA'), + mightGet = cms.optional.untracked.vstring, + alpaka = cms.untracked.PSet( + backend = cms.untracked.string('') + ) + ) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelTracksCAExtension_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelTracksCAExtension_cfi.py new file mode 100644 index 0000000000000..9d5c48d241bf9 --- /dev/null +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelTracksCAExtension_cfi.py @@ -0,0 +1,13 @@ +import FWCore.ParameterSet.Config as cms + +hltPhase2PixelTracksCAExtension = cms.EDProducer("PixelTrackProducerFromSoAAlpakaPhase2", + beamSpot = cms.InputTag("hltOnlineBeamSpot"), + minNumberOfHits = cms.int32(0), + minQuality = cms.string('tight'), + pixelRecHitLegacySrc = cms.InputTag("hltSiPixelRecHits"), + trackSrc = cms.InputTag("hltPhase2PixelTracksSoA"), + outerTrackerRecHitSrc = cms.InputTag("hltSiPhase2RecHits"), + outerTrackerRecHitSoAConverterSrc = cms.InputTag("hltPhase2OtRecHitsSoA"), + useOTExtension = cms.bool(True), + requireQuadsFromConsecutiveLayers = cms.bool(True) +) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelTracksCutClassifier_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelTracksCutClassifier_cfi.py new file mode 100644 index 0000000000000..224ab76a304aa --- /dev/null +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelTracksCutClassifier_cfi.py @@ -0,0 +1,34 @@ +import FWCore.ParameterSet.Config as cms + +hltPhase2PixelTracksCutClassifier = cms.EDProducer("TrackCutClassifier", + beamspot = cms.InputTag("hltOnlineBeamSpot"), + ignoreVertices = cms.bool(False), + mva = cms.PSet( + dr_par = cms.PSet( + d0err = cms.vdouble(0.003, 0.003, 0.003), + d0err_par = cms.vdouble(0.001, 0.001, 0.001), + dr_exp = cms.vint32(4, 4, 4), + dr_par1 = cms.vdouble(0.8, 0.7, 0.6), + dr_par2 = cms.vdouble(0.6, 0.5, 0.45) + ), + dz_par = cms.PSet( + dz_exp = cms.vint32(4, 4, 4), + dz_par1 = cms.vdouble(0.9, 0.8, 0.7), + dz_par2 = cms.vdouble(0.8, 0.7, 0.55) + ), + maxChi2 = cms.vdouble(9999.0, 25.0, 16.0), + maxChi2n = cms.vdouble(2.0, 1.4, 1.2), + maxDr = cms.vdouble(0.5, 0.03, 3.40282346639e+38), + maxDz = cms.vdouble(0.5, 0.2, 3.40282346639e+38), + maxDzWrtBS = cms.vdouble(3.40282346639e+38, 24.0, 15.0), + maxLostLayers = cms.vint32(3, 2, 2), + min3DLayers = cms.vint32(3, 3, 3), + minLayers = cms.vint32(3, 3, 3), + minNVtxTrk = cms.int32(3), + minNdof = cms.vdouble(1e-05, 1e-05, 1e-05), + minPixelHits = cms.vint32(0, 0, 3) + ), + qualityCuts = cms.vdouble(-0.7, 0.1, 0.7), + src = cms.InputTag("hltPhase2PixelTracksCAExtension"), + vertices = cms.InputTag("hltPhase2PixelVertices") +) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelTracksSoA_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelTracksSoA_cfi.py index 6baca6635d7b8..d0398eb281423 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelTracksSoA_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelTracksSoA_cfi.py @@ -1,24 +1,188 @@ import FWCore.ParameterSet.Config as cms + +# list of layers to exclude from the CA (empty list doesn't exclude; [28, 29, 30] excludes the OT) +layersToExclude = [] + +# layers +layers = [ + # 0, 1, 2, 3 + # index, isBarrel, caDCA, caTheta + [ 0, True, 0.15, 0.002], + [ 1, True, 0.25, 0.002], + [ 2, True, 0.20, 0.002], + [ 3, True, 0.20, 0.002], + [ 4, False, 0.25, 0.003], + [ 5, False, 0.25, 0.003], + [ 6, False, 0.25, 0.003], + [ 7, False, 0.25, 0.003], + [ 8, False, 0.25, 0.003], + [ 9, False, 0.25, 0.003], + [ 10, False, 0.25, 0.003], + [ 11, False, 0.25, 0.003], + [ 12, False, 0.25, 0.003], + [ 13, False, 0.25, 0.003], + [ 14, False, 0.25, 0.003], + [ 15, False, 0.25, 0.003], + [ 16, False, 0.25, 0.003], + [ 17, False, 0.25, 0.003], + [ 18, False, 0.25, 0.003], + [ 19, False, 0.25, 0.003], + [ 20, False, 0.25, 0.003], + [ 21, False, 0.25, 0.003], + [ 22, False, 0.25, 0.003], + [ 23, False, 0.25, 0.003], + [ 24, False, 0.25, 0.003], + [ 25, False, 0.25, 0.003], + [ 26, False, 0.25, 0.003], + [ 27, False, 0.25, 0.003], + [ 28, True, 0.10, 0.003], + [ 29, True, 0.10, 0.003], + [ 30, True, 0.10, 0.003], +] + +# layerPairs for doublet building including pair-specific cut values +layerPairs = [ + # 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 + # i, o, start, phiCut, minIn, maxIn, minOut, maxOut, maxDR, minDZ, maxDZ, ptCuts + [ 0, 1, True, 350, -17.0, 17.0, -10000, 10000, 5.0, -16.0, 16.0, 0.85], + [ 0, 2, True, 600, -14.0, 14.0, -10000, 10000, 10.0, -16.0, 16.0, 0.85], + [ 0, 4, True, 450, 4.0, 10000, 0, 10.0, 8.0, 0.0, 25.0, 0.85], + [ 0, 5, True, 522, 7.0, 10000, 0, 10000, 5.0, 0.0, 25.0, 0.85], + # [ 0, 6, False, 522, 11.0, 10000, 0, 10000, 5.0, -10000, 10000, 0.85], + [ 0, 16, True, 450, -10000, -4.0, 0, 10.0, 8.0, -25.0, 0.0, 0.85], + [ 0, 17, True, 522, -10000, -7.0, 0, 10000, 5.0, -25.0, 0.0, 0.85], + # [ 0, 18, False, 522, -10000, -10.0, 0, 10000, 5.0, -10000, 10000, 0.85], + [ 1, 2, True, 400, -17.0, 17.0, -10000, 10000, 7.0, -13.0, 13.0, 0.85], + [ 1, 3, False, 650, -15.0, 15.0, -10000, 10000, 10.0, -15.0, 15.0, 0.85], + [ 1, 4, True, 500, 6.0, 10000, 6.5, 10000, 8.0, 0.0, 19.0, 0.85], + [ 1, 5, False, 730, 9.0, 10000, 6.5, 10000, 10.0, 0.0, 21.0, 0.85], + # [ 1, 6, False, 730, 13.0, 10000, 6.5, 10000, 8.0, -10000, 10000, 0.85], + [ 1, 16, True, 500, -10000, -6.0, 6.5, 10000, 8.0, -19.0, 0.0, 0.85], + [ 1, 17, False, 730, -10000, -9.0, 6.5, 10000, 10.0, -21.0, 0.0, 0.85], + # [ 1, 18, False, 730, -10000, -13.0, 6.5, 10000, 8.0, -10000, 10000, 0.85], + # [ 1, 28, False, 1300, 7.0, 10000, 30.0, 40.0, 10000, 19.0, 32.0, 1.0], + # [ 1, 28, False, 1300, -10000, -7.0, -40.0, -30.0, 10000, -32.0, -19.0, 1.0], + [ 2, 3, True, 350, -18.0, 18.0, -10000, 10000, 7.0, -9.0, 9.0, 0.85], + [ 2, 4, False, 400, 11.0, 10000, 11.7, 10000, 7.0, 0.0, 13.0, 0.85], + [ 2, 16, False, 400, -10000, -11.0, 11.7, 10000, 7.0, -13.0, 0.0, 0.85], + [ 2, 28, False, 1200, -10, 10, -30.0, 30.0, 10000, -15.0, 15.0, 2.0], + [ 2, 28, False, 1200, -20, -10, -50.0, -25.0, 10000, -35.0, -10.0, 0.85], + [ 2, 28, False, 1200, 10, 20, 25.0, 50.0, 10000, 10.0, 35.0, 0.85], + # [ 2, 28, False, 1200, -20, 20, -50.0, 50.0, 10000, -35.0, 35.0, 0.85], + [ 3, 28, False, 1000, -20, 20, -45.0, 45.0, 10000, -22.0, 22.0, 0.85], + # [ 3, 29, False, 1500, -40, 40, -10000, 10000, 10000, -10000, 10000, 0.85], + [ 4, 5, True, 300, 0, 14.0, 3.5, 10000, 4.5, -10000, 10000, 0.85], + [ 4, 6, False, 522, 0, 14.0, 3.5, 10000, 9.0, -10000, 10000, 0.85], + [ 4, 28, False, 1000, 11.6, 10000, 30.0, 57.5, 16.0, 5.0, 32.5, 0.85], + # [ 4, 29, False, 1000, 0, 10000, -10000, 10000, 10000, -10000, 10000, 0.85], + [ 5, 6, True, 300, 0, 13.0, 3.5, 10000, 4.5, -10000, 10000, 0.85], + [ 5, 7, False, 522, 0, 13.0, 3.5, 10000, 9.0, -10000, 10000, 0.85], + [ 5, 28, False, 1000, 11.6, 10000, 40.0, 80.0, 16.0, -10.0, 50.0, 0.85], + # [ 5, 29, False, 1000, 0, 10000, -10000, 10000, 10000, -10000, 10000, 0.85], + [ 6, 7, True, 250, 0, 13.0, 3.5, 10000, 4.5, -10000, 10000, 0.85], + [ 6, 8, False, 522, 0, 13.0, 3.5, 10000, 9.0, -10000, 10000, 0.85], + [ 6, 28, False, 1000, 11.6, 10000, 55.0, 95.0, 16.0, 5.0, 50.0, 0.85], + # [ 6, 29, False, 1000, 0, 10000, -10000, 10000, 10000, -10000, 10000, 0.85], + [ 7, 8, True, 250, 0, 13.0, 3.5, 10000, 4.5, -10000, 10000, 0.85], + [ 7, 9, False, 522, 0, 13.0, 3.5, 10000, 8.0, -10000, 10000, 0.85], + [ 7, 28, False, 1000, 11.8, 10000, 70.0, 110.0, 16.0, 15.0, 70.0, 0.85], + # [ 7, 29, False, 1000, 0, 10000, -10000, 10000, 10000, -10000, 10000, 0.85], + [ 8, 9, True, 250, 0, 13.0, 3.5, 10000, 4.0, -10000, 10000, 0.85], + [ 8, 10, False, 522, 0, 13.0, 3.5, 10000, 8.0, -10000, 10000, 0.85], + [ 8, 28, False, 850, 0, 10000, 80.0, 10000, 14.0, 25.0, 70.0, 0.85], + # [ 8, 29, False, 1000, 0, 10000, 0, 10000, 10000, -10000, 10000, 0.85], + [ 9, 10, True, 300, 0, 13.0, 4.0, 10000, 4.5, -10000, 10000, 0.85], + [ 9, 11, False, 522, 0, 13.0, 4.0, 10000, 8.0, -10000, 10000, 0.85], + # [ 9, 28, False, 1000, 0, 10000, 0, 10000, 10000, -10000, 10000, 0.85], + [ 10, 11, True, 240, 0, 13.0, 3.5, 10000, 4.0, -10000, 10000, 0.85], + [ 10, 12, False, 650, 12.5, 16.5, 20.0, 10000, 10.0, -10000, 10000, 0.85], + [ 11, 12, False, 300, 0, 16.5, 6.0, 21.0, 5.0, -10000, 10000, 0.85], + [ 11, 13, False, 200, 0, 6.0, 0, 7.5, 3.0, -10000, 10000, 0.85], + [ 11, 14, False, 220, 0, 4.6, 0, 7.5, 3.0, -10000, 10000, 0.85], + [ 11, 15, False, 250, 0, 6.0, 0, 10000, 4.0, -10000, 10000, 0.85], + [ 12, 13, False, 250, 0, 22.5, 7.0, 10000, 4.0, -10000, 10000, 0.85], + [ 13, 14, False, 250, 0, 22.5, 7.0, 10000, 4.0, -10000, 10000, 0.85], + [ 14, 15, False, 250, 0, 22.5, 7.0, 10000, 3.5, -10000, 10000, 0.85], + [ 16, 17, True, 300, 0, 14.0, 3.5, 10000, 4.5, -10000, 10000, 0.85], + [ 16, 18, False, 522, 0, 14.0, 3.5, 10000, 9.0, -10000, 10000, 0.85], + [ 16, 28, False, 1000, 11.6, 10000, -57.5, -30.0, 16.0, -32.5, -5.0, 0.85], + # [ 16, 29, False, 1000, 0, 10000, -10000, 10000, 10000, -10000, 10000, 0.85], + [ 17, 18, True, 300, 0, 13.0, 3.5, 10000, 4.5, -10000, 10000, 0.85], + [ 17, 19, False, 522, 0, 13.0, 3.5, 10000, 9.0, -10000, 10000, 0.85], + [ 17, 28, False, 1000, 11.6, 10000, -70.0, -40.0, 16.0, -50.0, -10.0, 0.85], + # [ 17, 29, False, 1000, 0, 10000, -10000, 10000, 10000, -10000, 10000, 0.85], + [ 18, 19, True, 250, 0, 13.0, 3.5, 10000, 4.5, -10000, 10000, 0.85], + [ 18, 20, False, 522, 0, 13.0, 3.5, 10000, 9.0, -10000, 10000, 0.85], + [ 18, 28, False, 1000, 11.6, 10000, -95.0, -55.0, 16.0, -50.0, -5.0, 0.85], + # [ 18, 29, False, 1000, 0, 10000, -10000, 10000, 10000, -10000, 10000, 0.85], + [ 19, 20, True, 250, 0, 13.0, 3.5, 10000, 4.5, -10000, 10000, 0.85], + [ 19, 21, False, 522, 0, 13.0, 3.5, 10000, 8.0, -10000, 10000, 0.85], + [ 19, 28, False, 1000, 11.8, 10000, -110.0, -70.0, 16.0, -70.0, -15.0, 0.85], + # [ 19, 29, False, 1000, 0, 10000, -10000, 10000, 10000, -10000, 10000, 0.85], + [ 20, 21, True, 250, 0, 13.0, 3.5, 10000, 4.0, -10000, 10000, 0.85], + [ 20, 22, False, 522, 0, 13.0, 3.5, 10000, 8.0, -10000, 10000, 0.85], + [ 20, 28, False, 1000, 0, 10000, -10000, -80.0, 14.0, -70.0, -25.0, 0.85], + # [ 20, 29, False, 1000, 0, 10000, -10000, 10000, 10000, -10000, 10000, 0.85], + [ 21, 22, True, 300, 0, 13.0, 4.0, 10000, 4.5, -10000, 10000, 0.85], + [ 21, 23, False, 522, 0, 13.0, 4.0, 10000, 8.0, -10000, 10000, 0.85], + # [ 21, 28, False, 1000, 0, 10000, -10000, 10000, 10000, -10000, 10000, 0.85], + [ 22, 23, True, 240, 0, 13.0, 3.5, 10000, 4.0, -10000, 10000, 0.85], + [ 22, 24, False, 650, 12.5, 16.5, 20.0, 10000, 10.0, -10000, 10000, 0.85], + [ 23, 24, False, 300, 0, 16.5, 6.0, 21.0, 5.0, -10000, 10000, 0.85], + [ 23, 25, False, 200, 0, 6.0, 0, 7.5, 3.0, -10000, 10000, 0.85], + [ 23, 26, False, 220, 0, 4.6, 0, 7.5, 3.0, -10000, 10000, 0.85], + [ 23, 27, False, 250, 0, 6.0, 0, 10000, 4.0, -10000, 10000, 0.85], + [ 24, 25, False, 250, 0, 22.5, 7.0, 10000, 4.0, -10000, 10000, 0.85], + [ 25, 26, False, 250, 0, 22.5, 7.0, 10000, 4.0, -10000, 10000, 0.85], + [ 26, 27, False, 250, 0, 22.5, 7.0, 10000, 3.5, -10000, 10000, 0.85], + [ 28, 29, False, 1100, -1200, 1200, -10000, 10000, 10000, -50.0, 50.0, 0.85], + # [ 28, 30, False, 2000, -40, 40, -10000, 10000, 10000, -10000, 10000, 0.85], + [ 29, 30, False, 1250, -1200, 1200, -10000, 10000, 10000, -40.0, 40.0, 0.85], +] + +# find the layerPairs that contain a layer that is excluded +excludeLayerPair = [any([(lp[0] == l) or (lp[1] == l) for l in layersToExclude]) for lp in layerPairs] +excludeCAExtension = [any([(lp[0] == l) or (lp[1] == l) for l in [28, 29, 30]]) for lp in layerPairs] + +# exclude those layerPairs +layerPairsAlpaka = [] +layerPairsCAExtension = [] +for i, lp in enumerate(layerPairs): + if (not excludeLayerPair[i]) and (not excludeCAExtension[i]): + layerPairsAlpaka.append(lp) + if not excludeLayerPair[i]: + layerPairsCAExtension.append(lp) + +# get startingPairs for Ntuplet building +startingPairsAlpaka = [] +for i, lp in enumerate(layerPairsAlpaka): + if lp[2]: + startingPairsAlpaka.append(i) + +startingPairsCAExtension = [] +for i, lp in enumerate(layerPairsCAExtension): + if lp[2]: + startingPairsCAExtension.append(i) + hltPhase2PixelTracksSoA = cms.EDProducer('CAHitNtupletAlpakaPhase2@alpaka', pixelRecHitSrc = cms.InputTag('hltPhase2SiPixelRecHitsSoA'), ptmin = cms.double(0.9), - hardCurvCut = cms.double(0.0328407225), + hardCurvCut = cms.double(0.01425), # corresponds to 800 MeV in 3.8T. earlyFishbone = cms.bool(True), lateFishbone = cms.bool(False), fillStatistics = cms.bool(False), minHitsPerNtuplet = cms.uint32(4), - maxNumberOfDoublets = cms.string(str(5*512*1024)), - maxNumberOfTuples = cms.string(str(32*1024)), - cellPtCut = cms.double(0.85), - cellZ0Cut = cms.double(7.5), - minYsizeB1 = cms.int32(25), - minYsizeB2 = cms.int32(15), + maxNumberOfDoublets = cms.string(str(6*512*1024)), + maxNumberOfTuples = cms.string(str(60*1024)), + cellZ0Cut = cms.double(12.5), # it's half the BS width! It has nothing to do with the sample!! + minYsizeB1 = cms.int32(20), + minYsizeB2 = cms.int32(18), maxDYsize12 = cms.int32(12), maxDYsize = cms.int32(10), - maxDYPred = cms.int32(20), + maxDYPred = cms.int32(24), avgHitsPerTrack = cms.double(7.0), - avgCellsPerHit = cms.double(6), + avgCellsPerHit = cms.double(12), avgCellsPerCell = cms.double(0.151), avgTracksPerCell = cms.double(0.040), minHitsForSharingCut = cms.uint32(10), @@ -28,21 +192,129 @@ dupPassThrough = cms.bool(False), useSimpleTripletCleaner = cms.bool(True), trackQualityCuts = cms.PSet( + maxChi2TripletsOrQuadruplets = cms.double(5.0), + maxChi2Quintuplets = cms.double(5.0), maxChi2 = cms.double(5.0), minPt = cms.double(0.9), maxTip = cms.double(0.3), - maxZip = cms.double(12.), + maxZip = cms.double(12), ), geometry = cms.PSet( - caDCACuts = cms.vdouble(0.15, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25), - caThetaCuts = cms.vdouble(0.002, 0.002, 0.002, 0.002, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003, 0.003), - startingPairs = cms.vuint32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32), - pairGraph = cms.vuint32(0, 1, 0, 4, 0, 16, 1, 2, 1, 4, 1, 16, 2, 3, 2, 4, 2, 16, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 0, 2, 0, 5, 0, 17, 0, 6, 0, 18, 1, 3, 1, 5, 1, 17, 1, 6, 1, 18, 11, 12, 12, 13, 13, 14, 14, 15, 23, 24, 24, 25, 25, 26, 26, 27, 4, 6, 5, 7, 6, 8, 7, 9, 8, 10, 9, 11, 10, 12, 16, 18, 17, 19, 18, 20, 19, 21, 20, 22, 21, 23, 22, 24), - phiCuts = cms.vint32(522, 522, 522, 626, 730, 730, 626, 730, 730, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 522, 730, 730, 730, 730, 730, 730, 730, 730, 730, 730, 730, 730, 730, 730, 730, 730, 730, 730, 522, 522, 522, 522, 522, 522, 522, 522), - minZ = cms.vdouble(-16, 4, -22, -17, 6, -22, -18, 11, -22, 23, 30, 39, 50, 65, 82, 109, -28, -35, -44, -55, -70, -87, -113, -16, 7, -22, 11, -22, -17, 9, -22, 13, -22, 137, 173, 199, 229, -142, -177, -203, -233, 23, 30, 39, 50, 65, 82, 109, -28, -35, -44, -55, -70, -87, -113), - maxZ = cms.vdouble(17, 22, -4, 17, 22, -6, 18, 22, -11, 28, 35, 44, 55, 70, 87, 113, -23, -30, -39, -50, -65, -82, -109, 17, 22, -7, 22, -10, 17, 22, -9, 22, -13, 142, 177, 203, 233, -137, -173, -199, -229, 28, 35, 44, 55, 70, 87, 113, -23, -30, -39, -50, -65, -82, -109), - maxR = cms.vdouble(5, 5, 5, 7, 8, 8, 7, 7, 7, 6, 6, 6, 6, 5, 6, 5, 6, 6, 6, 6, 5, 6, 5, 5, 5, 5, 5, 5, 5, 8, 8, 8, 8, 6, 5, 5, 5, 6, 5, 5, 5, 9, 9, 9, 8, 8, 8, 11, 9, 9, 9, 8, 8, 8, 11) + caDCACuts = cms.vdouble([l[2] for l in layers[:28]]), + caThetaCuts = cms.vdouble([l[3] for l in layers[:28]]), + startingPairs = cms.vuint32(startingPairsAlpaka), + pairGraph = cms.vuint32(sum([[lp[0], lp[1]] for lp in layerPairsAlpaka], [])), + phiCuts = cms.vint32( [lp[ 3] for lp in layerPairsAlpaka]), + minInner = cms.vdouble([lp[ 4] for lp in layerPairsAlpaka]), + maxInner = cms.vdouble([lp[ 5] for lp in layerPairsAlpaka]), + minOuter = cms.vdouble([lp[ 6] for lp in layerPairsAlpaka]), + maxOuter = cms.vdouble([lp[ 7] for lp in layerPairsAlpaka]), + maxDR = cms.vdouble([lp[ 8] for lp in layerPairsAlpaka]), + minDZ = cms.vdouble([lp[ 9] for lp in layerPairsAlpaka]), + maxDZ = cms.vdouble([lp[10] for lp in layerPairsAlpaka]), + ptCuts = cms.vdouble([lp[11] for lp in layerPairsAlpaka]), + ), + # autoselect the alpaka backend + alpaka = cms.untracked.PSet(backend = cms.untracked.string('')) +) + +_hltPhase2PixelTracksSoA = cms.EDProducer('CAHitNtupletAlpakaPhase2OT@alpaka', + pixelRecHitSrc = cms.InputTag('hltPhase2PixelRecHitsExtendedSoA'), + ptmin = cms.double(0.9), + hardCurvCut = cms.double(0.01425), # corresponds to 800 MeV in 3.8T. + earlyFishbone = cms.bool(True), + lateFishbone = cms.bool(False), + fillStatistics = cms.bool(False), + minHitsPerNtuplet = cms.uint32(4), + maxNumberOfDoublets = cms.string(str(12*512*1024)), + maxNumberOfTuples = cms.string(str(2*60*1024)), + cellZ0Cut = cms.double(12.5), # it's half the BS width! It has nothing to do with the sample!! + minYsizeB1 = cms.int32(20), + minYsizeB2 = cms.int32(18), + maxDYsize12 = cms.int32(12), + maxDYsize = cms.int32(10), + maxDYPred = cms.int32(24), + avgHitsPerTrack = cms.double(8.0), + avgCellsPerHit = cms.double(17), + avgCellsPerCell = cms.double(0.5), + avgTracksPerCell = cms.double(0.09), + minHitsForSharingCut = cms.uint32(10), + fitNas4 = cms.bool(False), + useRiemannFit = cms.bool(False), + doSharedHitCut = cms.bool(True), + dupPassThrough = cms.bool(False), + useSimpleTripletCleaner = cms.bool(True), + trackQualityCuts = cms.PSet( + maxChi2TripletsOrQuadruplets = cms.double(1.0), + maxChi2Quintuplets = cms.double(3.0), + maxChi2 = cms.double(5.0), + minPt = cms.double(0.9), + maxTip = cms.double(0.3), + maxZip = cms.double(12), + ), + geometry = cms.PSet( + # This cut also uses the hardCurvCut parameters inside the + # Kernel_connect "function". This is used to cut connections that have + # either a too low p_t or that do not intersect the BS+tolerance + # region. Internally, this cut is compared against the circle.dca0() in + # natural units divided by circle.curvature(), where circle is the + # circle passing through the 3 points of the triplet under + # investigation. Therefore the cut represent the compatibility of the + # circle in the transverse plane and the units are meant to be cm. + caDCACuts = cms.vdouble([l[2] for l in layers]), + # caThetaCut is used in the areAlignedRZ function to check if two + # sibling cell are compatible in the R-Z plane. In that same function, + # we also use ptmin variable. The caThetaCut is assigned to the SoA of + # the layers, and is percolated into this compatibility function via + # the SoA itself. + caThetaCuts = cms.vdouble([l[3] for l in layers]), + startingPairs = cms.vuint32(startingPairsCAExtension), + pairGraph = cms.vuint32(sum([[lp[0], lp[1]] for lp in layerPairsCAExtension], [])), + phiCuts = cms.vint32( [lp[ 3] for lp in layerPairsCAExtension]), + minInner = cms.vdouble([lp[ 4] for lp in layerPairsCAExtension]), + maxInner = cms.vdouble([lp[ 5] for lp in layerPairsCAExtension]), + minOuter = cms.vdouble([lp[ 6] for lp in layerPairsCAExtension]), + maxOuter = cms.vdouble([lp[ 7] for lp in layerPairsCAExtension]), + maxDR = cms.vdouble([lp[ 8] for lp in layerPairsCAExtension]), + minDZ = cms.vdouble([lp[ 9] for lp in layerPairsCAExtension]), + maxDZ = cms.vdouble([lp[10] for lp in layerPairsCAExtension]), + ptCuts = cms.vdouble([lp[11] for lp in layerPairsCAExtension]), ), # autoselect the alpaka backend alpaka = cms.untracked.PSet(backend = cms.untracked.string('')) ) + +def _exclude_OT_layers(hltPhase2PixelTracksSoA, layers_to_exclude = [28, 29, 30]): + keep_indices = [] + num_pairs = len(hltPhase2PixelTracksSoA.geometry.pairGraph) // 2 + for i in range(num_pairs): + a = hltPhase2PixelTracksSoA.geometry.pairGraph[2*i] + b = hltPhase2PixelTracksSoA.geometry.pairGraph[2*i + 1] + if a not in layers_to_exclude and b not in layers_to_exclude: + keep_indices.append(i) + # Now update in place + # For pairGraph, build the new flat list from kept pairs + new_pairGraph = [] + for i in keep_indices: + new_pairGraph.extend([hltPhase2PixelTracksSoA.geometry.pairGraph[2*i], hltPhase2PixelTracksSoA.geometry.pairGraph[2*i+1]]) + + hltPhase2PixelTracksSoA.geometry.pairGraph[:] = new_pairGraph + # Update all other lists in place + hltPhase2PixelTracksSoA.geometry.phiCuts[:] = [hltPhase2PixelTracksSoA.geometry.phiCuts[i] for i in keep_indices] + hltPhase2PixelTracksSoA.geometry.minInnerR[:] = [hltPhase2PixelTracksSoA.geometry.minInnerR[i] for i in keep_indices] + hltPhase2PixelTracksSoA.geometry.maxInnerR[:] = [hltPhase2PixelTracksSoA.geometry.maxInnerR[i] for i in keep_indices] + hltPhase2PixelTracksSoA.geometry.minOuterR[:] = [hltPhase2PixelTracksSoA.geometry.minOuterR[i] for i in keep_indices] + hltPhase2PixelTracksSoA.geometry.maxOuterR[:] = [hltPhase2PixelTracksSoA.geometry.maxOuterR[i] for i in keep_indices] + hltPhase2PixelTracksSoA.geometry.maxDR[:] = [hltPhase2PixelTracksSoA.geometry.maxDR[i] for i in keep_indices] + hltPhase2PixelTracksSoA.geometry.minInnerZ[:] = [hltPhase2PixelTracksSoA.geometry.minInnerZ[i] for i in keep_indices] + hltPhase2PixelTracksSoA.geometry.maxInnerZ[:] = [hltPhase2PixelTracksSoA.geometry.maxInnerZ[i] for i in keep_indices] + hltPhase2PixelTracksSoA.geometry.minOuterZ[:] = [hltPhase2PixelTracksSoA.geometry.minOuterZ[i] for i in keep_indices] + hltPhase2PixelTracksSoA.geometry.maxOuterZ[:] = [hltPhase2PixelTracksSoA.geometry.maxOuterZ[i] for i in keep_indices] + hltPhase2PixelTracksSoA.geometry.minDZ[:] = [hltPhase2PixelTracksSoA.geometry.minDZ[i] for i in keep_indices] + hltPhase2PixelTracksSoA.geometry.maxDZ[:] = [hltPhase2PixelTracksSoA.geometry.maxDZ[i] for i in keep_indices] + hltPhase2PixelTracksSoA.geometry.ptCuts[:] = [hltPhase2PixelTracksSoA.geometry.ptCuts[i] for i in keep_indices] + +from Configuration.ProcessModifiers.phase2CAExtension_cff import phase2CAExtension +phase2CAExtension.toReplaceWith(hltPhase2PixelTracksSoA, _hltPhase2PixelTracksSoA) + +#print("Using {} pair connections: {}".format(len(hltPhase2PixelTracksSoA.geometry.pairGraph) // 2, hltPhase2PixelTracksSoA.geometry.pairGraph)) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelTracks_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelTracks_cfi.py index b06d6b0fcdf9d..00f61dd05dee4 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelTracks_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelTracks_cfi.py @@ -1,6 +1,29 @@ import FWCore.ParameterSet.Config as cms -hltPhase2PixelTracks = cms.EDProducer("PixelTrackProducer", +hltPhase2PixelTracks = cms.EDProducer("PixelTrackProducerFromSoAAlpakaPhase2", + beamSpot = cms.InputTag("hltOnlineBeamSpot"), + minNumberOfHits = cms.int32(0), + minQuality = cms.string('tight'), + pixelRecHitLegacySrc = cms.InputTag("hltSiPixelRecHits"), + trackSrc = cms.InputTag("hltPhase2PixelTracksSoA"), + outerTrackerRecHitSrc = cms.InputTag(""), + useOTExtension = cms.bool(False), + requireQuadsFromConsecutiveLayers = cms.bool(True) +) + +from Configuration.ProcessModifiers.phase2CAExtension_cff import phase2CAExtension +_hltPhase2PixelTracksCAExtensionSelectionHighPurity = 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") +) +phase2CAExtension.toReplaceWith(hltPhase2PixelTracks, _hltPhase2PixelTracksCAExtensionSelectionHighPurity) + +from Configuration.ProcessModifiers.phase2LegacyPixelTracks_cff import phase2LegacyPixelTracks +_hltPhase2PixelTracksLegacy = cms.EDProducer("PixelTrackProducer", Cleaner = cms.string('pixelTrackCleanerBySharedHits'), Filter = cms.InputTag("hltPhase2PixelTrackFilterByKinematics"), Fitter = cms.InputTag("hltPhase2PixelFitterByHelixProjections"), @@ -8,13 +31,4 @@ mightGet = cms.optional.untracked.vstring, passLabel = cms.string('hltPhase2PixelTracks') ) - -from Configuration.ProcessModifiers.alpaka_cff import alpaka -_hltPhase2PixelTracks = cms.EDProducer("PixelTrackProducerFromSoAAlpakaPhase2", - beamSpot = cms.InputTag("hltOnlineBeamSpot"), - minNumberOfHits = cms.int32(0), - minQuality = cms.string('tight'), - pixelRecHitLegacySrc = cms.InputTag("hltSiPixelRecHits"), - trackSrc = cms.InputTag("hltPhase2PixelTracksSoA") -) -alpaka.toReplaceWith(hltPhase2PixelTracks, _hltPhase2PixelTracks) +phase2LegacyPixelTracks.toReplaceWith(hltPhase2PixelTracks, _hltPhase2PixelTracksLegacy) \ No newline at end of file diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelVertices_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelVertices_cfi.py index 5706cfc2737e1..80bb22481bc6f 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelVertices_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltPhase2PixelVertices_cfi.py @@ -16,3 +16,8 @@ ZSeparation = cms.double(0.005), beamSpot = cms.InputTag("hltOnlineBeamSpot") ) + +from Configuration.ProcessModifiers.phase2CAExtension_cff import phase2CAExtension +phase2CAExtension.toModify(hltPhase2PixelVertices, + TrackCollection = "hltPhase2PixelTracksCAExtension" +) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltSiPixelClusters_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltSiPixelClusters_cfi.py index 54666e0d1c5f8..dc58cb9354861 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltSiPixelClusters_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltSiPixelClusters_cfi.py @@ -1,34 +1,9 @@ import FWCore.ParameterSet.Config as cms -hltSiPixelClusters = cms.EDProducer("SiPixelClusterProducer", - ChannelThreshold = cms.int32(1000), - ClusterMode = cms.string('PixelThresholdClusterizer'), - ClusterThreshold = cms.int32(4000), - ClusterThreshold_L1 = cms.int32(4000), - ElectronPerADCGain = cms.double(1500.0), - MissCalibrate = cms.bool(False), - Phase2Calibration = cms.bool(True), - Phase2DigiBaseline = cms.double(1000.0), - Phase2KinkADC = cms.int32(8), - Phase2ReadoutMode = cms.int32(3), - SeedThreshold = cms.int32(1000), - SplitClusters = cms.bool(False), - VCaltoElectronGain = cms.int32(1), - VCaltoElectronGain_L1 = cms.int32(1), - VCaltoElectronOffset = cms.int32(0), - VCaltoElectronOffset_L1 = cms.int32(0), - maxNumberOfClusters = cms.int32(-1), - mightGet = cms.optional.untracked.vstring, - payloadType = cms.string('None'), - src = cms.InputTag("simSiPixelDigis","Pixel") -) - -from Configuration.ProcessModifiers.alpaka_cff import alpaka -_hltSiPixelClusters = cms.EDProducer('SiPixelDigisClustersFromSoAAlpakaPhase2', +hltSiPixelClusters = cms.EDProducer('SiPixelDigisClustersFromSoAAlpakaPhase2', src = cms.InputTag('hltPhase2SiPixelClustersSoA'), clusterThreshold_layer1 = cms.int32(4000), clusterThreshold_otherLayers = cms.int32(4000), produceDigis = cms.bool(False), storeDigis = cms.bool(False) ) -alpaka.toReplaceWith(hltSiPixelClusters, _hltSiPixelClusters) diff --git a/HLTrigger/Configuration/python/HLT_75e33/modules/hltSiPixelRecHits_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/modules/hltSiPixelRecHits_cfi.py index f0248206f35a6..093c1f9fe7d34 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/modules/hltSiPixelRecHits_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/modules/hltSiPixelRecHits_cfi.py @@ -1,12 +1,6 @@ import FWCore.ParameterSet.Config as cms -hltSiPixelRecHits = cms.EDProducer("SiPixelRecHitConverter", - CPE = cms.string('PixelCPEGeneric'), - src = cms.InputTag("hltSiPixelClusters") -) - -from Configuration.ProcessModifiers.alpaka_cff import alpaka -alpaka.toReplaceWith(hltSiPixelRecHits, cms.EDProducer('SiPixelRecHitFromSoAAlpakaPhase2', +hltSiPixelRecHits = cms.EDProducer('SiPixelRecHitFromSoAAlpakaPhase2', pixelRecHitSrc = cms.InputTag('hltPhase2SiPixelRecHitsSoA'), src = cms.InputTag('hltSiPixelClusters'), -)) +) diff --git a/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTBeamSpotSequence_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTBeamSpotSequence_cfi.py index 7375eef09abee..64ab8e9d64354 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTBeamSpotSequence_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTBeamSpotSequence_cfi.py @@ -1,13 +1,9 @@ import FWCore.ParameterSet.Config as cms from ..modules.hltOnlineBeamSpot_cfi import * - -HLTBeamSpotSequence = cms.Sequence(hltOnlineBeamSpot) - -from Configuration.ProcessModifiers.alpaka_cff import alpaka from ..modules.hltPhase2OnlineBeamSpotDevice_cfi import hltPhase2OnlineBeamSpotDevice -_HLTBeamSpotSequence = cms.Sequence( + +HLTBeamSpotSequence = cms.Sequence( hltOnlineBeamSpot +hltPhase2OnlineBeamSpotDevice ) -alpaka.toReplaceWith(HLTBeamSpotSequence, _HLTBeamSpotSequence) diff --git a/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTDoLocalPixelSequence_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTDoLocalPixelSequence_cfi.py index 3c146cda8e880..4858df733ff5a 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTDoLocalPixelSequence_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTDoLocalPixelSequence_cfi.py @@ -2,19 +2,14 @@ from ..modules.hltSiPixelClusters_cfi import * from ..modules.hltSiPixelRecHits_cfi import * - -HLTDoLocalPixelSequence = cms.Sequence(hltSiPixelClusters+hltSiPixelRecHits) - from ..modules.hltPhase2SiPixelClustersSoA_cfi import hltPhase2SiPixelClustersSoA from ..modules.hltPhase2SiPixelRecHitsSoA_cfi import hltPhase2SiPixelRecHitsSoA from ..modules.hltSiPixelClusterShapeCache_cfi import hltSiPixelClusterShapeCache -_HLTDoLocalPixelSequence = cms.Sequence( + +HLTDoLocalPixelSequence = cms.Sequence( hltPhase2SiPixelClustersSoA +hltSiPixelClusters +hltSiPixelClusterShapeCache # should we disable this? Still needed by tracker muons +hltPhase2SiPixelRecHitsSoA +hltSiPixelRecHits ) - -from Configuration.ProcessModifiers.alpaka_cff import alpaka -alpaka.toReplaceWith(HLTDoLocalPixelSequence, _HLTDoLocalPixelSequence) diff --git a/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTInitialStepSequence_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTInitialStepSequence_cfi.py index aa899f2527736..f08b245561e9a 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTInitialStepSequence_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTInitialStepSequence_cfi.py @@ -6,7 +6,11 @@ from ..modules.hltInitialStepTracks_cfi import * from ..modules.hltInitialStepTrackSelectionHighPurity_cfi import * -HLTInitialStepSequence = cms.Sequence(hltInitialStepSeeds+hltInitialStepTrackCandidates+hltInitialStepTracks+hltInitialStepTrackCutClassifier+hltInitialStepTrackSelectionHighPurity) +HLTInitialStepSequence = cms.Sequence(hltInitialStepSeeds+ + hltInitialStepTrackCandidates+ + hltInitialStepTracks+ + hltInitialStepTrackCutClassifier+ + hltInitialStepTrackSelectionHighPurity) from ..modules.hltInitialStepSeedTracksLST_cfi import * from ..sequences.HLTHighPtTripletStepSeedingSequence_cfi import * @@ -62,3 +66,16 @@ ) (singleIterPatatrack & trackingLST & seedingLST).toReplaceWith(HLTInitialStepSequence, _HLTInitialStepSequenceSingleIterPatatrackLSTSeeding) + +_HLTInitialStepSequenceNGTScouting = cms.Sequence( + hltInitialStepSeeds + +hltInitialStepSeedTracksLST + +hltSiPhase2RecHits + +hltInputLST + +hltLST + +hltInitialStepTrackCandidates + +hltInitialStepTracksT5TCLST +) + +from Configuration.ProcessModifiers.ngtScouting_cff import ngtScouting +ngtScouting.toReplaceWith(HLTInitialStepSequence,_HLTInitialStepSequenceNGTScouting) diff --git a/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTItLocalRecoSequence_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTItLocalRecoSequence_cfi.py index 6f204d4b9455b..6129c168cfc0d 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTItLocalRecoSequence_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTItLocalRecoSequence_cfi.py @@ -1,15 +1,6 @@ import FWCore.ParameterSet.Config as cms -from ..modules.hltSiPhase2Clusters_cfi import * -from ..modules.hltSiPixelClusters_cfi import * -from ..modules.hltSiPixelClusterShapeCache_cfi import * -from ..modules.hltSiPixelRecHits_cfi import * - -HLTItLocalRecoSequence = cms.Sequence(hltSiPhase2Clusters+hltSiPixelClusters+hltSiPixelClusterShapeCache+hltSiPixelRecHits) - from ..sequences.HLTDoLocalPixelSequence_cfi import * from ..sequences.HLTDoLocalStripSequence_cfi import * -_HLTItLocalRecoSequence = cms.Sequence(HLTDoLocalPixelSequence+HLTDoLocalStripSequence) -from Configuration.ProcessModifiers.alpaka_cff import alpaka -alpaka.toReplaceWith(HLTItLocalRecoSequence, _HLTItLocalRecoSequence) +HLTItLocalRecoSequence = cms.Sequence(HLTDoLocalPixelSequence+HLTDoLocalStripSequence) diff --git a/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTOtLocalRecoSequence_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTOtLocalRecoSequence_cfi.py index 74591b451f439..9199d30590c8d 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTOtLocalRecoSequence_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTOtLocalRecoSequence_cfi.py @@ -1,5 +1,13 @@ import FWCore.ParameterSet.Config as cms from ..modules.hltMeasurementTrackerEvent_cfi import * +from ..modules.hltSiPhase2RecHits_cfi import * HLTOtLocalRecoSequence = cms.Sequence(hltMeasurementTrackerEvent) + +_HLTOtLocalRecoSequenceWithHits = cms.Sequence(hltMeasurementTrackerEvent + +hltSiPhase2RecHits + ) + +from Configuration.ProcessModifiers.phase2CAExtension_cff import phase2CAExtension +phase2CAExtension.toReplaceWith(HLTOtLocalRecoSequence, _HLTOtLocalRecoSequenceWithHits) diff --git a/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTPhase2PixelTracksAndVerticesSequence_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTPhase2PixelTracksAndVerticesSequence_cfi.py new file mode 100644 index 0000000000000..44c95bf0eb7ca --- /dev/null +++ b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTPhase2PixelTracksAndVerticesSequence_cfi.py @@ -0,0 +1,76 @@ +import FWCore.ParameterSet.Config as cms + +from ..modules.hltPhase2PixelFitterByHelixProjections_cfi import hltPhase2PixelFitterByHelixProjections +from ..modules.hltPhase2PixelTrackFilterByKinematics_cfi import hltPhase2PixelTrackFilterByKinematics +from ..modules.hltPhase2PixelTracks_cfi import hltPhase2PixelTracks +from ..modules.hltPhase2PixelTracksSoA_cfi import hltPhase2PixelTracksSoA +from ..modules.hltPhase2PixelTracksAndHighPtStepTrackingRegions_cfi import hltPhase2PixelTracksAndHighPtStepTrackingRegions +from ..modules.hltPhase2PixelTracksHitDoublets_cfi import hltPhase2PixelTracksHitDoublets +from ..modules.hltPhase2PixelTracksHitSeeds_cfi import hltPhase2PixelTracksHitSeeds +from ..modules.hltPhase2PixelTracksSeedLayers_cfi import hltPhase2PixelTracksSeedLayers +from ..modules.hltPhase2PixelVertices_cfi import * +from ..sequences.HLTPhase2PixelVertexingSequence_cfi import HLTPhase2PixelVertexingSequence +from ..sequences.HLTBeamSpotSequence_cfi import HLTBeamSpotSequence + +HLTPhase2PixelTracksAndVerticesSequence = cms.Sequence( + HLTBeamSpotSequence + +hltPhase2PixelTracksAndHighPtStepTrackingRegions # needed by highPtTripletStep iteration + +hltPhase2PixelFitterByHelixProjections # needed by tracker muons + +hltPhase2PixelTrackFilterByKinematics # needed by tracker muons + +hltPhase2PixelTracksSoA + +hltPhase2PixelTracks + +HLTPhase2PixelVertexingSequence +) + +from ..modules.hltPhase2TrimmedPixelVertices_cfi import hltPhase2TrimmedPixelVertices +_HLTPhase2PixelTracksAndVerticesSequenceTrimming = cms.Sequence( + HLTBeamSpotSequence + + hltPhase2PixelTracksAndHighPtStepTrackingRegions + + hltPhase2PixelFitterByHelixProjections + + hltPhase2PixelTrackFilterByKinematics + + hltPhase2PixelTracksSoA + + hltPhase2PixelTracks + + hltPhase2PixelVertices + + hltPhase2TrimmedPixelVertices +) + +from Configuration.ProcessModifiers.phase2_hlt_vertexTrimming_cff import phase2_hlt_vertexTrimming +phase2_hlt_vertexTrimming.toReplaceWith( + HLTPhase2PixelTracksAndVerticesSequence, + _HLTPhase2PixelTracksAndVerticesSequenceTrimming +) + +from ..modules.hltPhase2PixelRecHitsExtendedSoA_cfi import hltPhase2PixelRecHitsExtendedSoA +from ..modules.hltPhase2OtRecHitsSoA_cfi import hltPhase2OtRecHitsSoA +from ..modules.hltPhase2PixelTracksCAExtension_cfi import hltPhase2PixelTracksCAExtension +from ..modules.hltPhase2PixelTracksCutClassifier_cfi import hltPhase2PixelTracksCutClassifier +_HLTPhase2PixelTracksAndVerticesSequenceCAExtension = cms.Sequence( + HLTBeamSpotSequence + +hltPhase2PixelTracksAndHighPtStepTrackingRegions # needed by highPtTripletStep iteration + +hltPhase2PixelFitterByHelixProjections # needed by tracker muons + +hltPhase2PixelTrackFilterByKinematics # needed by tracker muons + +hltPhase2OtRecHitsSoA + +hltPhase2PixelRecHitsExtendedSoA + +hltPhase2PixelTracksSoA + +hltPhase2PixelTracksCAExtension + +HLTPhase2PixelVertexingSequence + +hltPhase2PixelTracksCutClassifier + +hltPhase2PixelTracks +) + +from Configuration.ProcessModifiers.phase2CAExtension_cff import phase2CAExtension +phase2CAExtension.toReplaceWith(HLTPhase2PixelTracksAndVerticesSequence, _HLTPhase2PixelTracksAndVerticesSequenceCAExtension) + +from Configuration.ProcessModifiers.phase2LegacyPixelTracks_cff import phase2LegacyPixelTracks +_HLTPhase2PixelTracksAndVerticesSequenceLegacy = cms.Sequence( + hltPhase2PixelTracksSeedLayers + +hltPhase2PixelTracksAndHighPtStepTrackingRegions + +hltPhase2PixelTracksHitDoublets + +hltPhase2PixelTracksHitSeeds + +hltPhase2PixelFitterByHelixProjections + +hltPhase2PixelTrackFilterByKinematics + +hltPhase2PixelTracks + +HLTPhase2PixelVertexingSequence +) +phase2LegacyPixelTracks.toReplaceWith(HLTPhase2PixelTracksAndVerticesSequence, _HLTPhase2PixelTracksAndVerticesSequenceLegacy) + diff --git a/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTPhase2PixelTracksSequence_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTPhase2PixelTracksSequence_cfi.py deleted file mode 100644 index 9277f2dadeace..0000000000000 --- a/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTPhase2PixelTracksSequence_cfi.py +++ /dev/null @@ -1,23 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -from ..modules.hltPhase2PixelFitterByHelixProjections_cfi import * -from ..modules.hltPhase2PixelTrackFilterByKinematics_cfi import * -from ..modules.hltPhase2PixelTracks_cfi import * -from ..modules.hltPhase2PixelTracksAndHighPtStepTrackingRegions_cfi import * -from ..modules.hltPhase2PixelTracksHitDoublets_cfi import * -from ..modules.hltPhase2PixelTracksHitSeeds_cfi import * -from ..modules.hltPhase2PixelTracksSeedLayers_cfi import * - -HLTPhase2PixelTracksSequence = cms.Sequence(hltPhase2PixelTracksSeedLayers+hltPhase2PixelTracksAndHighPtStepTrackingRegions+hltPhase2PixelTracksHitDoublets+hltPhase2PixelTracksHitSeeds+hltPhase2PixelFitterByHelixProjections+hltPhase2PixelTrackFilterByKinematics+hltPhase2PixelTracks) -from ..sequences.HLTBeamSpotSequence_cfi import HLTBeamSpotSequence -from ..modules.hltPhase2PixelTracksSoA_cfi import hltPhase2PixelTracksSoA -_HLTPhase2PixelTracksSequence = cms.Sequence( - HLTBeamSpotSequence - +hltPhase2PixelTracksAndHighPtStepTrackingRegions # needed by highPtTripletStep iteration - +hltPhase2PixelFitterByHelixProjections # needed by tracker muons - +hltPhase2PixelTrackFilterByKinematics # needed by tracker muons - +hltPhase2PixelTracksSoA - +hltPhase2PixelTracks -) -from Configuration.ProcessModifiers.alpaka_cff import alpaka -alpaka.toReplaceWith(HLTPhase2PixelTracksSequence, _HLTPhase2PixelTracksSequence) diff --git a/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTPhase2PixelVertexingSequence_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTPhase2PixelVertexingSequence_cfi.py new file mode 100644 index 0000000000000..72eefd7e5b1a5 --- /dev/null +++ b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTPhase2PixelVertexingSequence_cfi.py @@ -0,0 +1,7 @@ +import FWCore.ParameterSet.Config as cms + +from ..modules.hltPhase2PixelVertices_cfi import * + +HLTPhase2PixelVertexingSequence = cms.Sequence( + hltPhase2PixelVertices +) diff --git a/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTTrackingSequence_cfi.py b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTTrackingSequence_cfi.py index 2ec0a50dd4089..5e98649b79e13 100644 --- a/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTTrackingSequence_cfi.py +++ b/HLTrigger/Configuration/python/HLT_75e33/sequences/HLTTrackingSequence_cfi.py @@ -1,11 +1,9 @@ import FWCore.ParameterSet.Config as cms from ..modules.hltGeneralTracks_cfi import * -from ..modules.hltPhase2PixelVertices_cfi import * -from ..modules.hltPhase2TrimmedPixelVertices_cfi import * from ..modules.hltTrackerClusterCheck_cfi import * from ..sequences.HLTHighPtTripletStepSequence_cfi import * -from ..sequences.HLTPhase2PixelTracksSequence_cfi import * +from ..sequences.HLTPhase2PixelTracksAndVerticesSequence_cfi import * from ..sequences.HLTInitialStepSequence_cfi import * from ..sequences.HLTItLocalRecoSequence_cfi import * from ..sequences.HLTOtLocalRecoSequence_cfi import * @@ -13,8 +11,7 @@ HLTTrackingSequence = cms.Sequence(HLTItLocalRecoSequence+ HLTOtLocalRecoSequence+ hltTrackerClusterCheck+ - HLTPhase2PixelTracksSequence+ - hltPhase2PixelVertices+ + HLTPhase2PixelTracksAndVerticesSequence+ HLTInitialStepSequence+ HLTHighPtTripletStepSequence+ hltGeneralTracks) @@ -22,7 +19,7 @@ from Configuration.ProcessModifiers.singleIterPatatrack_cff import singleIterPatatrack singleIterPatatrack.toReplaceWith(HLTTrackingSequence, HLTTrackingSequence.copyAndExclude([HLTHighPtTripletStepSequence])) -from Configuration.ProcessModifiers.phase2_hlt_vertexTrimming_cff import phase2_hlt_vertexTrimming -_HLTTrackingSequenceTrimming = HLTTrackingSequence.copy() -_HLTTrackingSequenceTrimming.insert(_HLTTrackingSequenceTrimming.index(hltPhase2PixelVertices)+1, hltPhase2TrimmedPixelVertices) -phase2_hlt_vertexTrimming.toReplaceWith(HLTTrackingSequence, _HLTTrackingSequenceTrimming) +from Configuration.ProcessModifiers.ngtScouting_cff import ngtScouting +from Configuration.ProcessModifiers.trackingLST_cff import trackingLST +(ngtScouting & trackingLST).toReplaceWith(HLTTrackingSequence, HLTTrackingSequence.copyAndExclude([HLTHighPtTripletStepSequence])) +(ngtScouting & ~trackingLST).toReplaceWith(HLTTrackingSequence, HLTTrackingSequence.copyAndExclude([HLTInitialStepSequence,HLTHighPtTripletStepSequence])) diff --git a/HLTrigger/Configuration/python/HLT_75e33_cff.py b/HLTrigger/Configuration/python/HLT_75e33_cff.py index 2e1089dba5212..08d279c6a2222 100644 --- a/HLTrigger/Configuration/python/HLT_75e33_cff.py +++ b/HLTrigger/Configuration/python/HLT_75e33_cff.py @@ -82,6 +82,7 @@ fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltPhase2L3MuonInitialStepChi2Est_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltPhase2L3MuonPixelTrackCleanerBySharedHits_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltPhase2L3MuonTrackAlgoPriorityOrder_cfi") +fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPPixelCPEFastParams_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltPixelTracksCleanerBySharedHits_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPTTRHBuilderWithTrackAngle_cfi") @@ -291,7 +292,8 @@ fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2L3FromL1TkSequence_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2L3MuonsSequence_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2L3OISequence_cfi") -fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2PixelTracksSequence_cfi") +fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2PixelVertexingSequence_cfi") +fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2PixelTracksAndVerticesSequence_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhoton108EBTightIDTightIsoL1SeededSequence_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhoton108EBTightIDTightIsoUnseededSequence_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhoton187L1SeededSequence_cfi") diff --git a/HLTrigger/Configuration/python/HLT_75e33_timing_cff.py b/HLTrigger/Configuration/python/HLT_75e33_timing_cff.py index bb75f637219af..df8ea7d06307a 100644 --- a/HLTrigger/Configuration/python/HLT_75e33_timing_cff.py +++ b/HLTrigger/Configuration/python/HLT_75e33_timing_cff.py @@ -87,6 +87,7 @@ fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltPhase2L3MuonInitialStepChi2Est_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltPhase2L3MuonPixelTrackCleanerBySharedHits_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltPhase2L3MuonTrackAlgoPriorityOrder_cfi") +fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPPixelCPEFastParams_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltPixelTracksCleanerBySharedHits_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPTTRHBuilderWithTrackAngle_cfi") @@ -282,7 +283,8 @@ fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2L3FromL1TkSequence_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2L3MuonsSequence_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2L3OISequence_cfi") -fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2PixelTracksSequence_cfi") +fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2PixelVertexingSequence_cfi") +fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2PixelTracksAndVerticesSequence_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhoton108EBTightIDTightIsoL1SeededSequence_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhoton108EBTightIDTightIsoUnseededSequence_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhoton187L1SeededSequence_cfi") diff --git a/HLTrigger/Configuration/python/HLT_NGTScouting_cff.py b/HLTrigger/Configuration/python/HLT_NGTScouting_cff.py index 98631d74b76ac..b3dd351bd8baf 100644 --- a/HLTrigger/Configuration/python/HLT_NGTScouting_cff.py +++ b/HLTrigger/Configuration/python/HLT_NGTScouting_cff.py @@ -86,6 +86,7 @@ fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltPhase2L3MuonInitialStepChi2Est_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltPhase2L3MuonPixelTrackCleanerBySharedHits_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltPhase2L3MuonTrackAlgoPriorityOrder_cfi") +fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPPixelCPEFastParams_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltPixelTracksCleanerBySharedHits_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPTTRHBuilderWithTrackAngle_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/eventsetup/hltESPKFFittingSmootherForL2Muon_cfi") @@ -258,7 +259,8 @@ fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2L3FromL1TkSequence_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2L3MuonsSequence_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2L3OISequence_cfi") -fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2PixelTracksSequence_cfi") +fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2PixelVertexingSequence_cfi") +fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhase2PixelTracksAndVerticesSequence_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhoton108EBTightIDTightIsoL1SeededSequence_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhoton108EBTightIDTightIsoUnseededSequence_cfi") fragment.load("HLTrigger/Configuration/HLT_75e33/sequences/HLTPhoton187L1SeededSequence_cfi") diff --git a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py index d4edf7a10aecf..7047f5a8e8de0 100644 --- a/HLTrigger/Configuration/python/customizeHLTforCMSSW.py +++ b/HLTrigger/Configuration/python/customizeHLTforCMSSW.py @@ -46,6 +46,137 @@ def customizeHLTFor49147(process): setattr(prod, 'geometry', g) return process +def customizeHLTfor48921(process): + """ This customizer + - renames some of the geometry parameters used to fill the CAGeometry: + - minZ -> minInner + - maxZ -> maxInner + - maxR -> maxDR + - for pp and HIN hlt setups. + """ + + ca_producers_pp = ['CAHitNtupletAlpakaPhase1@alpaka','alpaka_serial_sync::CAHitNtupletAlpakaPhase1'] + ca_producers_hi = ['CAHitNtupletAlpakaHIonPhase1@alpaka','alpaka_serial_sync::CAHitNtupletAlpakaHIonPhase1'] + ca_producers = ca_producers_pp + ca_producers_hi + + for ca_producer in ca_producers: + for prod in producers_by_type(process, ca_producer): + + # cell pt cut + if hasattr(prod, 'cellPtCut'): + cellPtCut = getattr(prod, 'cellPtCut').value() + delattr(prod, 'cellPtCut') + else: + cellPtCut = 0.85 + + isPP = (ca_producer in ca_producers_pp) + + # geometry + if hasattr(prod, 'geometry'): + geometry = getattr(prod, "geometry") + else: + geometry = cms.PSet() + + # pair graph of layer pairs + if not hasattr(geometry, "pairGraph"): + setattr(geometry, "pairGraph", cms.vuint32( + 0, 1, 0, 4, 0, + 7, 1, 2, 1, 4, + 1, 7, 4, 5, 7, + 8, 2, 3, 2, 4, + 2, 7, 5, 6, 8, + 9, 0, 2, 1, 3, + 0, 5, 0, 8, + 4, 6, 7, 9)) + + nPairs = int(len(geometry.pairGraph) / 2) + + # dca cut for connections + if not hasattr(geometry, "caDCACuts"): + if isPP: + setattr(geometry, "caDCACuts", cms.vdouble([0.0918113099491] + [0.420724617835] * 9)) + else: + setattr(geometry, "caDCACuts", cms.vdouble(0.05, 0.1, 0.1, 0.1, 0.1, + 0.1, 0.1, 0.1, 0.1, 0.1)) + + nLayers = len(geometry.caDCACuts) + + # theta cut for connections + if not hasattr(geometry, "caThetaCuts"): + if isPP: + setattr(geometry, "caThetaCuts", cms.vdouble([0.00123302705499] * 4 + [0.00355691321774] * 6)) + else: + setattr(geometry, "caThetaCuts", cms.vdouble(0.001, 0.001, 0.001, 0.001, 0.002, + 0.002, 0.002, 0.002, 0.002, 0.002)) + + if not hasattr(geometry, "startingPairs"): + if isPP: + setattr(geometry, "startingPairs", cms.vuint32( [i for i in range(8)] + [i for i in range(13,19)])) + else: + setattr(geometry, "startingPairs", cms.vuint32(0,1,2)) + + # delta phi cuts + if not hasattr(geometry, "phiCuts"): + if isPP: + setattr(geometry, "phiCuts", cms.vint32( + 965, 1241, 395, 698, 1058, + 1211, 348, 782, 1016, 810, + 463, 755, 694, 531, 770, + 471, 592, 750, 348)) + else: + setattr(geometry, "phiCuts", cms.vint32( + 522, 730, 730, 522, 626, 626, 522, 522, 626, 626, 626, 522, 522, 522, 522, 522, 522, 522, 522)) + + # minInner + if hasattr(geometry, "minZ"): + minZ = getattr(geometry, "minZ") + delattr(geometry, "minZ") + else: + minZ = cms.vdouble(-20, 0, -30, -22, 10, -30, -70, -70, -22, 15, -30, -70, -70, -20, -22, 0, -30, -70, -70) + if not hasattr(geometry, "minInner"): + setattr(geometry, "minInner", minZ) + + # maxInner + if hasattr(geometry, "maxZ"): + maxZ = getattr(geometry, "maxZ") + delattr(geometry, "maxZ") + else: + maxZ = cms.vdouble(20, 30, 0, 22, 30, -10, 70, 70, 22, 30, -15, 70, 70, 20, 22, 30, 0, 70, 70) + if not hasattr(geometry, "maxInner"): + setattr(geometry, "maxInner", maxZ) + + # minOuter + if not hasattr(geometry, "minOuter"): + setattr(geometry, "minOuter", cms.vdouble([-10000] * nPairs)) + + # maxOuter + if not hasattr(geometry, "maxOuter"): + setattr(geometry, "maxOuter", cms.vdouble([ 10000] * nPairs)) + + # maxDR + if hasattr(geometry, "maxR"): + maxR = getattr(geometry, "maxR") + delattr(geometry, "maxR") + else: + maxR = cms.vdouble(20, 9, 9, 20, 7, 7, 5, 5, 20, 6, 6, 5, 5, 20, 20, 9, 9, 9, 9) + if not hasattr(geometry, "maxDR"): + setattr(geometry, "maxDR", maxR) + + # minDZ + if not hasattr(geometry, "minDZ"): + setattr(geometry, "minDZ", cms.vdouble([-10000] * nPairs)) + + if not hasattr(geometry, "maxDZ"): + setattr(geometry, "maxDZ", cms.vdouble([ 10000] * nPairs)) + + if not hasattr(geometry, "ptCuts"): + setattr(geometry, "ptCuts", cms.vdouble([ cellPtCut] * nPairs)) + + # set the full geometry + setattr(prod, 'geometry', geometry) + + return process + # CMSSW version specific customizations def customizeHLTforCMSSW(process, menuType="GRun"): @@ -53,6 +184,7 @@ def customizeHLTforCMSSW(process, menuType="GRun"): process = customizeHLTFor49147(process) # add call to action function in proper order: newest last! # process = customiseFor12718(process) - - return process + process = customizeHLTfor48921(process) + + return process diff --git a/RecoLocalTracker/Phase2TrackerRecHits/plugins/BuildFile.xml b/RecoLocalTracker/Phase2TrackerRecHits/plugins/BuildFile.xml index 5ec8e56667ecf..5addf06f89d9b 100644 --- a/RecoLocalTracker/Phase2TrackerRecHits/plugins/BuildFile.xml +++ b/RecoLocalTracker/Phase2TrackerRecHits/plugins/BuildFile.xml @@ -6,3 +6,14 @@ + + + + + + + + + + + diff --git a/RecoLocalTracker/Phase2TrackerRecHits/plugins/alpaka/Phase2OTRecHitsSoAConverter.cc b/RecoLocalTracker/Phase2TrackerRecHits/plugins/alpaka/Phase2OTRecHitsSoAConverter.cc new file mode 100644 index 0000000000000..daef627eef43e --- /dev/null +++ b/RecoLocalTracker/Phase2TrackerRecHits/plugins/alpaka/Phase2OTRecHitsSoAConverter.cc @@ -0,0 +1,267 @@ +#include "DataFormats/BeamSpot/interface/BeamSpot.h" +#include "DataFormats/Common/interface/DetSetVectorNew.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/GeometryVector/interface/GlobalPoint.h" +#include "DataFormats/Math/interface/approx_atan2.h" +#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "DataFormats/TrackerRecHit2D/interface/Phase2TrackerRecHit1D.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" +#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "HeterogeneousCore/AlpakaCore/interface/alpaka/Event.h" +#include "HeterogeneousCore/AlpakaInterface/interface/config.h" +#include "HeterogeneousCore/AlpakaCore/interface/alpaka/stream/EDProducer.h" +#include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" + +#include +#include + +//#define HITS_DEBUG + +namespace ALPAKA_ACCELERATOR_NAMESPACE { + + class Phase2OTRecHitsSoAConverter : public stream::EDProducer<> { + using Hits = ::reco::TrackingRecHitHost; + using HMSstorage = typename std::vector; + + public: + explicit Phase2OTRecHitsSoAConverter(const edm::ParameterSet& iConfig); + ~Phase2OTRecHitsSoAConverter() override = default; + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + + void beginRun(edm::Run const& run, edm::EventSetup const& setup) override; + + private: + void produce(device::Event& iEvent, const device::EventSetup& es) override; + + const edm::ESGetToken geomToken_; + const edm::ESGetToken geomTokenRun_; + const edm::EDGetTokenT recHitToken_; + const edm::EDGetTokenT<::reco::BeamSpot> beamSpotToken_; + const edm::EDGetTokenT pixelHitsSoA_; + + const edm::EDPutTokenT stripSoA_; + const edm::EDPutTokenT hitModuleStart_; + + int modulesInPixel_; + std::unordered_map detIdIsP_; + std::vector orderedModules_; + std::unordered_map moduleIndexToOffset_; + std::map detIdToIndex_; + }; + + Phase2OTRecHitsSoAConverter::Phase2OTRecHitsSoAConverter(const edm::ParameterSet& iConfig) + : stream::EDProducer<>(iConfig), + geomToken_(esConsumes()), + geomTokenRun_(esConsumes()), + recHitToken_{consumes(iConfig.getParameter("otRecHitSource"))}, + beamSpotToken_(consumes<::reco::BeamSpot>(iConfig.getParameter("beamSpot"))), + pixelHitsSoA_{consumes(iConfig.getParameter("pixelRecHitSoASource"))}, + stripSoA_{produces()}, + hitModuleStart_{produces()}, + modulesInPixel_(0) {} + + void Phase2OTRecHitsSoAConverter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + + desc.add("pixelRecHitSoASource", edm::InputTag("hltPhase2SiPixelRecHitsSoA")); + desc.add("otRecHitSource", edm::InputTag("hltSiPhase2RecHits")); + desc.add("beamSpot", edm::InputTag("hltOnlineBeamSpot")); + + descriptions.addWithDefaultLabel(desc); + } + + void Phase2OTRecHitsSoAConverter::beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { + detIdIsP_.clear(); + orderedModules_.clear(); + moduleIndexToOffset_.clear(); + detIdToIndex_.clear(); + modulesInPixel_ = 0; + + const auto& trackerGeometry = &iSetup.getData(geomTokenRun_); + auto isPinPSinOTBarrel = [&](DetId detId) { + LogDebug("Phase2OTRecHitsSoAConverter") + << (int)trackerGeometry->getDetectorType(detId) << " " + << (trackerGeometry->getDetectorType(detId) == TrackerGeometry::ModuleType::Ph2PSP) << '\n' + << (int)detId.subdetId() << " " << (detId.subdetId() == StripSubdetector::TOB) << '\n'; + // Select only P-hits from the OT barrel + return (trackerGeometry->getDetectorType(detId) == TrackerGeometry::ModuleType::Ph2PSP && + detId.subdetId() == StripSubdetector::TOB); + }; + auto isPh2Pixel = [&](DetId detId) { + auto subId = detId.subdetId(); + return (subId == PixelSubdetector::PixelBarrel || subId == PixelSubdetector::PixelEndcap); + }; + + const auto& detUnits = trackerGeometry->detUnits(); + + for (auto& detUnit : detUnits) { + DetId detId(detUnit->geographicalId()); + detIdIsP_[detId.rawId()] = isPinPSinOTBarrel(detId); + if (isPh2Pixel(detId)) + modulesInPixel_++; + if (detIdIsP_[detId.rawId()]) { + detIdToIndex_[detUnit->geographicalId()] = detUnit->index(); + moduleIndexToOffset_[detUnit->index()] = orderedModules_.size(); + orderedModules_.push_back(detUnit->index()); + LogDebug("Phase2OTRecHitsSoAConverter") << "Inserted " << detUnit->index() << " " << orderedModules_.size() + << " on layer " << int((detId.rawId() >> 20) & 0xF) << '\n'; + } + } + } + + void Phase2OTRecHitsSoAConverter::produce(device::Event& iEvent, device::EventSetup const& iSetup) { + auto queue = iEvent.queue(); + auto& bs = iEvent.get(beamSpotToken_); + const auto& trackerGeometry = &iSetup.getData(geomToken_); + const auto& stripHits = iEvent.get(recHitToken_); + + const auto& pixelHitsSoA = iEvent.get(pixelHitsSoA_); + int nPixelHits = pixelHitsSoA.view().metadata().size(); + + // Count strip hits and active strip modules + const int nStripHits = stripHits.data().size(); + const int activeStripModules = stripHits.size(); + + // Count the number of P hits in the OT to dimension the SoA + int PHitsInOTBarrel = 0; + for (const auto& detSet : stripHits) { + for (const auto& recHit : detSet) { + DetId detId(recHit.geographicalId()); + if (detIdIsP_[detId.rawId()]) + PHitsInOTBarrel++; + } + } + LogDebug("Phase2OTRecHitsSoAConverter") + << "Tot number of modules in Pixels " << modulesInPixel_ << '\n' + << "Tot number of p_modulesInPSInOTBarrel: " << orderedModules_.size() << '\n' + << "Number of strip (active) modules: " << activeStripModules << '\n' + << "Number of strip hits: " << nStripHits << '\n' + << "Total hits of PinOTBarrel: " << PHitsInOTBarrel << '\n'; + + Hits stripHitsSoA(queue, PHitsInOTBarrel, orderedModules_.size()); + auto& stripHitsModuleView = stripHitsSoA.view<::reco::HitModuleSoA>(); + + std::vector counterOfHitsPerModule(orderedModules_.size(), 0); + assert(!orderedModules_.empty()); + for (const auto& detSet : stripHits) { + auto firstHit = detSet.begin(); + auto detId = firstHit->rawId(); + auto index = detIdToIndex_[detId]; + int offset = 0; + if (detIdIsP_[detId]) { + offset = moduleIndexToOffset_[index]; + counterOfHitsPerModule[offset] = detSet.size(); + } + } +#ifdef HITS_DEBUG + int modId = 0; + for (auto c : counterOfHitsPerModule) { + std::cout << "On module " << modId << " we have " << c << " hits." << std::endl; + modId++; + } +#endif + + std::vector cumulativeHitPerModule(counterOfHitsPerModule.size()); + std::partial_sum(counterOfHitsPerModule.begin(), counterOfHitsPerModule.end(), cumulativeHitPerModule.begin()); + stripHitsModuleView[0].moduleStart() = nPixelHits; + LogDebug("Phase2OTRecHitsSoAConverter") + << "Module start: 0 with hits: " << stripHitsModuleView[0].moduleStart() << '\n'; + for (size_t i = 1; i < cumulativeHitPerModule.size(); ++i) { + stripHitsModuleView[i].moduleStart() = cumulativeHitPerModule[i - 1] + nPixelHits; + LogDebug("Phase2OTRecHitsSoAConverter") + << "Module start: " << i << " with hits: " << stripHitsModuleView[i].moduleStart() << '\n'; + } + + for (const auto& detSet : stripHits) { + auto firstHit = detSet.begin(); + auto detId = firstHit->rawId(); + auto det = trackerGeometry->idToDet(detId); + auto index = detIdToIndex_[detId]; + int offset = 0; + if (detIdIsP_[detId]) { + offset = moduleIndexToOffset_[index]; + // Start with 0 with no offset, then shifted contents from counterOfHitsPerModule + int moduleHitIndex = (offset == 0 ? 0 : cumulativeHitPerModule[offset - 1]); + for (const auto& recHit : detSet) { + // Select only P-hits from the OT barrel + if (detIdIsP_[detId]) { + int idx = moduleHitIndex++; + assert(idx < PHitsInOTBarrel); + auto hit = stripHitsSoA.view()[idx]; + hit.xLocal() = recHit.localPosition().x(); + hit.yLocal() = recHit.localPosition().y(); + hit.xerrLocal() = recHit.localPositionError().xx(); + hit.yerrLocal() = recHit.localPositionError().yy(); + auto globalPosition = det->toGlobal(recHit.localPosition()); + double gx = globalPosition.x() - bs.x0(); + double gy = globalPosition.y() - bs.y0(); + double gz = globalPosition.z() - bs.z0(); + hit.xGlobal() = gx; + hit.yGlobal() = gy; + hit.zGlobal() = gz; + hit.rGlobal() = sqrt(gx * gx + gy * gy); + hit.iphi() = unsafe_atan2s<7>(gy, gx); + hit.chargeAndStatus().charge = 0; + hit.chargeAndStatus().status = {false, false, false, false, 0}; + hit.clusterSizeX() = -1; + hit.clusterSizeY() = -1; + hit.detectorIndex() = modulesInPixel_ + offset; + LogDebug("Phase2OTRecHitsSoAConverter") + << "Local (x, y) with (xx, yy) --> (" << recHit.localPosition().x() << ", " + << recHit.localPosition().y() << ") with (" << recHit.localPositionError().xx() << ", " + << recHit.localPositionError().yy() << ")" << '\n' + << "Global (x, y, z) --> (" << globalPosition.x() << ", " << globalPosition.y() << ", " + << globalPosition.z() << ")" << '\n' + << "Corrected Global (x, y, z) --> (" << gx << ", " << gy << ", " << gz << ")" << '\n' + << gx << '\n'; + } + } + } + } + stripHitsModuleView[orderedModules_.size()].moduleStart() = + cumulativeHitPerModule[orderedModules_.size() - 1] + nPixelHits; + +#ifdef HITS_DEBUG + int current = 0; + for (int h = 0; h < stripHitsSoA.view().metadata().size(); ++h) { + auto idx = stripHitsSoA.view()[h].detectorIndex(); + std::cout << h << " detectorIndexInSoA: " << idx << std::endl; + assert(idx >= current); + current = idx; + } + for (int h = 0; h < stripHitsModuleView.metadata().size(); ++h) { + std::cout << h << " -> " << stripHitsModuleView[h].moduleStart() << std::endl; + } +#endif + + HMSstorage moduleStartVec(stripHitsModuleView.metadata().size()); + + // Put in the event the hit module start vector. + // Now, this could be avoided having the Host Hit SoA + // consumed by the downstream module (converters to legacy formats). + // But this is the common practice at the moment + // also for legacy data formats. + std::memcpy(moduleStartVec.data(), + stripHitsModuleView.moduleStart().data(), + sizeof(uint32_t) * stripHitsModuleView.metadata().size()); + iEvent.emplace(hitModuleStart_, std::move(moduleStartVec)); + + // Put the strip hits SoA (host) in the event + // The framework will take care of the host to device transfer + iEvent.emplace(stripSoA_, std::move(stripHitsSoA)); + } + +} // namespace ALPAKA_ACCELERATOR_NAMESPACE + +#include "HeterogeneousCore/AlpakaCore/interface/alpaka/MakerMacros.h" +DEFINE_FWK_ALPAKA_MODULE(Phase2OTRecHitsSoAConverter); diff --git a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/SiPixelRecHitExtendedAlpaka.cc b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/SiPixelRecHitExtendedAlpaka.cc new file mode 100644 index 0000000000000..332fa09e4b894 --- /dev/null +++ b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/SiPixelRecHitExtendedAlpaka.cc @@ -0,0 +1,192 @@ +#include "DataFormats/BeamSpot/interface/BeamSpotPOD.h" +#include "DataFormats/BeamSpot/interface/alpaka/BeamSpotDevice.h" +#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h" +#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersSoACollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisDevice.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisSoACollection.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsDevice.h" +#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/Utilities/interface/InputTag.h" +#include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" +#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "HeterogeneousCore/AlpakaCore/interface/alpaka/Event.h" +#include "HeterogeneousCore/AlpakaCore/interface/alpaka/EventSetup.h" +#include "HeterogeneousCore/AlpakaCore/interface/alpaka/global/EDProducer.h" +#include "HeterogeneousCore/AlpakaInterface/interface/config.h" +#include "HeterogeneousCore/AlpakaInterface/interface/memory.h" +#include "RecoLocalTracker/Records/interface/PixelCPEFastParamsRecord.h" +#include "RecoLocalTracker/SiPixelRecHits/interface/PixelCPEBase.h" +#include "RecoLocalTracker/SiPixelRecHits/interface/alpaka/PixelCPEFastParamsCollection.h" +#include "RecoLocalTracker/SiPixelRecHits/interface/pixelCPEforDevice.h" + +//#define GPU_DEBUG + +namespace ALPAKA_ACCELERATOR_NAMESPACE { + + class SiPixelRecHitExtendedAlpaka : public global::EDProducer<> { + public: + explicit SiPixelRecHitExtendedAlpaka(const edm::ParameterSet& iConfig); + ~SiPixelRecHitExtendedAlpaka() override = default; + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + + private: + void produce(edm::StreamID streamID, device::Event& iEvent, const device::EventSetup& iSetup) const override; + + const device::EDGetToken pixelRecHitToken_; + const device::EDGetToken trackerRecHitToken_; + + const device::EDPutToken outputRecHitsSoAToken_; + }; + + SiPixelRecHitExtendedAlpaka::SiPixelRecHitExtendedAlpaka(const edm::ParameterSet& iConfig) + : EDProducer(iConfig), + pixelRecHitToken_(consumes(iConfig.getParameter("pixelRecHitsSoA"))), + trackerRecHitToken_(consumes(iConfig.getParameter("trackerRecHitsSoA"))), + outputRecHitsSoAToken_(produces()) {} + + void SiPixelRecHitExtendedAlpaka::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + + desc.add("pixelRecHitsSoA", edm::InputTag("siPixelRecHitsPreSplittingAlpaka")); + desc.add("trackerRecHitsSoA", edm::InputTag("phase2OTRecHitsSoAConverter")); + + descriptions.addWithDefaultLabel(desc); + } + + namespace { + // This utility unrolls the SoA columns (tuples) at compile time, calling the provided functor 'f' + // once for each element. The index is passed as a std::integral_constant so it + // is available at compile time. + template + void unrollColumns(F&& f, std::index_sequence) { + (f(std::integral_constant{}), ...); + } + // User-facing wrapper to deduce the size of the tuple and create the index sequence + // Usage: mergeSoAColumns([&](auto columnIndex) { ... }); + template + void mergeSoAColumns(F&& f) { + unrollColumns(std::forward(f), std::make_index_sequence{}); + } + } // namespace + + void SiPixelRecHitExtendedAlpaka::produce(edm::StreamID streamID, + device::Event& iEvent, + const device::EventSetup& es) const { + // get both Pixel and Tracker SoA collections + auto queue = iEvent.queue(); + const auto& pixColl = iEvent.get(pixelRecHitToken_); + const auto& trkColl = iEvent.get(trackerRecHitToken_); + + // pix and trk SoA collections have the same layout + // each of them is made up of two SoAs: + // - one that contains the hits + // - one to track the number of hits in each module (hitModuleSoA) + // this code merges and copy both of them into a new SoA collection + // taking into account that for the hits the copy is straightforward, + // while for the hitModuleSoA we need to copy nPixelModules + nTrackerModules + 1 elements + // to account for the last "hidden" element in the SoA which is used to store + // the cumulative sum of hits in all the previous modules (thus this SoA has 1 more + // element than the actual number of modules to track the hits in the last module + // and sum them to the others). + // See also DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsDevice.h + + const int nPixHits = pixColl.nHits(); + const int nTrkHits = trkColl.nHits(); + + const int nPixMod = pixColl.nModules(); + const int nTrkMod = trkColl.nModules(); + + // the output is also a SoA collection with the same layout as the input ones + auto output = reco::TrackingRecHitsSoACollection(queue, nPixHits + nTrkHits, nPixMod + nTrkMod); + +#ifdef GPU_DEBUG + std::cout << "----------------- Merging Pixel and Tracker RecHits -----------------\n" + << "Number of Pixel recHits: " << nPixHits << '\n' + << "Number of Tracker recHits: " << nTrkHits << '\n' + << "Total number of recHits: " << output.nHits() << '\n' + << "Number of Pixel modules: " << nPixMod << '\n' + << "Number of Tracker modules: " << nTrkMod << '\n' + << "Total number of modules: " << output.nModules() << '\n' + << "---------------------------------------------------------------------\n"; +#endif + + // start from the hits SoA, use metarecords to loop over all the columns + auto outView = output.view(); + auto pixView = pixColl.view(); + auto trkView = trkColl.view(); + + // layout type (same for all views) + using ViewType = decltype(outView); + using LayoutType = typename ViewType::Metadata::TypeOf_Layout; + + // build descriptors (tuple of spans: one span for each column) + auto outDesc = LayoutType::Descriptor(outView); + auto pixDesc = LayoutType::ConstDescriptor(pixView); + auto trkDesc = LayoutType::ConstDescriptor(trkView); + + // merge all columns using a compile-time loop + + // number of columns (same for all hits SoAs) + constexpr std::size_t N = std::tuple_size_v; + mergeSoAColumns([&](auto columnIndex) { + auto& outCol = std::get(outDesc.buff); + const auto& pixCol = std::get(pixDesc.buff); + const auto& trkCol = std::get(trkDesc.buff); + // distinguish between scalar and column types + if constexpr (std::get(outDesc.columnTypes) == cms::soa::SoAColumnType::scalar) { + // scalar type, copy the value directly + alpaka::memcpy(queue, + cms::alpakatools::make_device_view(queue, outCol.data(), 1), + cms::alpakatools::make_device_view(queue, pixCol.data(), 1)); +#ifdef GPU_DEBUG + alpaka::wait(queue); + std::cout << "Copied scalar with index " << columnIndex << '\n'; +#endif + } else { + // column type, copy the whole column + // copy Pixel hits + alpaka::memcpy(queue, + cms::alpakatools::make_device_view(queue, outCol.data(), nPixHits), + cms::alpakatools::make_device_view(queue, pixCol.data(), nPixHits)); + // copy Tracker hits (offset after Pixel hits) + alpaka::memcpy(queue, + cms::alpakatools::make_device_view(queue, outCol.data() + nPixHits, nTrkHits), + cms::alpakatools::make_device_view(queue, trkCol.data(), nTrkHits)); +#ifdef GPU_DEBUG + alpaka::wait(queue); + std::cout << "Copied column with index " << columnIndex << '\n'; +#endif + } + }); + // copy hitModuleStart for Pixel modules + alpaka::memcpy( + queue, + cms::alpakatools::make_device_view(queue, output.view<::reco::HitModuleSoA>().moduleStart().data(), nPixMod), + cms::alpakatools::make_device_view(queue, pixColl.view<::reco::HitModuleSoA>().moduleStart().data(), nPixMod)); + // copy hitModuleStart for Tracker modules (offset after Pixel modules) + // copy nTrkMod + 1 elements to include the last "hidden" element + alpaka::memcpy(queue, + cms::alpakatools::make_device_view( + queue, output.view<::reco::HitModuleSoA>().moduleStart().data() + nPixMod, nTrkMod + 1), + cms::alpakatools::make_device_view( + queue, trkColl.view<::reco::HitModuleSoA>().moduleStart().data(), nTrkMod + 1)); +#ifdef GPU_DEBUG + alpaka::wait(queue); + std::cout << "Copied hitModuleStart for Pixel and Tracker modules\n"; +#endif + + // update the information cached in the output collection with device information + output.updateFromDevice(queue); + + // emplace the merged SoA collection in the event + iEvent.emplace(outputRecHitsSoAToken_, std::move(output)); + } +} // namespace ALPAKA_ACCELERATOR_NAMESPACE + +#include "HeterogeneousCore/AlpakaCore/interface/alpaka/MakerMacros.h" +DEFINE_FWK_ALPAKA_MODULE(SiPixelRecHitExtendedAlpaka); diff --git a/RecoLocalTracker/SiPixelRecHits/python/SiPixelRecHits_cfi.py b/RecoLocalTracker/SiPixelRecHits/python/SiPixelRecHits_cfi.py index 5bdec4b10cb2d..de2d8bd7c1c6d 100644 --- a/RecoLocalTracker/SiPixelRecHits/python/SiPixelRecHits_cfi.py +++ b/RecoLocalTracker/SiPixelRecHits/python/SiPixelRecHits_cfi.py @@ -28,7 +28,6 @@ from RecoLocalTracker.SiPixelRecHits.siPixelRecHitAlpakaPhase2_cfi import siPixelRecHitAlpakaPhase2 as _siPixelRecHitAlpakaPhase2 from RecoLocalTracker.SiPixelRecHits.siPixelRecHitAlpakaHIonPhase1_cfi import siPixelRecHitAlpakaHIonPhase1 as _siPixelRecHitAlpakaHIonPhase1 - # Hit SoA producer on the device siPixelRecHitsPreSplittingAlpaka = _siPixelRecHitAlpakaPhase1.clone( src = "siPixelClustersPreSplittingAlpaka" @@ -40,10 +39,30 @@ src = "siPixelClustersPreSplittingAlpaka" )) +### Phase-2 CA OT extension +from Configuration.ProcessModifiers.phase2CAExtension_cff import phase2CAExtension + +from RecoLocalTracker.Phase2TrackerRecHits.Phase2TrackerRecHits_cfi import siPhase2RecHits + +from RecoLocalTracker.Phase2TrackerRecHits.phase2OTRecHitsSoAConverter_cfi import phase2OTRecHitsSoAConverter as _phase2OTRecHitsSoAConverter +phase2OTRecHitsSoAConverter = _phase2OTRecHitsSoAConverter.clone( + beamSpot = "offlineBeamSpot", + otRecHitSource = "siPhase2RecHits", + pixelRecHitSoASource = "siPixelRecHitsPreSplittingAlpaka" +) + +from RecoLocalTracker.SiPixelRecHits.siPixelRecHitExtendedAlpaka_cfi import siPixelRecHitExtendedAlpaka as _siPixelRecHitExtendedAlpaka +siPixelRecHitsExtendedPreSplittingAlpaka = _siPixelRecHitExtendedAlpaka.clone( + pixelRecHitsSoA = "siPixelRecHitsPreSplittingAlpaka", + trackerRecHitsSoA = "phase2OTRecHitsSoAConverter" +) + # Hit SoA producer on the cpu, for validation siPixelRecHitsPreSplittingAlpakaSerial = makeSerialClone(siPixelRecHitsPreSplittingAlpaka, - src = "siPixelClustersPreSplittingAlpakaSerial" -) + src = "siPixelClustersPreSplittingAlpakaSerial") + +siPixelRecHitsExtendedPreSplittingAlpakaSerial = makeSerialClone(siPixelRecHitsExtendedPreSplittingAlpaka, + pixelRecHitsSoA = "siPixelClustersPreSplittingAlpakaSerial") from RecoLocalTracker.SiPixelRecHits.siPixelRecHitFromSoAAlpaka_cfi import siPixelRecHitFromSoAAlpaka as _siPixelRecHitFromSoAAlpaka @@ -57,10 +76,20 @@ ) -alpaka.toReplaceWith(siPixelRecHitsPreSplittingTask, cms.Task( +(~phase2CAExtension & alpaka).toReplaceWith(siPixelRecHitsPreSplittingTask, cms.Task( # Reconstruct the pixel hits with alpaka on the device siPixelRecHitsPreSplittingAlpaka, # Reconstruct the pixel hits with alpaka on the cpu (if requested by the validation) siPixelRecHitsPreSplittingAlpakaSerial, # Convert hit soa on host to legacy formats siPixelRecHitsPreSplitting)) + +phase2CAExtension.toReplaceWith(siPixelRecHitsPreSplittingTask, cms.Task( + siPhase2RecHits, + siPixelRecHitsPreSplittingAlpaka, + siPixelRecHitsPreSplittingAlpakaSerial, + phase2OTRecHitsSoAConverter, + siPixelRecHitsExtendedPreSplittingAlpaka, + siPixelRecHitsExtendedPreSplittingAlpakaSerial, + siPixelRecHitsPreSplitting +)) diff --git a/RecoTracker/Configuration/python/customizePixelTracksForTriplets.py b/RecoTracker/Configuration/python/customizePixelTracksForTriplets.py index 01ff186c65dbe..694c7b4edbee6 100644 --- a/RecoTracker/Configuration/python/customizePixelTracksForTriplets.py +++ b/RecoTracker/Configuration/python/customizePixelTracksForTriplets.py @@ -27,23 +27,31 @@ def customizePixelTracksForTriplets(process): 9, 0, 2, 1, 3, 0, 5, 0, 8, 4, 6, 7, 9 ] + + nPairs = int(len(producer.geometry.pairGraph) / 2) producer.geometry.startingPairs = [i for i in range(8)] + [13, 14, 15, 16, 17, 18] + producer.geometry.phiCuts = [522, 730, 730, 522, 626, 626, 522, 522, 626, 626, 626, 522, 522, 522, 522, 522, 522, 522, 522] - producer.geometry.minZ = [-20., 0., -30., -22., 10., + producer.geometry.minInner = [-20., 0., -30., -22., 10., -30., -70., -70., -22., 15., -30, -70., -70., -20., -22., 0, -30., -70., -70.] - producer.geometry.maxZ = [20., 30., 0., 22., 30., + producer.geometry.maxInner = [20., 30., 0., 22., 30., -10., 70., 70., 22., 30., -15., 70., 70., 20., 22., 30., 0., 70., 70.] - producer.geometry.maxR = [20., 9., 9., 20., 7., + producer.geometry.maxDR = [20., 9., 9., 20., 7., 7., 5., 5., 20., 6., 6., 5., 5., 20., 20., 9., 9., 9., 9.] + producer.geometry.minDZ = [-10000] * nPairs + producer.geometry.maxDZ = [10000] * nPairs + producer.geometry.minOuter = [-10000] * nPairs + producer.geometry.maxOuter = [10000] * nPairs + producer.geometry.ptCuts = [0.5] * nPairs elif name == 'CAHitNtupletAlpakaPhase2@alpaka': diff --git a/RecoTracker/PixelSeeding/interface/CAGeometrySoA.h b/RecoTracker/PixelSeeding/interface/CAGeometrySoA.h index e86b0da1ac711..3067a8cd5bbce 100644 --- a/RecoTracker/PixelSeeding/interface/CAGeometrySoA.h +++ b/RecoTracker/PixelSeeding/interface/CAGeometrySoA.h @@ -32,15 +32,21 @@ namespace reco { GENERATE_SOA_LAYOUT(CALayersLayout, SOA_COLUMN(uint32_t, layerStarts), SOA_COLUMN(float, caThetaCut), - SOA_COLUMN(float, caDCACut)) + SOA_COLUMN(float, caDCACut), + SOA_COLUMN(bool, isBarrel)) GENERATE_SOA_LAYOUT(CAGraphLayout, SOA_COLUMN(GraphNode, graph), SOA_COLUMN(bool, startingPair), SOA_COLUMN(int16_t, phiCuts), - SOA_COLUMN(float, minz), - SOA_COLUMN(float, maxz), - SOA_COLUMN(float, maxr)) + SOA_COLUMN(float, minInner), + SOA_COLUMN(float, maxInner), + SOA_COLUMN(float, minOuter), + SOA_COLUMN(float, maxOuter), + SOA_COLUMN(float, maxDZ), + SOA_COLUMN(float, minDZ), + SOA_COLUMN(float, maxDR), + SOA_COLUMN(float, ptCuts)) using CALayersSoA = CALayersLayout<>; using CALayersSoAView = CALayersSoA::View; diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/BrokenLineFit.dev.cc b/RecoTracker/PixelSeeding/plugins/alpaka/BrokenLineFit.dev.cc index feb11ab3f2eba..be6fb70901afa 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/BrokenLineFit.dev.cc +++ b/RecoTracker/PixelSeeding/plugins/alpaka/BrokenLineFit.dev.cc @@ -135,9 +135,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { #endif #ifdef BL_DUMP_HITS - bool dump = foundNtuplets->size(tkid) == 5; + bool dump = foundNtuplets->size(tkid) >= 4; if (dump) { - printf("Track id %d %d Hit %d on %d\nGlobal: hits.col(%d) << %f,%f,%f\n", + printf("Track local_id %d tkid: %d Hit %d on det: %d\nGlobal: hits.col(%d) << x: %f,y: %f, r(%f),z: %f\n", local_idx, tkid, hit, @@ -145,7 +145,19 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { i, hh[hit].xGlobal(), hh[hit].yGlobal(), + sqrt(hh[hit].xGlobal() * hh[hit].xGlobal() + hh[hit].yGlobal() * hh[hit].yGlobal()), hh[hit].zGlobal()); + printf("Local Error(%d): x2: %e, x[um]: %e, y2: %e, y[um]: %e\n", + i, + hh[hit].xerrLocal(), + 1.e4 * sqrt(hh[hit].xerrLocal()), + hh[hit].yerrLocal(), + 1.e4 * sqrt(hh[hit].yerrLocal())); + printf("Error: hits_ge.col(%d) x[um]: %e, y[um]: %e, z[um]: %e\n", + i, + 1.e4 * sqrt(ge[0]), + 1.e4 * sqrt(ge[2]), + 1.e4 * sqrt(ge[5])); printf("Error: hits_ge.col(%d) << %e,%e,%e,%e,%e,%e\n", i, ge[0], ge[1], ge[2], ge[3], ge[4], ge[5]); } #endif @@ -154,6 +166,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { hits_ge.col(i) << ge[0], ge[1], ge[2], ge[3], ge[4], ge[5]; } brokenline::fastFit(acc, hits, fast_fit); +#if 0 + printf("Fast Fit: %f, %f, %f, %f\n", fast_fit(0), fast_fit(1), fast_fit(2), fast_fit(3)); +#endif #ifdef BROKENLINE_DEBUG // any NaN value should cause the track to be rejected at a later stage @@ -218,7 +233,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { #ifdef BROKENLINE_DEBUG if (!(circle.chi2 >= 0) || !(line.chi2 >= 0)) printf("kernelBLFit failed! %f/%f\n", circle.chi2, line.chi2); - printf("kernelBLFit size %d for %d hits circle.par(0,1,2): %d %f,%f,%f\n", + printf("kernelBLFit size %d for %d hits of tkid %d circle.par(0,1,2): %f,%f,%f\n", N, N, tkid, @@ -226,7 +241,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { circle.par(1), circle.par(2)); printf("kernelBLHits line.par(0,1): %d %f,%f\n", tkid, line.par(0), line.par(1)); - printf("kernelBLHits chi2 cov %f/%f %e,%e,%e,%e,%e\n", + printf("kernelBLHits chi2_circle: %f chi2_line: %f, cov(0-3)_circle: %e, %e, %e cov(1-2)_line %e,%e\n", circle.chi2, line.chi2, circle.cov(0, 0), @@ -418,6 +433,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template class HelixFit; template class HelixFit; + template class HelixFit; template class HelixFit; } // namespace ALPAKA_ACCELERATOR_NAMESPACE diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/CAFishbone.h b/RecoTracker/PixelSeeding/plugins/alpaka/CAFishbone.h index 96924f76932ec..d53980732eeb0 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/CAFishbone.h +++ b/RecoTracker/PixelSeeding/plugins/alpaka/CAFishbone.h @@ -38,7 +38,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets { // outermost parallel loop, using all grid elements along the slower dimension (Y or 0 in a 2D grid) for (uint32_t idy : cms::alpakatools::uniform_elements_y(acc, outerHits)) { uint32_t size = outerHitHisto->size(idy); - +#ifdef GPU_DEBUG + printf("fishbone ---> outersize %d - ", idy, size); +#endif if (size < 2) continue; @@ -50,11 +52,19 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets { auto xo = c0.outer_x(hh); auto yo = c0.outer_y(hh); auto zo = c0.outer_z(hh); + //printf("first cell %d xo %.2f yo %.2f zo %.2f - ",bin[0],c0.outer_x(hh),c0.outer_y(hh),c0.outer_z(hh));ve +#ifdef GPU_DEBUG + for (auto idx = 0u; idx < size; idx++) { + unsigned int otherCell = bin[idx]; + printf("vc[0] %d idx %d vc[idx] %d otherCell %d \n", vc[0], idx, vc[idx], otherCell); + } +#endif for (uint32_t ic : cms::alpakatools::independent_group_elements_x(acc, size)) { + //printf("cell0 = %d ci = %d\n",bin[0],bin[ic]); unsigned int otherCell = bin[ic]; auto& ci = cells[otherCell]; - + // printf("xo = %.2f yo = %.2f zo = %.2f xi = %.2f yi = %.2f zi = %.2f \n",xo,yo,zo,ci.inner_x(hh),ci.inner_y(hh),ci.inner_z(hh)); if (ci.unused()) continue; // for triplets equivalent to next if (checkTrack && cellTracksHisto->size(otherCell) == 0) diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtuplet.cc b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtuplet.cc index 5ac464eda88c0..236e3e53a1825 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtuplet.cc +++ b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtuplet.cc @@ -35,6 +35,7 @@ #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "RecoTracker/PixelSeeding/interface/CAGeometrySoA.h" +#include "DataFormats/SiStripDetId/interface/StripSubdetector.h" // #define GPU_DEBUG @@ -47,21 +48,32 @@ namespace reco { pairGraph_(iConfig.getParameter>("pairGraph")), startingPairs_(iConfig.getParameter>("startingPairs")), phiCuts_(iConfig.getParameter>("phiCuts")), - minZ_(iConfig.getParameter>("minZ")), - maxZ_(iConfig.getParameter>("maxZ")), - maxR_(iConfig.getParameter>("maxR")) {} + ptCuts_(iConfig.getParameter>("ptCuts")), + minInner_(iConfig.getParameter>("minInner")), + maxInner_(iConfig.getParameter>("maxInner")), + minOuter_(iConfig.getParameter>("minOuter")), + maxOuter_(iConfig.getParameter>("maxOuter")), + maxDZ_(iConfig.getParameter>("maxDZ")), + minDZ_(iConfig.getParameter>("minDZ")), + maxDR_(iConfig.getParameter>("maxDR")) {} // Layers params const std::vector caThetaCuts_; const std::vector caDCACuts_; + const std::vector isBarrel_; // Cells params const std::vector pairGraph_; const std::vector startingPairs_; const std::vector phiCuts_; - const std::vector minZ_; - const std::vector maxZ_; - const std::vector maxR_; + const std::vector ptCuts_; + const std::vector minInner_; + const std::vector maxInner_; + const std::vector minOuter_; + const std::vector maxOuter_; + const std::vector maxDZ_; + const std::vector minDZ_; + const std::vector maxDR_; mutable edm::ESGetToken tokenGeometry_; mutable edm::ESGetToken tokenTopology_; @@ -104,9 +116,14 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { static std::shared_ptr globalBeginRun(edm::Run const& iRun, edm::EventSetup const& iSetup, GlobalCache const* iCache) { - assert(iCache->minZ_.size() == iCache->maxZ_.size()); - assert(iCache->minZ_.size() == iCache->maxR_.size()); - assert(iCache->minZ_.size() == iCache->phiCuts_.size()); + assert(iCache->maxDR_.size() == iCache->minInner_.size()); + assert(iCache->maxDR_.size() == iCache->maxInner_.size()); + assert(iCache->maxDR_.size() == iCache->minOuter_.size()); + assert(iCache->maxDR_.size() == iCache->maxOuter_.size()); + assert(iCache->maxDR_.size() == iCache->maxDZ_.size()); + assert(iCache->maxDR_.size() == iCache->minDZ_.size()); + assert(iCache->maxDR_.size() == iCache->phiCuts_.size()); + assert(iCache->maxDR_.size() == iCache->ptCuts_.size()); assert(iCache->caThetaCuts_.size() == iCache->caDCACuts_.size()); @@ -119,61 +136,118 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { std::cout << "No. Pairs to be used = " << n_pairs << std::endl; #endif - assert(int(n_pairs) == int(iCache->minZ_.size())); + assert(int(n_pairs) == int(iCache->maxDR_.size())); assert(int(*std::max_element(iCache->startingPairs_.begin(), iCache->startingPairs_.end())) < n_pairs); assert(int(*std::max_element(iCache->pairGraph_.begin(), iCache->pairGraph_.end())) < n_layers); - const auto& trackerGeometry = iSetup.getData(iCache->tokenGeometry_); - const auto& trackerTopology = iSetup.getData(iCache->tokenTopology_); + auto const& trackerGeometry = iSetup.getData(iCache->tokenGeometry_); + auto const& trackerTopology = iSetup.getData(iCache->tokenTopology_); auto const& dets = trackerGeometry.dets(); #ifdef GPU_DEBUG - auto subSystem = 1; + auto subSystem = 0; auto subSystemName = GeomDetEnumerators::tkDetEnum[subSystem]; - auto subSystemOffset = trackerGeometry.offsetDU(subSystemName); std::cout << "=========================================================================================================" << std::endl; - std::cout << " ===================== Subsystem: " << subSystemName << std::endl; - subSystemName = GeomDetEnumerators::tkDetEnum[++subSystem]; - subSystemOffset = trackerGeometry.offsetDU(subSystemName); #endif auto oldLayer = 0u; auto layerCount = 0u; + std::vector layerIsBarrel(n_layers); std::vector layerStarts(n_layers + 1); //^ why n_layers + 1? This is a cumulative sum of the number // of modules each layer has. And we need the extra spot // at the end to hold the total number of modules. + std::vector moduleToindexInDets; + + auto isPinPSinOTBarrel = [&](DetId detId) { + // Select only P-hits from the OT barrel + return (trackerGeometry.getDetectorType(detId) == TrackerGeometry::ModuleType::Ph2PSP && + detId.subdetId() == StripSubdetector::TOB); + }; + auto isPixel = [&](DetId detId) { + auto subId = detId.subdetId(); + return (subId == PixelSubdetector::PixelBarrel || subId == PixelSubdetector::PixelEndcap); + }; + auto isBarrel = [&](DetId detId) { + auto subId = detId.subdetId(); + auto subDetector = trackerGeometry.geomDetSubDetector(subId); + return GeomDetEnumerators::isBarrel(subDetector); + }; + + // loop over all detector modules and build the CA layers + int counter = 0; for (auto& det : dets) { DetId detid = det->geographicalId(); + auto layer = trackerTopology.layer(detid); + // Logic: + // - if we are not inside pixels, we need to ignore anything **but** the OT. + // - for the time being, this is assuming that the CA extension will + // only cover the OT barrel part, and will ignore the OT forward. + #ifdef GPU_DEBUG - if (n_modules >= int(subSystemOffset)) { - subSystemName = GeomDetEnumerators::tkDetEnum[++subSystem]; - subSystemOffset = trackerGeometry.offsetDU(subSystemName); + auto subId = detid.subdetId(); + if (subSystemName != trackerGeometry.geomDetSubDetector(subId)) { + subSystemName = trackerGeometry.geomDetSubDetector(subId); std::cout << " ===================== Subsystem: " << subSystemName << std::endl; } #endif - auto layer = trackerTopology.layer(detid); - - if (layer != oldLayer) { - layerStarts[layerCount++] = n_modules; - - if (layerCount >= layerStarts.size()) - break; - - oldLayer = layer; + // Modules of the pixel layers + if (isPixel(detid)) { + if (layer != oldLayer) { #ifdef GPU_DEBUG - std::cout << " > New layer at module : " << n_modules << " (detId: " << detid << ")" << std::endl; + std::cout << "Pixel LayerStart: CA layer " << layerCount << " at subdetector layer " << layer + << " starts at module " << n_modules << " and is " << (isBarrel(detid) ? "barrel" : "not barrel") + << std::endl; #endif + layerIsBarrel[layerCount] = isBarrel(detid); + layerStarts[layerCount++] = n_modules; + if (layerCount >= layerStarts.size()) + break; + oldLayer = layer; + } + moduleToindexInDets.push_back(counter); + n_modules++; } - n_modules++; + // if we are using the CA extension for Phase-2, + // we also have to collect the modules from the considered OT layers + if constexpr (std::is_same_v) { + auto const& detUnits = det->components(); + for (auto& detUnit : detUnits) { + DetId unitDetId(detUnit->geographicalId()); + // Modules of the considered OT layers + if (isPinPSinOTBarrel(unitDetId)) { + if (layer != oldLayer) { +#ifdef GPU_DEBUG + std::cout << "OT LayerStart: CA layer " << layerCount << " at subdetector layer " << layer + << " starts at module " << n_modules << " and is " + << (isBarrel(detid) ? "barrel" : "not barrel") << std::endl; +#endif + layerIsBarrel[layerCount] = isBarrel(detid); + layerStarts[layerCount++] = n_modules; + if (layerCount >= layerStarts.size()) + break; + oldLayer = layer; + } + moduleToindexInDets.push_back(counter); + n_modules++; + } + } + } + counter++; } +#ifdef GPU_DEBUG + std::cout << "Full CA LayerStart: " << n_layers << " layers with " << n_modules << " modules in total." + << std::endl; +#endif + layerStarts[n_layers] = n_modules; + reco::CAGeometryHost product{{{n_layers + 1, n_pairs, n_modules}}, cms::alpakatools::host()}; auto layerSoA = product.view(); @@ -181,16 +255,34 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { auto modulesSoA = product.view<::reco::CAModulesSoA>(); for (int i = 0; i < n_modules; ++i) { - auto det = dets[i]; + auto idx = moduleToindexInDets[i]; + auto det = dets[idx]; auto vv = det->surface().position(); auto rr = Rotation(det->surface().rotation()); modulesSoA[i].detFrame() = Frame(vv.x(), vv.y(), vv.z(), rr); +#ifdef GPU_DEBUG + auto const& detUnits = det->components(); + for (auto& detUnit : detUnits) { + DetId unitDetId(detUnit->geographicalId()); + if (isPinPSinOTBarrel(unitDetId)) { + std::cout << "Filling frame at index " << idx << " in SoA position " << i << " for det " + << det->geographicalId() << " and detUnit->index: " << detUnit->index() << std::endl; + } + } + std::cout << "Filling frame at index " << idx << " in SoA position " << i << " for det " + << det->geographicalId() << std::endl; + std::cout << "Position: " << vv << " with Rotation: " << det->surface().rotation() << std::endl; + std::cout << "Rotation in z-r plane: " + << atan2(det->surface().normalVector().perp(), det->surface().normalVector().z()) * 180. / M_PI + << std::endl; +#endif } for (int i = 0; i < n_layers; ++i) { layerSoA.layerStarts()[i] = layerStarts[i]; layerSoA.caThetaCut()[i] = iCache->caThetaCuts_[i]; layerSoA.caDCACut()[i] = iCache->caDCACuts_[i]; + layerSoA.isBarrel()[i] = layerIsBarrel[i]; } layerSoA.layerStarts()[n_layers] = layerStarts[n_layers]; @@ -198,9 +290,19 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { for (int i = 0; i < n_pairs; ++i) { cellSoA.graph()[i] = {{uint32_t(iCache->pairGraph_[2 * i]), uint32_t(iCache->pairGraph_[2 * i + 1])}}; cellSoA.phiCuts()[i] = iCache->phiCuts_[i]; - cellSoA.minz()[i] = iCache->minZ_[i]; - cellSoA.maxz()[i] = iCache->maxZ_[i]; - cellSoA.maxr()[i] = iCache->maxR_[i]; + // convert ptCut in curvature radius in cm + // 1 GeV track has 1 GeV/c / (e * 3.8T) ~ 87 cm radius in a 3.8T field + const float minRadius = iCache->ptCuts_[i] * 87.78f; + // Use minRadius^2/4 in the CA to avoid sqrt + const float minRadius2T4 = 4.f * minRadius * minRadius; + cellSoA.ptCuts()[i] = minRadius2T4; + cellSoA.minInner()[i] = iCache->minInner_[i]; + cellSoA.maxInner()[i] = iCache->maxInner_[i]; + cellSoA.minOuter()[i] = iCache->minOuter_[i]; + cellSoA.maxOuter()[i] = iCache->maxOuter_[i]; + cellSoA.maxDZ()[i] = iCache->maxDZ_[i]; + cellSoA.minDZ()[i] = iCache->minDZ_[i]; + cellSoA.maxDR()[i] = iCache->maxDR_[i]; cellSoA.startingPair()[i] = false; } @@ -269,6 +371,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { using CAHitNtupletAlpakaPhase1 = CAHitNtupletAlpaka; using CAHitNtupletAlpakaHIonPhase1 = CAHitNtupletAlpaka; using CAHitNtupletAlpakaPhase2 = CAHitNtupletAlpaka; + using CAHitNtupletAlpakaPhase2OT = CAHitNtupletAlpaka; } // namespace ALPAKA_ACCELERATOR_NAMESPACE #include "HeterogeneousCore/AlpakaCore/interface/alpaka/MakerMacros.h" @@ -276,3 +379,4 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { DEFINE_FWK_ALPAKA_MODULE(CAHitNtupletAlpakaPhase1); DEFINE_FWK_ALPAKA_MODULE(CAHitNtupletAlpakaHIonPhase1); DEFINE_FWK_ALPAKA_MODULE(CAHitNtupletAlpakaPhase2); +DEFINE_FWK_ALPAKA_MODULE(CAHitNtupletAlpakaPhase2OT); diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGenerator.cc b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGenerator.cc index 4e205ba95f6b3..299b5208409e3 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGenerator.cc +++ b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGenerator.cc @@ -35,23 +35,102 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { return x * x; } - //Common Params + // Common Params + template void fillDescriptionsCommon(edm::ParameterSetDescription& desc) { - desc.add("cellZ0Cut", 12.0f)->setComment("Z0 cut for cells"); - desc.add("cellPtCut", 0.5f)->setComment("Preliminary pT cut at cell building level."); + desc.add("cellZ0Cut", TrackerTraits::cellZ0Cut)->setComment("Z0 cut for cells"); //// Pixel Cluster Cuts (@cell level) - desc.add("dzdrFact", 8.0f * 0.0285f / 0.015f); - desc.add("minYsizeB1", 1) - ->setComment("Cut on inner hit cluster size (in Y) for barrel-forward cells. Barrel 1 cut."); - desc.add("minYsizeB2", 1) - ->setComment("Cut on inner hit cluster size (in Y) for barrel-forward cells. Barrel 2 cut."); - desc.add("maxDYsize12", 28) - ->setComment("Cut on cluster size differences (in Y) for barrel-forward cells. Barrel 1-2 cells."); - desc.add("maxDYsize", 20) - ->setComment("Cut on cluster size differences (in Y) for barrel-forward cells. Other barrel cells."); - desc.add("maxDYPred", 20) - ->setComment("Cut on cluster size differences (in Y) for barrel-forward cells. Barrel-forward cells."); + desc.add("dzdrFact", TrackerTraits::dzdrFact); + desc.add("minYsizeB1", TrackerTraits::minYsizeB1) + ->setComment("Cut on inner hit cluster size (in global z / local y) for barrel-forward cells. Barrel 1 cut."); + desc.add("minYsizeB2", TrackerTraits::minYsizeB2) + ->setComment( + "Cut on inner hit cluster size (in global z / local y) for barrel-forward cells. Anything but Barrel 1 " + "cut."); + desc.add("maxDYsize12", TrackerTraits::maxDYsize12) + ->setComment( + "Cut on cluster size differences (in global z / local y) for barrel-forward cells. Barrel 1-2 cells."); + desc.add("maxDYsize", TrackerTraits::maxDYsize) + ->setComment( + "Cut on cluster size differences (in global z / local y) for barrel-forward cells. Other barrel cells."); + desc.add("maxDYPred", TrackerTraits::maxDYPred) + ->setComment( + "Maximum difference between actual and expected cluster size of inner RecHit. Barrel-forward cells."); + + edm::ParameterSetDescription geometryParams; + // layers params + geometryParams + .add>( + "caDCACuts", + std::vector(TrackerTraits::dcaCuts, TrackerTraits::dcaCuts + TrackerTraits::numberOfLayers)) + ->setComment("Cut on RZ alignement. One per layer, the layer being the middle one for a triplet."); + geometryParams + .add>( + "caThetaCuts", + std::vector(TrackerTraits::thetaCuts, TrackerTraits::thetaCuts + TrackerTraits::numberOfLayers)) + ->setComment("Cut on origin radius. One per layer, the layer being the innermost one for a triplet."); + geometryParams + .add>( + "startingPairs", + std::vector(TrackerTraits::startingPairs, + TrackerTraits::startingPairs + TrackerTraits::nStartingPairs)) + ->setComment("The list of the ids of pairs from which the CA ntuplets building may start."); + // cells params + geometryParams + .add>( + "pairGraph", + std::vector(TrackerTraits::layerPairs, + TrackerTraits::layerPairs + (TrackerTraits::nPairsForQuadruplets * 2))) + ->setComment("CA graph (layer pairs used for building doublets/cells)"); + geometryParams + .add>( + "phiCuts", + std::vector(TrackerTraits::phicuts, TrackerTraits::phicuts + TrackerTraits::nPairsForQuadruplets)) + ->setComment("Cuts in dphi for cells"); + geometryParams + .add>( + "ptCuts", + std::vector(TrackerTraits::ptCuts, TrackerTraits::ptCuts + TrackerTraits::nPairsForQuadruplets)) + ->setComment("Cuts in pt for cells"); + geometryParams + .add>("minInner", + std::vector(TrackerTraits::minInner, + TrackerTraits::minInner + TrackerTraits::nPairsForQuadruplets)) + ->setComment("Cuts on inner hit's z (for barrel) or r (for endcap) for cells (min value)"); + geometryParams + .add>("maxInner", + std::vector(TrackerTraits::maxInner, + TrackerTraits::maxInner + TrackerTraits::nPairsForQuadruplets)) + ->setComment("Cuts on inner hit's z (for barrel) or r (for endcap) for cells (max value)"); + geometryParams + .add>("minOuter", + std::vector(TrackerTraits::minOuter, + TrackerTraits::minOuter + TrackerTraits::nPairsForQuadruplets)) + ->setComment("Cuts on outer hit's z (for barrel) or r (for endcap) for cells (min value)"); + geometryParams + .add>("maxOuter", + std::vector(TrackerTraits::maxOuter, + TrackerTraits::maxOuter + TrackerTraits::nPairsForQuadruplets)) + ->setComment("Cuts on outer hit's z (for barrel) or r (for endcap) for cells (max value)"); + geometryParams + .add>( + "maxDR", + std::vector(TrackerTraits::maxDR, TrackerTraits::maxDR + TrackerTraits::nPairsForQuadruplets)) + ->setComment("Cuts in max dr for cells"); + geometryParams + .add>( + "minDZ", + std::vector(TrackerTraits::minDZ, TrackerTraits::minDZ + TrackerTraits::nPairsForQuadruplets)) + ->setComment("Cuts in minimum dz between hits for cells"); + geometryParams + .add>( + "maxDZ", + std::vector(TrackerTraits::maxDZ, TrackerTraits::maxDZ + TrackerTraits::nPairsForQuadruplets)) + ->setComment("Cuts in maximum dz between hits for cells"); + + desc.add("geometry", geometryParams) + ->setComment("Layer-dependent cuts and settings of the CA"); // Container sizes // @@ -67,18 +146,19 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { // maxNumberOfDoublets = cms.string(str(512*1024)) // - desc.add("maxNumberOfDoublets", std::to_string(pixelTopology::Phase1::maxNumberOfDoublets)) + desc.add("maxNumberOfDoublets", std::to_string(TrackerTraits::maxNumberOfDoublets)) ->setComment( "Max nummber of doublets (cells) as a string. The string will be parsed to a TFormula, depending on " "nHits (labeled 'x'), \n and evaluated for each event. May also be a constant."); - desc.add("maxNumberOfTuples", std::to_string(pixelTopology::Phase1::maxNumberOfTuples)) + desc.add("maxNumberOfTuples", std::to_string(TrackerTraits::maxNumberOfTuples)) ->setComment("Max nummber of tuples as a string. Same behavior as maxNumberOfDoublets."); - desc.add("avgHitsPerTrack", 5.0f)->setComment("Number of hits per track. Average per track."); - desc.add("avgCellsPerHit", 25.0f) + desc.add("avgHitsPerTrack", double(TrackerTraits::avgHitsPerTrack)) + ->setComment("Number of hits per track. Average per track."); + desc.add("avgCellsPerHit", TrackerTraits::avgCellsPerHit) ->setComment("Number of cells for which an hit is the outer hit. Average per hit."); - desc.add("avgCellsPerCell", 2.0f) + desc.add("avgCellsPerCell", TrackerTraits::avgCellsPerCell) ->setComment("Number of cells connected to another cell. Average per cell."); - desc.add("avgTracksPerCell", 1.0f) + desc.add("avgTracksPerCell", TrackerTraits::avgTracksPerCell) ->setComment("Number of tracks to which a cell belongs. Average per cell."); // nTuplet Cuts and Params @@ -86,7 +166,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { //// p [GeV/c] = B [T] * R [m] * 0.3 (factor from conversion from J to GeV and q = e = 1.6 * 10e-19 C) //// 87 cm/GeV = 1/(3.8T * 0.3) //// take less than radius given by the hardPtCut and reject everything below - desc.add("hardCurvCut", 1.f / (0.35 * 87.f)) + desc.add("hardCurvCut", TrackerTraits::hardCurvCut) ->setComment("Cut on minimum curvature, used in DCA ntuplet selection"); desc.add("earlyFishbone", true); @@ -119,7 +199,6 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { (float)cfg.getParameter("ptmin"), (float)cfg.getParameter("hardCurvCut"), (float)cfg.getParameter("cellZ0Cut"), - (float)cfg.getParameter("cellPtCut"), // Pixel Cluster Cut Params (float)cfg.getParameter("dzdrFact"), @@ -173,6 +252,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { static constexpr ::pixelTrack::QualityCutsT makeQualityCuts(edm::ParameterSet const& pset) { return ::pixelTrack::QualityCutsT{ static_cast(pset.getParameter("maxChi2")), + static_cast(pset.getParameter("maxChi2TripletsOrQuadruplets")), + static_cast(pset.getParameter("maxChi2Quintuplets")), static_cast(pset.getParameter("minPt")), static_cast(pset.getParameter("maxTip")), static_cast(pset.getParameter("maxZip")), @@ -219,7 +300,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template <> void CAHitNtupletGenerator::fillPSetDescription(edm::ParameterSetDescription& desc) { - fillDescriptionsCommon(desc); + fillDescriptionsCommon(desc); edm::ParameterSetDescription trackQualityCuts; trackQualityCuts.add("chi2MaxPt", 10.)->setComment("max pT used to determine the pT-dependent chi2 cut"); @@ -237,60 +318,12 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { desc.add("trackQualityCuts", trackQualityCuts) ->setComment( "Quality cuts based on the results of the track fit:\n - apply a pT-dependent chi2 cut;\n - apply " - "\"region " - "cuts\" based on the fit results (pT, Tip, Zip)."); - - edm::ParameterSetDescription geometryParams; - using namespace phase1PixelTopology; - // layers params - geometryParams - .add>("caDCACuts", - std::vector(std::begin(dcaCuts), std::begin(dcaCuts) + numberOfLayers)) - ->setComment("Cut on RZ alignement. One per layer, the layer being the middle one for a triplet."); - geometryParams - .add>("caThetaCuts", - std::vector(std::begin(thetaCuts), std::begin(thetaCuts) + numberOfLayers)) - ->setComment("Cut on origin radius. One per layer, the layer being the innermost one for a triplet."); - geometryParams.add>("startingPairs", {0u, 1u, 2u}) - ->setComment( - "The list of the ids of pairs from which the CA ntuplets building may start."); //TODO could be parsed via an expression - // cells params - geometryParams - .add>( - "pairGraph", - std::vector(std::begin(layerPairs), - std::begin(layerPairs) + (pixelTopology::Phase1::nPairsForQuadruplets * 2))) - ->setComment("CA graph"); - geometryParams - .add>( - "phiCuts", - std::vector(std::begin(phicuts), std::begin(phicuts) + pixelTopology::Phase1::nPairsForQuadruplets)) - ->setComment("Cuts in phi for cells"); - geometryParams - .add>( - "minZ", - std::vector(std::begin(minz), std::begin(minz) + pixelTopology::Phase1::nPairsForQuadruplets)) - ->setComment("Cuts in min z (on inner hit) for cells"); - geometryParams - .add>( - "maxZ", - std::vector(std::begin(maxz), std::begin(maxz) + pixelTopology::Phase1::nPairsForQuadruplets)) - ->setComment("Cuts in max z (on inner hit) for cells"); - geometryParams - .add>( - "maxR", - std::vector(std::begin(maxr), std::begin(maxr) + pixelTopology::Phase1::nPairsForQuadruplets)) - ->setComment("Cuts in max r for cells"); - - desc.add("geometry", geometryParams) - ->setComment( - "Quality cuts based on the results of the track fit:\n - apply cuts based on the fit results (pT, Tip, " - "Zip)."); + "\"region cuts\" based on the fit results (pT, Tip, Zip)."); } template <> void CAHitNtupletGenerator::fillPSetDescription(edm::ParameterSetDescription& desc) { - fillDescriptionsCommon(desc); + fillDescriptionsCommon(desc); edm::ParameterSetDescription trackQualityCuts; trackQualityCuts.add("chi2MaxPt", 10.)->setComment("max pT used to determine the pT-dependent chi2 cut"); @@ -309,66 +342,18 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { desc.add("trackQualityCuts", trackQualityCuts) ->setComment( "Quality cuts based on the results of the track fit:\n - apply a pT-dependent chi2 cut;\n - apply " - "\"region " - "cuts\" based on the fit results (pT, Tip, Zip)."); - - edm::ParameterSetDescription geometryParams; - using namespace phase1PixelTopology; - // layers params - geometryParams - .add>("caDCACuts", - std::vector(std::begin(phase1HIonPixelTopology::dcaCuts), - std::begin(phase1HIonPixelTopology::dcaCuts) + numberOfLayers)) - ->setComment("Cut on RZ alignement. One per layer, the layer being the middle one for a triplet."); - geometryParams - .add>("caThetaCuts", - std::vector(std::begin(phase1HIonPixelTopology::thetaCuts), - std::begin(phase1HIonPixelTopology::thetaCuts) + numberOfLayers)) - ->setComment("Cut on origin radius. One per layer, the layer being the innermost one for a triplet."); - geometryParams.add>("startingPairs", {0u, 1u, 2u}) - ->setComment( - "The list of the ids of pairs from which the CA ntuplets building may start."); //TODO could be parsed via an expression - // cells params - geometryParams - .add>( - "pairGraph", - std::vector(std::begin(layerPairs), - std::begin(layerPairs) + (pixelTopology::Phase1::nPairsForQuadruplets * 2))) - ->setComment("CA graph"); - geometryParams - .add>("phiCuts", - std::vector(std::begin(phase1HIonPixelTopology::phicuts), - std::begin(phase1HIonPixelTopology::phicuts) + - pixelTopology::Phase1::nPairsForQuadruplets)) - ->setComment("Cuts in phi for cells"); - geometryParams - .add>( - "minZ", - std::vector(std::begin(minz), std::begin(minz) + pixelTopology::Phase1::nPairsForQuadruplets)) - ->setComment("Cuts in min z (on inner hit) for cells"); - geometryParams - .add>( - "maxZ", - std::vector(std::begin(maxz), std::begin(maxz) + pixelTopology::Phase1::nPairsForQuadruplets)) - ->setComment("Cuts in max z (on inner hit) for cells"); - geometryParams - .add>( - "maxR", - std::vector(std::begin(maxr), std::begin(maxr) + pixelTopology::Phase1::nPairsForQuadruplets)) - ->setComment("Cuts in max r for cells"); - - desc.add("geometry", geometryParams) - ->setComment( - "Quality cuts based on the results of the track fit:\n - apply cuts based on the fit results (pT, Tip, " - "Zip)."); + "\"region cuts\" based on the fit results (pT, Tip, Zip)."); } template <> void CAHitNtupletGenerator::fillPSetDescription(edm::ParameterSetDescription& desc) { - fillDescriptionsCommon(desc); + fillDescriptionsCommon(desc); edm::ParameterSetDescription trackQualityCuts; - trackQualityCuts.add("maxChi2", 5.)->setComment("Max normalized chi2"); + trackQualityCuts.add("maxChi2", 5.)->setComment("Max normalized chi2 for tracks with 6 or more hits"); + trackQualityCuts.add("maxChi2TripletsOrQuadruplets", 5.) + ->setComment("Max normalized chi2 for tracks with 4 or less hits"); + trackQualityCuts.add("maxChi2Quintuplets", 5.)->setComment("Max normalized chi2 for tracks with 5 hits"); trackQualityCuts.add("minPt", 0.5)->setComment("Min pT in GeV"); trackQualityCuts.add("maxTip", 0.3)->setComment("Max |Tip| in cm"); trackQualityCuts.add("maxZip", 12.)->setComment("Max |Zip|, in cm"); @@ -376,40 +361,21 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { ->setComment( "Quality cuts based on the results of the track fit:\n - apply cuts based on the fit results (pT, Tip, " "Zip)."); + } - edm::ParameterSetDescription geometryParams; - using namespace phase2PixelTopology; - // layers params - geometryParams - .add>("caDCACuts", - std::vector(std::begin(dcaCuts), std::begin(dcaCuts) + numberOfLayers)) - ->setComment("Cut on RZ alignement. One per layer, the layer being the middle one for a triplet."); - geometryParams - .add>("caThetaCuts", - std::vector(std::begin(thetaCuts), std::begin(thetaCuts) + numberOfLayers)) - ->setComment("Cut on origin radius. One per layer, the layer being the innermost one for a triplet."); - geometryParams - .add>("startingPairs", - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32}) - ->setComment( - "The list of the ids of pairs from which the CA ntuplets building may start."); //TODO could be parsed via an expression - // cells params - geometryParams - .add>( - "pairGraph", std::vector(std::begin(layerPairs), std::begin(layerPairs) + (nPairs * 2))) - ->setComment("CA graph"); - geometryParams - .add>("phiCuts", std::vector(std::begin(phicuts), std::begin(phicuts) + nPairs)) - ->setComment("Cuts in phi for cells"); - geometryParams.add>("minZ", std::vector(std::begin(minz), std::begin(minz) + nPairs)) - ->setComment("Cuts in min z (on inner hit) for cells"); - geometryParams.add>("maxZ", std::vector(std::begin(maxz), std::begin(maxz) + nPairs)) - ->setComment("Cuts in max z (on inner hit) for cells"); - geometryParams.add>("maxR", std::vector(std::begin(maxr), std::begin(maxr) + nPairs)) - ->setComment("Cuts in max r for cells"); - - desc.add("geometry", geometryParams) + template <> + void CAHitNtupletGenerator::fillPSetDescription(edm::ParameterSetDescription& desc) { + fillDescriptionsCommon(desc); + + edm::ParameterSetDescription trackQualityCuts; + trackQualityCuts.add("maxChi2", 5.)->setComment("Max normalized chi2 for tracks with 6 or more hits"); + trackQualityCuts.add("maxChi2TripletsOrQuadruplets", 1.) + ->setComment("Max normalized chi2 for tracks with 4 or less hits"); + trackQualityCuts.add("maxChi2Quintuplets", 3.)->setComment("Max normalized chi2 for tracks with 5 hits"); + trackQualityCuts.add("minPt", 0.9)->setComment("Min pT in GeV"); + trackQualityCuts.add("maxTip", 0.3)->setComment("Max |Tip| in cm"); + trackQualityCuts.add("maxZip", 12.)->setComment("Max |Zip|, in cm"); + desc.add("trackQualityCuts", trackQualityCuts) ->setComment( "Quality cuts based on the results of the track fit:\n - apply cuts based on the fit results (pT, Tip, " "Zip)."); @@ -482,5 +448,6 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template class CAHitNtupletGenerator; template class CAHitNtupletGenerator; + template class CAHitNtupletGenerator; template class CAHitNtupletGenerator; } // namespace ALPAKA_ACCELERATOR_NAMESPACE diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernels.dev.cc b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernels.dev.cc index bfaaeb419eef5..65c02aa783f13 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernels.dev.cc +++ b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernels.dev.cc @@ -800,6 +800,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template class CAHitNtupletGeneratorKernels; template class CAHitNtupletGeneratorKernels; + template class CAHitNtupletGeneratorKernels; template class CAHitNtupletGeneratorKernels; } // namespace ALPAKA_ACCELERATOR_NAMESPACE diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernelsImpl.h b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernelsImpl.h index 5158f42fba51f..f86c1656c0d5e 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernelsImpl.h +++ b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernelsImpl.h @@ -635,7 +635,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caHitNtupletGeneratorKernels { tracks_view[it].quality() = Quality::strict; - if (cuts.strictCut(tracks_view, it)) + if (cuts.strictCut(tracks_view, nhits, it)) continue; tracks_view[it].quality() = Quality::tight; diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/CAPixelDoubletsAlgos.h b/RecoTracker/PixelSeeding/plugins/alpaka/CAPixelDoubletsAlgos.h index 26b38ca1aa9fb..871212e810b64 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/CAPixelDoubletsAlgos.h +++ b/RecoTracker/PixelSeeding/plugins/alpaka/CAPixelDoubletsAlgos.h @@ -37,14 +37,44 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets { using PhiBinner = PhiBinnerT; //Move this ^ definition in CAStructures maybe - template + ALPAKA_FN_ACC ALPAKA_FN_INLINE bool moduleIsOuterLadderPhase1(int const moduleId) { + return (0 == (moduleId / 8) % 2); + } + ALPAKA_FN_ACC ALPAKA_FN_INLINE bool moduleIsOuterLadderPhase2(int const moduleId) { + return (0 != (moduleId / 18) % 2); + } + + template + ALPAKA_FN_ACC ALPAKA_FN_INLINE bool moduleIsOuterLadder(const int moduleId); + + template <> + ALPAKA_FN_ACC ALPAKA_FN_INLINE bool moduleIsOuterLadder(int const moduleId) { + return moduleIsOuterLadderPhase1(moduleId); + } + + template <> + ALPAKA_FN_ACC ALPAKA_FN_INLINE bool moduleIsOuterLadder(int const moduleId) { + return moduleIsOuterLadderPhase1(moduleId); + } + + template <> + ALPAKA_FN_ACC ALPAKA_FN_INLINE bool moduleIsOuterLadder(int const moduleId) { + return moduleIsOuterLadderPhase2(moduleId); + } + + template <> + ALPAKA_FN_ACC ALPAKA_FN_INLINE bool moduleIsOuterLadder(int const moduleId) { + return moduleIsOuterLadderPhase2(moduleId); + } + + template ALPAKA_FN_ACC ALPAKA_FN_INLINE bool zSizeCut( const TAcc& acc, HitsConstView hh, ::reco::CALayersSoAConstView ll, AlgoParams const& params, int i, int o) { const uint32_t mi = hh[i].detectorIndex(); const auto first_forward = ll.layerStarts()[4]; const auto first_bpix2 = ll.layerStarts()[1]; bool innerB1 = mi < first_bpix2; - bool isOuterLadder = 0 == (mi / 8) % 2; + bool isOuterLadder = moduleIsOuterLadder(mi); auto mes = (!innerB1) || isOuterLadder ? hh[i].clusterSizeY() : -1; #ifdef DOUBLETS_DEBUG printf("i = %d o = %d mi = %d innerB1 = %d isOuterLadder = %d first_forward = %d first_bpix2 = %d\n", @@ -88,7 +118,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets { : innerBarrel && std::abs(mes - int(std::abs(dz / dr) * params.dzdrFact_ + 0.5f)) > params.maxDYPred_; } - template + template ALPAKA_FN_ACC ALPAKA_FN_INLINE bool clusterCut( const TAcc& acc, HitsConstView hh, ::reco::CALayersSoAConstView ll, AlgoParams const& params, uint32_t i) { const uint32_t mi = hh[i].detectorIndex(); @@ -114,7 +144,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets { bool innerB1 = mi < first_bpix2; - bool isOuterLadder = 0 == (mi / 8) % 2; + bool isOuterLadder = moduleIsOuterLadder(mi); auto mes = (!innerB1) || isOuterLadder ? hh[i].clusterSizeY() : -1; if (innerB1) // B1 @@ -143,20 +173,16 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets { const bool doClusterCut = params.minYsizeB1_ > 0 or params.minYsizeB2_ > 0; const bool doZSizeCut = params.maxDYsize12_ > 0 or params.maxDYsize_ > 0 or params.maxDYPred_ > 0; - // cm (1 GeV track has 1 GeV/c / (e * 3.8T) ~ 87 cm radius in a 3.8T field) - const float minRadius = params.cellPtCut_ * 87.78f; - const float minRadius2T4 = 4.f * minRadius * minRadius; - const uint32_t nPairs = cc.metadata().size(); using PhiHisto = PhiBinner; ALPAKA_ASSERT_ACC(offsets); auto layerSize = [=](uint8_t li) { return offsets[li + 1] - offsets[li]; }; - // nPairsMax to be optimized later (originally was 64). - // If it should much be bigger, consider using a block-wide parallel prefix scan, + // nPairs for the OT-extended CA is 73. + // If it should become much bigger than 64, consider using a block-wide parallel prefix scan, // e.g. see https://nvlabs.github.io/cub/classcub_1_1_warp_scan.html - auto& innerLayerCumulativeSize = alpaka::declareSharedVar(acc); + auto& innerLayerCumulativeSize = alpaka::declareSharedVar(acc); auto& ntot = alpaka::declareSharedVar(acc); #ifdef DOUBLETS_DEBUG @@ -218,8 +244,12 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets { offsets[inner + 1]); #endif // found hit corresponding to our worker thread, now do the job - if (hh[i].detectorIndex() > ll.layerStarts()[ll.metadata().size() - 1]) //TODO use cc - continue; // invalid + if (hh[i].detectorIndex() > ll.layerStarts()[ll.metadata().size() - 1]) { //TODO use cc +#ifdef DOUBLETS_DEBUG + printf("Killed here 1\n"); +#endif + continue; // invalid + } /* maybe clever, not effective when zoCut is on auto bpos = (mi%8)/4; // if barrel is 1 for z>0 @@ -227,34 +257,57 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets { if ( ((inner<3) & (outer>3)) && bpos!=fpos) continue; */ - auto mez = hh[i].zGlobal(); + auto zi = hh[i].zGlobal(); + auto ri = hh[i].rGlobal(); - if (mez < cc.minz()[pairLayerId] || mez > cc.maxz()[pairLayerId]) + // cut on inner coordinate (z or r depending on layer) + auto valInner = ll.isBarrel()[inner] ? zi : ri; + if (valInner < cc.minInner()[pairLayerId] || valInner > cc.maxInner()[pairLayerId]) { +#ifdef DOUBLETS_DEBUG + printf("Killed here 2 --> valInner: %f [index: %d], minInner: %f, maxInner: %f\n", + valInner, + hh[i].detectorIndex(), + cc.minInner()[pairLayerId], + cc.maxInner()[pairLayerId]); +#endif continue; + } + #ifdef DOUBLETS_DEBUG if (doClusterCut && outer > pixelTopology::last_barrel_layer) - printf("clustCut: %d %d \n", i, clusterCut(acc, hh, ll, params, i)); + printf("clustCut: %d %d \n", i, clusterCut(acc, hh, ll, params, i)); #endif - if (doClusterCut && outer > pixelTopology::last_barrel_layer && clusterCut(acc, hh, ll, params, i)) + if (doClusterCut && outer > pixelTopology::last_barrel_layer && + clusterCut(acc, hh, ll, params, i)) { +#ifdef DOUBLETS_DEBUG + printf("Killed here 4\n"); +#endif continue; + } auto mep = hh[i].iphi(); - auto mer = hh[i].rGlobal(); // all cuts: true if fails auto ptcut = [&](int j, int16_t idphi) { - auto r2t4 = minRadius2T4; - auto ri = mer; + // ptCut already converted to minRadius2T4 in CAHitNtupletGenerator.cc auto ro = hh[j].rGlobal(); auto dphi = short2phi(idphi); - return dphi * dphi * (r2t4 - ri * ro) > (ro - ri) * (ro - ri); + return dphi * dphi * (cc.ptCuts()[pairLayerId] - ri * ro) > (ro - ri) * (ro - ri); }; auto z0cutoff = [&](int j) { auto zo = hh[j].zGlobal(); auto ro = hh[j].rGlobal(); - auto dr = ro - mer; - return dr > cc.maxr()[pairLayerId] || dr < 0 || std::abs((mez * ro - mer * zo)) > params.cellZ0Cut_ * dr; + auto dr = ro - ri; +#ifdef DOUBLETS_DEBUG + printf("dr: %4.3f, %4.3f, %4.3f --> %d\n", ri, ro, dr, (dr > cc.maxDR()[pairLayerId])); + printf("zi: %4.3f, zo: %4.3f, std::abs((zi * ro - ri * zo)): %4.3f --> %d\n", + zi, + zo, + std::abs((zi * ro - ri * zo)), + (std::abs((zi * ro - ri * zo)) > params.cellZ0Cut_ * dr)); +#endif + return dr > cc.maxDR()[pairLayerId] || dr < 0 || std::abs((zi * ro - ri * zo)) > params.cellZ0Cut_ * dr; }; auto iphicut = cc.phiCuts()[pairLayerId]; @@ -263,13 +316,13 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets { auto kh = PhiHisto::bin(int16_t(mep + iphicut)); auto incr = [](auto& k) { return k = (k + 1) % PhiHisto::nbins(); }; -#ifdef GPU_DEGBU +#ifdef GPU_DEBUG printf("pairLayerId %d %d %.2f %.2f %.2f \n", pairLayerId, cc.phiCuts()[pairLayerId], - cc.maxr()[pairLayerId], - cc.maxz()[pairLayerId], - cc.minz()[pairLayerId]); + cc.maxDR()[pairLayerId], + cc.maxInnerZ()[pairLayerId], + cc.minInnerZ()[pairLayerId]); #endif auto khh = kh; @@ -290,28 +343,81 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets { auto oi = p[pIndex]; ALPAKA_ASSERT_ACC(oi >= offsets[outer]); ALPAKA_ASSERT_ACC(oi < offsets[outer + 1]); +#ifdef DOUBLETS_DEBUG + printf("Exploring couple i: %d o: %d\n", i, oi); +#endif auto mo = hh[oi].detectorIndex(); // invalid - if (mo > pixelClustering::maxNumModules) //FIXME use cc? + if (mo > pixelClustering::maxNumModules) { //FIXME use cc? +#ifdef DOUBLETS_DEBUG + printf("Killed here 4\n"); +#endif + continue; + } + + auto zo = hh[oi].zGlobal(); + auto ro = hh[oi].rGlobal(); + + // cut on outer coordinate (z or r depending on layer) + auto valOuter = ll.isBarrel()[outer] ? zo : ro; + if (valOuter < cc.minOuter()[pairLayerId] || valOuter > cc.maxOuter()[pairLayerId]) { +#ifdef DOUBLETS_DEBUG + printf("Killed here 5 --> valOuter: %f [index: %d], minOuter: %f, maxOuter: %f\n", + valOuter, + mo, + cc.minOuter()[pairLayerId], + cc.maxOuter()[pairLayerId]); +#endif + continue; + } + + auto dz = zo - zi; + + // cut on signed dz + if (dz < cc.minDZ()[pairLayerId] || dz > cc.maxDZ()[pairLayerId]) { +#ifdef DOUBLETS_DEBUG + printf("Killed here 5 --> dz: %f [index: %d], minDZ: %f, maxDZ: %f\n", + dz, + mo, + cc.minDZ()[pairLayerId], + cc.maxDZ()[pairLayerId]); +#endif continue; + } - if (params.cellZ0Cut_ > 0. && z0cutoff(oi)) + if (params.cellZ0Cut_ > 0. && z0cutoff(oi)) { +#ifdef DOUBLETS_DEBUG + printf("Killed here 5\n"); +#endif continue; + } auto mop = hh[oi].iphi(); uint16_t idphi = std::min(std::abs(int16_t(mop - mep)), std::abs(int16_t(mep - mop))); - if (idphi > iphicut) + if (idphi > iphicut) { +#ifdef DOUBLETS_DEBUG + printf("Killed here 6\n"); +#endif continue; + } +#ifdef DOUBLETS_DEBUG + printf("zSizeCut: %d %d %d \n", i, oi, zSizeCut(acc, hh, ll, params, i, oi)); +#endif + if (doZSizeCut && zSizeCut(acc, hh, ll, params, i, oi)) { #ifdef DOUBLETS_DEBUG - printf("zSizeCut: %d %d %d \n", i, oi, zSizeCut(acc, hh, ll, params, i, oi)); + printf("Killed here 7\n"); #endif - if (doZSizeCut && zSizeCut(acc, hh, ll, params, i, oi)) continue; + } - if (params.cellPtCut_ > 0. && ptcut(oi, idphi)) + if (cc.ptCuts()[pairLayerId] > 0. && ptcut(oi, idphi)) { +#ifdef DOUBLETS_DEBUG + printf("Killed here 8\n"); +#endif continue; + } auto ind = alpaka::atomicAdd(acc, nCells, 1u, alpaka::hierarchy::Blocks{}); if (ind >= maxNumOfDoublets) { diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/CAStructures.h b/RecoTracker/PixelSeeding/plugins/alpaka/CAStructures.h index 7af104d2fe274..10a1a876310b6 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/CAStructures.h +++ b/RecoTracker/PixelSeeding/plugins/alpaka/CAStructures.h @@ -23,7 +23,6 @@ namespace caStructures { float ptmin_; float hardCurvCut_; float cellZ0Cut_; - float cellPtCut_; // Pixel Cluster Cut Params float dzdrFact_; // from dz/dr to "DY" diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/HelixFit.cc b/RecoTracker/PixelSeeding/plugins/alpaka/HelixFit.cc index e8507dd92a838..9aeb013dc52cc 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/HelixFit.cc +++ b/RecoTracker/PixelSeeding/plugins/alpaka/HelixFit.cc @@ -20,5 +20,6 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template class HelixFit; template class HelixFit; + template class HelixFit; template class HelixFit; } // namespace ALPAKA_ACCELERATOR_NAMESPACE diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/RiemannFit.dev.cc b/RecoTracker/PixelSeeding/plugins/alpaka/RiemannFit.dev.cc index e1ecf5825b106..d255840a613c4 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/RiemannFit.dev.cc +++ b/RecoTracker/PixelSeeding/plugins/alpaka/RiemannFit.dev.cc @@ -389,6 +389,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template class HelixFit; template class HelixFit; + template class HelixFit; template class HelixFit; } // namespace ALPAKA_ACCELERATOR_NAMESPACE diff --git a/RecoTracker/PixelTrackFitting/interface/alpaka/BrokenLine.h b/RecoTracker/PixelTrackFitting/interface/alpaka/BrokenLine.h index b4cd2e04686c3..f340342228e33 100644 --- a/RecoTracker/PixelTrackFitting/interface/alpaka/BrokenLine.h +++ b/RecoTracker/PixelTrackFitting/interface/alpaka/BrokenLine.h @@ -8,6 +8,8 @@ #include "HeterogeneousCore/AlpakaInterface/interface/config.h" #include "RecoTracker/PixelTrackFitting/interface/alpaka/FitUtils.h" +//#define BL_DEEPDEBUG + namespace ALPAKA_ACCELERATOR_NAMESPACE::brokenline { using namespace cms::alpakatools; @@ -186,6 +188,16 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::brokenline { alpaka::math::atan2(acc, riemannFit::cross2D(acc, dVec, eVec), dVec.dot(eVec)); // calculates the arc length } riemannFit::VectorNd zVec = hits.block(2, 0, 1, n).transpose(); +#ifdef BL_DEEPDEBUG + for (u_int i = 0; i < n; i++) { + printf("Point %d, x, %f, y: %f, z: %f, s: %f\n", + i, + hits.block(0, 0, 2, n)(0, i), + hits.block(0, 0, 2, n)(1, i), + zVec(i), + results.sTransverse(i)); + } +#endif //calculate sTotal and zVec riemannFit::Matrix2xNd pointsSZ = riemannFit::Matrix2xNd::Zero(); @@ -196,7 +208,11 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::brokenline { } results.sTotal = pointsSZ.block(0, 0, 1, n).transpose(); results.zInSZplane = pointsSZ.block(1, 0, 1, n).transpose(); - +#ifdef BL_DEEPDEBUG + for (u_int i = 0; i < n; i++) { + printf("Point %d, rot_s: %f, rot_z: %f\n", i, results.sTotal(i), results.zInSZplane(i)); + } +#endif //calculate varBeta results.varBeta(0) = results.varBeta(n - 1) = 0; for (u_int i = 1; i < n - 1; i++) { @@ -293,6 +309,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::brokenline { result(3) = result(2) * atan2(riemannFit::cross2D(acc, d, e), d.dot(e)) / (hits(2, n - 1) - hits(2, 0)); // ds/dz slope between last and first point +#ifdef BL_DEEPDEBUG + printf("FastFit results(x,y,R,tan(theta): %e, %e, %e, %e\n", result(0), result(1), result(2), result(3)); +#endif } /*! @@ -481,6 +500,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::brokenline { const auto& varBeta = data.varBeta; const double slope = -data.qCharge / fast_fit(3); +#ifdef BL_DEEPDEBUG + printf("Slope: %e, charge: %d, curvature: %e\n", slope, data.qCharge, fast_fit(3)); +#endif riemannFit::Matrix2d rotMat = rotationMatrix(acc, slope); riemannFit::Matrix3d vMat = riemannFit::Matrix3d::Zero(); // covariance matrix XYZ diff --git a/RecoTracker/PixelTrackFitting/plugins/PixelTrackProducerFromSoAAlpaka.cc b/RecoTracker/PixelTrackFitting/plugins/PixelTrackProducerFromSoAAlpaka.cc index d368ed6b552a2..ac615ef2309ae 100644 --- a/RecoTracker/PixelTrackFitting/plugins/PixelTrackProducerFromSoAAlpaka.cc +++ b/RecoTracker/PixelTrackFitting/plugins/PixelTrackProducerFromSoAAlpaka.cc @@ -10,6 +10,7 @@ #include "DataFormats/BeamSpot/interface/BeamSpot.h" #include "DataFormats/GeometrySurface/interface/Plane.h" #include "DataFormats/SiPixelClusterSoA/interface/ClusteringConstants.h" +#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackReco/interface/TrackExtra.h" #include "DataFormats/TrackReco/interface/TrackFwd.h" @@ -17,6 +18,7 @@ #include "DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h" +#include "DataFormats/TrackerRecHit2D/interface/Phase2TrackerRecHit1D.h" #include "DataFormats/TrajectoryState/interface/LocalTrajectoryParameters.h" #include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/Event.h" @@ -29,8 +31,10 @@ #include "FWCore/Utilities/interface/InputTag.h" #include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" #include "Geometry/Records/interface/TrackerTopologyRcd.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" #include "RecoTracker/PixelTrackFitting/interface/alpaka/FitUtils.h" +#include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h" #include "TrackingTools/AnalyticalJacobians/interface/JacobianLocalToCurvilinear.h" #include "TrackingTools/TrajectoryParametrization/interface/CurvilinearTrajectoryError.h" #include "TrackingTools/TrajectoryParametrization/interface/GlobalTrajectoryParameters.h" @@ -43,8 +47,18 @@ */ // #define GPU_DEBUG +// struct that holds two maps for detIds of the OT modules +struct DetIdMaps { + DetIdMaps() : detIdToOTModuleId_(), detIdIsUsedOTModule_() {} + + // map from the detId of OT modules to the moduleId among the used OT modules + // (starting from 0 for first module of first OT layer) + std::map detIdToOTModuleId_; + // map from detId to bool if used as OT extension + std::map detIdIsUsedOTModule_; +}; -class PixelTrackProducerFromSoAAlpaka : public edm::global::EDProducer<> { +class PixelTrackProducerFromSoAAlpaka : public edm::global::EDProducer> { using TrackSoAHost = reco::TracksHost; using HMSstorage = std::vector; using IndToEdm = std::vector; @@ -55,32 +69,43 @@ class PixelTrackProducerFromSoAAlpaka : public edm::global::EDProducer<> { ~PixelTrackProducerFromSoAAlpaka() override = default; static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); + std::shared_ptr globalBeginRun(edm::Run const &, edm::EventSetup const &) const override; + void globalEndRun(edm::Run const &, edm::EventSetup const &) const override {}; private: void produce(edm::StreamID streamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override; // Event Data tokens - const edm::EDGetTokenT tBeamSpot_; - const edm::EDGetTokenT tokenTrack_; - const edm::EDGetTokenT cpuHits_; - const edm::EDGetTokenT hmsToken_; + const edm::EDGetTokenT beamSpotToken_; + const edm::EDGetTokenT trackSoAToken_; + const edm::EDGetTokenT pixelRecHitsToken_; + edm::EDGetTokenT otRecHitsToken_; + const edm::EDGetTokenT pixelHMSToken_; + edm::EDGetTokenT otHMSToken_; // Event Setup tokens const edm::ESGetToken idealMagneticFieldToken_; - const edm::ESGetToken ttTopoToken_; + const edm::ESGetToken trackerTopologyToken_; + const edm::ESGetToken trackerGeometryTokenRun_; int32_t const minNumberOfHits_; pixelTrack::Quality const minQuality_; + const bool useOTExtension_; + const bool requireQuadsFromConsecutiveLayers_; }; PixelTrackProducerFromSoAAlpaka::PixelTrackProducerFromSoAAlpaka(const edm::ParameterSet &iConfig) - : tBeamSpot_(consumes(iConfig.getParameter("beamSpot"))), - tokenTrack_(consumes(iConfig.getParameter("trackSrc"))), - cpuHits_(consumes(iConfig.getParameter("pixelRecHitLegacySrc"))), - hmsToken_(consumes(iConfig.getParameter("pixelRecHitLegacySrc"))), + : beamSpotToken_(consumes(iConfig.getParameter("beamSpot"))), + trackSoAToken_(consumes(iConfig.getParameter("trackSrc"))), + pixelRecHitsToken_( + consumes(iConfig.getParameter("pixelRecHitLegacySrc"))), + pixelHMSToken_(consumes(iConfig.getParameter("pixelRecHitLegacySrc"))), idealMagneticFieldToken_(esConsumes()), - ttTopoToken_(esConsumes()), + trackerTopologyToken_(esConsumes()), + trackerGeometryTokenRun_(esConsumes()), minNumberOfHits_(iConfig.getParameter("minNumberOfHits")), - minQuality_(pixelTrack::qualityByName(iConfig.getParameter("minQuality"))) { + minQuality_(pixelTrack::qualityByName(iConfig.getParameter("minQuality"))), + useOTExtension_(iConfig.getParameter("useOTExtension")), + requireQuadsFromConsecutiveLayers_(iConfig.getParameter("requireQuadsFromConsecutiveLayers")) { if (minQuality_ == pixelTrack::Quality::notQuality) { throw cms::Exception("PixelTrackConfiguration") << iConfig.getParameter("minQuality") + " is not a pixelTrack::Quality"; @@ -96,6 +121,48 @@ PixelTrackProducerFromSoAAlpaka::PixelTrackProducerFromSoAAlpaka(const edm::Para // around a rare race condition in framework scheduling produces(); produces(); + + // if useOTExtension consume the OT RecHits + if (useOTExtension_) { + otRecHitsToken_ = + consumes(iConfig.getParameter("outerTrackerRecHitSrc")); + otHMSToken_ = consumes(iConfig.getParameter("outerTrackerRecHitSoAConverterSrc")); + } +} + +std::shared_ptr PixelTrackProducerFromSoAAlpaka::globalBeginRun(const edm::Run &iRun, + const edm::EventSetup &iSetup) const { + // make the maps object + auto detIdMaps = std::make_shared(); + + // if OT RecHits are used in PixelTracks, fill the detIdToOTModuleId_ map + if (useOTExtension_) { + // get track geometry + const auto &trackerGeometry = &iSetup.getData(trackerGeometryTokenRun_); + + // function to check if given module is used as OT for CA + auto isPinPSinOTBarrel = [&](DetId detId) { + // Select only P-hits from the OT barrel + return (trackerGeometry->getDetectorType(detId) == TrackerGeometry::ModuleType::Ph2PSP && + detId.subdetId() == StripSubdetector::TOB); + }; + + // loop over all modules and fill the map detIdToOTModuleId_ + auto const &detUnits = trackerGeometry->detUnits(); + for (uint32_t otModuleId{0}; auto &detUnit : detUnits) { + DetId detId(detUnit->geographicalId()); + // check if the module is used for OT extension + bool isUsedOTModule = isPinPSinOTBarrel(detId); + detIdMaps->detIdIsUsedOTModule_[detUnit->geographicalId()] = isUsedOTModule; + if (isUsedOTModule) { + // save the module index among the extension modules + detIdMaps->detIdToOTModuleId_[detUnit->geographicalId()] = otModuleId; + otModuleId++; + } + } + } + + return detIdMaps; } void PixelTrackProducerFromSoAAlpaka::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { @@ -103,8 +170,16 @@ void PixelTrackProducerFromSoAAlpaka::fillDescriptions(edm::ConfigurationDescrip desc.add("beamSpot", edm::InputTag("offlineBeamSpot")); desc.add("trackSrc", edm::InputTag("pixelTracksAlpaka")); desc.add("pixelRecHitLegacySrc", edm::InputTag("siPixelRecHitsPreSplittingLegacy")); + desc.add("outerTrackerRecHitSrc", edm::InputTag("hltSiPhase2RecHits")); + desc.add("outerTrackerRecHitSoAConverterSrc", edm::InputTag("phase2OTRecHitsSoAConverter")); desc.add("minNumberOfHits", 0); desc.add("minQuality", "loose"); + desc.add("useOTExtension", false); + + // this option for removing tracks with exactly 4 hits is a temporary solution to reduce the fake rate in Phase-2 + // and is to be replaced by a smarter inclusive track selection in the CA directly + desc.add("requireQuadsFromConsecutiveLayers", false); + descriptions.addWithDefaultLabel(desc); } @@ -125,44 +200,169 @@ void PixelTrackProducerFromSoAAlpaka::produce(edm::StreamID streamID, std::cout << "Converting soa helix in reco tracks" << std::endl; #endif + // index map: trackId(in SoA) -> trackId(in legacy edm) auto indToEdmP = std::make_unique(); auto &indToEdm = *indToEdmP; auto const &idealField = iSetup.getData(idealMagneticFieldToken_); + // prepare container for legacy tracks pixeltrackfitting::TracksWithRecHits tracks; - auto const &httopo = iSetup.getData(ttTopoToken_); + // get trackerTopology + auto const &trackerTopology = iSetup.getData(trackerTopologyToken_); + + // get the maps for the detId of the OT modules + auto const &detIdIsUsedOTModule = runCache(iEvent.getRun().index())->detIdIsUsedOTModule_; + auto const &detIdToOTModuleId = runCache(iEvent.getRun().index())->detIdToOTModuleId_; - const auto &bsh = iEvent.get(tBeamSpot_); + // get beamspot + const auto &bsh = iEvent.get(beamSpotToken_); GlobalPoint bs(bsh.x0(), bsh.y0(), bsh.z0()); - auto const &pixelRecHitsDSV = iEvent.get(cpuHits_); - std::vector hitmap; + // get the module's starting indices in the hit collection + auto const &pixelHitsModuleStart = iEvent.get(pixelHMSToken_); + + // get Pixel RecHits + auto const &pixelRecHitsDSV = iEvent.get(pixelRecHitsToken_); auto const &pixelRecHits = pixelRecHitsDSV.data(); auto const nPixelHits = pixelRecHits.size(); - auto const &hitsModuleStart = iEvent.get(hmsToken_); + // get OT RecHits if needed + size_t nOTHits = 0; + const Phase2TrackerRecHit1DCollectionNew *otRecHitsDSV = nullptr; + if (useOTExtension_) { + otRecHitsDSV = &iEvent.get(otRecHitsToken_); + nOTHits = otRecHitsDSV->dataSize(); + } - hitmap.resize(nPixelHits, nullptr); + size_t nTotalHits = nPixelHits + nOTHits; + // hitmap to go from a unique RecHit identifier to the RecHit in the legacy collection + // (unique hit identifier is equivalent to the position of the hit in the RecHit SoA) + std::vector hitmap; + hitmap.resize(nTotalHits, nullptr); + + // loop over pixel RecHits to fill the hitmap for (auto const &pixelHit : pixelRecHits) { auto const &thit = static_cast(pixelHit); auto const detI = thit.det()->index(); auto const &clus = thit.firstClusterRef(); assert(clus.isPixel()); - auto const idx = hitsModuleStart[detI] + clus.pixelCluster().originalId(); - if (idx >= hitmap.size()) - hitmap.resize(idx + 256, nullptr); // only in case of hit overflow in one module + + // get hit identifier as (hit offset of the module) + (hit index in this module) + auto const idx = pixelHitsModuleStart[detI] + clus.pixelCluster().originalId(); assert(nullptr == hitmap[idx]); hitmap[idx] = &pixelHit; } + // if OT RecHits are used in PixelTracks, fill the hitmap also with those + if (useOTExtension_) { + // The RecHits in the SoA are ordered according to the detUnit->index() + // of the respective OT module. For this reason, we need the map from the + // detId to the moduleId among all used OT modules. This otModuleId corresponds + // to the module's position in the otHitsModuleStart that we get from the event. + + // get the module's starting indices in the hit collection + auto const &otHitsModuleStart = iEvent.get(otHMSToken_); + + // perform the exact same loop of how the SoA is initially filled with OT hits + // and get the index by counting the hits (starting from the correpondign HitStartModule) + for (auto const &detSet : *otRecHitsDSV) { + auto detId = detSet.detId(); + + // check if module is used in extension + if (detIdIsUsedOTModule.find(detId)->second) { + // get the corresponding otModuleId + auto otModuleId = detIdToOTModuleId.find(detId)->second; + + // loop over the RecHits of the module and fill the hitmap + for (int idx = otHitsModuleStart[otModuleId]; auto const &recHit : detSet) { + assert(nullptr == hitmap[idx]); + hitmap[idx] = &recHit; + idx++; + } + } + } + } + + // function that returns the number of skipped layers for a given pair of RecHits + // for the case where the inner RecHit is in the pixel barrel. + auto getNSkippedLayersInnerInBarrel = [&](const DetId &innerDetId, + const DetId &outerDetId, + const TrackingRecHit *innerRecHit) { + int nSkippedLayers = 0; + switch (outerDetId.subdetId()) { + case PixelSubdetector::PixelBarrel: + nSkippedLayers = trackerTopology.pxbLayer(outerDetId) - trackerTopology.pxbLayer(innerDetId) - 1; + break; + case PixelSubdetector::PixelEndcap: + nSkippedLayers = trackerTopology.pxfDisk(outerDetId) - 1; // -1 because first disk has Id 1 + break; + case StripSubdetector::TOB: + // if the inner RecHit is at the edge of the barrel layer, consider the jump to the first OT layer as no skip + if (std::abs(innerRecHit->globalPosition().z()) > 17) + nSkippedLayers = trackerTopology.getOTLayerNumber(outerDetId) - 1; // -1 because first barrel has Id 1 + else + nSkippedLayers = trackerTopology.getOTLayerNumber(outerDetId) + 4 - trackerTopology.pxbLayer(innerDetId) - 1; + break; + } + return nSkippedLayers; + }; + + // function that returns the number of skipped layers for a given pair of RecHits + // for the case where the inner RecHit is in the pixel endcap. + auto getNSkippedLayersInnerInEndcap = [&](const DetId &innerDetId, const DetId &outerDetId) { + int nSkippedLayers = 0; + switch (outerDetId.subdetId()) { + case PixelSubdetector::PixelEndcap: + nSkippedLayers = trackerTopology.pxfDisk(outerDetId) - trackerTopology.pxfDisk(innerDetId) - 1; + break; + case StripSubdetector::TOB: + nSkippedLayers = trackerTopology.getOTLayerNumber(outerDetId) - 1; // -1 because first disk has Id 1 + break; + } + return nSkippedLayers; + }; + + // function that returns the number of skipped layers for a given pair of RecHits + // for the case where the inner RecHit is in the OT barrel. + auto getNSkippedLayersInnerInOT = [&](const DetId &innerDetId, const DetId &outerDetId) { + assert(outerDetId.subdetId() == StripSubdetector::TOB); + int nSkippedLayers = + trackerTopology.getOTLayerNumber(outerDetId) - trackerTopology.getOTLayerNumber(innerDetId) - 1; + return nSkippedLayers; + }; + + // function that returns the number of skipped layers for a given pair of RecHits + // It works only for Phase-2, as this feature does not make sense for Phase-1 due to the smaller number of layers. + // (needed for layer-skipping quadruplet rejection) + auto getNSkippedLayers = [&](const TrackingRecHit *innerRecHit, const TrackingRecHit *outerRecHit) { + // get detIds and subdetectors of the hits to determine their layers + auto innerDetId = innerRecHit->geographicalId(); + auto outerDetId = outerRecHit->geographicalId(); + + int nSkippedLayers = 0; + + switch (innerDetId.subdetId()) { + case PixelSubdetector::PixelBarrel: + nSkippedLayers = getNSkippedLayersInnerInBarrel(innerDetId, outerDetId, innerRecHit); + break; + case PixelSubdetector::PixelEndcap: + nSkippedLayers = getNSkippedLayersInnerInEndcap(innerDetId, outerDetId); + break; + case StripSubdetector::TOB: + nSkippedLayers = getNSkippedLayersInnerInOT(innerDetId, outerDetId); + break; + } + return nSkippedLayers; + }; + std::vector hits; hits.reserve(5); //TODO move to a configurable parameter? - auto const &tsoa = iEvent.get(tokenTrack_); + auto const &tsoa = iEvent.get(trackSoAToken_); auto const quality = tsoa.view().quality(); auto const hitOffs = tsoa.view().hitOffsets(); auto const hitIdxs = tsoa.template view().id(); @@ -173,7 +373,7 @@ void PixelTrackProducerFromSoAAlpaka::produce(edm::StreamID streamID, int32_t nt = 0; - //sort index by pt + // sort index by pt std::vector sortIdxs(nTracks); std::iota(sortIdxs.begin(), sortIdxs.end(), 0); // sort good-quality tracks by pt, keep bad-quality tracks at the bottom @@ -184,26 +384,56 @@ void PixelTrackProducerFromSoAAlpaka::produce(edm::StreamID streamID, return quality[i1] > quality[i2]; }); - //store the index of the SoA: indToEdm[index_SoAtrack] -> index_edmTrack (if it exists) - indToEdm.resize(sortIdxs.size(), -1); + indToEdm.resize(nTracks, -1); + + // loop over (sorted) tracks for (const auto &it : sortIdxs) { auto nHits = reco::nHits(tsoa.view(), it); assert(nHits >= 3); auto q = quality[it]; + // apply cuts on quality and number of hits if (q < minQuality_) - continue; + // since the tracks are sorted according to quality, + // we can break after the first track with low quality + break; if (nHits < minNumberOfHits_) //move to nLayers? continue; - indToEdm[it] = nt; - ++nt; hits.resize(nHits); auto start = (it == 0) ? 0 : hitOffs[it - 1]; auto end = hitOffs[it]; - - for (auto iHit = start; iHit < end; ++iHit) - hits[iHit - start] = hitmap[hitIdxs[iHit]]; + int nRemovedHits{0}; + + for (auto iHit = start; iHit < end; ++iHit) { + // if hit in hitmap: true for pixel hits, true for OT hits if useOTExtension_ + auto hitIdx = hitIdxs[iHit]; + if (hitIdx < nTotalHits) + hits[iHit - start] = hitmap[hitIdx]; + // else remove the OT hit from the track + else + nRemovedHits++; + } + hits.resize(nHits - nRemovedHits); + end = end - nRemovedHits; + + // implement custome requirement for quadruplets coming from consecutive layers + if (requireQuadsFromConsecutiveLayers_ && (nHits == 4)) { + bool skipThisTrack{false}; + // loop over layer pairs and check if they skip + for (auto iHit = start; iHit < end - 1; ++iHit) { + // if the inner (iHit-start) to outer (iHit-start+1) hit layer-change skips 1 or more + // layers skipt the track + if (getNSkippedLayers(hits[iHit - start], hits[iHit - start + 1]) > 0) { + skipThisTrack = true; + break; + } + } + if (skipThisTrack) { + indToEdm[it] = pixelTrack::skippedTrack; // mark as skipped + continue; + } + } #ifdef CA_DEBUG std::cout << "track soa : " << it << " with hits: "; @@ -212,6 +442,11 @@ void PixelTrackProducerFromSoAAlpaka::produce(edm::StreamID streamID, std::cout << std::endl; #endif + // store the index of the SoA: + // indToEdm[index_SoAtrack] -> index_edmTrack (if it exists) + indToEdm[it] = nt; + ++nt; + // mind: this values are respect the beamspot! float chi2 = tsoa.view()[it].chi2(); float phi = reco::phi(tsoa.view(), it); @@ -267,7 +502,7 @@ void PixelTrackProducerFromSoAAlpaka::produce(edm::StreamID streamID, #endif // store tracks - storeTracks(iEvent, tracks, httopo); + storeTracks(iEvent, tracks, trackerTopology); iEvent.put(std::move(indToEdmP)); } diff --git a/RecoTracker/PixelTrackFitting/python/PixelTracks_cff.py b/RecoTracker/PixelTrackFitting/python/PixelTracks_cff.py index 63004687dc0dd..30befe7e0e047 100644 --- a/RecoTracker/PixelTrackFitting/python/PixelTracks_cff.py +++ b/RecoTracker/PixelTrackFitting/python/PixelTracks_cff.py @@ -102,6 +102,7 @@ from RecoTracker.PixelSeeding.caHitNtupletAlpakaPhase1_cfi import caHitNtupletAlpakaPhase1 as _pixelTracksAlpakaPhase1 from RecoTracker.PixelSeeding.caHitNtupletAlpakaPhase2_cfi import caHitNtupletAlpakaPhase2 as _pixelTracksAlpakaPhase2 from RecoTracker.PixelSeeding.caHitNtupletAlpakaHIonPhase1_cfi import caHitNtupletAlpakaHIonPhase1 as _pixelTracksAlpakaHIonPhase1 +from RecoTracker.PixelSeeding.caHitNtupletAlpakaPhase2OT_cfi import caHitNtupletAlpakaPhase2OT as _pixelTracksAlpakaPhase2Extended pixelTracksAlpaka = _pixelTracksAlpakaPhase1.clone( avgHitsPerTrack = 4.6, @@ -112,44 +113,69 @@ maxNumberOfTuples = str(32 * 1024), # this couul be much lower (2.1k, these are quads) ) phase2_tracker.toReplaceWith(pixelTracksAlpaka,_pixelTracksAlpakaPhase2.clone()) -phase2_tracker.toModify(pixelTracksAlpaka, - maxNumberOfDoublets = str(5*512*1024), - maxNumberOfTuples = str(256 * 1024), - avgHitsPerTrack = 7.0, - avgCellsPerHit = 6, - avgCellsPerCell = 0.151, - avgTracksPerCell = 0.040, - cellPtCut = 0.85, - cellZ0Cut = 7.5, - minYsizeB1 = 25, - minYsizeB2 = 15, - maxDYsize12 = 12, - maxDYsize = 10, - maxDYPred = 20, -) - - -(pp_on_AA & ~phase2_tracker).toModify(pixelTracksAlpaka, - maxNumberOfDoublets = str(6 * 512 *1024), # this could be 2.3M - maxNumberOfTuples = str(256 * 1024), # this could be 4.7 - avgHitsPerTrack = 5.0, - avgCellsPerHit = 40, - avgCellsPerCell = 0.07, # with maxNumberOfDoublets ~= 3.14M; 0.02 for HLT HI on 2024 HI Data - avgTracksPerCell = 0.03, # with maxNumberOfDoublets ~= 3.14M; 0.005 for HLT HI on 2024 HI Data - cellPtCut = 0.5, # setup currenlty used @ HLT (was 0.0) - cellZ0Cut = 8.0, # setup currenlty used @ HLT (was 10.0) -) +def _modifyForPhase2(producer): + nPairs = int(len(producer.geometry.pairGraph) / 2) + producer.maxNumberOfDoublets = str(5*512*1024) + producer.maxNumberOfTuples = str(256 * 1024) + producer.avgHitsPerTrack = 7.0 + producer.avgCellsPerHit = 6 + producer.avgCellsPerCell = 0.151 + producer.avgTracksPerCell = 0.040 + producer.cellZ0Cut = 7.5 + producer.minYsizeB1 = 25 + producer.minYsizeB2 = 15 + producer.maxDYsize12 = 12 + producer.maxDYsize = 10 + producer.maxDYPred = 20 + producer.geometry.ptCuts = [0.85] * nPairs + +phase2_tracker.toModify(pixelTracksAlpaka, _modifyForPhase2) + +def _modifyForPPonAAandNotPhase2(producer): + nPairs = int(len(producer.geometry.pairGraph) / 2) + producer.maxNumberOfDoublets = str(6 * 512 *1024) # this could be 2.3M + producer.maxNumberOfTuples = str(256 * 1024) # this could be 4.7 + producer.avgHitsPerTrack = 5.0 + producer.avgCellsPerHit = 40 + producer.avgCellsPerCell = 0.07 # with maxNumberOfDoublets ~= 3.14M; 0.02 for HLT HI on 2024 HI Data + producer.avgTracksPerCell = 0.03 # with maxNumberOfDoublets ~= 3.14M; 0.005 for HLT HI on 2024 HI Data + producer.cellZ0Cut = 8.0 # setup currenlty used @ HLT (was 10.0) + producer.geometry.ptCuts = [0.5] * nPairs # setup currenlty used @ HLT (was 0.0) + +(pp_on_AA & ~phase2_tracker).toModify(pixelTracksAlpaka, _modifyForPPonAAandNotPhase2) + + +from Configuration.ProcessModifiers.phase2CAExtension_cff import phase2CAExtension +phase2CAExtension.toReplaceWith(pixelTracksAlpaka,_pixelTracksAlpakaPhase2Extended.clone( + pixelRecHitSrc = "siPixelRecHitsExtendedPreSplittingAlpaka", +)) # pixel tracks SoA producer on the cpu, for validation pixelTracksAlpakaSerial = makeSerialClone(pixelTracksAlpaka, pixelRecHitSrc = 'siPixelRecHitsPreSplittingAlpakaSerial' ) +phase2CAExtension.toModify(pixelTracksAlpakaSerial, + pixelRecHitSrc = 'siPixelRecHitsExtendedPreSplittingAlpakaSerial' + ) + # legacy pixel tracks from SoA from RecoTracker.PixelTrackFitting.pixelTrackProducerFromSoAAlpaka_cfi import pixelTrackProducerFromSoAAlpaka as _pixelTrackProducerFromSoAAlpaka -(alpaka).toReplaceWith(pixelTracks, _pixelTrackProducerFromSoAAlpaka.clone( +(alpaka & ~phase2CAExtension).toReplaceWith(pixelTracks, _pixelTrackProducerFromSoAAlpaka.clone( + pixelRecHitLegacySrc = "siPixelRecHitsPreSplitting", +)) + +phase2CAExtension.toReplaceWith(pixelTracks, _pixelTrackProducerFromSoAAlpaka.clone( pixelRecHitLegacySrc = "siPixelRecHitsPreSplitting", + beamSpot = cms.InputTag("offlineBeamSpot"), + minNumberOfHits = cms.int32(0), + minQuality = cms.string('tight'), + trackSrc = cms.InputTag("pixelTracksAlpaka"), + outerTrackerRecHitSrc = cms.InputTag("siPhase2RecHits"), + outerTrackerRecHitSoAConverterSrc = cms.InputTag("phase2OTRecHitsSoAConverter"), + useOTExtension = cms.bool(True), + requireQuadsFromConsecutiveLayers = cms.bool(True) )) alpaka.toReplaceWith(pixelTracksTask, cms.Task( diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedGeneratorFromProtoTracksEDProducer.cc b/RecoTracker/TkSeedGenerator/plugins/SeedGeneratorFromProtoTracksEDProducer.cc index ad37eab8cb960..f300665353477 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedGeneratorFromProtoTracksEDProducer.cc +++ b/RecoTracker/TkSeedGenerator/plugins/SeedGeneratorFromProtoTracksEDProducer.cc @@ -44,6 +44,7 @@ void SeedGeneratorFromProtoTracksEDProducer::fillDescriptions(edm::Configuration desc.add("useEventsWithNoVertex", true); desc.add("TTRHBuilder", "TTRHBuilderWithoutAngle4PixelTriplets"); desc.add("usePV", false); + desc.add("removeOTRechits", false); desc.add("includeFourthHit", false); desc.add("produceComplement", false); @@ -67,6 +68,7 @@ SeedGeneratorFromProtoTracksEDProducer::SeedGeneratorFromProtoTracksEDProducer(c useProtoTrackKinematics(cfg.getParameter("useProtoTrackKinematics")), useEventsWithNoVertex(cfg.getParameter("useEventsWithNoVertex")), usePV_(cfg.getParameter("usePV")), + removeOTRechits_(cfg.getParameter("removeOTRechits")), includeFourthHit_(cfg.getParameter("includeFourthHit")), produceComplement_(cfg.getParameter("produceComplement")), theInputCollectionTag(consumes(cfg.getParameter("InputCollection"))), @@ -147,10 +149,27 @@ void SeedGeneratorFromProtoTracksEDProducer::produce(edm::Event& ev, const edm:: GlobalTrackingRegion region(mom_perp, vtx, 0.2, 0.2); seedCreator_.init(region, es, nullptr); - if (hits.size() > 3 and not includeFourthHit_) - seedCreator_.makeSeed(*result, {hits[0], hits[1], hits[2]}); - else - seedCreator_.makeSeed(*result, hits); + + if (removeOTRechits_) { + // Filter out non-pixel hits + hits.erase(std::remove_if(hits.begin(), + hits.end(), + [](const Hit& hit) { + unsigned int subdetId = hit->geographicalId().subdetId(); + return subdetId != PixelSubdetector::PixelBarrel && + subdetId != PixelSubdetector::PixelEndcap; + }), + hits.end()); + + if (hits.size() > 2) { + seedCreator_.makeSeed(*result, hits); + } + } else { + if (hits.size() > 3 and not includeFourthHit_) + seedCreator_.makeSeed(*result, {hits[0], hits[1], hits[2]}); + else + seedCreator_.makeSeed(*result, hits); + } } } } diff --git a/RecoTracker/TkSeedGenerator/plugins/SeedGeneratorFromProtoTracksEDProducer.h b/RecoTracker/TkSeedGenerator/plugins/SeedGeneratorFromProtoTracksEDProducer.h index e6a212302d144..df42650e5cdad 100644 --- a/RecoTracker/TkSeedGenerator/plugins/SeedGeneratorFromProtoTracksEDProducer.h +++ b/RecoTracker/TkSeedGenerator/plugins/SeedGeneratorFromProtoTracksEDProducer.h @@ -21,6 +21,7 @@ class dso_hidden SeedGeneratorFromProtoTracksEDProducer : public edm::stream::ED const bool useProtoTrackKinematics; const bool useEventsWithNoVertex; const bool usePV_; + const bool removeOTRechits_; const bool includeFourthHit_; const bool produceComplement_; const edm::EDGetTokenT theInputCollectionTag; diff --git a/RecoVertex/PixelVertexFinding/plugins/PixelVertexProducerFromSoAAlpaka.cc b/RecoVertex/PixelVertexFinding/plugins/PixelVertexProducerFromSoAAlpaka.cc index 86561db386303..cf3d8aecdaafb 100644 --- a/RecoVertex/PixelVertexFinding/plugins/PixelVertexProducerFromSoAAlpaka.cc +++ b/RecoVertex/PixelVertexFinding/plugins/PixelVertexProducerFromSoAAlpaka.cc @@ -3,6 +3,7 @@ #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackReco/interface/TrackExtra.h" #include "DataFormats/TrackReco/interface/TrackFwd.h" +#include "DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h" #include "DataFormats/VertexReco/interface/Vertex.h" #include "DataFormats/VertexReco/interface/VertexFwd.h" #include "DataFormats/VertexSoA/interface/ZVertexHost.h" @@ -125,8 +126,13 @@ void PixelVertexProducerFromSoAAlpaka::produce(edm::StreamID streamID, assert(it < int(indToEdm.size())); auto k = indToEdm[it]; if (k > tracksSize) { - edm::LogWarning("PixelVertexProducer") << "oops track " << it << " does not exists on CPU " << k; - continue; + if (k == pixelTrack::skippedTrack) { + LogDebug("PixelVertexProducer") << "Track " << it << " conversion to legacy was skipped "; + continue; + } else { + edm::LogWarning("PixelVertexProducer") << "oops track " << it << " does not exists on CPU " << k; + continue; + } } auto tk = reco::TrackRef(tracksHandle, k); v.add(tk); diff --git a/Validation/RecoTrack/python/HLTmultiTrackValidator_cff.py b/Validation/RecoTrack/python/HLTmultiTrackValidator_cff.py index e6a67e140457b..3c21ffd504a80 100644 --- a/Validation/RecoTrack/python/HLTmultiTrackValidator_cff.py +++ b/Validation/RecoTrack/python/HLTmultiTrackValidator_cff.py @@ -39,6 +39,7 @@ def _modifyForPhase2(trackvalidator): from Configuration.ProcessModifiers.trackingLST_cff import trackingLST from Configuration.ProcessModifiers.seedingLST_cff import seedingLST +from Configuration.ProcessModifiers.ngtScouting_cff import ngtScouting def _modifyForPhase2LSTTracking(trackvalidator): trackvalidator.label = ["hltGeneralTracks", "hltPhase2PixelTracks", "hltInitialStepTrackSelectionHighPuritypTTCLST", "hltInitialStepTrackSelectionHighPuritypLSTCLST", "hltInitialStepTracksT5TCLST", "hltHighPtTripletStepTrackSelectionHighPurity"] @@ -60,3 +61,11 @@ def _modifyForSingleIterPatatrackLST(trackvalidator): def _modifyForSingleIterPatatrackLSTSeeding(trackvalidator): trackvalidator.label = ["hltGeneralTracks", "hltPhase2PixelTracks", "hltInitialStepTrackSelectionHighPuritypTTCLST", "hltInitialStepTracksT5TCLST"] (singleIterPatatrack & seedingLST & trackingLST).toModify(hltTrackValidator, _modifyForSingleIterPatatrackLSTSeeding) + +def _modifyForNGTScouting(trackvalidator): + trackvalidator.label = ["hltGeneralTracks", "hltPhase2PixelTracks"] +(ngtScouting & ~trackingLST).toModify(hltTrackValidator, _modifyForNGTScouting) + +def _modifyForNGTScoutingLST(trackvalidator): + trackvalidator.label = ["hltGeneralTracks", "hltPhase2PixelTracks", "hltInitialStepTracksT5TCLST"] +(ngtScouting & trackingLST).toModify(hltTrackValidator, _modifyForNGTScoutingLST) diff --git a/Validation/SiTrackerPhase2V/python/HLTPhase2TrackerValidationFirstStep_cff.py b/Validation/SiTrackerPhase2V/python/HLTPhase2TrackerValidationFirstStep_cff.py index 41da8628648c8..e53b93125a548 100644 --- a/Validation/SiTrackerPhase2V/python/HLTPhase2TrackerValidationFirstStep_cff.py +++ b/Validation/SiTrackerPhase2V/python/HLTPhase2TrackerValidationFirstStep_cff.py @@ -45,8 +45,9 @@ from Configuration.ProcessModifiers.trackingLST_cff import trackingLST from Configuration.ProcessModifiers.seedingLST_cff import seedingLST -# Conditionally add hltRechitValidOT if either trackingLST or seedingLST is active -(trackingLST | seedingLST).toModify( +# Conditionally add hltRechitValidOT if either trackingLST or seedingLST or phase2CAExtension is active +from Configuration.ProcessModifiers.phase2CAExtension_cff import phase2CAExtension +(trackingLST | seedingLST | phase2CAExtension).toModify( hltTrackerphase2ValidationSource, lambda s: s.__iadd__(hltRechitValidOT) -) \ No newline at end of file +)