Skip to content

Commit 12582e3

Browse files
committed
Feat: fix bugs in index column partially
1 parent 56158de commit 12582e3

21 files changed

+157
-142
lines changed

PWGCF/Femto/Core/cascadeBuilder.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,9 @@ class CascadeBuilder
367367
return;
368368
}
369369

370-
int64_t bachelorIndex = 0;
371-
int64_t posDaughterIndex = 0;
372-
int64_t negDaughterIndex = 0;
370+
int32_t bachelorIndex = 0;
371+
int32_t posDaughterIndex = 0;
372+
int32_t negDaughterIndex = 0;
373373
for (const auto& cascade : fullCascades) {
374374
if (!mCascadeSelection.checkFilters(cascade)) {
375375
continue;

PWGCF/Femto/Core/kinkBuilder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ class KinkSelection : public BaseSelection<float, o2::aod::femtodatatypes::KinkM
243243
float pt = std::hypot(px, py);
244244
float p = std::sqrt(px * px + py * py + pz * pz);
245245
float eta = (p > 0.f) ? 0.5f * std::log((p + pz) / (p - pz)) : 0.f;
246-
float phi = std::atan2(py, px);
246+
float phi = RecoDecay::constrainAngle(std::atan2(py, px));
247247

248248
return ((pt > mPtMin && pt < mPtMax) &&
249249
(eta > mEtaMin && eta < mEtaMax) &&
@@ -372,7 +372,7 @@ class KinkBuilder
372372
float pt = std::hypot(px, py);
373373
float p = std::sqrt(px * px + py * py + pz * pz);
374374
float eta = (p > 0.f) ? 0.5f * std::log((p + pz) / (p - pz)) : 0.f;
375-
float phi = std::atan2(py, px);
375+
float phi = RecoDecay::constrainAngle(std::atan2(py, px));
376376

377377
kinkProducts.producedSigmas(collisionProducts.producedCollision.lastIndex(),
378378
kink.mothSign() * pt,

PWGCF/Femto/Core/pairBuilder.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,16 @@ class PairTrackTrackBuilder
131131
void processSameEvent(T1 const& col, T2& trackTable, T3& partition1, T4& partition2, T5& cache)
132132
{
133133
if (mSameSpecies) {
134-
auto trackSlice1 = partition1->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
134+
auto trackSlice1 = partition1->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
135135
if (trackSlice1.size() == 0) {
136136
return;
137137
}
138138
mColHistManager.fill(col);
139139
mCprSe.setMagField(col.magField());
140140
pairprocesshelpers::processSameEvent(trackSlice1, trackTable, mTrackHistManager1, mPairHistManagerSe, mCprSe, mRng, mMixIdenticalParticles);
141141
} else {
142-
auto trackSlice1 = partition1->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
143-
auto trackSlice2 = partition2->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
142+
auto trackSlice1 = partition1->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
143+
auto trackSlice2 = partition2->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
144144
if (trackSlice1.size() == 0 || trackSlice2.size() == 0) {
145145
return;
146146
}
@@ -299,16 +299,16 @@ class PairV0V0Builder
299299
void processSameEvent(T1 const& col, T2& trackTable, T3& /*lambdaTable*/, T4& partition1, T5& partition2, T6& cache)
300300
{
301301
if (mSameSpecies) {
302-
auto v0Slice1 = partition1->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
302+
auto v0Slice1 = partition1->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
303303
if (v0Slice1.size() == 0) {
304304
return;
305305
}
306306
mColHistManager.fill(col);
307307
mCprSe.setMagField(col.magField());
308308
pairprocesshelpers::processSameEvent(v0Slice1, trackTable, mV0HistManager1, mPairHistManagerSe, mCprSe, mRng, mMixIdenticalParticles);
309309
} else {
310-
auto v0Slice1 = partition1->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
311-
auto v0Slice2 = partition2->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
310+
auto v0Slice1 = partition1->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
311+
auto v0Slice2 = partition2->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
312312
if (v0Slice1.size() == 0 || v0Slice2.size() == 0) {
313313
return;
314314
}
@@ -433,8 +433,8 @@ class PairTrackV0Builder
433433
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
434434
void processSameEvent(T1 const& col, T2& trackTable, T3& trackPartition, T4& /*v0table*/, T5& v0Partition, T6& cache)
435435
{
436-
auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
437-
auto v0Slice = v0Partition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
436+
auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
437+
auto v0Slice = v0Partition->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
438438
if (trackSlice.size() == 0 || v0Slice.size() == 0) {
439439
return;
440440
}
@@ -538,8 +538,8 @@ class PairTrackTwoTrackResonanceBuilder
538538
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
539539
void processSameEvent(T1 const& col, T2& trackTable, T3& trackPartition, T4& /*resonanceTable*/, T5& resonancePartition, T6& cache)
540540
{
541-
auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
542-
auto v0Slice = resonancePartition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
541+
auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
542+
auto v0Slice = resonancePartition->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
543543
if (trackSlice.size() == 0 || v0Slice.size() == 0) {
544544
return;
545545
}
@@ -640,8 +640,8 @@ class PairTrackKinkBuilder
640640
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
641641
void processSameEvent(T1 const& col, T2& trackTable, T3& trackPartition, T4& /*kinktable*/, T5& kinkPartition, T6& cache)
642642
{
643-
auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
644-
auto kinkSlice = kinkPartition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
643+
auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
644+
auto kinkSlice = kinkPartition->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
645645
if (trackSlice.size() == 0 || kinkSlice.size() == 0) {
646646
return;
647647
}
@@ -748,8 +748,8 @@ class PairTrackCascadeBuilder
748748
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
749749
void processSameEvent(T1 const& col, T2& trackTable, T3& trackPartition, T4& /*cascadeTable*/, T5& v0Partition, T6& cache)
750750
{
751-
auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
752-
auto v0Slice = v0Partition->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
751+
auto trackSlice = trackPartition->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
752+
auto v0Slice = v0Partition->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
753753
if (trackSlice.size() == 0 || v0Slice.size() == 0) {
754754
return;
755755
}

PWGCF/Femto/Core/pairProcessHelpers.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ void processMixedEvent(T1& Collisions,
182182
continue;
183183
}
184184
CprManager.setMagField(collision1.magField());
185-
auto sliceParticle1 = Partition->sliceByCached(o2::aod::femtobase::stored::fColId, collision1.globalIndex(), cache);
186-
auto sliceParticle2 = Partition->sliceByCached(o2::aod::femtobase::stored::fColId, collision2.globalIndex(), cache);
185+
auto sliceParticle1 = Partition->sliceByCached(o2::aod::femtobase::stored::collisionId, collision1.globalIndex(), cache);
186+
auto sliceParticle2 = Partition->sliceByCached(o2::aod::femtobase::stored::collisionId, collision2.globalIndex(), cache);
187187
if (sliceParticle1.size() == 0 || sliceParticle2.size() == 0) {
188188
continue;
189189
}
@@ -233,8 +233,8 @@ void processMixedEvent(T1& Collisions,
233233
continue;
234234
}
235235
CprManager.setMagField(collision1.magField());
236-
auto sliceParticle1 = Partition1->sliceByCached(o2::aod::femtobase::stored::fColId, collision1.globalIndex(), cache);
237-
auto sliceParticle2 = Partition2->sliceByCached(o2::aod::femtobase::stored::fColId, collision2.globalIndex(), cache);
236+
auto sliceParticle1 = Partition1->sliceByCached(o2::aod::femtobase::stored::collisionId, collision1.globalIndex(), cache);
237+
auto sliceParticle2 = Partition2->sliceByCached(o2::aod::femtobase::stored::collisionId, collision2.globalIndex(), cache);
238238
if (sliceParticle1.size() == 0 || sliceParticle2.size() == 0) {
239239
continue;
240240
}
@@ -284,8 +284,8 @@ void processMixedEvent(T1& Collisions,
284284
// continue;
285285
// }
286286
// CprManager.setMagField(collision1.magField());
287-
// auto sliceParticle1 = Partition1->sliceByCached(o2::aod::femtobase::stored::fColId, collision1.globalIndex(), cache);
288-
// auto sliceParticle2 = Partition2->sliceByCached(o2::aod::femtobase::stored::fColId, collision2.globalIndex(), cache);
287+
// auto sliceParticle1 = Partition1->sliceByCached(o2::aod::femtobase::stored::collisionId, collision1.globalIndex(), cache);
288+
// auto sliceParticle2 = Partition2->sliceByCached(o2::aod::femtobase::stored::collisionId, collision2.globalIndex(), cache);
289289
// if (sliceParticle1.size() == 0 || sliceParticle2.size() == 0) {
290290
// continue;
291291
// }

PWGCF/Femto/Core/trackBuilder.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ class TrackSelection : public BaseSelection<float, o2::aod::femtodatatypes::Trac
375375
this->evaluateObservable(kTpcKaon, Track.tpcNSigmaKa());
376376
this->evaluateObservable(kTpcProton, Track.tpcNSigmaPr());
377377
this->evaluateObservable(kTpcDeuteron, Track.tpcNSigmaDe());
378-
this->evaluateObservable(kTpctofTriton, Track.tpcNSigmaTr());
378+
this->evaluateObservable(kTpcTriton, Track.tpcNSigmaTr());
379379
this->evaluateObservable(kTpcHelium, Track.tpcNSigmaHe());
380380

381381
// tof pid
@@ -506,16 +506,15 @@ class TrackBuilder
506506
track.pt() * track.sign(),
507507
track.eta(),
508508
track.phi());
509+
indexMap.emplace(track.globalIndex(), trackProducts.producedTracks.lastIndex());
509510
}
510-
511511
if (mProduceTrackMasks) {
512512
if constexpr (type == modes::Track::kPrimaryTrack) {
513513
trackProducts.producedTrackMasks(mTrackSelection.getBitmask());
514514
} else {
515515
trackProducts.producedTrackMasks(static_cast<o2::aod::femtodatatypes::TrackMaskType>(0u));
516516
}
517517
}
518-
519518
if (mProduceTrackDcas) {
520519
trackProducts.producedTrackDcas(track.dcaXY(), track.dcaZ());
521520
}
@@ -533,7 +532,6 @@ class TrackBuilder
533532
track.beta(),
534533
track.mass());
535534
}
536-
537535
if (mProduceElectronPids) {
538536
if constexpr (type == modes::Track::kPrimaryTrack) {
539537
trackProducts.producedElectronPids(track.itsNSigmaEl(), track.tpcNSigmaEl(), track.tofNSigmaEl());
@@ -583,7 +581,6 @@ class TrackBuilder
583581
trackProducts.producedHeliumPids(0, track.tpcNSigmaHe(), track.tofNSigmaHe());
584582
}
585583
}
586-
indexMap.emplace(track.globalIndex(), trackProducts.producedTracks.lastIndex());
587584
}
588585

589586
template <modes::Track type, typename T1, typename T2, typename T3, typename T4>
@@ -643,8 +640,8 @@ class TrackBuilderDerivedToDerived
643640
template <typename T1, typename T2, typename T3, typename T4, typename T5>
644641
bool collisionHasTooFewTracks(T1& col, T2& /*trackTable*/, T3& partitionTrack1, T4& partitionTrack2, T5& cache)
645642
{
646-
auto trackSlice1 = partitionTrack1->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
647-
auto trackSlice2 = partitionTrack2->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
643+
auto trackSlice1 = partitionTrack1->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
644+
auto trackSlice2 = partitionTrack2->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
648645
if (trackSlice1.size() >= mLimitTrack1 && trackSlice2.size() >= mLimitTrack2) {
649646
return false;
650647
}
@@ -654,8 +651,8 @@ class TrackBuilderDerivedToDerived
654651
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
655652
void processTracks(T1& col, T2& /*trackTable*/, T3& partitionTrack1, T4& partitionTrack2, T5& indexMap, T6& cache, T7& newTrackTable, T8& newCollisionTable)
656653
{
657-
auto trackSlice1 = partitionTrack1->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
658-
auto trackSlice2 = partitionTrack2->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
654+
auto trackSlice1 = partitionTrack1->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
655+
auto trackSlice2 = partitionTrack2->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
659656

660657
for (auto const& track : trackSlice1) {
661658
this->fillTrack(track, newTrackTable, newCollisionTable, indexMap);

PWGCF/Femto/Core/v0Builder.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ template <modes::V0 v0Type>
330330
class V0Builder
331331
{
332332
public:
333-
V0Builder() {}
334-
virtual ~V0Builder() = default;
333+
V0Builder() = default;
334+
~V0Builder() = default;
335335

336336
template <typename T1, typename T2, typename T3, typename T4>
337337
void init(T1& config, T2& filter, T3& table, T4& initContext)
@@ -395,7 +395,7 @@ class V0Builder
395395
}
396396

397397
template <typename T1, typename T2, typename T3>
398-
void fillLambda(T1& collisionProducts, T2& v0products, T3 const& v0, float sign, int posDaughterIndex, int negDaughterIndex)
398+
void fillLambda(T1& collisionProducts, T2& v0products, T3 const& v0, float sign, int32_t posDaughterIndex, int32_t negDaughterIndex)
399399
{
400400
float mass, massAnti;
401401
if (sign > 0.f) {
@@ -500,7 +500,7 @@ class V0BuilderDerivedToDerived
500500
template <typename T1, typename T2, typename T3, typename T4>
501501
bool collisionHasTooFewLambdas(T1& col, T2& /*lambdaTable*/, T3& partitionLambda, T4& cache)
502502
{
503-
auto lambdaSlice = partitionLambda->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
503+
auto lambdaSlice = partitionLambda->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
504504
if (lambdaSlice.size() >= mLimitLambda) {
505505
return false;
506506
}
@@ -510,7 +510,7 @@ class V0BuilderDerivedToDerived
510510
template <typename T1, typename T2, typename T3, typename T4>
511511
bool collisionHasTooFewK0shorts(T1& col, T2& /*k0shortTable*/, T3& partitionK0short, T4& cache)
512512
{
513-
auto k0shortSlice = partitionK0short->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
513+
auto k0shortSlice = partitionK0short->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
514514
if (k0shortSlice.size() >= mLimitK0short) {
515515
return false;
516516
}
@@ -520,7 +520,7 @@ class V0BuilderDerivedToDerived
520520
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
521521
void processLambdas(T1& col, T2& /*lambdaTable*/, T3& /*oldTrackTable*/, T4& partitionLambda, T5& trackBuilder, T6& indexMap, T7& cache, T8& newLambdaTable, T9& newTrackTable, T10& newCollisionTable)
522522
{
523-
auto lambdaSlice = partitionLambda->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
523+
auto lambdaSlice = partitionLambda->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
524524

525525
for (auto const& lambda : lambdaSlice) {
526526

@@ -544,7 +544,7 @@ class V0BuilderDerivedToDerived
544544
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
545545
void processK0shorts(T1& col, T2& /*k0shortTable*/, T3& /*oldTrackTable*/, T4& partitionK0short, T5& trackBuilder, T6& indexMap, T7& cache, T8& newK0shortTable, T9& newTrackTable, T10& newCollisionTable)
546546
{
547-
auto k0shortSlice = partitionK0short->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
547+
auto k0shortSlice = partitionK0short->sliceByCached(o2::aod::femtobase::stored::collisionId, col.globalIndex(), cache);
548548

549549
for (auto const& k0short : k0shortSlice) {
550550

PWGCF/Femto/Core/v0HistManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ class V0HistManager
259259
template <typename T1, typename T2>
260260
void fill(T1 const& v0candidate, T2 const& tracks)
261261
{
262-
263262
auto posDaughter = v0candidate.template posDau_as<T2>();
264263
mPosDauManager.fill(posDaughter, tracks);
265264
auto negDaughter = v0candidate.template negDau_as<T2>();
@@ -311,6 +310,7 @@ class V0HistManager
311310
mHistogramRegistry->fill(HIST(v0Prefix) + HIST(QaDir) + HIST(getHistName(kK0shortMassVsLambdaMass, HistTable)), v0candidate.massK0short(), massLambda);
312311
mHistogramRegistry->fill(HIST(v0Prefix) + HIST(QaDir) + HIST(getHistName(kK0shortMassVsAntiLambdaMass, HistTable)), v0candidate.massK0short(), massAntiLambda);
313312
}
313+
314314
if constexpr (modes::isEqual(v0, modes::V0::kK0short)) {
315315
mHistogramRegistry->fill(HIST(v0Prefix) + HIST(QaDir) + HIST(getHistName(kMassLambda, HistTable)), v0candidate.massLambda());
316316
mHistogramRegistry->fill(HIST(v0Prefix) + HIST(QaDir) + HIST(getHistName(kMassAntiLambda, HistTable)), v0candidate.massAntiLambda());

0 commit comments

Comments
 (0)