Skip to content

Commit bf0c0b6

Browse files
committed
Fix: various bug fixes
1 parent 178a58f commit bf0c0b6

9 files changed

Lines changed: 70 additions & 66 deletions

File tree

‎PWGCF/Femto/Core/cascadeBuilder.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ class CascadeBuilder
669669
}
670670

671671
template <typename T1, typename T2, typename T3, typename T4>
672-
void fillCascade(T1& collisionBuilder, T2& cascadeProducts, T3 const& cascade, T4 const& col, int bachelorIndex, int posDaughterIndex, int negDaughterIndex)
672+
void fillCascade(T1& collisionBuilder, T2& cascadeProducts, T3 const& cascade, T4 const& col, int64_t bachelorIndex, int64_t posDaughterIndex, int64_t negDaughterIndex)
673673
{
674674
float strangeTofBachelor = 0.f;
675675
float strangeTofPosDau = 0.f;

‎PWGCF/Femto/Core/cascadeHistManager.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ class CascadeHistManager
475475
this->fillAnalysis(cascadeCandidate);
476476
}
477477
if constexpr (modes::isFlagSet(mode, modes::Mode::kQa)) {
478-
this->fillQa(cascadeCandidate, bachelor, negDaughter, posDaughter);
478+
this->fillQa(cascadeCandidate, bachelor, posDaughter, negDaughter);
479479
}
480480
if constexpr (modes::isFlagSet(mode, modes::Mode::kMc)) {
481481
this->template fillMc<mode>(cascadeCandidate, col, mcParticles, mcMothers, mcPartonicMothers);

‎PWGCF/Femto/Core/pairBuilder.h‎

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -398,14 +398,6 @@ class PairV0V0Builder
398398
<< "). Overriding sameSpecies to false.";
399399
mSameSpecies = false;
400400
}
401-
} else {
402-
// same v0 species: both values are legitimate (e.g. lambda-lambda vs lambda-antilambda),
403-
// but running as different species only makes sense if the two selections are disjoint
404-
if (!mSameSpecies && confV0Selection1.sign.value == confV0Selection2.sign.value) {
405-
LOG(warn) << "sameSpecies=false for identical v0 species with identical sign ("
406-
<< confV0Selection1.sign.value << "). If both selections match the same "
407-
<< "candidates, this produces self-pairs and double counting.";
408-
}
409401
}
410402

411403
mColHistManager.template init<modeSe>(registry, colHistSpec, confCollisionBinning);
@@ -1910,17 +1902,17 @@ class PairTrackCascadeBuilder
19101902
}
19111903

19121904
template <modes::Mode mode, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
1913-
void processMixedEvent(T1 const& cols, T2& trackTable, T3& trackPartition, T4& v0Partition, T5& cache, T6& binsVtxMult, T7& binsVtxCent, T8& binsVtxMultCent)
1905+
void processMixedEvent(T1 const& cols, T2& trackTable, T3& trackPartition, T4& cascadePartition, T5& cache, T6& binsVtxMult, T7& binsVtxCent, T8& binsVtxMultCent)
19141906
{
19151907
switch (mMixingPolicy) {
19161908
case static_cast<int>(pairhistmanager::kVtxMult):
1917-
pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, v0Partition, trackTable, cache, binsVtxMult, mMixingDepth, mPairHistManagerMe, mCprMe, mPcMe);
1909+
pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, cascadePartition, trackTable, cache, binsVtxMult, mMixingDepth, mPairHistManagerMe, mCprMe, mPcMe);
19181910
break;
19191911
case static_cast<int>(pairhistmanager::kVtxCent):
1920-
pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, v0Partition, trackTable, cache, binsVtxCent, mMixingDepth, mPairHistManagerMe, mCprMe, mPcMe);
1912+
pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, cascadePartition, trackTable, cache, binsVtxCent, mMixingDepth, mPairHistManagerMe, mCprMe, mPcMe);
19211913
break;
19221914
case static_cast<int>(pairhistmanager::kVtxMultCent):
1923-
pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, v0Partition, trackTable, cache, binsVtxMultCent, mMixingDepth, mPairHistManagerMe, mCprMe, mPcMe);
1915+
pairprocesshelpers::processMixedEvent<mode>(cols, trackPartition, cascadePartition, trackTable, cache, binsVtxMultCent, mMixingDepth, mPairHistManagerMe, mCprMe, mPcMe);
19241916
break;
19251917
default:
19261918
LOG(fatal) << "Invalid binning policiy specifed. Breaking...";

