Skip to content

Commit ab118f1

Browse files
authored
Merge 84ca389 into sapling-pr-archive-ktf
2 parents 884c29a + 84ca389 commit ab118f1

File tree

9 files changed

+203
-101
lines changed

9 files changed

+203
-101
lines changed

Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/TrackingKernels.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ GPUg() void fitTrackSeedsKernel(
4040
CellSeed* trackSeeds,
4141
const TrackingFrameInfo** foundTrackingFrameInfo,
4242
o2::its::TrackITSExt* tracks,
43+
const float* minPts,
4344
const unsigned int nSeeds,
4445
const float Bz,
4546
const int startLevel,
@@ -182,6 +183,7 @@ void filterCellNeighboursHandler(std::vector<int>&,
182183
void trackSeedHandler(CellSeed* trackSeeds,
183184
const TrackingFrameInfo** foundTrackingFrameInfo,
184185
o2::its::TrackITSExt* tracks,
186+
std::vector<float>& minPtsHost,
185187
const unsigned int nSeeds,
186188
const float Bz,
187189
const int startLevel,

Detectors/ITSMFT/ITS/tracking/GPU/cuda/TrackerTraitsGPU.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ void TrackerTraitsGPU<nLayers>::findRoads(const int iteration)
278278
const int minimumLayer{startLevel - 1};
279279
std::vector<CellSeed> trackSeeds;
280280
for (int startLayer{mTrkParams[iteration].CellsPerRoad() - 1}; startLayer >= minimumLayer; --startLayer) {
281+
if ((mTrkParams[iteration].StartLayerMask & (1 << (startLayer + 2))) == 0) {
282+
continue;
283+
}
281284
std::vector<int> lastCellId, updatedCellId;
282285
std::vector<CellSeed> lastCellSeed, updatedCellSeed;
283286

@@ -308,6 +311,7 @@ void TrackerTraitsGPU<nLayers>::findRoads(const int iteration)
308311
trackSeedHandler(mTimeFrameGPU->getDeviceTrackSeeds(), // CellSeed* trackSeeds,
309312
mTimeFrameGPU->getDeviceArrayTrackingFrameInfo(), // TrackingFrameInfo** foundTrackingFrameInfo,
310313
mTimeFrameGPU->getDeviceTrackITSExt(), // o2::its::TrackITSExt* tracks,
314+
mTrkParams[iteration].MinPt, // std::vector<float>& minPtsHost,
311315
trackSeeds.size(), // const size_t nSeeds,
312316
mBz, // const float Bz,
313317
startLevel, // const int startLevel,

Detectors/ITSMFT/ITS/tracking/GPU/cuda/TrackingKernels.cu

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ GPUg() void fitTrackSeedsKernel(
267267
CellSeed* trackSeeds,
268268
const TrackingFrameInfo** foundTrackingFrameInfo,
269269
o2::its::TrackITSExt* tracks,
270+
const float* minPts,
270271
const unsigned int nSeeds,
271272
const float Bz,
272273
const int startLevel,
@@ -317,7 +318,7 @@ GPUg() void fitTrackSeedsKernel(
317318
foundTrackingFrameInfo, // TrackingFrameInfo** trackingFrameInfo,
318319
propagator, // const o2::base::Propagator* propagator,
319320
matCorrType); // o2::base::PropagatorF::MatCorrType matCorrType
320-
if (!fitSuccess) {
321+
if (!fitSuccess || temporaryTrack.getPt() < minPts[nLayers - temporaryTrack.getNClusters()]) {
321322
continue;
322323
}
323324
tracks[iCurrentTrackSeedIndex] = temporaryTrack;
@@ -1089,6 +1090,7 @@ void filterCellNeighboursHandler(std::vector<int>& neighHost,
10891090
void trackSeedHandler(CellSeed* trackSeeds,
10901091
const TrackingFrameInfo** foundTrackingFrameInfo,
10911092
o2::its::TrackITSExt* tracks,
1093+
std::vector<float>& minPtsHost,
10921094
const unsigned int nSeeds,
10931095
const float Bz,
10941096
const int startLevel,
@@ -1099,17 +1101,19 @@ void trackSeedHandler(CellSeed* trackSeeds,
10991101
const int nBlocks,
11001102
const int nThreads)
11011103
{
1104+
thrust::device_vector<float> minPts(minPtsHost);
11021105
gpu::fitTrackSeedsKernel<<<nBlocks, nThreads>>>(
1103-
trackSeeds, // CellSeed*
1104-
foundTrackingFrameInfo, // TrackingFrameInfo**
1105-
tracks, // TrackITSExt*
1106-
nSeeds, // const unsigned int
1107-
Bz, // const float
1108-
startLevel, // const int
1109-
maxChi2ClusterAttachment, // float
1110-
maxChi2NDF, // float
1111-
propagator, // const o2::base::Propagator*
1112-
matCorrType); // o2::base::PropagatorF::MatCorrType
1106+
trackSeeds, // CellSeed*
1107+
foundTrackingFrameInfo, // TrackingFrameInfo**
1108+
tracks, // TrackITSExt*
1109+
thrust::raw_pointer_cast(&minPts[0]), // const float* minPts,
1110+
nSeeds, // const unsigned int
1111+
Bz, // const float
1112+
startLevel, // const int
1113+
maxChi2ClusterAttachment, // float
1114+
maxChi2NDF, // float
1115+
propagator, // const o2::base::Propagator*
1116+
matCorrType); // o2::base::PropagatorF::MatCorrType
11131117
11141118
gpuCheckError(cudaPeekAtLastError());
11151119
gpuCheckError(cudaDeviceSynchronize());

Framework/AnalysisSupport/src/AODJAlienReaderHelpers.cxx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
// or submit itself to any jurisdiction.
1111

1212
#include "AODJAlienReaderHelpers.h"
13+
#include <memory>
1314
#include "Framework/TableTreeHelpers.h"
1415
#include "Framework/AnalysisHelpers.h"
1516
#include "Framework/DataProcessingStats.h"
1617
#include "Framework/RootTableBuilderHelpers.h"
18+
#include "Framework/RootArrowFilesystem.h"
1719
#include "Framework/AlgorithmSpec.h"
1820
#include "Framework/ConfigParamRegistry.h"
1921
#include "Framework/ControlService.h"
@@ -41,6 +43,8 @@
4143
#include <arrow/io/interfaces.h>
4244
#include <arrow/table.h>
4345
#include <arrow/util/key_value_metadata.h>
46+
#include <arrow/dataset/dataset.h>
47+
#include <arrow/dataset/file_base.h>
4448

4549
using namespace o2;
4650
using namespace o2::aod;
@@ -272,11 +276,13 @@ AlgorithmSpec AODJAlienReaderHelpers::rootFileReaderCallback(ConfigContext const
272276
// Origin file name for derived output map
273277
auto o2 = Output(TFFileNameHeader);
274278
auto fileAndFolder = didir->getFileFolder(dh, fcnt, ntf);
275-
std::string currentFilename(fileAndFolder.file->GetName());
276-
if (strcmp(fileAndFolder.file->GetEndpointUrl()->GetProtocol(), "file") == 0 && fileAndFolder.file->GetEndpointUrl()->GetFile()[0] != '/') {
279+
auto rootFS = std::dynamic_pointer_cast<TFileFileSystem>(fileAndFolder.filesystem());
280+
auto* f = dynamic_cast<TFile*>(rootFS->GetFile());
281+
std::string currentFilename(f->GetFile()->GetName());
282+
if (strcmp(f->GetEndpointUrl()->GetProtocol(), "file") == 0 && f->GetEndpointUrl()->GetFile()[0] != '/') {
277283
// This is not an absolute local path. Make it absolute.
278284
static std::string pwd = gSystem->pwd() + std::string("/");
279-
currentFilename = pwd + std::string(fileAndFolder.file->GetName());
285+
currentFilename = pwd + std::string(f->GetName());
280286
}
281287
outputs.make<std::string>(o2) = currentFilename;
282288
}
@@ -312,7 +318,9 @@ AlgorithmSpec AODJAlienReaderHelpers::rootFileReaderCallback(ConfigContext const
312318
auto concrete = DataSpecUtils::asConcreteDataMatcher(firstRoute.matcher);
313319
auto dh = header::DataHeader(concrete.description, concrete.origin, concrete.subSpec);
314320
auto fileAndFolder = didir->getFileFolder(dh, fcnt, ntf);
315-
if (!fileAndFolder.file) {
321+
322+
// In case the filesource is empty, move to the next one.
323+
if (fileAndFolder.path().empty()) {
316324
fcnt += 1;
317325
ntf = 0;
318326
if (didir->atEnd(fcnt)) {

0 commit comments

Comments
 (0)