1313#define ALICEO2_ITSMFT_TRACKING_CONFIG_PARAM_H_
1414
1515#include < array>
16+ #include < cstddef>
17+ #include < cstdint>
1618#include < limits>
17- #include < string_view>
1819
1920#include " CommonUtils/ConfigurableParam.h"
2021#include " CommonUtils/ConfigurableParamHelper.h"
@@ -38,65 +39,37 @@ inline constexpr std::array<float, ITSNLayers> kITSLookupZHalfExtent{
3839namespace o2 ::itsmft
3940{
4041
41- // / Minimal configuration for opt-in ITS common-CA tracking.
42- // / It does not use the registered name "ITSCATrackerParam", which belongs to the
43- // / legacy o2::its::TrackerParamConfig.
44- // / Implemented workflow controls. Defaults preserve the detector tracking
45- // / baseline for both supported modes.
46- // /
47- // / diamondPos, pvRes, and useDiamond define the static vertex/beam constraint
48- // / consumed by the shared TrackerTraits.
49- struct ITSCommonCATrackerParam : public o2 ::conf::ConfigurableParamHelper<ITSCommonCATrackerParam> {
50- bool dropTFUponFailure = false ;
51- size_t maxMemory = std::numeric_limits<size_t >::max();
52- bool useDiamond = false ;
53- float diamondPos[3 ] = {0 .f , 0 .f , 0 .f }; // Diamond vertex position when useDiamond is set.
54- float pvRes = -1 .f; // Diamond-vertex PV resolution; <=0 keeps the default.
55- uint16_t holeLayerMask = 0 ; // Detector layers that may be absent from accepted tracks.
56- float sysErr2Row[tracking::ITSNLayers] = {0 }; // Additional sensor-row variance for cluster covariance and candidate windows (cm^2).
57- float sysErr2Col[tracking::ITSNLayers] = {0 }; // Additional sensor-column variance for cluster covariance and candidate windows (cm^2).
58-
59- // / Number of tbb::task_arena threads for the ITS common-CA tracker.
60- // / This dedicated field is separate from the legacy ITS configuration.
61- // / Must be > 0; validated where consumed because ConfigurableParam
62- // / structs cannot reject construction.
63- int nThreads = 1 ;
64-
65- O2ParamDef (ITSCommonCATrackerParam, " ITSCommonCATrackerParam" );
66- };
67-
68- template <int N>
69- struct TrackerParamConfig : public o2 ::conf::ConfigurableParamHelper<TrackerParamConfig<N>> {
70- static constexpr std::string_view getParamName ()
71- {
72- return " MFTCATrackerParam" ;
73- }
74-
42+ // / Shared common-CA controls, with independent ITS and MFT parameter instances.
43+ // / The ITS key remains distinct from the legacy ITSCATrackerParam configuration.
44+ template <int Detector>
45+ struct TrackerParamConfig : public o2 ::conf::ConfigurableParamHelper<TrackerParamConfig<Detector>> {
46+ static_assert (Detector == o2::detectors::DetID::ITS || Detector == o2::detectors::DetID::MFT );
47+ static constexpr int NLayers = Detector == o2::detectors::DetID::ITS ? tracking::ITSNLayers : tracking::MFTNLayers;
7548 static constexpr int MinTrackLength = tracking::kCAMinTrackLength ;
76- static constexpr int MaxTrackLength = tracking::MFTNLayers;
77- static constexpr int getNLayers () { return tracking::MFTNLayers; }
78-
79- int addTimeError[getNLayers()] = {0 }; // Tracking window width in BC.
80- int minTrackLgtIter[o2::itsmft::tracking::MaxIter] = {}; // Async minimum track length per iteration; <=0 keeps preset.
81- uint32_t startLayerMask[o2::itsmft::tracking::MaxIter] = {}; // Per-pass starts; 0 keeps the preset, bits must name detector layers.
82- int maxHolesIter[o2::itsmft::tracking::MaxIter] = {}; // Maximum missing internal layers per iteration.
83- uint16_t holeLayerMask = 0 ; // Detector layers that may be absent from accepted tracks.
84- float minPtIterLgt[o2::itsmft::tracking::MaxIter * (MaxTrackLength - MinTrackLength + 1 )] = {}; // Async minimum pT by track length; <=0 keeps preset.
85- float sysErr2Row[getNLayers()] = {0 }; // Additional sensor-row variance for cluster covariance and candidate windows (cm^2).
86- float sysErr2Col[getNLayers()] = {0 }; // Additional sensor-column variance for cluster covariance and candidate windows (cm^2).
49+ static constexpr int MaxTrackLength = NLayers;
50+
51+ int addTimeError[NLayers] = {0 }; // Tracking window width in BC.
52+ int minTrackLgtIter[tracking::MaxIter] = {}; // Async minimum track length per iteration; <=0 keeps preset.
53+ uint32_t startLayerMask[tracking::MaxIter] = {}; // Per-pass starts; 0 keeps the preset, bits must name detector layers.
54+ int maxHolesIter[tracking::MaxIter] = {}; // Maximum missing internal layers per iteration.
55+ uint16_t holeLayerMask = 0 ; // Detector layers that may be absent from accepted tracks.
56+ float minPtIterLgt[tracking::MaxIter * (MaxTrackLength - MinTrackLength + 1 )] = {}; // Async minimum pT by track length; <=0 keeps preset.
57+ float sysErr2Row[NLayers] = {0 }; // Additional sensor-row variance for cluster covariance and candidate windows (cm^2).
58+ float sysErr2Col[NLayers] = {0 }; // Additional sensor-column variance for cluster covariance and candidate windows (cm^2).
8759 float maxChi2ClusterAttachment = -1 .f;
8860 float maxChi2NDF = -1 .f;
8961 float nSigmaCut = -1 .f;
9062 float minPt = -1 .f;
9163 float pvRes = -1 .f;
92- int LUTbinsU = 64 ; // Radial bins in the MFT PhiR index (radius in cm).
93- int LUTbinsV = 128 ; // Phi bins in the MFT PhiR index (angle in radians).
94- float diamondPos[3 ] = {0 .f , 0 .f , 0 .f }; // Diamond vertex for MFT seeds (cm).
95- int trackingMode = -1 ; // -1: use --tracking-mode; 0: sync, 1: async, 2: cosmics, 3: off.
96- int nIterations = -1 ; // -1 uses all mode preset passes; otherwise a positive limit no larger than the preset.
97- bool shiftRefToCluster{true }; // Shift the linearization reference to the cluster after update.
98- bool repeatRefitOut{false }; // Repeat outward refit using the inward refit as a seed.
99- bool createArtefactLabels{false }; // Create labels for artefacts on the fly.
64+ int LUTbinsU = 64 ; // Longitudinal ITS bins or radial MFT bins (cm).
65+ int LUTbinsV = Detector == o2::detectors::DetID::ITS ? 32 : 128 ; // Phi bins (radians).
66+ bool useDiamond = Detector == o2::detectors::DetID::MFT ;
67+ float diamondPos[3 ] = {0 .f , 0 .f , 0 .f }; // Diamond vertex position (cm).
68+ int trackingMode = -1 ; // -1: use --tracking-mode; 0: sync, 1: async, 2: cosmics, 3: off.
69+ int nIterations = -1 ; // -1 uses all mode preset passes; otherwise a positive limit no larger than the preset.
70+ bool shiftRefToCluster{true }; // Shift the linearization reference to the cluster after update.
71+ bool repeatRefitOut{false }; // Repeat outward refit using the inward refit as a seed.
72+ bool createArtefactLabels{false }; // Create labels for artefacts on the fly.
10073
10174 int nThreads = 1 ;
10275 size_t maxMemory = std::numeric_limits<size_t >::max();
@@ -108,24 +81,15 @@ struct TrackerParamConfig : public o2::conf::ConfigurableParamHelper<TrackerPara
10881 float sharedClusterMaxDeltaEta = 0 .03f ; // Maximum delta eta at the cluster.
10982 bool sharedClusterOppositeSign = false ; // Require opposite-sign tracklets.
11083
111- O2ParamDef (TrackerParamConfig, getParamName().data());
112-
113- private:
114- static_assert (N == o2::detectors::DetID::MFT , " common ITS settings use ITSCommonCATrackerParam" );
84+ O2ParamDef (TrackerParamConfig, Detector == o2::detectors::DetID::ITS ? " ITSCommonCATrackerParam" : " MFTCATrackerParam" );
11585};
11686
117- template <int N >
118- TrackerParamConfig<N > TrackerParamConfig<N >::sInstance ;
87+ template <int Detector >
88+ TrackerParamConfig<Detector > TrackerParamConfig<Detector >::sInstance ;
11989
120- } // namespace o2::itsmft
90+ using ITSCommonCATrackerParam = TrackerParamConfig<o2::detectors::DetID::ITS >;
91+ using MFTCATrackerParam = TrackerParamConfig<o2::detectors::DetID::MFT >;
12192
122- namespace framework
123- {
124- template <typename T>
125- struct is_messageable ;
126- template <>
127- struct is_messageable <o2::itsmft::TrackerParamConfig<o2::detectors::DetID::MFT >> : std::true_type {
128- };
129- } // namespace framework
93+ } // namespace o2::itsmft
13094
13195#endif /* ALICEO2_ITSMFT_TRACKING_CONFIG_PARAM_H_ */
0 commit comments