‎PWGCF/Femto/Core/tripletProcessHelpers.h‎

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ enum TripletOrder : uint8_t {
3535
kOrder123, // no swap
3636
kOrder213, // swap 1&2: for the case that particle 1 & 2 are the same species, particle 3 is something else
3737
kOrder132, // swap 2&3
38-
kOrder321, // reverse: swap 1&3
38+
kOrder231, // swap 1&2 & 1&3
39+
kOrder312, // swap 2&3 & 1&3
40+
kOrder321, // swap 1&3
3941
};
4042

4143
// process same event for identical 3 particles
@@ -76,6 +78,12 @@ bool processSameEvent(T1 const& SliceParticle,
7678
case kOrder132:
7779
TripletHistManager.setTriplet(p1, p3, p2, Collision);
7880
break;
81+
case kOrder231:
82+
TripletHistManager.setTriplet(p2, p3, p1, Collision);
83+
break;
84+
case kOrder312:
85+
TripletHistManager.setTriplet(p3, p1, p2, Collision);
86+
break;
7987
case kOrder321:
8088
TripletHistManager.setTriplet(p3, p2, p1, Collision);
8189
break;
@@ -291,6 +299,12 @@ bool processSameEvent(T1 const& SliceParticle,
291299
case kOrder132:
292300
TripletHistManager.setTripletMc(p1, p3, p2, mcParticles, Collision, mcCollisions);
293301
break;
302+
case kOrder231:
303+
TripletHistManager.setTripletMc(p2, p3, p1, mcParticles, Collision, mcCollisions);
304+
break;
305+
case kOrder312:
306+
TripletHistManager.setTripletMc(p3, p1, p2, mcParticles, Collision, mcCollisions);
307+
break;
294308
case kOrder321:
295309
TripletHistManager.setTripletMc(p3, p2, p1, mcParticles, Collision, mcCollisions);
296310
break;
@@ -403,7 +417,6 @@ bool processSameEvent(T1 const& SliceParticle1,
403417
}
404418

405419
// process same event for 3 different particles with mc information
406-
// NOTE: added `Cleaner1`, `Cleaner2`, `Cleaner3` (one per species)
407420
template <modes::Mode mode,
408421
typename T1,
409422
typename T2,
@@ -498,13 +511,6 @@ bool processSameEvent(T1 const& SliceParticle1,
498511
}
499512

500513
// --- mc truth only (kMc without kReco): triplets of generated particles ---------------------------
501-
// These are named processSameEventMcTruth (not processSameEvent) on purpose: several of the reco
502-
// overloads have the same number of arguments and every parameter is a template type, so the call
503-
// would be ambiguous.
504-
// The particles ARE the truth, so there is no track table, no reco counterpart and no charge rescaling.
505-
// The close triplet rejection and the triplet cleaner take the table of mc particles where the reco
506-
// helpers take the track table; both ignore it in the track-track-track case.
507-
508514
// process same event for identical 3 mc particles
509515
template <modes::Mode mode,
510516
typename T1,
@@ -548,16 +554,24 @@ bool processSameEventMcTruth(T1 const& SliceParticle,
548554

549555
// Randomize triplet order if enabled, then compute the kinematic (Q3) for this triplet
550556
switch (tripletOrder) {
557+
case kOrder123:
558+
TripletHistManager.setTripletMcTruth(p1, p2, p3, Collision);
559+
break;
551560
case kOrder213:
552561
TripletHistManager.setTripletMcTruth(p2, p1, p3, Collision);
553562
break;
554563
case kOrder132:
555564
TripletHistManager.setTripletMcTruth(p1, p3, p2, Collision);
556565
break;
566+
case kOrder231:
567+
TripletHistManager.setTripletMcTruth(p2, p3, p1, Collision);
568+
break;
569+
case kOrder312:
570+
TripletHistManager.setTripletMcTruth(p3, p1, p2, Collision);
571+
break;
557572
case kOrder321:
558573
TripletHistManager.setTripletMcTruth(p3, p2, p1, Collision);
559574
break;
560-
case kOrder123:
561575
default:
562576
TripletHistManager.setTripletMcTruth(p1, p2, p3, Collision);
563577
break;
@@ -729,7 +743,6 @@ bool processSameEventMcTruth(T1 const& SliceParticle1,
729743
}
730744

731745
// process mixed event
732-
// (no cleaner here — ParticleCleaner only operates on MC info, see the mc overload below)
733746
template <modes::Mode mode,
734747
typename T1,
735748
typename T2,
@@ -843,8 +856,6 @@ void processMixedEvent(T1 const& Collisions,
843856
}
844857

845858
// process mixed event in mc
846-
// NOTE: added `mcMothers`, `mcPartonicMothers` (missing in the original — mixed-event mc triplets
847-
// were never mc-cleaned via TcManager) plus `Cleaner1`, `Cleaner2`, `Cleaner3`
848859
template <modes::Mode mode,
849860
typename T1,
850861
typename T2,

‎PWGCF/Femto/Core/twoTrackResonanceHistManager.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ class TwoTrackResonanceHistManager
216216
negDauPdgCodeAbs = std::abs(PDG_t::kPiMinus);
217217
} else {
218218
mPdgCode = -1 * mPdgCode;
219-
posDauPdgCodeAbs = std::abs(PDG_t::kKMinus);
220-
negDauPdgCodeAbs = std::abs(PDG_t::kPiPlus);
219+
posDauPdgCodeAbs = std::abs(PDG_t::kPiPlus);
220+
negDauPdgCodeAbs = std::abs(PDG_t::kKMinus);
221221
}
222222
} else {
223223
LOG(fatal) << "PDG code for TwoTrackResonance has to be either Rho, Phi or K^0*(892)";

‎PWGCF/Femto/Core/v0HistManager.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ class V0HistManager
618618
massLambda = v0candidate.massLambda();
619619
massAntiLambda = v0candidate.massAntiLambda();
620620
tofPosDau = posDau.tofNSigmaPi();
621-
tofNegDau = posDau.tofNSigmaPi();
621+
tofNegDau = negDau.tofNSigmaPi();
622622
}
623623

624624
mHistogramRegistry->fill(HIST(v0Prefix) + HIST(QaDir) + HIST(getHistName(kMassLambda, HistTable)), massLambda);

‎PWGCF/Femto/DataModel/FemtoTables.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,11 @@ DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, //! transverse momentum
216216
});
217217
DECLARE_SOA_DYNAMIC_COLUMN(Px, px, //! momentum in x
218218
[](float pt, float phi) -> float {
219-
return std::fabs(pt) * std::sin(phi);
219+
return std::fabs(pt) * std::cos(phi);
220220
});
221221
DECLARE_SOA_DYNAMIC_COLUMN(Py, py, //! momentum in y
222222
[](float pt, float phi) -> float {
223-
return std::fabs(pt) * std::cos(phi);
223+
return std::fabs(pt) * std::sin(phi);
224224
});
225225
DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, //! momentum in z
226226
[](float pt, float eta) -> float {

0 commit comments

Comments
 (0)