diff --git a/PWGLF/DataModel/LFHypernucleiTables.h b/PWGLF/DataModel/LFHypernucleiTables.h index f0f37bf4d86..6b10a7ddd9f 100644 --- a/PWGLF/DataModel/LFHypernucleiTables.h +++ b/PWGLF/DataModel/LFHypernucleiTables.h @@ -34,6 +34,7 @@ DECLARE_SOA_COLUMN(QFT0C, qFT0C, float); // Amplitude with FT0 DECLARE_SOA_COLUMN(MultFT0C, multFT0C, float); // Multiplicity with FT0C estimator DECLARE_SOA_COLUMN(PsiTPC, psiTPC, float); // Psi with TPC estimator DECLARE_SOA_COLUMN(MultTPC, multTPC, float); // Multiplicity with TPC estimator +DECLARE_SOA_COLUMN(CollisionId, collisionId, int64_t); // CollisionID DECLARE_SOA_COLUMN(IsMatter, isMatter, bool); // bool: true for matter DECLARE_SOA_COLUMN(PtHe3, ptHe3, float); // Pt of the He daughter @@ -147,9 +148,26 @@ DECLARE_SOA_TABLE(MCHypCands, "AOD", "MCHYPCANDS", hyperrec::IsRecoMCCollision, hyperrec::IsSurvEvSel); +DECLARE_SOA_TABLE(DataHypCandsWColl, "AOD", "HYPCANDSWCOLL", + o2::soa::Index<>, + hyperrec::CollisionId, hyperrec::CentralityFT0A, hyperrec::CentralityFT0C, hyperrec::CentralityFT0M, + hyperrec::XPrimVtx, hyperrec::YPrimVtx, hyperrec::ZPrimVtx, + + hyperrec::IsMatter, + hyperrec::PtHe3, hyperrec::PhiHe3, hyperrec::EtaHe3, + hyperrec::PtPi, hyperrec::PhiPi, hyperrec::EtaPi, + hyperrec::XDecVtx, hyperrec::YDecVtx, hyperrec::ZDecVtx, + hyperrec::DcaV0Daug, hyperrec::DcaHe, hyperrec::DcaPi, + hyperrec::NSigmaHe, hyperrec::NTPCclusHe, hyperrec::NTPCclusPi, hyperrec::NTPCpidClusHe, hyperrec::NTPCpidClusPi, + hyperrec::TPCmomHe, hyperrec::TPCmomPi, hyperrec::TPCsignalHe, hyperrec::TPCsignalPi, hyperrec::TPCChi2He, hyperrec::ITSChi2He, hyperrec::ITSChi2Pi, + hyperrec::TOFMass, + hyperrec::ITSclusterSizesHe, hyperrec::ITSclusterSizesPi, + hyperrec::Flags, hyperrec::TrackedClSize); + using DataHypCand = DataHypCands::iterator; using DataHypCandFlow = DataHypCandsFlow::iterator; using MCHypCand = MCHypCands::iterator; +using DataHypCandWColl = DataHypCandsWColl::iterator; namespace hyperkink { diff --git a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx index e93828980b1..ebe45137da0 100644 --- a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx @@ -91,7 +91,7 @@ struct hyperCandidate { float genPhi() const { return std::atan2(gMom[1], gMom[0]); } float genEta() const { return std::asinh(gMom[2] / genPt()); } - int v0ID; + int v0ID = -1; int heTrackID; int piTrackID; float dcaV0dau = -10; @@ -121,7 +121,7 @@ struct hyperCandidate { uint32_t clusterSizeITSPi = 0u; // collision information - unsigned int collisionID = 0; + int64_t collisionID = 0; bool isMatter = false; bool isSignal = false; // true MC signal @@ -137,6 +137,7 @@ struct hyperRecoTask { Produces outputDataTable; Produces outputDataTableWithFlow; Produces outputMCTable; + Produces outputDataTableWithCollID; Service ccdb; Zorro zorro; OutputObj zorroSummary{"zorroSummary"}; @@ -409,10 +410,10 @@ struct hyperRecoTask { hypCand.nSigmaHe3 = computeNSigmaHe3(heTrack); hypCand.nTPCClustersHe3 = heTrack.tpcNClsFound(); hypCand.tpcSignalHe3 = heTrack.tpcSignal(); - hypCand.nTPCpidClusHe3 = (int16_t)heTrack.tpcNClsFindable() - heTrack.tpcNClsFindableMinusPID(); + hypCand.nTPCpidClusHe3 = static_cast(heTrack.tpcNClsFindable()) - heTrack.tpcNClsFindableMinusPID(); hypCand.clusterSizeITSHe3 = heTrack.itsClusterSizes(); hypCand.nTPCClustersPi = piTrack.tpcNClsFound(); - hypCand.nTPCpidClusPi = (int16_t)piTrack.tpcNClsFindable() - piTrack.tpcNClsFindableMinusPID(); + hypCand.nTPCpidClusPi = static_cast(piTrack.tpcNClsFindable()) - piTrack.tpcNClsFindableMinusPID(); hypCand.tpcSignalPi = piTrack.tpcSignal(); hypCand.tpcChi2He3 = heTrack.tpcChi2NCl(); hypCand.itsChi2He3 = heTrack.itsChi2NCl(); @@ -733,6 +734,34 @@ struct hyperRecoTask { } PROCESS_SWITCH(hyperRecoTask, processDataWithFlow, "Data analysis with flow", false); + void processDataWithCollID(CollisionsFull const& collisions, aod::V0s const& V0s, TracksFull const& tracks, aod::AmbiguousTracks const& ambiTracks, aod::BCsWithTimestamps const& bcs) + { + goodCollision.clear(); + goodCollision.resize(collisions.size(), false); + hyperCandidates.clear(); + + selectGoodCollisions(collisions); + useCustomVertexer ? fillCustomV0s(collisions, tracks, ambiTracks, bcs) : fillV0s(collisions, tracks, V0s); + + for (auto& hypCand : hyperCandidates) { + auto collision = collisions.rawIteratorAt(hypCand.collisionID); + float trackedHypClSize = !trackedClSize.empty() ? trackedClSize[hypCand.v0ID] : 0; + outputDataTableWithCollID(hypCand.collisionID, collision.centFT0A(), collision.centFT0C(), collision.centFT0M(), + collision.posX(), collision.posY(), collision.posZ(), + hypCand.isMatter, + hypCand.recoPtHe3(), hypCand.recoPhiHe3(), hypCand.recoEtaHe3(), + hypCand.recoPtPi(), hypCand.recoPhiPi(), hypCand.recoEtaPi(), + hypCand.decVtx[0], hypCand.decVtx[1], hypCand.decVtx[2], + hypCand.dcaV0dau, hypCand.he3DCAXY, hypCand.piDCAXY, + hypCand.nSigmaHe3, hypCand.nTPCClustersHe3, hypCand.nTPCClustersPi, + hypCand.nTPCpidClusHe3, hypCand.nTPCpidClusPi, + hypCand.momHe3TPC, hypCand.momPiTPC, hypCand.tpcSignalHe3, hypCand.tpcSignalPi, hypCand.tpcChi2He3, hypCand.itsChi2He3, hypCand.itsChi2Pi, + hypCand.massTOFHe3, + hypCand.clusterSizeITSHe3, hypCand.clusterSizeITSPi, hypCand.flags, trackedHypClSize); + } + } + PROCESS_SWITCH(hyperRecoTask, processDataWithCollID, "Data analysis with collision ID", false); + void processMC(CollisionsFullMC const& collisions, aod::McCollisions const& mcCollisions, aod::V0s const& V0s, TracksFull const& tracks, aod::AmbiguousTracks const& ambiTracks, aod::BCsWithTimestamps const& bcs, aod::McTrackLabels const& trackLabelsMC, aod::McParticles const& particlesMC) { filledMothers.clear();