Skip to content

Commit 41788fe

Browse files
authored
[PWGLF] store tracks number beyond 8 bits (#14533)
1 parent 5550c47 commit 41788fe

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,20 @@ float calculateDCAStraightToPV(float X, float Y, float Z, float Px, float Py, fl
9393
{
9494
return std::sqrt((std::pow((pvY - Y) * Pz - (pvZ - Z) * Py, 2) + std::pow((pvX - X) * Pz - (pvZ - Z) * Px, 2) + std::pow((pvX - X) * Py - (pvY - Y) * Px, 2)) / (Px * Px + Py * Py + Pz * Pz));
9595
}
96+
void encode16bit(int const& n, uint8_t& low, uint8_t& up)
97+
{
98+
if (n >= (1 << 16))
99+
low = up = -1;
100+
int bbyte = 8;
101+
for (int b{0}; b < bbyte; ++b) {
102+
int bl = (n & (1 << b)) >> b;
103+
int bu = (n & (1 << (b + bbyte))) >> (b + bbyte);
104+
if (bl > 0)
105+
low += (1 << b);
106+
if (bu > 0)
107+
up += (1 << b);
108+
}
109+
}
96110
} // namespace
97111

98112
struct CandidateV0 {
@@ -184,6 +198,7 @@ struct EbyeMaker {
184198
uint8_t nTrackletsColl;
185199
uint8_t nTracksColl;
186200
uint8_t nChPartGen;
201+
int nTracksCollFull;
187202

188203
Configurable<int> cfgMaterialCorrection{"cfgMaterialCorrection", static_cast<int>(o2::base::Propagator::MatCorrType::USEMatCorrNONE), "Type of material correction"};
189204
Configurable<LabeledArray<double>> cfgBetheBlochParams{"cfgBetheBlochParams", {kBetheBlochDefault[0], 2, 6, particleNamesPar, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for deuteron"};
@@ -565,6 +580,7 @@ struct EbyeMaker {
565580
candidateV0s.clear();
566581
nTrackletsColl = 0u;
567582
nTracksColl = 0u;
583+
nTracksCollFull = 0;
568584

569585
std::array<float, 2> dcaInfo;
570586
for (const auto& track : tracks) {
@@ -592,9 +608,10 @@ struct EbyeMaker {
592608
if (track.tpcNClsFound() < trackNclusTpcCut || track.tpcNClsCrossedRows() < trackNcrossedRows)
593609
continue;
594610
histos.fill(HIST("QA/tpcSignal"), track.tpcInnerParam(), track.tpcSignal());
595-
if (trackPt > ptMin[0] && trackPt < ptMax[0] && ((track.sign() < 0 && countOnlyLSTrk == TracksCharge::kNegative) || (track.sign() > 0 && countOnlyLSTrk == TracksCharge::kPositive) || (countOnlyLSTrk == TracksCharge::kAll)))
611+
if (trackPt > ptMin[0] && trackPt < ptMax[0] && ((track.sign() < 0 && countOnlyLSTrk == TracksCharge::kNegative) || (track.sign() > 0 && countOnlyLSTrk == TracksCharge::kPositive) || (countOnlyLSTrk == TracksCharge::kAll))) {
596612
nTracksColl++;
597-
613+
nTracksCollFull++;
614+
}
598615
for (int iP{0}; iP < kNpart; ++iP) {
599616
if (trackPt < ptMin[iP] || trackPt > ptMax[iP]) {
600617
continue;
@@ -989,6 +1006,7 @@ struct EbyeMaker {
9891006
histos.fill(HIST("QA/V0MvsCL0"), centralityCl0, centrality);
9901007
histos.fill(HIST("QA/trackletsVsV0M"), centrality, multTracklets);
9911008

1009+
encode16bit(nTracksCollFull, nTrackletsColl, nTracksColl);
9921010
miniCollTable(static_cast<int8_t>(collision.posZ() * 10), 0x0, nTrackletsColl, centrality, nTracksColl);
9931011
for (auto& candidateTrack : candidateTracks[0]) { // o2-linter: disable=const-ref-in-for-loop (not a const ref)
9941012
auto tk = tracks.rawIteratorAt(candidateTrack.globalIndex);

0 commit comments

Comments
 (0)