Skip to content

Commit b5afa49

Browse files
committed
ITS: unify configuration of algorithms
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 52d7d58 commit b5afa49

File tree

24 files changed

+322
-330
lines changed

24 files changed

+322
-330
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ void TrackerTraitsGPU<nLayers>::findRoads(const int iteration)
243243
this->mTrkParams[0].MaxChi2ClusterAttachment,
244244
this->mTrkParams[0].MaxChi2NDF,
245245
mTimeFrameGPU->getDevicePropagator(),
246-
this->mCorrType,
246+
this->mTrkParams[0].CorrType,
247247
conf.nBlocks,
248248
conf.nThreads);
249249
}
@@ -265,7 +265,7 @@ void TrackerTraitsGPU<nLayers>::findRoads(const int iteration)
265265
this->mTrkParams[0].MaxChi2ClusterAttachment, // float maxChi2ClusterAttachment
266266
this->mTrkParams[0].MaxChi2NDF, // float maxChi2NDF
267267
mTimeFrameGPU->getDevicePropagator(), // const o2::base::Propagator* propagator
268-
this->mCorrType, // o2::base::PropagatorImpl<float>::MatCorrType
268+
this->mTrkParams[0].CorrType, // o2::base::PropagatorImpl<float>::MatCorrType
269269
conf.nBlocks,
270270
conf.nThreads);
271271

Detectors/ITSMFT/ITS/tracking/include/ITStracking/Configuration.h

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,8 @@
2626
#include "DetectorsBase/Propagator.h"
2727
#include "ITStracking/Constants.h"
2828

29-
namespace o2
29+
namespace o2::its
3030
{
31-
namespace its
32-
{
33-
34-
enum class TrackingMode {
35-
Sync,
36-
Async,
37-
Cosmics,
38-
Unset, // Special value to leave a default in case we want to override via Configurable Params
39-
};
40-
41-
std::string asString(TrackingMode mode);
42-
std::ostream& operator<<(std::ostream& os, TrackingMode v);
43-
44-
template <typename Param>
45-
class Configuration : public Param
46-
{
47-
public:
48-
static Configuration<Param>& getInstance()
49-
{
50-
static Configuration<Param> instance;
51-
return instance;
52-
}
53-
Configuration(const Configuration<Param>&) = delete;
54-
const Configuration<Param>& operator=(const Configuration<Param>&) = delete;
55-
56-
private:
57-
Configuration() = default;
58-
};
5931

6032
struct TrackingParameters {
6133
int CellMinimumLevel() const noexcept { return MinTrackLength - constants::ClustersPerCell + 1; }
@@ -166,7 +138,24 @@ struct TimeFrameGPUParameters {
166138
int maxGPUMemoryGB = -1;
167139
};
168140

169-
} // namespace its
170-
} // namespace o2
141+
namespace TrackingMode
142+
{
143+
enum Type : int8_t {
144+
Unset = -1, // Special value to leave a default in case we want to override via Configurable Params
145+
Sync = 0,
146+
Async = 1,
147+
Cosmics = 2,
148+
Off = 3,
149+
};
150+
151+
Type fromString(std::string_view str);
152+
std::string toString(Type mode);
153+
154+
std::vector<TrackingParameters> getTrackingParameters(Type mode);
155+
std::vector<VertexingParameters> getVertexingParameters(Type mode);
156+
157+
}; // namespace TrackingMode
158+
159+
} // namespace o2::its
171160

172161
#endif /* TRACKINGITSU_INCLUDE_CONFIGURATION_H_ */

