Skip to content

Commit 371f12c

Browse files
committed
Unclutter the configuration
1 parent 69dde8b commit 371f12c

17 files changed

Lines changed: 36 additions & 416 deletions

Detectors/ITSMFT/ITS/workflow-ca/src/ConfigPreflight.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "CommonUtils/StringUtils.h"
2121
#include "Framework/Logger.h"
2222
#include "ITSMFTTracking/TrackingConfigParam.h"
23+
#include "ITSMFTTracking/ITSTrackingConfigParam.h"
2324

2425
namespace o2::its::ca
2526
{
@@ -87,7 +88,6 @@ WorkflowOptions readWorkflowOptions(const o2::framework::ConfigContext& context)
8788
WorkflowOptions result;
8889
result.mode = o2::itsmft::TrackingMode::fromString(options.get<std::string>("tracking-mode"));
8990
requireSupportedTrackingModeOrFatal(result.mode);
90-
o2::itsmft::TrackingMode::validateCommonCAOptions(o2::detectors::DetID::ITS);
9191
const auto& params = o2::itsmft::ITSCommonCATrackerParam::Instance();
9292
result.vertexSource = resolveVertexSource(options.get<std::string>("vertex-source"), params.useDiamond,
9393
o2::its::VertexerParamConfig::Instance().useTruthSeeding);

Detectors/ITSMFT/ITS/workflow-ca/test/testITSCAConfigPreflight.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "Framework/ParamRetriever.h"
3030
#include "Framework/ServiceRegistry.h"
3131
#include "ITSMFTTracking/TrackingConfigParam.h"
32+
#include "ITSMFTTracking/ITSTrackingConfigParam.h"
3233

3334
using namespace o2::its::ca;
3435

Detectors/ITSMFT/MFT/workflow/src/CATrackerSpec.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ void CATrackerDPL::configureROFViews(gsl::span<const o2::itsmft::ROFRecord> rofs
258258
void CATrackerDPL::initialiseTracking()
259259
{
260260
const auto mode = mOptions.mode;
261-
const auto& trackerParams = o2::itsmft::tracking::TrackerParamRef<o2::detectors::DetID::MFT>::get();
261+
const auto& trackerParams = o2::itsmft::TrackerParamConfig<o2::detectors::DetID::MFT>::Instance();
262262
auto plan = o2::itsmft::TrackingMode::getTrackingPlan(o2::detectors::DetID::MFT, mode);
263263
LOGP(info, "MFT CA tracker initialized in {} mode with {} iteration(s)",
264264
o2::itsmft::TrackingMode::toString(mode), plan.iterations.size());

Detectors/ITSMFT/MFT/workflow/src/CAWorkflowOptions.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ WorkflowOptions readWorkflowOptions(const o2::framework::ConfigContext& context,
107107
input.tracksToRecords = options.get<bool>("run-tracks2records");
108108
input.staggering = o2::itsmft::DPLAlpideParamInitializer::isMFTStaggeringEnabled(context);
109109
}
110-
o2::itsmft::TrackingMode::validateCommonCAOptions(o2::detectors::DetID::MFT);
111110
const auto& params = Param::Instance();
112111
auto result = resolveWorkflowOptions(input, {params.trackingMode, params.nThreads, MFTTrackingParam::Instance().irFramesOnly});
113112
for (const auto& diagnostic : result.diagnostics) {

Detectors/ITSMFT/common/tracking/include/ITSMFTTracking/Configuration.h

Lines changed: 1 addition & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,9 @@
1616
#ifndef ALICEO2_ITSMFT_TRACKING_CONFIGURATION_H_
1717
#define ALICEO2_ITSMFT_TRACKING_CONFIGURATION_H_
1818

19+
#include <cstddef>
1920
#include <cstdint>
2021

21-
#ifndef GPUCA_GPUCODE
22-
#include <gsl/span>
23-
#include "ITSMFTTracking/SurfaceDescriptor.h"
24-
#endif
25-
2622
#ifndef GPUCA_GPUCODE_DEVICE
2723
#include <limits>
2824
#include <string>
@@ -31,13 +27,9 @@
3127
#endif
3228

3329
#include "CommonUtils/EnumFlags.h"
34-
#include "DetectorsBase/Propagator.h"
3530
#include "DetectorsCommonDataFormats/DetID.h"
36-
#include "GPUCommonMath.h"
37-
#include "ITSMFTTracking/ITSMFTDetectorDefinitions.h"
3831
#include "ITSMFTTracking/LayerMask.h"
3932
#include "ITSMFTTracking/TrackingConfigParam.h"
40-
#include "ITSMFTTracking/ITSTrackingConfigParam.h"
4133

4234
namespace o2::itsmft
4335
{
@@ -50,13 +42,6 @@ enum class IterationStep : uint16_t {
5042
RebuildClusterLUT = 1,
5143
UseUPCMask = 2,
5244
SelectUPCVertices = 3,
53-
// Reserved for legacy vertexing/follower configurations; the common
54-
// tracker does not implement these steps.
55-
ResetVertices = 4,
56-
SkipROFsAboveThreshold = 5,
57-
MarkVerticesAsUPC = 6,
58-
TrackFollowerTop = 7,
59-
TrackFollowerBot = 8,
6045
};
6146
using IterationSteps = o2::utils::EnumFlags<IterationStep>;
6247

@@ -80,11 +65,6 @@ struct IterationParameters {
8065
return SeedingLayers.empty() ? activeLayers : (SeedingLayers & activeLayers);
8166
}
8267

83-
tracking::LayerMask getNonSeedingLayerMask() const noexcept
84-
{
85-
return tracking::LayerMask::span(0, NLayers - 1) & ~getSeedingLayerMask();
86-
}
87-
8868
int getNSeedingLayers() const noexcept
8969
{
9070
return getSeedingLayerMask().count();
@@ -120,17 +100,13 @@ struct IterationParameters {
120100
/// Trackleting cuts
121101
float TrackletMinPt = 0.3f;
122102
/// Fitter parameters
123-
// Common tracking applies nominal descriptor material; NONE disables external providers only.
124-
o2::base::PropagatorImpl<float>::MatCorrType CorrType = o2::base::PropagatorImpl<float>::MatCorrType::USEMatCorrNONE;
125103
float MaxChi2ClusterAttachment = 60.f;
126104
float MaxChi2NDF = 30.f;
127-
int ReseedIfShorter = 6; // Reseed final fit tracks shorter than this.
128105
std::vector<float> MinPt = {0.f, 0.f, 0.f, 0.f};
129106
tracking::LayerMask StartLayerMask = 0x7F;
130107
bool RepeatRefitOut = false; // Repeat outward refit using inward refit as a seed.
131108
bool ShiftRefToCluster = true; // Shift the linearization reference to the cluster after an update.
132109
bool PerPrimaryVertexProcessing = false;
133-
bool DoUPCIteration = false;
134110
bool CreateArtefactLabels{false};
135111
// Track-sharing selections.
136112
bool AllowSharingFirstCluster = false;
@@ -145,10 +121,6 @@ struct IterationParameters {
145121
// per-iteration configuration.
146122
struct DetectorParameters {
147123
std::vector<uint32_t> AddTimeError = {0, 0, 0, 0, 0, 0, 0};
148-
std::vector<float> LayerZ{tracking::kITSLookupZHalfExtent.begin(), tracking::kITSLookupZHalfExtent.end()};
149-
std::vector<float> LayerColHalfExtent{}; // Legacy PhiZ helper extent (cm); production lookup uses descriptor chartRange.
150-
float IndexRowMin{0.f}; // Reserved legacy bound; production phi lookup starts at 0.
151-
float IndexRowMax{0.f}; // Reserved legacy bound; production phi lookup ends at TwoPI.
152124
std::vector<float> LayerResolution = {5.e-4f, 5.e-4f, 5.e-4f, 5.e-4f, 5.e-4f, 5.e-4f, 5.e-4f};
153125
std::vector<float> SystError2Row = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; // Systematic row error squared per layer (ALPIDE X).
154126
std::vector<float> SystError2Col = {0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f}; // Systematic column error squared per layer (ALPIDE Z).
@@ -159,7 +131,6 @@ struct DetectorParameters {
159131
// Single-pass host defaults/input bundle. Production plans store detector
160132
// inputs and execution policy once, separately from the iteration records.
161133
struct TrackingParameters : IterationParameters, DetectorParameters, TrackingExecutionPolicy {
162-
std::string asString() const;
163134
};
164135

165136
struct TrackingPlan {
@@ -168,70 +139,6 @@ struct TrackingPlan {
168139
std::vector<IterationParameters> iterations;
169140
};
170141

171-
#ifndef GPUCA_GPUCODE
172-
173-
inline bool isRecognizedMatCorrType(o2::base::PropagatorF::MatCorrType corrType) noexcept
174-
{
175-
return corrType == o2::base::PropagatorF::MatCorrType::USEMatCorrNONE ||
176-
corrType == o2::base::PropagatorF::MatCorrType::USEMatCorrTGeo ||
177-
corrType == o2::base::PropagatorF::MatCorrType::USEMatCorrLUT;
178-
}
179-
180-
struct AttachHitConfigView {
181-
tracking::SurfaceCatalogView catalog;
182-
o2::base::PropagatorF::MatCorrType corrType{o2::base::PropagatorF::MatCorrType::USEMatCorrNONE};
183-
184-
bool isValid(size_t expectedLayers) const noexcept
185-
{
186-
if (catalog.nSurfaces < expectedLayers || !catalog.surfaces || !isRecognizedMatCorrType(corrType)) {
187-
return false;
188-
}
189-
for (size_t layer = 0; layer < expectedLayers; ++layer) {
190-
const auto& material = catalog.surfaces[layer].material;
191-
if (!o2::gpu::GPUCommonMath::Finite(material.xOverX0) || material.xOverX0 < 0.f ||
192-
!o2::gpu::GPUCommonMath::Finite(material.arealDensityGPerCm2) || material.arealDensityGPerCm2 < 0.f) {
193-
return false;
194-
}
195-
}
196-
return true;
197-
}
198-
};
199-
200-
inline AttachHitConfigView bindAttachHitConfig(tracking::SurfaceCatalogView catalog,
201-
const IterationParameters& params) noexcept
202-
{
203-
return {catalog, params.CorrType};
204-
}
205-
206-
namespace tracking
207-
{
208-
209-
enum class MaterialCorrectionModeSupport : uint8_t {
210-
Supported,
211-
Unsupported,
212-
InvalidMode,
213-
InvalidSurfaceKind
214-
};
215-
216-
inline MaterialCorrectionModeSupport materialCorrectionModeSupport(
217-
SurfaceKind kind, o2::base::PropagatorF::MatCorrType corrType) noexcept
218-
{
219-
if (!isRecognizedMatCorrType(corrType)) {
220-
return MaterialCorrectionModeSupport::InvalidMode;
221-
}
222-
if (kind != SurfaceKind::Cylinder && kind != SurfaceKind::Disk) {
223-
return MaterialCorrectionModeSupport::InvalidSurfaceKind;
224-
}
225-
if (corrType != o2::base::PropagatorF::MatCorrType::USEMatCorrNONE) {
226-
return MaterialCorrectionModeSupport::Unsupported;
227-
}
228-
return MaterialCorrectionModeSupport::Supported;
229-
}
230-
231-
} // namespace tracking
232-
233-
#endif
234-
235142
/// Reset tracking parameters to detector geometry defaults.
236143
void resetDetectorDefaults(TrackingParameters& params, o2::detectors::DetID::ID detId);
237144

@@ -247,35 +154,10 @@ enum Type : int8_t {
247154

248155
Type fromString(std::string_view str);
249156
std::string toString(Type mode);
250-
// Field-independent validation of common-CA public aliases.
251-
void validateCommonCAOptions(detectors::DetID::ID detId);
252157
TrackingPlan getTrackingPlan(o2::detectors::DetID::ID detId, Type mode);
253158

254159
} // namespace TrackingMode
255160

256161
} // namespace o2::itsmft
257162

258-
namespace o2::itsmft::tracking
259-
{
260-
261-
/// Detector-specific entry points for the common CA configuration.
262-
template <o2::detectors::DetID::ID DetId>
263-
struct TrackerParamRef;
264-
265-
template <>
266-
struct TrackerParamRef<o2::detectors::DetID::MFT> {
267-
using Type = o2::itsmft::TrackerParamConfig<o2::detectors::DetID::MFT>;
268-
static const Type& get() { return Type::Instance(); }
269-
static constexpr int nLayers() { return Type::getNLayers(); }
270-
};
271-
272-
template <>
273-
struct TrackerParamRef<o2::detectors::DetID::ITS> {
274-
using Type = o2::itsmft::ITSCommonCATrackerParam;
275-
static const Type& get() { return Type::Instance(); }
276-
static constexpr int nLayers() { return ITSNLayers; }
277-
};
278-
279-
} // namespace o2::itsmft::tracking
280-
281163
#endif /* ALICEO2_ITSMFT_TRACKING_CONFIGURATION_H_ */

Detectors/ITSMFT/common/tracking/include/ITSMFTTracking/IndexTableUtils.h

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,6 @@ class IndexTableUtilsCore
8484
gsl::span<const float>{maxima.data(), static_cast<size_t>(count)});
8585
}
8686

87-
/// Fill LUT geometry from any struct exposing RowBins, ColBins and LayerZ (ITS phi-z).
88-
template <class T>
89-
void setTrackingParameters(const T& params)
90-
{
91-
const auto extents = layerColHalfExtentFrom(params);
92-
setIndexTableParams(IndexTableCoordType::PhiZ, params.RowBins, params.ColBins,
93-
0.f, o2::constants::math::TwoPI, gsl::span<const float>{extents.data(), static_cast<std::size_t>(extents.count)});
94-
}
95-
9687
GPUhdi() float getInverseColCoordinate(const int layerIndex) const
9788
{
9889
return mInverseColBinSize[layerIndex];
@@ -139,33 +130,6 @@ class IndexTableUtilsCore
139130
GPUhdi() float getRowCoordinateSpan() const { return mRowCoordinateSpan; }
140131

141132
private:
142-
/// Fixed-capacity result of layerColHalfExtentFrom(); count is the number of
143-
/// available entries, never above MaxLayers.
144-
struct LayerExtents {
145-
std::array<float, MaxLayers> values{};
146-
int count{0};
147-
const float* data() const noexcept { return values.data(); }
148-
};
149-
150-
template <class T>
151-
static LayerExtents layerColHalfExtentFrom(const T& params)
152-
{
153-
LayerExtents extents;
154-
if constexpr (requires { params.LayerColHalfExtent; }) {
155-
const auto& colExtents = params.LayerColHalfExtent.empty() ? params.LayerZ : params.LayerColHalfExtent;
156-
extents.count = std::min(static_cast<int>(colExtents.size()), MaxLayers);
157-
for (int iLayer{0}; iLayer < extents.count; ++iLayer) {
158-
extents.values[iLayer] = colExtents[iLayer];
159-
}
160-
} else {
161-
extents.count = std::min(static_cast<int>(params.LayerZ.size()), MaxLayers);
162-
for (int iLayer{0}; iLayer < extents.count; ++iLayer) {
163-
extents.values[iLayer] = params.LayerZ[iLayer];
164-
}
165-
}
166-
return extents;
167-
}
168-
169133
int mNcolBins = 0;
170134
int mNrowBins = 0;
171135
float mInverseRowBinSize = 0.f;

Detectors/ITSMFT/common/tracking/include/ITSMFTTracking/TrackingConfigParam.h

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
#include <array>
1616
#include <limits>
17-
#include <string>
1817
#include <string_view>
1918

2019
#include "CommonUtils/ConfigurableParam.h"
@@ -42,17 +41,14 @@ namespace o2::itsmft
4241
/// Minimal configuration for opt-in ITS common-CA tracking.
4342
/// It does not use the registered name "ITSCATrackerParam", which belongs to the
4443
/// legacy o2::its::TrackerParamConfig.
45-
/// Implemented workflow controls plus reserved diagnostic aliases; unsupported
46-
/// overrides are rejected by common-CA option validation. Defaults preserve the detector tracking
44+
/// Implemented workflow controls. Defaults preserve the detector tracking
4745
/// baseline for both supported modes.
4846
///
4947
/// diamondPos, pvRes, and useDiamond define the static vertex/beam constraint
5048
/// consumed by the shared TrackerTraits.
5149
struct ITSCommonCATrackerParam : public o2::conf::ConfigurableParamHelper<ITSCommonCATrackerParam> {
5250
bool dropTFUponFailure = false;
53-
bool printMemory = false; // Reserved alias: true is rejected (no memory report).
5451
size_t maxMemory = std::numeric_limits<size_t>::max();
55-
bool saveTimeBenchmarks = false; // Reserved alias: true is rejected (no benchmark writer).
5652
bool useDiamond = false;
5753
float diamondPos[3] = {0.f, 0.f, 0.f}; // Diamond vertex position when useDiamond is set.
5854
float pvRes = -1.f; // Diamond-vertex PV resolution; <=0 keeps the default.
@@ -80,9 +76,6 @@ struct TrackerParamConfig : public o2::conf::ConfigurableParamHelper<TrackerPara
8076
static constexpr int MaxTrackLength = tracking::MFTNLayers;
8177
static constexpr int getNLayers() { return tracking::MFTNLayers; }
8278

83-
std::string materialModel = "nominal"; // Implemented provider: nominal descriptor material.
84-
bool useMatCorrTGeo = false; // Legacy alias: true requests unsupported TGeo and is rejected.
85-
bool useFastMaterial = true; // Legacy alias: true selects nominal; false requests unsupported LUT.
8679
int addTimeError[getNLayers()] = {0}; // Tracking window width in BC.
8780
int minTrackLgtIter[o2::itsmft::tracking::MaxIter] = {}; // Async minimum track length per iteration; <=0 keeps preset.
8881
uint32_t startLayerMask[o2::itsmft::tracking::MaxIter] = {}; // Per-pass starts; 0 keeps the preset, bits must name detector layers.
@@ -94,29 +87,20 @@ struct TrackerParamConfig : public o2::conf::ConfigurableParamHelper<TrackerPara
9487
float maxChi2ClusterAttachment = -1.f;
9588
float maxChi2NDF = -1.f;
9689
float nSigmaCut = -1.f;
97-
float deltaTanLres = -1.f; // Reserved alias: overrides are rejected (no consumer).
9890
float minPt = -1.f;
9991
float pvRes = -1.f;
10092
int LUTbinsU = 64; // Radial bins in the MFT PhiR index (radius in cm).
10193
int LUTbinsV = 128; // Phi bins in the MFT PhiR index (angle in radians).
10294
float diamondPos[3] = {0.f, 0.f, 0.f}; // Diamond vertex for MFT seeds (cm).
103-
bool useDiamond = true; // Compatibility constraint: MFT requires true.
104-
bool perPrimaryVertexProcessing = false; // Compatibility constraint: MFT requires false.
105-
bool saveTimeBenchmarks = false; // Reserved alias: true is rejected (no benchmark writer).
106-
bool overrideBeamEstimation = false; // Reserved alias: true is rejected (no MFT beam estimation).
10795
int trackingMode = -1; // -1: use --tracking-mode; 0: sync, 1: async, 2: cosmics, 3: off.
108-
bool doUPCIteration = false; // Reserved alias: true is rejected (no MFT UPC preset).
10996
int nIterations = -1; // -1 uses all mode preset passes; otherwise a positive limit no larger than the preset.
110-
int reseedIfShorter = 6; // Reserved while reseeding is developed; currently diagnosed as ineffective.
11197
bool shiftRefToCluster{true}; // Shift the linearization reference to the cluster after update.
11298
bool repeatRefitOut{false}; // Repeat outward refit using the inward refit as a seed.
11399
bool createArtefactLabels{false}; // Create labels for artefacts on the fly.
114100

115101
int nThreads = 1;
116-
bool printMemory = false; // Reserved alias: true is rejected (no memory report).
117102
size_t maxMemory = std::numeric_limits<size_t>::max();
118103
bool dropTFUponFailure = false;
119-
bool fataliseUponFailure = true; // Reserved alias: false is rejected; use dropTFUponFailure.
120104

121105
// Selection of tracks sharing clusters.
122106
bool allowSharingFirstCluster = false; // Allow sharing the first cluster.

0 commit comments

Comments
 (0)