Skip to content

Commit 3cda4e9

Browse files
committed
ALICE3: validate configuration before running
1 parent 806f5d6 commit 3cda4e9

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

Detectors/Upgrades/ALICE3/GlobalReconstruction/workflow/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ The tracking configuration is provided via a JSON file that specifies:
5353
"LayerResolution": [0.0003, 0.0003, 0.0003, 0.0003, 0.0012, 0.0012, 0.0012, 0.0012, 0.0012, 0.0012, 0.0012],
5454
"SystErrorY2": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
5555
"SystErrorZ2": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
56+
"AddTimeError": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
5657
"ZBins": 256,
5758
"PhiBins": 128,
5859
"nROFsPerIterations": -1,
@@ -70,7 +71,7 @@ The tracking configuration is provided via a JSON file that specifies:
7071
"MaxChi2ClusterAttachment": 60.0,
7172
"MaxChi2NDF": 30.0,
7273
"ReseedIfShorter": 6,
73-
"MinPt": [0.0, 0.0, 0.0, 0.0],
74+
"MinPt": [0.0, 0.0, 0.0, 0.0, 0.0],
7475
"StartLayerMask": 4095,
7576
"RepeatRefitOut": false,
7677
"ShiftRefToCluster": true,

Detectors/Upgrades/ALICE3/GlobalReconstruction/workflow/src/TrackerSpec.cxx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ std::vector<o2::its::TrackingParameters> TrackerDPL::createTrackingParamsFromCon
191191
if (paramConfig.contains("MinPt")) {
192192
params.MinPt = paramConfig["MinPt"].get<std::vector<float>>();
193193
}
194+
if (paramConfig.contains("AddTimeError")) {
195+
params.AddTimeError = paramConfig["AddTimeError"].get<std::vector<UInt_t>>();
196+
}
194197

195198
if (paramConfig.contains("Diamond") && paramConfig["Diamond"].is_array() && paramConfig["Diamond"].size() == 3) {
196199
params.Diamond[0] = paramConfig["Diamond"][0].get<float>();
@@ -207,6 +210,19 @@ std::vector<o2::its::TrackingParameters> TrackerDPL::createTrackingParamsFromCon
207210
params.CorrType = static_cast<o2::base::PropagatorImpl<float>::MatCorrType>(corrTypeInt);
208211
}
209212

213+
const auto nLayers = static_cast<size_t>(params.NLayers);
214+
LOG_IF(fatal, params.LayerZ.size() != nLayers) << "Invalid ALICE3 TRK tracking parameter LayerZ: expected " << nLayers << " entries, got " << params.LayerZ.size();
215+
LOG_IF(fatal, params.LayerRadii.size() != nLayers) << "Invalid ALICE3 TRK tracking parameter LayerRadii: expected " << nLayers << " entries, got " << params.LayerRadii.size();
216+
LOG_IF(fatal, params.LayerxX0.size() != nLayers) << "Invalid ALICE3 TRK tracking parameter LayerxX0: expected " << nLayers << " entries, got " << params.LayerxX0.size();
217+
LOG_IF(fatal, params.LayerResolution.size() != nLayers) << "Invalid ALICE3 TRK tracking parameter LayerResolution: expected " << nLayers << " entries, got " << params.LayerResolution.size();
218+
LOG_IF(fatal, params.SystErrorY2.size() != nLayers) << "Invalid ALICE3 TRK tracking parameter SystErrorY2: expected " << nLayers << " entries, got " << params.SystErrorY2.size();
219+
LOG_IF(fatal, params.SystErrorZ2.size() != nLayers) << "Invalid ALICE3 TRK tracking parameter SystErrorZ2: expected " << nLayers << " entries, got " << params.SystErrorZ2.size();
220+
LOG_IF(fatal, params.AddTimeError.size() != nLayers) << "Invalid ALICE3 TRK tracking parameter AddTimeError: expected " << nLayers << " entries, got " << params.AddTimeError.size();
221+
222+
LOG_IF(fatal, params.MinTrackLength > params.NLayers) << "Invalid ALICE3 TRK tracking parameter MinTrackLength: expected <= NLayers (" << params.NLayers << "), got " << params.MinTrackLength;
223+
const auto minPtSize = static_cast<size_t>(params.NLayers - params.MinTrackLength + 1);
224+
LOG_IF(fatal, params.MinPt.size() != minPtSize) << "Invalid ALICE3 TRK tracking parameter MinPt: expected " << minPtSize << " entries, got " << params.MinPt.size();
225+
210226
trackingParams.push_back(params);
211227
}
212228
};

0 commit comments

Comments
 (0)