-
Notifications
You must be signed in to change notification settings - Fork 510
TPCClusterFinder: Add optional filter for noisy pads. #4850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| // Copyright CERN and copyright holders of ALICE O2. This software is | ||
| // distributed under the terms of the GNU General Public License v3 (GPL | ||
| // Version 3), copied verbatim in the file "COPYING". | ||
| // | ||
| // See http://alice-o2.web.cern.ch/license for full licensing information. | ||
| // | ||
| // In applying this license CERN does not waive the privileges and immunities | ||
| // granted to it by virtue of its status as an Intergovernmental Organization | ||
| // or submit itself to any jurisdiction. | ||
|
|
||
| /// \file GPUTPCCFCheckPadBaseline.h | ||
| /// \author Felix Weiglhofer | ||
|
|
||
| #include "GPUTPCCFCheckPadBaseline.h" | ||
| #include "Array2D.h" | ||
| #include "PackedCharge.h" | ||
| #include "clusterFinderDefs.h" | ||
|
|
||
| using namespace GPUCA_NAMESPACE::gpu; | ||
| using namespace GPUCA_NAMESPACE::gpu::tpccf; | ||
|
|
||
| template <> | ||
| GPUd() void GPUTPCCFCheckPadBaseline::Thread<0>(int nBlocks, int nThreads, int iBlock, int iThread, GPUSharedMemory& smem, processorType& clusterer) | ||
| { | ||
| static_assert(TPC_MAX_FRAGMENT_LEN % NumOfCachedTimebins == 0); | ||
|
|
||
| Array2D<PackedCharge> chargeMap(reinterpret_cast<PackedCharge*>(clusterer.mPchargeMap)); | ||
|
|
||
| int totalCharges = 0; | ||
| int consecCharges = 0; | ||
| int maxConsecCharges = 0; | ||
|
|
||
| int localPadId = iThread / NumOfCachedTimebins; | ||
| int localTimeBin = iThread % NumOfCachedTimebins; | ||
| bool handlePad = localTimeBin == 0; | ||
| int basePad = iBlock * PadsPerBlock; | ||
|
|
||
| CfFragment& fragment = clusterer.mPmemory->fragment; | ||
|
|
||
| ChargePos basePos = padToChargePos(basePad + localPadId, clusterer); | ||
|
|
||
| for (tpccf::TPCFragmentTime t = localTimeBin + fragment.firstNonOverlapTimeBin(); t < fragment.lastNonOverlapTimeBin(); t += NumOfCachedTimebins) { | ||
| ChargePos pos = basePos.delta({0, t}); | ||
| smem.charges[localPadId][localTimeBin] = (pos.valid()) ? chargeMap[pos].unpack() : 0; | ||
| GPUbarrierWarp(); | ||
| if (handlePad) { | ||
| for (int i = 0; i < NumOfCachedTimebins; i++) { | ||
| Charge q = smem.charges[localPadId][i]; | ||
| totalCharges += (q > 0); | ||
| consecCharges = (q > 0) ? consecCharges + 1 : 0; | ||
| maxConsecCharges = CAMath::Max(consecCharges, maxConsecCharges); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| GPUbarrierWarp(); | ||
|
|
||
| if (handlePad) { | ||
| int totalChargesBaseline = clusterer.Param().rec.maxTimeBinAboveThresholdIn1000Bin * fragment.lengthWithoutOverlap() / 1000; | ||
| int consecChargesBaseline = clusterer.Param().rec.maxConsecTimeBinAboveThreshold; | ||
| bool hasLostBaseline = (totalChargesBaseline > 0 && totalCharges >= totalChargesBaseline) || (consecChargesBaseline > 0 && maxConsecCharges >= consecChargesBaseline); | ||
| clusterer.mPpadHasLostBaseline[basePad + localPadId] |= hasLostBaseline; | ||
| } | ||
| } | ||
|
|
||
| GPUd() ChargePos GPUTPCCFCheckPadBaseline::padToChargePos(int pad, const GPUTPCClusterFinder& clusterer) | ||
| { | ||
| const GPUTPCGeometry& geo = clusterer.Param().tpcGeometry; | ||
|
|
||
| int padOffset = 0; | ||
| for (Row r = 0; r < TPC_NUM_OF_ROWS; r++) { | ||
| int padInRow = pad - padOffset; | ||
| if (0 <= padInRow && padInRow < geo.NPads(r)) { | ||
| return ChargePos{r, Pad(padInRow), 0}; | ||
| } | ||
| padOffset += geo.NPads(r); | ||
| } | ||
|
|
||
| return ChargePos{0, 0, INVALID_TIME_BIN}; | ||
| } |
75 changes: 75 additions & 0 deletions
75
GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| // Copyright CERN and copyright holders of ALICE O2. This software is | ||
| // distributed under the terms of the GNU General Public License v3 (GPL | ||
| // Version 3), copied verbatim in the file "COPYING". | ||
| // | ||
| // See http://alice-o2.web.cern.ch/license for full licensing information. | ||
| // | ||
| // In applying this license CERN does not waive the privileges and immunities | ||
| // granted to it by virtue of its status as an Intergovernmental Organization | ||
| // or submit itself to any jurisdiction. | ||
|
|
||
| /// \file GPUTPCCFCheckPadBaseline.h | ||
| /// \author Felix Weiglhofer | ||
|
|
||
| #ifndef O2_GPU_GPU_TPC_CF_CHECK_PAD_BASELINE_H | ||
| #define O2_GPU_GPU_TPC_CF_CHECK_PAD_BASELINE_H | ||
|
|
||
| #include "GPUGeneralKernels.h" | ||
| #include "GPUConstantMem.h" | ||
|
|
||
| #include "clusterFinderDefs.h" | ||
|
|
||
| namespace GPUCA_NAMESPACE::gpu | ||
| { | ||
|
|
||
| class GPUTPCCFCheckPadBaseline : public GPUKernelTemplate | ||
| { | ||
|
|
||
| private: | ||
| // Only use these constants on device side... | ||
| // Use getPadsPerBlock() for host side | ||
| enum { | ||
| PadsPerBlockGPU = 4, // Number of pads in a single cache line | ||
| PadsPerBlockCPU = 1, | ||
| #ifdef GPUCA_GPUCODE | ||
| PadsPerBlock = PadsPerBlockGPU, | ||
| #else | ||
| PadsPerBlock = PadsPerBlockCPU, | ||
| #endif | ||
| NumOfCachedTimebins = GPUCA_GET_THREAD_COUNT(GPUCA_LB_GPUTPCCFCheckPadBaseline) / PadsPerBlock, | ||
| }; | ||
|
|
||
| public: | ||
| struct GPUSharedMemory { | ||
| tpccf::Charge charges[PadsPerBlock][NumOfCachedTimebins]; | ||
| }; | ||
|
|
||
| #ifdef HAVE_O2HEADERS | ||
| typedef GPUTPCClusterFinder processorType; | ||
| GPUhdi() static processorType* Processor(GPUConstantMem& processors) | ||
| { | ||
| return processors.tpcClusterer; | ||
| } | ||
| #endif | ||
|
|
||
| GPUhdi() CONSTEXPR static GPUDataTypes::RecoStep GetRecoStep() | ||
| { | ||
| return GPUDataTypes::RecoStep::TPCClusterFinding; | ||
| } | ||
|
|
||
| // Use this to get num of pads per block on host side. Can't use constant there. | ||
| static int getPadsPerBlock(bool isGPU) | ||
| { | ||
| return (isGPU) ? PadsPerBlockGPU : PadsPerBlockCPU; | ||
| } | ||
|
|
||
| template <int iKernel = defaultKernel> | ||
| GPUd() static void Thread(int nBlocks, int nThreads, int iBlock, int iThread, GPUSharedMemory& smem, processorType& clusterer); | ||
|
|
||
| private: | ||
| GPUd() static ChargePos padToChargePos(int pad, const GPUTPCClusterFinder&); | ||
| }; | ||
|
|
||
| } // namespace GPUCA_NAMESPACE::gpu | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.