forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTrackingInterface.h
More file actions
100 lines (85 loc) · 3.33 KB
/
TrackingInterface.h
File metadata and controls
100 lines (85 loc) · 3.33 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// 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.
#ifndef O2_ITS_TRACKINGINTERFACE
#define O2_ITS_TRACKINGINTERFACE
#include "Framework/DataProcessorSpec.h"
#include "ITStracking/TimeFrame.h"
#include "ITStracking/Tracker.h"
#include "ITStracking/TrackerTraits.h"
#include "ITStracking/Vertexer.h"
#include "ITStracking/VertexerTraits.h"
#include "ITStracking/BoundedAllocator.h"
#include "DataFormatsParameters/GRPObject.h"
#include "DataFormatsITSMFT/TopologyDictionary.h"
#include "DataFormatsCalibration/MeanVertexObject.h"
#include "GPUDataTypes.h"
#include "GPUO2Interface.h"
#include "GPUChainITS.h"
#include <oneapi/tbb/task_arena.h>
namespace o2::its
{
class ITSTrackingInterface
{
static constexpr int NLayers{7};
using TrackerTraits7 = TrackerTraits<NLayers>;
using TimeFrame7 = TimeFrame<NLayers>;
public:
ITSTrackingInterface(bool isMC,
int trgType,
const bool overrBeamEst)
: mIsMC{isMC},
mUseTriggers{trgType},
mOverrideBeamEstimation{overrBeamEst} {}
void setClusterDictionary(const o2::itsmft::TopologyDictionary* d) { mDict = d; }
void setMeanVertex(const o2::dataformats::MeanVertexObject* v)
{
if (v == nullptr) {
LOGP(error, "Mean Vertex Object is nullptr");
return;
} else {
LOGP(info, "Mean Vertex set with x: {} y: {}", v->getX(), v->getY());
}
mMeanVertex = v;
}
// Task callbacks
void initialise();
void run(framework::ProcessingContext& pc);
void printSummary() const;
void end();
virtual void updateTimeDependentParams(framework::ProcessingContext& pc);
virtual void finaliseCCDB(framework::ConcreteDataMatcher& matcher, void* obj);
// Custom
void setTraitsFromProvider(VertexerTraits*, TrackerTraits7*, TimeFrame7*);
void setTrackingMode(TrackingMode::Type mode = TrackingMode::Unset) { mMode = mode; }
auto getTracker() const { return mTracker.get(); }
auto getVertexer() const { return mVertexer.get(); }
TimeFrame7* mTimeFrame = nullptr;
protected:
virtual void loadROF(gsl::span<itsmft::ROFRecord>& trackROFspan,
gsl::span<const itsmft::CompClusterExt> clusters,
gsl::span<const unsigned char>::iterator& pattIt,
const dataformats::MCTruthContainer<MCCompLabel>* mcLabels);
private:
bool mIsMC = false;
bool mRunVertexer = true;
bool mCosmicsProcessing = false;
int mUseTriggers = 0;
TrackingMode::Type mMode = TrackingMode::Unset;
bool mOverrideBeamEstimation = false;
const o2::itsmft::TopologyDictionary* mDict = nullptr;
std::unique_ptr<Tracker> mTracker = nullptr;
std::unique_ptr<Vertexer> mVertexer = nullptr;
const o2::dataformats::MeanVertexObject* mMeanVertex;
std::shared_ptr<BoundedMemoryResource> mMemoryPool;
std::shared_ptr<tbb::task_arena> mTaskArena;
};
} // namespace o2::its
#endif // O2_ITS_TRACKINGINTERFACE