Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 42 additions & 41 deletions ALICE3/TableProducer/OTF/onTheFlyTracker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

#include <TGenPhaseSpace.h>
#include <TGeoGlobalMagField.h>
#include <TLorentzVector.h>

Check failure on line 56 in ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include <TPDGCode.h>
#include <TRandom3.h>

Expand Down Expand Up @@ -195,8 +195,10 @@
o2::fastsim::FastTracker fastPrimaryTracker;

// V0 names for filling histograms
static constexpr std::string_view kV0names[] = {"K0", "Lambda", "AntiLambda"};
static constexpr std::string_view index[] = {"0", "1", "2", "3"};
static constexpr int NtypesV0 = 3;
static constexpr std::string_view NameV0s[NtypesV0] = {"K0", "Lambda", "AntiLambda"};
static constexpr int NtypesDetectors = 4;
static constexpr std::string_view NameDetectors[NtypesDetectors] = {"0", "1", "2", "3"};

// Class to hold the track information for the O2 vertexing
class TrackAlice3 : public o2::track::TrackParCov
Expand Down Expand Up @@ -598,7 +600,7 @@
/// \param xiDecayVertex the address of the xi decay vertex
/// \param laDecayVertex the address of the la decay vertex
template <typename McParticleType>
void decayCascade(McParticleType particle, o2::track::TrackParCov track, std::vector<TLorentzVector>& decayDaughters, std::vector<double>& xiDecayVertex, std::vector<double>& laDecayVertex)

