Skip to content

Commit f81fdb2

Browse files
authored
Replace decayProducts with cascadeDecayProducts
1 parent 7589d6f commit f81fdb2

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ struct OnTheFlyTracker {
741741
double xiDecayRadius2D = 0;
742742
double laDecayRadius2D = 0;
743743
double v0DecayRadius2D = 0;
744-
std::vector<TLorentzVector> decayProducts;
744+
std::vector<TLorentzVector> cascadeDecayProducts;
745745
std::vector<TLorentzVector> v0DecayProducts;
746746
std::vector<double> xiDecayVertex, laDecayVertex, v0DecayVertex;
747747
for (const auto& mcParticle : mcParticles) {
@@ -752,14 +752,17 @@ struct OnTheFlyTracker {
752752
laDecayVertex.clear();
753753
v0DecayVertex.clear();
754754

755-
decayProducts.clear();
755+
cascadeDecayProducts.clear();
756756
v0DecayProducts.clear();
757757

758758
if (cascadeDecaySettings.decayXi) {
759759
if (mcParticle.pdgCode() == kXiMinus) {
760760
o2::track::TrackParCov xiTrackParCov;
761761
o2::upgrade::convertMCParticleToO2Track(mcParticle, xiTrackParCov, pdgDB);
762-
decayCascade(mcParticle, xiTrackParCov, decayProducts, xiDecayVertex, laDecayVertex);
762+
decayCascade(mcParticle, xiTrackParCov, cascadeDecayProducts, xiDecayVertex, laDecayVertex);
763+
if (cascadeDecayProducts.size() != 3) {
764+
LOG(fatal) << "Xi decay did not produce 3 daughters as expected!";
765+
}
763766
xiDecayRadius2D = std::hypot(xiDecayVertex[0], xiDecayVertex[1]);
764767
laDecayRadius2D = std::hypot(laDecayVertex[0], laDecayVertex[1]);
765768
}
@@ -768,6 +771,9 @@ struct OnTheFlyTracker {
768771

769772
if (v0DecaySettings.decayV0 && isV0) {
770773
decayV0Particle(mcParticle, v0DecayProducts, v0DecayVertex, mcParticle.pdgCode());
774+
if (v0DecayProducts.size() != 2) {
775+
LOG(fatal) << "V0 decay did not produce 2 daughters as expected!";
776+
}
771777
v0DecayRadius2D = std::hypot(v0DecayVertex[0], v0DecayVertex[1]);
772778
}
773779

@@ -805,9 +811,9 @@ struct OnTheFlyTracker {
805811
}
806812
if (cascadeDecaySettings.doXiQA && mcParticle.pdgCode() == kXiMinus) {
807813
histos.fill(HIST("hGenXi"), xiDecayRadius2D, mcParticle.pt());
808-
histos.fill(HIST("hGenPiFromXi"), xiDecayRadius2D, decayProducts[0].Pt());
809-
histos.fill(HIST("hGenPiFromLa"), laDecayRadius2D, decayProducts[1].Pt());
810-
histos.fill(HIST("hGenPrFromLa"), laDecayRadius2D, decayProducts[2].Pt());
814+
histos.fill(HIST("hGenPiFromXi"), xiDecayRadius2D, cascadeDecayProducts[0].Pt());
815+
histos.fill(HIST("hGenPiFromLa"), laDecayRadius2D, cascadeDecayProducts[1].Pt());
816+
histos.fill(HIST("hGenPrFromLa"), laDecayRadius2D, cascadeDecayProducts[2].Pt());
811817
}
812818
if (v0DecaySettings.doV0QA && isV0) {
813819
for (size_t indexV0 = 0; indexV0 < v0PDGs.size(); indexV0++) {
@@ -848,9 +854,9 @@ struct OnTheFlyTracker {
848854
histos.fill(HIST("hXiBuilding"), 0.0f);
849855
}
850856

851-
o2::upgrade::convertTLorentzVectorToO2Track(kPiMinus, decayProducts[0], xiDecayVertex, xiDaughterTrackParCovsPerfect[0], pdgDB);
852-
o2::upgrade::convertTLorentzVectorToO2Track(kPiMinus, decayProducts[1], laDecayVertex, xiDaughterTrackParCovsPerfect[1], pdgDB);
853-
o2::upgrade::convertTLorentzVectorToO2Track(kProton, decayProducts[2], laDecayVertex, xiDaughterTrackParCovsPerfect[2], pdgDB);
857+
o2::upgrade::convertTLorentzVectorToO2Track(kPiMinus, cascadeDecayProducts[0], xiDecayVertex, xiDaughterTrackParCovsPerfect[0], pdgDB);
858+
o2::upgrade::convertTLorentzVectorToO2Track(kPiMinus, cascadeDecayProducts[1], laDecayVertex, xiDaughterTrackParCovsPerfect[1], pdgDB);
859+
o2::upgrade::convertTLorentzVectorToO2Track(kProton, cascadeDecayProducts[2], laDecayVertex, xiDaughterTrackParCovsPerfect[2], pdgDB);
854860

855861
for (int i = 0; i < kCascProngs; i++) {
856862
isReco[i] = false;
@@ -897,11 +903,11 @@ struct OnTheFlyTracker {
897903
histos.fill(HIST("hRecoXi"), xiDecayRadius2D, mcParticle.pt());
898904
}
899905
if (isReco[0])
900-
histos.fill(HIST("hRecoPiFromXi"), xiDecayRadius2D, decayProducts[0].Pt());
906+
histos.fill(HIST("hRecoPiFromXi"), xiDecayRadius2D, cascadeDecayProducts[0].Pt());
901907
if (isReco[1])
902-
histos.fill(HIST("hRecoPiFromLa"), laDecayRadius2D, decayProducts[1].Pt());
908+
histos.fill(HIST("hRecoPiFromLa"), laDecayRadius2D, cascadeDecayProducts[1].Pt());
903909
if (isReco[2])
904-
histos.fill(HIST("hRecoPrFromLa"), laDecayRadius2D, decayProducts[2].Pt());
910+
histos.fill(HIST("hRecoPrFromLa"), laDecayRadius2D, cascadeDecayProducts[2].Pt());
905911
}
906912

907913
// +-~-+-~-+-~-+-~-+-~-+-~-+-~-+-~-+-~-+-~-+-~-+-~-+-~-+

0 commit comments

Comments
 (0)