diff --git a/Common/DataModel/StrangenessTables.h b/Common/DataModel/StrangenessTables.h index 85d1c1d3edd..4c33c1e0c9e 100644 --- a/Common/DataModel/StrangenessTables.h +++ b/Common/DataModel/StrangenessTables.h @@ -19,13 +19,13 @@ namespace o2::aod { namespace v0data { -//Needed to have shorter table that does not rely on existing one (filtering!) +// Needed to have shorter table that does not rely on existing one (filtering!) DECLARE_SOA_INDEX_COLUMN_FULL(PosTrack, posTrack, int, Tracks, "_Pos"); //! DECLARE_SOA_INDEX_COLUMN_FULL(NegTrack, negTrack, int, Tracks, "_Neg"); //! DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! DECLARE_SOA_INDEX_COLUMN(V0, v0); //! -//General V0 properties: position, momentum +// General V0 properties: position, momentum DECLARE_SOA_COLUMN(PosX, posX, float); //! positive track X at min DECLARE_SOA_COLUMN(NegX, negX, float); //! negative track X at min DECLARE_SOA_COLUMN(PxPos, pxpos, float); //! positive track px at min @@ -38,47 +38,47 @@ DECLARE_SOA_COLUMN(X, x, float); //! decay position X DECLARE_SOA_COLUMN(Y, y, float); //! decay position Y DECLARE_SOA_COLUMN(Z, z, float); //! decay position Z -//Saved from finding: DCAs +// Saved from finding: DCAs DECLARE_SOA_COLUMN(DCAV0Daughters, dcaV0daughters, float); //! DCA between V0 daughters DECLARE_SOA_COLUMN(DCAPosToPV, dcapostopv, float); //! DCA positive prong to PV DECLARE_SOA_COLUMN(DCANegToPV, dcanegtopv, float); //! DCA negative prong to PV -//Derived expressions -//Momenta +// Derived expressions +// Momenta DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, //! V0 pT [](float pxpos, float pypos, float pxneg, float pyneg) -> float { return RecoDecay::sqrtSumOfSquares(pxpos + pxneg, pypos + pyneg); }); -//Length quantities +// Length quantities DECLARE_SOA_DYNAMIC_COLUMN(V0Radius, v0radius, //! V0 decay radius (2D, centered at zero) [](float x, float y) -> float { return RecoDecay::sqrtSumOfSquares(x, y); }); -//Distance Over To Mom +// Distance Over To Mom DECLARE_SOA_DYNAMIC_COLUMN(DistOverTotMom, distovertotmom, //! PV to V0decay distance over total momentum [](float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) { float P = RecoDecay::sqrtSumOfSquares(Px, Py, Pz); return std::sqrt(std::pow(X - pvX, 2) + std::pow(Y - pvY, 2) + std::pow(Z - pvZ, 2)) / (P + 1E-10); }); -//CosPA +// CosPA DECLARE_SOA_DYNAMIC_COLUMN(V0CosPA, v0cosPA, //! V0 CosPA [](float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) -> float { return RecoDecay::CPA(array{pvX, pvY, pvZ}, array{X, Y, Z}, array{Px, Py, Pz}); }); DECLARE_SOA_DYNAMIC_COLUMN(DCAV0ToPV, dcav0topv, //! DCA of V0 to PV [](float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) -> float { 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)); }); -//Armenteros-Podolanski variables +// Armenteros-Podolanski variables DECLARE_SOA_DYNAMIC_COLUMN(Alpha, alpha, //! Armenteros Alpha [](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) { float momTot = RecoDecay::P(pxpos + pxneg, pypos + pyneg, pzpos + pzneg); float lQlNeg = RecoDecay::dotProd(array{pxneg, pyneg, pzneg}, array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}) / momTot; float lQlPos = RecoDecay::dotProd(array{pxpos, pypos, pzpos}, array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}) / momTot; - return (lQlPos - lQlNeg) / (lQlPos + lQlNeg); //alphav0 + return (lQlPos - lQlNeg) / (lQlPos + lQlNeg); // alphav0 }); DECLARE_SOA_DYNAMIC_COLUMN(QtArm, qtarm, //! Armenteros Qt [](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) { float momTot = RecoDecay::P2(pxpos + pxneg, pypos + pyneg, pzpos + pzneg); float dp = RecoDecay::dotProd(array{pxneg, pyneg, pzneg}, array{pxpos + pxneg, pypos + pyneg, pzpos + pzneg}); - return std::sqrt(RecoDecay::P2(pxneg, pyneg, pzneg) - dp * dp / momTot); //qtarm + return std::sqrt(RecoDecay::P2(pxneg, pyneg, pzneg) - dp * dp / momTot); // qtarm }); // Psi pair angle: angle between the plane defined by the electron and positron momenta and the xy plane @@ -93,7 +93,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(PsiPair, psipair, //! psi pair angle return std::asin(clipToPM1(argsin)); }); -//Calculated on the fly with mass assumption + dynamic tables +// Calculated on the fly with mass assumption + dynamic tables DECLARE_SOA_DYNAMIC_COLUMN(MLambda, mLambda, //! mass under lambda hypothesis [](float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float { return RecoDecay::M(array{array{pxpos, pypos, pzpos}, array{pxneg, pyneg, pzneg}}, array{RecoDecay::getMassPDG(kProton), RecoDecay::getMassPDG(kPiPlus)}); }); DECLARE_SOA_DYNAMIC_COLUMN(MAntiLambda, mAntiLambda, //! mass under antilambda hypothesis @@ -141,7 +141,7 @@ DECLARE_SOA_TABLE_FULL(StoredV0Datas, "V0Datas", "AOD", "V0DATA", //! v0data::PxNeg, v0data::PyNeg, v0data::PzNeg, v0data::DCAV0Daughters, v0data::DCAPosToPV, v0data::DCANegToPV, - //Dynamic columns + // Dynamic columns v0data::Pt, v0data::V0Radius, v0data::DistOverTotMom, @@ -151,13 +151,13 @@ DECLARE_SOA_TABLE_FULL(StoredV0Datas, "V0Datas", "AOD", "V0DATA", //! v0data::QtArm, v0data::PsiPair, - //Invariant masses + // Invariant masses v0data::MLambda, v0data::MAntiLambda, v0data::MK0Short, v0data::MGamma, - //Longitudinal + // Longitudinal v0data::YK0Short, v0data::YLambda, v0data::Eta, @@ -174,13 +174,24 @@ DECLARE_SOA_EXTENDED_TABLE_USER(V0Datas, StoredV0Datas, "V0DATAEXT", //! v0data::Px, v0data::Py, v0data::Pz); // the table name has here to be the one with EXT which is not nice and under study using V0Data = V0Datas::iterator; +namespace v0data +{ +DECLARE_SOA_INDEX_COLUMN(V0Data, v0Data); //! Index to V0Data entry +} + +DECLARE_SOA_TABLE(V0DataLink, "AOD", "V0DATALINK", //! Joinable table with V0s which links to V0Data which is not produced for all entries + v0data::V0DataId); + +using V0sLinked = soa::Join; +using V0Linked = V0sLinked::iterator; + namespace cascdata { -//Necessary for full filtering functionality +// Necessary for full filtering functionality DECLARE_SOA_INDEX_COLUMN(V0, v0); //! DECLARE_SOA_INDEX_COLUMN_FULL(Bachelor, bachelor, int, Tracks, ""); //! DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! -//General cascade properties: position, momentum +// General cascade properties: position, momentum DECLARE_SOA_COLUMN(Sign, sign, int); //! DECLARE_SOA_COLUMN(PxPos, pxpos, float); //! DECLARE_SOA_COLUMN(PyPos, pypos, float); //! @@ -198,25 +209,25 @@ DECLARE_SOA_COLUMN(Xlambda, xlambda, float); //! DECLARE_SOA_COLUMN(Ylambda, ylambda, float); //! DECLARE_SOA_COLUMN(Zlambda, zlambda, float); //! -//Saved from finding: DCAs +// Saved from finding: DCAs DECLARE_SOA_COLUMN(DCAV0Daughters, dcaV0daughters, float); //! DECLARE_SOA_COLUMN(DCACascDaughters, dcacascdaughters, float); //! DECLARE_SOA_COLUMN(DCAPosToPV, dcapostopv, float); //! DECLARE_SOA_COLUMN(DCANegToPV, dcanegtopv, float); //! DECLARE_SOA_COLUMN(DCABachToPV, dcabachtopv, float); //! -//Derived expressions -//Momenta +// Derived expressions +// Momenta DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, //! [](float Px, float Py) -> float { return RecoDecay::sqrtSumOfSquares(Px, Py); }); -//Length quantities +// Length quantities DECLARE_SOA_DYNAMIC_COLUMN(V0Radius, v0radius, //! [](float xlambda, float ylambda) -> float { return RecoDecay::sqrtSumOfSquares(xlambda, ylambda); }); DECLARE_SOA_DYNAMIC_COLUMN(CascRadius, cascradius, //! [](float x, float y) -> float { return RecoDecay::sqrtSumOfSquares(x, y); }); -//CosPAs +// CosPAs DECLARE_SOA_DYNAMIC_COLUMN(V0CosPA, v0cosPA, //! [](float Xlambda, float Ylambda, float Zlambda, float PxLambda, float PyLambda, float PzLambda, float pvX, float pvY, float pvZ) -> float { return RecoDecay::CPA(array{pvX, pvY, pvZ}, array{Xlambda, Ylambda, Zlambda}, array{PxLambda, PyLambda, PzLambda}); }); DECLARE_SOA_DYNAMIC_COLUMN(CascCosPA, casccosPA, //! @@ -226,10 +237,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(DCAV0ToPV, dcav0topv, //! DECLARE_SOA_DYNAMIC_COLUMN(DCACascToPV, dcacasctopv, //! [](float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) -> float { 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)); }); -//Calculated on the fly with mass assumption + dynamic tables +// Calculated on the fly with mass assumption + dynamic tables DECLARE_SOA_DYNAMIC_COLUMN(MLambda, mLambda, //! [](int charge, float pxpos, float pypos, float pzpos, float pxneg, float pyneg, float pzneg) -> float { return RecoDecay::M(array{array{pxpos, pypos, pzpos}, array{pxneg, pyneg, pzneg}}, charge < 0 ? array{RecoDecay::getMassPDG(kProton), RecoDecay::getMassPDG(kPiPlus)} : array{RecoDecay::getMassPDG(kPiPlus), RecoDecay::getMassPDG(kProton)}); }); -//Calculated on the fly with mass assumption + dynamic tables +// Calculated on the fly with mass assumption + dynamic tables DECLARE_SOA_DYNAMIC_COLUMN(MXi, mXi, //! [](float pxbach, float pybach, float pzbach, float PxLambda, float PyLambda, float PzLambda) -> float { return RecoDecay::M(array{array{pxbach, pybach, pzbach}, array{PxLambda, PyLambda, PzLambda}}, array{RecoDecay::getMassPDG(kPiPlus), RecoDecay::getMassPDG(kLambda0)}); }); @@ -272,7 +283,7 @@ DECLARE_SOA_TABLE(CascData, "AOD", "CASCDATA", //! cascdata::DCAV0Daughters, cascdata::DCACascDaughters, cascdata::DCAPosToPV, cascdata::DCANegToPV, cascdata::DCABachToPV, - //Dynamic columns + // Dynamic columns cascdata::Pt, cascdata::V0Radius, cascdata::CascRadius, @@ -281,11 +292,11 @@ DECLARE_SOA_TABLE(CascData, "AOD", "CASCDATA", //! cascdata::DCAV0ToPV, cascdata::DCACascToPV, - //Invariant masses + // Invariant masses cascdata::MLambda, cascdata::MXi, cascdata::MOmega, - //Longitudinal + // Longitudinal cascdata::YXi, cascdata::YOmega, cascdata::Eta); @@ -301,9 +312,9 @@ using CascDataFull = CascDataExt; namespace v0ind { -DECLARE_SOA_INDEX_COLUMN(V0, v0); //the biggest object -DECLARE_SOA_INDEX_COLUMN(V0Data, v0data); //the skimmed object -DECLARE_SOA_INDEX_COLUMN(Cascade, cascade); //the part that will use the previous ones +DECLARE_SOA_INDEX_COLUMN(V0, v0); // the biggest object +DECLARE_SOA_INDEX_COLUMN(V0Data, v0data); // the skimmed object +DECLARE_SOA_INDEX_COLUMN(Cascade, cascade); // the part that will use the previous ones } // namespace v0ind DECLARE_SOA_INDEX_TABLE_EXCLUSIVE_USER(MatchedV0Cascades, V0s, "MATCHEDV0CASC", v0ind::V0DataId, v0ind::V0Id, v0ind::CascadeId); diff --git a/PWGLF/TableProducer/lambdakzerobuilder.cxx b/PWGLF/TableProducer/lambdakzerobuilder.cxx index 8cb8833cc05..1905d0b05b2 100644 --- a/PWGLF/TableProducer/lambdakzerobuilder.cxx +++ b/PWGLF/TableProducer/lambdakzerobuilder.cxx @@ -65,19 +65,6 @@ using namespace o2::framework; using namespace o2::framework::expressions; using std::array; -// This table stores a filtered list of valid V0 indices -namespace o2::aod -{ -namespace v0goodindices -{ -DECLARE_SOA_INDEX_COLUMN_FULL(PosTrack, posTrack, int, Tracks, "_Pos"); -DECLARE_SOA_INDEX_COLUMN_FULL(NegTrack, negTrack, int, Tracks, "_Neg"); -DECLARE_SOA_INDEX_COLUMN(Collision, collision); -} // namespace v0goodindices -DECLARE_SOA_TABLE(V0GoodIndices, "AOD", "V0GOODINDICES", o2::soa::Index<>, - v0goodindices::PosTrackId, v0goodindices::NegTrackId, v0goodindices::CollisionId); -} // namespace o2::aod - using FullTracksExt = soa::Join; using FullTracksExtMC = soa::Join; @@ -93,10 +80,11 @@ using MyTracks = FullTracksExt; #define MY_DEBUG_MSG(condition, cmd) #endif -// This prefilter creates a skimmed list of good V0s to re-reconstruct so that +// Builder task: rebuilds V0s +// The prefilter part skims the list of good V0s to re-reconstruct so that // CPU is saved in case there are specific selections that are to be done // Note: more configurables, more options to be added as needed -struct lambdakzeroPrefilterPairs { +struct lambdakzeroBuilder { Configurable dcanegtopv{"dcanegtopv", .1, "DCA Neg To PV"}; Configurable dcapostopv{"dcapostopv", .1, "DCA Pos To PV"}; Configurable mincrossedrows{"mincrossedrows", 70, "min crossed rows"}; @@ -108,80 +96,17 @@ struct lambdakzeroPrefilterPairs { Configurable> v_labelK0Sneg{"v_labelK0Sneg", {730, 2867, 4755}, "labels of K0S negative daughters, for debug"}; #endif - HistogramRegistry registry{ - "registry", - { - {"hGoodIndices", "hGoodIndices", {HistType::kTH1F, {{4, 0.0f, 4.0f}}}}, - }, - }; - - Produces v0goodindices; - - void process(aod::Collision const& collision, aod::V0s const& V0s, - MyTracks const& tracks -#ifdef MY_DEBUG - , - aod::McParticles const& particlesMC -#endif - ) - { - for (auto& V0 : V0s) { - -#ifdef MY_DEBUG - auto labelPos = V0.posTrack_as().mcParticleId(); - auto labelNeg = V0.negTrack_as().mcParticleId(); - bool isK0SfromLc = isK0SfromLcFunc(labelPos, labelNeg, v_labelK0Spos, v_labelK0Sneg); -#endif - MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "V0 builder: found K0S from Lc, posTrack --> " << labelPos << ", negTrack --> " << labelNeg); - - registry.fill(HIST("hGoodIndices"), 0.5); - if (isRun2) { - if (!(V0.posTrack_as().trackType() & o2::aod::track::TPCrefit)) { - MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack " << labelPos << " has no TPC refit"); - continue; // TPC refit - } - if (!(V0.negTrack_as().trackType() & o2::aod::track::TPCrefit)) { - MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "negTrack " << labelNeg << " has no TPC refit"); - continue; // TPC refit - } - } - registry.fill(HIST("hGoodIndices"), 1.5); - if (V0.posTrack_as().tpcNClsCrossedRows() < mincrossedrows) { - MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack " << labelPos << " has " << V0.posTrack_as().tpcNClsCrossedRows() << " crossed rows, cut at " << mincrossedrows); - continue; - } - if (V0.negTrack_as().tpcNClsCrossedRows() < mincrossedrows) { - MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "negTrack " << labelNeg << " has " << V0.negTrack_as().tpcNClsCrossedRows() << " crossed rows, cut at " << mincrossedrows); - continue; - } - registry.fill(HIST("hGoodIndices"), 2.5); - if (fabs(V0.posTrack_as().dcaXY()) < dcapostopv) { - MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack " << labelPos << " has dcaXY " << V0.posTrack_as().dcaXY() << " , cut at " << dcanegtopv); - continue; - } - if (fabs(V0.negTrack_as().dcaXY()) < dcanegtopv) { - MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "negTrack " << labelNeg << " has dcaXY " << V0.negTrack_as().dcaXY() << " , cut at " << dcanegtopv); - continue; - } - MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "Filling good indices: posTrack --> " << labelPos << ", negTrack --> " << labelNeg); - registry.fill(HIST("hGoodIndices"), 3.5); - v0goodindices(V0.posTrack_as().globalIndex(), - V0.negTrack_as().globalIndex(), - V0.posTrack_as().collisionId()); - } - } -}; - -/// Cascade builder task: rebuilds cascades -struct lambdakzeroBuilder { - Produces v0data; + Produces v0dataLink; Service ccdb; HistogramRegistry registry{ "registry", - {{"hEventCounter", "hEventCounter", {HistType::kTH1F, {{1, 0.0f, 1.0f}}}}, - {"hV0Candidate", "hV0Candidate", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}}}, + { + {"hEventCounter", "hEventCounter", {HistType::kTH1F, {{1, 0.0f, 1.0f}}}}, + {"hV0Candidate", "hV0Candidate", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}}, + {"hGoodIndices", "hGoodIndices", {HistType::kTH1F, {{4, 0.0f, 4.0f}}}}, + }, }; // Configurables @@ -203,7 +128,7 @@ struct lambdakzeroBuilder { void init(InitContext& context) { - //using namespace analysis::lambdakzerobuilder; + // using namespace analysis::lambdakzerobuilder; ccdb->setURL("https://alice-ccdb.cern.ch"); ccdb->setCaching(true); @@ -223,7 +148,7 @@ struct lambdakzeroBuilder { } } - void process(aod::Collision const& collision, aod::V0GoodIndices const& V0s, MyTracks const& tracks + void process(aod::Collision const& collision, aod::V0s const& V0s, MyTracks const& tracks #ifdef MY_DEBUG , aod::McParticles const& particlesMC @@ -244,6 +169,54 @@ struct lambdakzeroBuilder { registry.fill(HIST("hEventCounter"), 0.5); for (auto& V0 : V0s) { + + // Track preselection part +#ifdef MY_DEBUG + auto labelPos = V0.posTrack_as().mcParticleId(); + auto labelNeg = V0.negTrack_as().mcParticleId(); + bool isK0SfromLc = isK0SfromLcFunc(labelPos, labelNeg, v_labelK0Spos, v_labelK0Sneg); +#endif + MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "V0 builder: found K0S from Lc, posTrack --> " << labelPos << ", negTrack --> " << labelNeg); + + registry.fill(HIST("hGoodIndices"), 0.5); + if (isRun2) { + if (!(V0.posTrack_as().trackType() & o2::aod::track::TPCrefit)) { + MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack " << labelPos << " has no TPC refit"); + v0dataLink(-1); + continue; // TPC refit + } + if (!(V0.negTrack_as().trackType() & o2::aod::track::TPCrefit)) { + MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "negTrack " << labelNeg << " has no TPC refit"); + v0dataLink(-1); + continue; // TPC refit + } + } + registry.fill(HIST("hGoodIndices"), 1.5); + if (V0.posTrack_as().tpcNClsCrossedRows() < mincrossedrows) { + MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack " << labelPos << " has " << V0.posTrack_as().tpcNClsCrossedRows() << " crossed rows, cut at " << mincrossedrows); + v0dataLink(-1); + continue; + } + if (V0.negTrack_as().tpcNClsCrossedRows() < mincrossedrows) { + MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "negTrack " << labelNeg << " has " << V0.negTrack_as().tpcNClsCrossedRows() << " crossed rows, cut at " << mincrossedrows); + v0dataLink(-1); + continue; + } + registry.fill(HIST("hGoodIndices"), 2.5); + if (fabs(V0.posTrack_as().dcaXY()) < dcapostopv) { + MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack " << labelPos << " has dcaXY " << V0.posTrack_as().dcaXY() << " , cut at " << dcanegtopv); + v0dataLink(-1); + continue; + } + if (fabs(V0.negTrack_as().dcaXY()) < dcanegtopv) { + MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "negTrack " << labelNeg << " has dcaXY " << V0.negTrack_as().dcaXY() << " , cut at " << dcanegtopv); + v0dataLink(-1); + continue; + } + MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "Filling good indices: posTrack --> " << labelPos << ", negTrack --> " << labelNeg); + registry.fill(HIST("hGoodIndices"), 3.5); + + // Candidate building part std::array pos = {0.}; std::array pvec0 = {0.}; std::array pvec1 = {0.}; @@ -261,28 +234,32 @@ struct lambdakzeroBuilder { auto pTrack = getTrackParCov(V0.posTrack_as()); auto nTrack = getTrackParCov(V0.negTrack_as()); - //Require collision-ID - if (V0.posTrack_as().collisionId() != V0.negTrack_as().collisionId() && rejDiffCollTracks) + // Require collision-ID + if (V0.posTrack_as().collisionId() != V0.negTrack_as().collisionId() && rejDiffCollTracks) { + v0dataLink(-1); continue; + } - //Act on copies for minimization + // Act on copies for minimization auto pTrackCopy = o2::track::TrackParCov(pTrack); auto nTrackCopy = o2::track::TrackParCov(nTrack); //---/---/---/ // Move close to minima int nCand = fitter.process(pTrackCopy, nTrackCopy); - if (nCand == 0) + if (nCand == 0) { + v0dataLink(-1); continue; + } double finalXpos = fitter.getTrack(0).getX(); double finalXneg = fitter.getTrack(1).getX(); - //Rotate to desired alpha + // Rotate to desired alpha pTrack.rotateParam(fitter.getTrack(0).getAlpha()); nTrack.rotateParam(fitter.getTrack(1).getAlpha()); - //Retry closer to minimum with material corrections + // Retry closer to minimum with material corrections o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; if (useMatCorrType == 1) matCorr = o2::base::Propagator::MatCorrType::USEMatCorrTGeo; @@ -293,8 +270,10 @@ struct lambdakzeroBuilder { o2::base::Propagator::Instance()->propagateToX(nTrack, finalXneg, d_bz, 0.85f, 2.0f, matCorr); nCand = fitter.process(pTrack, nTrack); - if (nCand == 0) + if (nCand == 0) { + v0dataLink(-1); continue; + } pTrack.getPxPyPzGlo(pvec0); nTrack.getPxPyPzGlo(pvec1); @@ -309,18 +288,21 @@ struct lambdakzeroBuilder { // Apply selections so a skimmed table is created only if (fitter.getChi2AtPCACandidate() > dcav0dau) { MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack --> " << labelPos << ", negTrack --> " << labelNeg << " will be skipped due to dca cut"); + v0dataLink(-1); continue; } auto V0CosinePA = RecoDecay::CPA(array{collision.posX(), collision.posY(), collision.posZ()}, array{pos[0], pos[1], pos[2]}, array{pvec0[0] + pvec1[0], pvec0[1] + pvec1[1], pvec0[2] + pvec1[2]}); if (V0CosinePA < v0cospa) { MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack --> " << labelPos << ", negTrack --> " << labelNeg << " will be skipped due to CPA cut"); + v0dataLink(-1); continue; } auto V0radius = RecoDecay::sqrtSumOfSquares(pos[0], pos[1]); // probably find better name to differentiate the cut from the variable if (V0radius < v0radius) { MY_DEBUG_MSG(isK0SfromLc, LOG(info) << "posTrack --> " << labelPos << ", negTrack --> " << labelNeg << " will be skipped due to radius cut"); + v0dataLink(-1); continue; } @@ -328,9 +310,9 @@ struct lambdakzeroBuilder { registry.fill(HIST("hV0Candidate"), 1.5); v0data( - V0.posTrack_as().globalIndex(), - V0.negTrack_as().globalIndex(), - V0.negTrack_as().collisionId(), + V0.posTrackId(), + V0.negTrackId(), + V0.collisionId(), V0.globalIndex(), fitter.getTrack(0).getX(), fitter.getTrack(1).getX(), pos[0], pos[1], pos[2], @@ -339,6 +321,7 @@ struct lambdakzeroBuilder { fitter.getChi2AtPCACandidate(), V0.posTrack_as().dcaXY(), V0.negTrack_as().dcaXY()); + v0dataLink(v0data.lastIndex()); } } }; @@ -352,7 +335,6 @@ struct lambdakzeroInitializer { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc), adaptAnalysisTask(cfgc)}; }