Check failure on line 603 in ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
{
const double uXi = rand.Uniform(0, 1);
const double ctauXi = 4.91; // cm
Expand All @@ -621,12 +623,12 @@
xiDecayVertex.push_back(particle.vz() + rxyzXi * (particle.pz() / particle.p()));

std::vector<double> xiDaughters = {o2::constants::physics::MassLambda, o2::constants::physics::MassPionCharged};
TLorentzVector xi(newPx, newPy, particle.pz(), newE);

Check failure on line 626 in ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
TGenPhaseSpace xiDecay;
xiDecay.SetDecay(xi, 2, xiDaughters.data());
xiDecay.Generate();
decayDaughters.push_back(*xiDecay.GetDecay(1));
TLorentzVector la = *xiDecay.GetDecay(0);

Check failure on line 631 in ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.

const double uLa = rand.Uniform(0, 1);
const double ctauLa = 7.845; // cm
Expand All @@ -649,7 +651,7 @@
/// \param decayDaughters the address of resulting daughters
/// \param v0DecayVertex the address of the la decay vertex
template <typename McParticleType>
void decayV0Particle(McParticleType particle, std::vector<TLorentzVector>& decayDaughters, std::vector<double>& v0DecayVertex, int pdgCode)

Check failure on line 654 in ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
{
double u = rand.Uniform(0, 1);
double v0Mass = -1.;
Expand All @@ -676,7 +678,7 @@

const double v0BetaGamma = particle.p() / v0Mass;
const double v0rxyz = (-v0BetaGamma * ctau * std::log(1 - u));
TLorentzVector v0(particle.px(), particle.py(), particle.pz(), particle.e());

Check failure on line 681 in ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.

v0DecayVertex.push_back(particle.vx() + v0rxyz * (particle.px() / particle.p()));
v0DecayVertex.push_back(particle.vy() + v0rxyz * (particle.py() / particle.p()));
Expand Down Expand Up @@ -760,8 +762,8 @@
double xiDecayRadius2D = 0;
double laDecayRadius2D = 0;
double v0DecayRadius2D = 0;
std::vector<TLorentzVector> decayProducts;

Check failure on line 765 in ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
std::vector<TLorentzVector> v0DecayProducts;

Check failure on line 766 in ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
std::vector<double> xiDecayVertex, laDecayVertex, v0DecayVertex;
if (cascadeDecaySettings.decayXi) {
if (mcParticle.pdgCode() == kXiMinus) {
Expand Down Expand Up @@ -817,13 +819,12 @@
}
if (v0DecaySettings.doV0QA && isV0) {
static_for<0, 11>([&](auto i) {
constexpr int Index = i.value / 4;
constexpr int IndexCnfg = i.value % 4;
if (pdg == v0PDGs[Index] && icfg == IndexCnfg) {

histos.fill(HIST("V0Building_Configuration_") + HIST(index[IndexCnfg]) + HIST("/") + HIST(kV0names[Index]) + HIST("/hGen"), v0DecayRadius2D, mcParticle.pt());
histos.fill(HIST("V0Building_Configuration_") + HIST(index[IndexCnfg]) + HIST("/") + HIST(kV0names[Index]) + HIST("/hGenNegDaughterFromV0"), v0DecayRadius2D, v0DecayProducts[0].Pt());
histos.fill(HIST("V0Building_Configuration_") + HIST(index[IndexCnfg]) + HIST("/") + HIST(kV0names[Index]) + HIST("/hGenPosDaughterFromV0"), v0DecayRadius2D, v0DecayProducts[1].Pt());
constexpr int IndexV0 = i.value / NtypesV0;
constexpr int IndexDetector = i.value % NtypesDetectors;
if (pdg == v0PDGs[IndexV0] && icfg == IndexDetector) {
histos.fill(HIST("V0Building_Configuration_") + HIST(NameDetectors[IndexDetector]) + HIST("/") + HIST(NameV0s[IndexV0]) + HIST("/hGen"), v0DecayRadius2D, mcParticle.pt());
histos.fill(HIST("V0Building_Configuration_") + HIST(NameDetectors[IndexDetector]) + HIST("/") + HIST(NameV0s[IndexV0]) + HIST("/hGenNegDaughterFromV0"), v0DecayRadius2D, v0DecayProducts[0].Pt());
histos.fill(HIST("V0Building_Configuration_") + HIST(NameDetectors[IndexDetector]) + HIST("/") + HIST(NameV0s[IndexV0]) + HIST("/hGenPosDaughterFromV0"), v0DecayRadius2D, v0DecayProducts[1].Pt());
}
});
}
Expand Down Expand Up @@ -852,8 +853,8 @@
histos.fill(HIST("hXiBuilding"), 0.0f);
}

o2::upgrade::convertTLorentzVectorToO2Track(kPiMinus, decayProducts[0], xiDecayVertex, xiDaughterTrackParCovsPerfect[0], pdgDB);

Check failure on line 856 in ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
o2::upgrade::convertTLorentzVectorToO2Track(kPiMinus, decayProducts[1], laDecayVertex, xiDaughterTrackParCovsPerfect[1], pdgDB);

Check failure on line 857 in ALICE3/TableProducer/OTF/onTheFlyTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
o2::upgrade::convertTLorentzVectorToO2Track(kProton, decayProducts[2], laDecayVertex, xiDaughterTrackParCovsPerfect[2], pdgDB);

for (int i = 0; i < kCascProngs; i++) {
Expand Down Expand Up @@ -1117,9 +1118,9 @@
if (v0DecaySettings.decayV0 && isV0) {
if (v0DecaySettings.doV0QA) {
static_for<0, 3>([&](auto j) {
constexpr int IndexCnfg = j.value;
if (icfg == IndexCnfg) {
histos.fill(HIST("V0Building_Configuration_") + HIST(index[IndexCnfg]) + HIST("/hV0Building"), 0.0f);
constexpr int IndexDetector = j.value;
if (icfg == IndexDetector) {
histos.fill(HIST("V0Building_Configuration_") + HIST(NameDetectors[IndexDetector]) + HIST("/hV0Building"), 0.0f);
}
});
}
Expand All @@ -1145,9 +1146,9 @@

if (nV0Hits[i] < 0) { // QA
static_for<0, 3>([&](auto j) {
constexpr int IndexCnfg = j.value;
if (icfg == IndexCnfg) {
histos.fill(HIST("V0Building_Configuration_") + HIST(index[IndexCnfg]) + HIST("/hFastTrackerQA"), o2::math_utils::abs(nV0Hits[i]));
constexpr int IndexDetector = j.value;
if (icfg == IndexDetector) {
histos.fill(HIST("V0Building_Configuration_") + HIST(NameDetectors[IndexDetector]) + HIST("/hFastTrackerQA"), o2::math_utils::abs(nV0Hits[i]));
}
});
}
Expand All @@ -1159,9 +1160,9 @@
}
for (uint32_t ih = 0; ih < fastTracker[icfg]->GetNHits(); ih++) {
static_for<0, 3>([&](auto j) {
constexpr int IndexCnfg = j.value;
if (icfg == IndexCnfg) {
histos.fill(HIST("V0Building_Configuration_") + HIST(index[IndexCnfg]) + HIST("/hFastTrackerHits"), fastTracker[icfg]->GetHitZ(ih), std::hypot(fastTracker[icfg]->GetHitX(ih), fastTracker[icfg]->GetHitY(ih)));
constexpr int IndexDetector = j.value;
if (icfg == IndexDetector) {
histos.fill(HIST("V0Building_Configuration_") + HIST(NameDetectors[IndexDetector]) + HIST("/hFastTrackerHits"), fastTracker[icfg]->GetHitZ(ih), std::hypot(fastTracker[icfg]->GetHitX(ih), fastTracker[icfg]->GetHitY(ih)));
}
});
}
Expand All @@ -1182,18 +1183,18 @@
}
}
if (v0DecaySettings.doV0QA) {
static_for<0, 11>([&](auto i) {
constexpr int Index = i.value / 4;
constexpr int IndexCnfg = i.value % 4;
if (pdg == v0PDGs[Index] && icfg == IndexCnfg) {
static_for<0, IndexV0 * IndexDetector - 1>([&](auto i) {
constexpr int IndexV0 = i.value / NtypesV0;
constexpr int IndexDetector = i.value % NtypesDetectors;
if (pdg == v0PDGs[IndexV0] && icfg == IndexDetector) {
if (isReco[0] && isReco[1]) {
histos.fill(HIST("V0Building_Configuration_") + HIST(index[IndexCnfg]) + HIST("/hV0Building"), 1.0f);
histos.fill(HIST("V0Building_Configuration_") + HIST(index[IndexCnfg]) + HIST("/") + HIST(kV0names[Index]) + HIST("/hReco"), v0DecayRadius2D, mcParticle.pt());
histos.fill(HIST("V0Building_Configuration_") + HIST(NameDetectors[IndexDetector]) + HIST("/hV0Building"), 1.0f);
histos.fill(HIST("V0Building_Configuration_") + HIST(NameDetectors[IndexDetector]) + HIST("/") + HIST(NameV0s[IndexV0]) + HIST("/hReco"), v0DecayRadius2D, mcParticle.pt());
}
if (isReco[0])
histos.fill(HIST("V0Building_Configuration_") + HIST(index[IndexCnfg]) + HIST("/") + HIST(kV0names[Index]) + HIST("/hRecoNegDaughterFromV0"), v0DecayRadius2D, v0DecayProducts[0].Pt());
histos.fill(HIST("V0Building_Configuration_") + HIST(NameDetectors[IndexDetector]) + HIST("/") + HIST(NameV0s[IndexV0]) + HIST("/hRecoNegDaughterFromV0"), v0DecayRadius2D, v0DecayProducts[0].Pt());
if (isReco[1])
histos.fill(HIST("V0Building_Configuration_") + HIST(index[IndexCnfg]) + HIST("/") + HIST(kV0names[Index]) + HIST("/hRecoPosDaughterFromV0"), v0DecayRadius2D, v0DecayProducts[1].Pt());
histos.fill(HIST("V0Building_Configuration_") + HIST(NameDetectors[IndexDetector]) + HIST("/") + HIST(NameV0s[IndexV0]) + HIST("/hRecoPosDaughterFromV0"), v0DecayRadius2D, v0DecayProducts[1].Pt());
}
});
}
Expand All @@ -1203,10 +1204,10 @@
// V0 building starts here
if (v0DecaySettings.findV0 && isReco[0] && isReco[1]) {
if (v0DecaySettings.doV0QA) {
static_for<0, 3>([&](auto j) {
constexpr int IndexCnfg = j.value;
if (icfg == IndexCnfg) {
histos.fill(HIST("V0Building_Configuration_") + HIST(index[IndexCnfg]) + HIST("/hV0Building"), 2.0f);
static_for<0, NtypesDetectors>([&](auto j) {
constexpr int IndexDetector = j.value;
if (icfg == IndexDetector) {
histos.fill(HIST("V0Building_Configuration_") + HIST(NameDetectors[IndexDetector]) + HIST("/hV0Building"), 2.0f);
}
});
}
Expand All @@ -1232,10 +1233,10 @@
// V0 found successfully
if (dcaFitterOK_V0) {
if (v0DecaySettings.doV0QA) {
static_for<0, 3>([&](auto j) {
constexpr int IndexCnfg = j.value;
if (icfg == IndexCnfg) {
histos.fill(HIST("V0Building_Configuration_") + HIST(index[IndexCnfg]) + HIST("/hV0Building"), 3.0f);
static_for<0, NtypesDetectors - 1>([&](auto j) {
constexpr int IndexDetector = j.value;
if (icfg == IndexDetector) {
histos.fill(HIST("V0Building_Configuration_") + HIST(NameDetectors[IndexDetector]) + HIST("/hV0Building"), 3.0f);
}
});
}
Expand Down Expand Up @@ -1293,13 +1294,13 @@
}

if (v0DecaySettings.doV0QA) {
static_for<0, 3>([&](auto j) {
constexpr int IndexCnfg = j.value;
if (icfg == IndexCnfg) {
histos.fill(HIST("V0Building_Configuration_") + HIST(index[IndexCnfg]) + HIST("/hV0Building"), 4.0f);
histos.fill(HIST("V0Building_Configuration_") + HIST(index[IndexCnfg]) + HIST("/K0/hMass"), thisV0.mK0, thisV0.pt);
histos.fill(HIST("V0Building_Configuration_") + HIST(index[IndexCnfg]) + HIST("/Lambda/hMass"), thisV0.mLambda, thisV0.pt);
histos.fill(HIST("V0Building_Configuration_") + HIST(index[IndexCnfg]) + HIST("/AntiLambda/hMass"), thisV0.mAntiLambda, thisV0.pt);
static_for<0, NtypesDetectors - 1>([&](auto j) {
constexpr int IndexDetector = j.value;
if (icfg == IndexDetector) {
histos.fill(HIST("V0Building_Configuration_") + HIST(NameDetectors[IndexDetector]) + HIST("/hV0Building"), 4.0f);
histos.fill(HIST("V0Building_Configuration_") + HIST(NameDetectors[IndexDetector]) + HIST("/K0/hMass"), thisV0.mK0, thisV0.pt);
histos.fill(HIST("V0Building_Configuration_") + HIST(NameDetectors[IndexDetector]) + HIST("/Lambda/hMass"), thisV0.mLambda, thisV0.pt);
histos.fill(HIST("V0Building_Configuration_") + HIST(NameDetectors[IndexDetector]) + HIST("/AntiLambda/hMass"), thisV0.mAntiLambda, thisV0.pt);
}
});
}
Expand Down
Loading