Detectors/ITSMFT/ITS/tracking/include/ITStracking/Tracker.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ class Tracker
7171
void setParameters(const std::vector<TrackingParameters>& p) { mTrkParams = p; }
7272
void setMemoryPool(std::shared_ptr<BoundedMemoryResource>& pool) { mMemoryPool = pool; }
7373
std::vector<TrackingParameters>& getParameters() { return mTrkParams; }
74-
void getGlobalConfiguration();
7574
void setBz(float bz) { mTraits->setBz(bz); }
76-
void setCorrType(const o2::base::PropagatorImpl<float>::MatCorrType type) { mTraits->setCorrType(type); }
7775
bool isMatLUT() const { return mTraits->isMatLUT(); }
7876
void setNThreads(int n, std::shared_ptr<tbb::task_arena>& arena) { mTraits->setNThreads(n, arena); }
7977
void printSummary() const;

Detectors/ITSMFT/ITS/tracking/include/ITStracking/TrackerTraits.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class TrackerTraits
6565

6666
virtual void setBz(float bz);
6767
float getBz() const { return mBz; }
68-
void setCorrType(const o2::base::PropagatorImpl<float>::MatCorrType type) { mCorrType = type; }
6968
bool isMatLUT() const;
7069
virtual const char* getName() const noexcept { return "CPU"; }
7170
virtual bool isGPU() const noexcept { return false; }
@@ -99,7 +98,6 @@ class TrackerTraits
9998
std::shared_ptr<tbb::task_arena> mTaskArena;
10099

101100
protected:
102-
o2::base::PropagatorImpl<float>::MatCorrType mCorrType = o2::base::PropagatorImpl<float>::MatCorrType::USEMatCorrNONE;
103101
o2::gpu::GPUChainITS* mChain = nullptr;
104102
TimeFrame<nLayers>* mTimeFrame;
105103
std::vector<TrackingParameters> mTrkParams;

Detectors/ITSMFT/ITS/tracking/include/ITStracking/TrackingInterface.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,7 @@ class ITSTrackingInterface
6868

6969
// Custom
7070
void setTraitsFromProvider(VertexerTraits*, TrackerTraits7*, TimeFrame7*);
71-
void setTrackingMode(TrackingMode mode = TrackingMode::Unset)
72-
{
73-
if (mode == TrackingMode::Unset) {
74-
LOGP(fatal, "ITS Tracking mode Unset is meant to be a default. Specify the mode");
75-
}
76-
mMode = mode;
77-
}
71+
void setTrackingMode(TrackingMode::Type mode = TrackingMode::Unset) { mMode = mode; }
7872

7973
auto getTracker() const { return mTracker.get(); }
8074
auto getVertexer() const { return mVertexer.get(); }
@@ -86,14 +80,13 @@ class ITSTrackingInterface
8680
gsl::span<const itsmft::CompClusterExt> clusters,
8781
gsl::span<const unsigned char>::iterator& pattIt,
8882
const dataformats::MCTruthContainer<MCCompLabel>* mcLabels);
89-
void getConfiguration(framework::ProcessingContext& pc);
9083

9184
private:
9285
bool mIsMC = false;
9386
bool mRunVertexer = true;
9487
bool mCosmicsProcessing = false;
9588
int mUseTriggers = 0;
96-
TrackingMode mMode = TrackingMode::Unset;
89+
TrackingMode::Type mMode = TrackingMode::Unset;
9790
bool mOverrideBeamEstimation = false;
9891
const o2::itsmft::TopologyDictionary* mDict = nullptr;
9992
std::unique_ptr<Tracker> mTracker = nullptr;

Detectors/ITSMFT/ITS/tracking/include/ITStracking/Vertexer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ class Vertexer
6060
auto& getVertParameters() const { return mTraits->getVertexingParameters(); }
6161
void setParameters(const std::vector<VertexingParameters>& vertParams) { mVertParams = vertParams; }
6262
const auto& getParameters() const noexcept { return mVertParams; }
63-
void getGlobalConfiguration();
6463
void setMemoryPool(std::shared_ptr<BoundedMemoryResource>& pool) { mMemoryPool = pool; }
6564

6665
std::vector<Vertex> exportVertices();

0 commit comments

Comments
 (0)