Project
Loading...
Searching...
No Matches
TrackerSpec.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13
14#ifndef O2_TRK_TRACKERDPL
15#define O2_TRK_TRACKERDPL
16
18
20#include "Framework/Task.h"
21
22#include <oneapi/tbb/task_arena.h>
23
27#include "GPUDataTypesConfig.h"
28
30
31#include "TStopwatch.h"
32
33#include <nlohmann/json.hpp>
34
35#include <memory>
36#include <utility>
37#include <vector>
38
39namespace o2::trk
40{
42{
43 public:
44 TrackerDPL(std::shared_ptr<o2::base::GRPGeomRequest> gr,
45 bool isMC,
46 const std::string& hitRecoConfig,
47 const std::string& clusterRecoConfig,
49 ~TrackerDPL() override = default;
50 void init(framework::InitContext& ic) final;
51 void run(framework::ProcessingContext& pc) final;
53 // void finaliseCCDB(framework::ConcreteDataMatcher& matcher, void* obj) final;
54 void stop() final;
55 template <typename TimeFrameT, typename TrackerTraitsT>
56 void runTracking(framework::ProcessingContext& pc, TimeFrameT& timeFrame, TrackerTraitsT& trackerTraits);
57 const std::shared_ptr<its::ExternalAllocator>& getGPUAllocator() const noexcept { return mGPUAllocator; }
58 void setGPUAllocator(std::shared_ptr<its::ExternalAllocator> allocator) { mGPUAllocator = std::move(allocator); }
59
60 private:
61 void updateTimeDependentParams(framework::ProcessingContext& pc);
62 std::vector<o2::its::TrackingParameters> createTrackingParamsFromConfig();
63 void runGPUTracking(framework::ProcessingContext& pc);
64 // std::unique_ptr<o2::gpu::GPUReconstruction> mRecChain = nullptr;
65 // std::unique_ptr<o2::gpu::GPUChainITS> mChainITS = nullptr;
66 // std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
67 // ITSTrackingInterface mITSTrackingInterface;
68 bool mIsMC{true};
70 std::shared_ptr<its::BoundedMemoryResource> mMemoryPool;
71 std::shared_ptr<its::ExternalAllocator> mGPUAllocator;
72 std::shared_ptr<tbb::task_arena> mTaskArena;
73 std::vector<o2::its::TrackingParameters> mTrackingParams;
74 nlohmann::json mHitRecoConfig;
75 nlohmann::json mClusterRecoConfig;
76 TStopwatch mTimer;
77#ifdef O2_WITH_ACTS
78 bool mUseACTS = false;
79#endif
80};
81
82framework::DataProcessorSpec getTrackerSpec(bool useMC, const std::string& hitRecoConfig, const std::string& clusterRecoConfig, gpu::gpudatatypes::DeviceType dType = gpu::gpudatatypes::DeviceType::CPU);
83
84} // namespace o2::trk
85#endif /* O2_TRK_TRACKERDPL */
Definition of the ClusterTopology class.
Helper for geometry and GRP related CCDB requests.
const std::shared_ptr< its::ExternalAllocator > & getGPUAllocator() const noexcept
Definition TrackerSpec.h:57
void runTracking(framework::ProcessingContext &pc, TimeFrameT &timeFrame, TrackerTraitsT &trackerTraits)
void endOfStream(framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void run(framework::ProcessingContext &pc) final
void stop() final
This is invoked on stop.
~TrackerDPL() override=default
void init(framework::InitContext &ic) final
void setGPUAllocator(std::shared_ptr< its::ExternalAllocator > allocator)
Definition TrackerSpec.h:58
framework::DataProcessorSpec getTrackerSpec(bool useMC, const std::string &hitRecoConfig, const std::string &clusterRecoConfig, gpu::gpudatatypes::DeviceType dType=gpu::gpudatatypes::DeviceType::CPU)