From 779091bcfcb468f714567ce47d25fc6dc12c956e Mon Sep 17 00:00:00 2001 From: AdrianoDee Date: Tue, 28 Mar 2023 13:02:46 +0200 Subject: [PATCH] Guard for no digis for Phase2 - Adding NuGun wfs --- .../PyReleaseValidation/python/relval_2017.py | 5 ++- .../PyReleaseValidation/python/relval_2026.py | 2 ++ .../PyReleaseValidation/python/relval_gpu.py | 4 +++ .../python/upgradeWorkflowComponents.py | 7 ++++- .../plugins/SiPixelPhase2DigiToClusterCUDA.cc | 31 +++++++++++++------ 5 files changed, 38 insertions(+), 11 deletions(-) diff --git a/Configuration/PyReleaseValidation/python/relval_2017.py b/Configuration/PyReleaseValidation/python/relval_2017.py index 088cff74d42e9..2f641e5005ff4 100644 --- a/Configuration/PyReleaseValidation/python/relval_2017.py +++ b/Configuration/PyReleaseValidation/python/relval_2017.py @@ -47,7 +47,9 @@ # (Patatrack pixel-only: ZMM - on CPU: quadruplets, triplets) # (TTbar FastSim, TTbar FastSim PU, MinBiasFS for mixing)) # (ZEE) +# (Nu Gun) # 2024 (TTbar, TTbar PU, TTbar PU premix) + numWFIB = [10001.0,10002.0,10003.0,10004.0,10005.0,10006.0,10007.0,10008.0,10009.0,10059.0,10071.0, 10042.0,10024.0,10025.0,10026.0,10023.0,10224.0,10225.0,10424.0, 10024.1,10024.2,10024.3,10024.4,10024.5, @@ -85,7 +87,8 @@ 12450.501,12450.505, 14034.0,14234.0,14040.303, 12446.0, - 12834.0,13034.0,13034.99,] + 12461.0, + 12834.0,13034.0,13034.99,] for numWF in numWFIB: if not numWF in _upgrade_workflows: diff --git a/Configuration/PyReleaseValidation/python/relval_2026.py b/Configuration/PyReleaseValidation/python/relval_2026.py index 7dc42987a84b3..1567a9086eb57 100644 --- a/Configuration/PyReleaseValidation/python/relval_2026.py +++ b/Configuration/PyReleaseValidation/python/relval_2026.py @@ -42,6 +42,8 @@ #CloseByPGun for HGCAL numWFIB.extend([24896.0]) #CE_E_Front_120um D98 numWFIB.extend([24900.0]) #CE_H_Coarse_Scint D98 +# NuGun +numWFIB.extend([24861.0]) #Nu Gun 2026D98 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 d53c326662370..3eeabf9d3c43a 100644 --- a/Configuration/PyReleaseValidation/python/relval_gpu.py +++ b/Configuration/PyReleaseValidation/python/relval_gpu.py @@ -23,6 +23,8 @@ # Patatrack pixel-only triplets, ECAL, HCAL: TTbar - on GPU (optional), GPU-vs-CPU validation, profiling (to be implemented) # full reco with Patatrack pixel-only quadruplets: TTbar - on GPU (optional), GPU-vs-CPU validation # full reco with Patatrack pixel-only triplets: TTbar - on GPU (optional), GPU-vs-CPU validation +# Patatrack Single Nu E10 on GPU (optional) +# mc 2026 Patatrack Single Nu E10 on GPU (optional) numWFIB = [ # 2023 12450.502, 12450.503, 12450.504, @@ -35,6 +37,8 @@ 12434.586, 12434.587, # 12434.588, 12434.592, 12434.593, 12434.596, 12434.597, + 12461.502, + 24861.502 ] for numWF in numWFIB: diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index ea6041c9d2822..f9717a3c7446b 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -782,10 +782,13 @@ def condition(self, fragment, stepList, key, hasHarvest): # - 2018 conditions, TTbar # - 2018 conditions, Z->mumu # - 2022 conditions (labelled "2021"), TTbar +# - 2022 conditions (labelled "2021"), NuGun # - 2022 conditions (labelled "2021"), Z->mumu # - 2023 conditions, TTbar +# - 2023 conditions, NuGun # - 2023 conditions, Z->mumu # - 2026 conditions, TTbar +# - 2026 conditions, NuGu class PatatrackWorkflow(UpgradeWorkflow): def __init__(self, digi = {}, reco = {}, mini = {}, harvest = {}, **kwargs): # adapt the parameters for the UpgradeWorkflow init method @@ -843,10 +846,12 @@ def condition(self, fragment, stepList, key, hasHarvest): ('2018' in key and fragment == "TTbar_13"), ('2021' in key and fragment == "TTbar_14TeV" and 'FS' not in key), ('2023' in key and fragment == "TTbar_14TeV" and 'FS' not in key), + ('2021' in key and fragment == "NuGun"), + ('2023' in key and fragment == "NuGun"), ('2018' in key and fragment == "ZMM_13"), ('2021' in key and fragment == "ZMM_14" and 'FS' not in key), ('2023' in key and fragment == "ZMM_14" and 'FS' not in key), - ('2026' in key and fragment == "TTbar_14TeV"), + ('2026' in key and (fragment == "TTbar_14TeV" or fragment=="NuGun")), (('HI' in key) and 'Hydjet' in fragment and "PixelOnly" in self.suffix ) ] result = any(selected) and hasHarvest diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelPhase2DigiToClusterCUDA.cc b/RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelPhase2DigiToClusterCUDA.cc index 260b288b581db..e68c8074d8535 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelPhase2DigiToClusterCUDA.cc +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelPhase2DigiToClusterCUDA.cc @@ -69,6 +69,7 @@ class SiPixelPhase2DigiToClusterCUDA : public edm::stream::EDProducer(gpuClustering::maxNumDigis, ctx.stream()); auto yDigis = cms::cuda::make_host_unique(gpuClustering::maxNumDigis, ctx.stream()); @@ -126,20 +127,23 @@ void SiPixelPhase2DigiToClusterCUDA::acquire(const edm::Event& iEvent, const GeomDetUnit* genericDet = geom_->idToDetUnit(detIdObject); auto const gind = genericDet->index(); for (auto const& px : *DSViter) { - moduleIds[nDigis] = uint16_t(gind); + moduleIds[nDigis_] = uint16_t(gind); - xDigis[nDigis] = uint16_t(px.row()); - yDigis[nDigis] = uint16_t(px.column()); - adcDigis[nDigis] = uint16_t(px.adc()); + xDigis[nDigis_] = uint16_t(px.row()); + yDigis[nDigis_] = uint16_t(px.column()); + adcDigis[nDigis_] = uint16_t(px.adc()); - packedData[nDigis] = uint32_t(px.packedData()); + packedData[nDigis_] = uint32_t(px.packedData()); - rawIds[nDigis] = uint32_t(detid); + rawIds[nDigis_] = uint32_t(detid); - nDigis++; + nDigis_++; } } + if (nDigis_ == 0) + return; + gpuAlgo_.makePhase2ClustersAsync(clusterThresholds_, moduleIds.get(), xDigis.get(), @@ -147,13 +151,22 @@ void SiPixelPhase2DigiToClusterCUDA::acquire(const edm::Event& iEvent, adcDigis.get(), packedData.get(), rawIds.get(), - nDigis, + nDigis_, ctx.stream()); } void SiPixelPhase2DigiToClusterCUDA::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { cms::cuda::ScopedContextProduce ctx{ctxState_}; + if (nDigis_ == 0) { + ctx.emplace(iEvent, digiPutToken_, nDigis_, ctx.stream()); + ctx.emplace(iEvent, clusterPutToken_, pixelTopology::Phase2::numberOfModules, ctx.stream()); + if (includeErrors_) { + ctx.emplace(iEvent, digiErrorPutToken_, SiPixelDigiErrorsCUDA{}); + } + return; + } + auto tmp = gpuAlgo_.getResults(); ctx.emplace(iEvent, digiPutToken_, std::move(tmp.first)); ctx.emplace(iEvent, clusterPutToken_, std::move(tmp.second));