Skip to content

Commit 7ec0eeb

Browse files
committed
U
1 parent 81bebaf commit 7ec0eeb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <utility>
2424
#include <map>
2525
#include <string>
26+
#include <algorithm>
2627
#include <vector>
2728

2829
#include "Framework/AnalysisDataModel.h"
@@ -106,7 +107,7 @@ struct OnTheFlyTrackerPid {
106107
// std::array<float, kMaxForwardLayers> timeOverThresholdForward;
107108
// std::array<float, kMaxForwardLayers> clusterSizeForward;
108109

109-
auto noSignalTrack = []() {
110+
auto noSignalTrack = [&]() {
110111
tableUpgradeTrkPidSignals(0.f, 0.f); // no PID information
111112
tableUpgradeTrkPids(0.f, 0.f, 0.f, 0.f, 0.f); // no PID information
112113
};
@@ -151,13 +152,14 @@ struct OnTheFlyTrackerPid {
151152
// Order them by ToT
152153
std::sort(timeOverThresholdBarrel.begin(), timeOverThresholdBarrel.end());
153154
std::sort(clusterSizeBarrel.begin(), clusterSizeBarrel.end());
155+
static constexpr int kTruncatedMean = 5;
154156
// Take the mean of the first 5 values
155-
for (int i = 0; i < 5; i++) {
157+
for (int i = 0; i < kTruncatedMean; i++) {
156158
meanToT += timeOverThresholdBarrel[i];
157159
meanClusterSize += clusterSizeBarrel[i];
158160
}
159-
meanToT /= 5;
160-
meanClusterSize /= 5;
161+
meanToT /= kTruncatedMean;
162+
meanClusterSize /= kTruncatedMean;
161163
// Fill the table
162164
tableUpgradeTrkPidSignals(meanToT, meanClusterSize);
163165
} break;

0 commit comments

Comments
 (0)