From 7ad281d797167ca01c9194f8e0488ad6d05b2541 Mon Sep 17 00:00:00 2001 From: Valentina Mantovani Sarti Date: Mon, 9 Aug 2021 11:19:18 +0200 Subject: [PATCH] Fixing the ProducerTask for V0, starting to implement the filling QA for daughters --- .../FemtoDream/femtoDreamProducerTask.cxx | 39 ++++++-- .../FemtoDream/FemtoDreamTrackSelection.h | 40 ++++++-- .../FemtoDream/FemtoDreamV0Selection.h | 92 +++++++++++++------ 3 files changed, 127 insertions(+), 44 deletions(-) diff --git a/Analysis/Tasks/PWGCF/FemtoDream/femtoDreamProducerTask.cxx b/Analysis/Tasks/PWGCF/FemtoDream/femtoDreamProducerTask.cxx index 7a418ef915dba..e84bf06407734 100644 --- a/Analysis/Tasks/PWGCF/FemtoDream/femtoDreamProducerTask.cxx +++ b/Analysis/Tasks/PWGCF/FemtoDream/femtoDreamProducerTask.cxx @@ -109,12 +109,14 @@ struct femtoDreamProducerTask { Configurable> ConfDCAV0DaughMax{"ConfDCAV0DaughMax", std::vector{1.2f, 1.5f}, "V0 sel: Max. DCA daugh from SV (cm)"}; Configurable> ConfCPAV0Min{"ConfCPAV0Min", std::vector{0.9f, 0.995f}, "V0 sel: Min. CPA"}; + Configurable> ConfV0PtMin{"ConfV0PtMin", std::vector{0.3f, 0.4f, 0.5f}, "V0 sel: Min. Pt"}; + MutableConfigurable V0DecVtxMax{"V0DecVtxMax", 100.f, "V0 sel: Max. distance from Vtx (cm)"}; MutableConfigurable V0TranRadV0Min{"V0TranRadV0Min", 0.2f, "V0 sel: Min. transverse radius (cm)"}; MutableConfigurable V0TranRadV0Max{"V0TranRadV0Max", 100.f, "V0 sel: Max. transverse radius (cm)"}; Configurable> ConfV0DaughTPCnclsMin{"ConfV0DaughTPCnclsMin", std::vector{80.f, 70.f, 60.f}, "V0 Daugh sel: Min. nCls TPC"}; - Configurable> ConfV0DaughDCAMax{"ConfV0DaughDCAMax", std::vector{0.05f, 0.06f}, "V0 Daugh sel: Max. DCA Daugh to PV (cm)"}; + Configurable> ConfV0DaughDCAMin{"ConfV0DaughDCAMin", std::vector{0.05f, 0.06f}, "V0 Daugh sel: Max. DCA Daugh to PV (cm)"}; Configurable> ConfV0DaughPIDnSigmaMax{"ConfV0DaughPIDnSigmaMax", std::vector{5.f, 4.f}, "V0 Daugh sel: Max. PID nSigma TPC"}; /// \todo should we add filter on min value pT/eta of V0 and daughters? @@ -147,15 +149,21 @@ struct femtoDreamProducerTask { v0Cuts.setSelection(ConfDCAV0DaughMax, femtoDreamV0Selection::kDCAV0DaughMax, femtoDreamSelection::kUpperLimit); v0Cuts.setSelection(ConfCPAV0Min, femtoDreamV0Selection::kCPAV0Min, femtoDreamSelection::kLowerLimit); + v0Cuts.setSelection(ConfV0PtMin, femtoDreamV0Selection::kpTV0Min, femtoDreamSelection::kLowerLimit); + v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfTrkCharge, femtoDreamTrackSelection::kSign, femtoDreamSelection::kEqual); + v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfTrkEta, femtoDreamTrackSelection::kEtaMax, femtoDreamSelection::kAbsUpperLimit); v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfV0DaughTPCnclsMin, femtoDreamTrackSelection::kTPCnClsMin, femtoDreamSelection::kLowerLimit); - v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfV0DaughDCAMax, femtoDreamTrackSelection::kDCAzMax, femtoDreamSelection::kAbsUpperLimit); + // v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfV0DaughDCAMin, femtoDreamTrackSelection::kDCAMin, femtoDreamSelection::kAbsLowerLimit); v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfV0DaughPIDnSigmaMax, femtoDreamTrackSelection::kPIDnSigmaMax, femtoDreamSelection::kAbsUpperLimit); v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfTrkCharge, femtoDreamTrackSelection::kSign, femtoDreamSelection::kEqual); + v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfTrkEta, femtoDreamTrackSelection::kEtaMax, femtoDreamSelection::kAbsUpperLimit); v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfV0DaughTPCnclsMin, femtoDreamTrackSelection::kTPCnClsMin, femtoDreamSelection::kLowerLimit); - v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfV0DaughDCAMax, femtoDreamTrackSelection::kDCAzMax, femtoDreamSelection::kAbsUpperLimit); + // v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfV0DaughDCAMin, femtoDreamTrackSelection::kDCAMin, femtoDreamSelection::kAbsLowerLimit); v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfV0DaughPIDnSigmaMax, femtoDreamTrackSelection::kPIDnSigmaMax, femtoDreamSelection::kAbsUpperLimit); - v0Cuts.init(&qaRegistry); + v0Cuts.setChildPIDSpecies(femtoDreamV0Selection::kPosTrack, ConfTrkTPIDspecies); + v0Cuts.setChildPIDSpecies(femtoDreamV0Selection::kNegTrack, ConfTrkTPIDspecies); + v0Cuts.init(&qaRegistry); } void process(aod::FilteredFullCollision const& col, @@ -198,30 +206,43 @@ struct femtoDreamProducerTask { } } + printf("V0 Loop\n"); for (auto& v0 : fullV0s) { + // printf("pT of V0 candidates before selection = %.2f\n", v0.pt()); auto postrack = v0.posTrack_as(); auto negtrack = v0.negTrack_as(); ///\tocheck funnily enough if we apply the filter the sign of Pos and Neg track is always negative + // printf("+++++ In Producer 1\n"); + const auto dcaXYpos = postrack.dcaXY(); + const auto dcaZpos = postrack.dcaZ(); + const auto dcapos = std::sqrt(pow(dcaXYpos, 2.) + pow(dcaZpos, 2.)); + // printf("dcaxy Positive Daughter = %.2f\n", dcaXYpos); + // printf("dcaz Positive Daughter = %.2f\n", dcaZpos); + // printf("dca Positive Daughter = %.2f\n", dcapos); + // printf("isSelectedMinimal V0 = %i\n", v0Cuts.isSelectedMinimal(col, v0, postrack, negtrack)); if (!v0Cuts.isSelectedMinimal(col, v0, postrack, negtrack)) { continue; } - v0Cuts.fillQA(col, v0); ///\todo fill QA also for daughters + // printf("+++++2\n"); + v0Cuts.fillQA(col, v0, postrack, negtrack); ///\todo fill QA also for daughters auto cutContainerV0 = v0Cuts.getCutContainer(col, v0, postrack, negtrack); + // printf("Container in V0\n"); + // printf("cutContainerV0.at(0) = %i\n", cutContainerV0.at(0)); if ((cutContainerV0.at(0) > 0) && (cutContainerV0.at(1) > 0) && (cutContainerV0.at(2) > 0)) { + // printf("pT of V0 candidates after selection = %.2f\n", v0.pt()); + // printf("Inside Cut container!!!!!!\n"); int postrackID = v0.posTrackId(); int rowInPrimaryTrackTablePos = -1; rowInPrimaryTrackTablePos = getRowDaughters(postrackID, tmpIDtrack); childIDs[0] = rowInPrimaryTrackTablePos; childIDs[1] = 0; - ROOT::Math::PxPyPzMVector postrackVec(v0.pxpos(), v0.pypos(), v0.pzpos(), 0.); - ROOT::Math::PxPyPzMVector negtrackVec(v0.pxneg(), v0.pyneg(), v0.pzneg(), 0.); - outputTracks(outputCollision.lastIndex(), postrackVec.Pt(), postrackVec.Eta(), postrackVec.Phi(), aod::femtodreamparticle::ParticleType::kV0Child, cutContainerV0.at(1), cutContainerV0.at(2), 0., childIDs); + outputTracks(outputCollision.lastIndex(), v0.positivept(), v0.positiveeta(), v0.positivephi(), aod::femtodreamparticle::ParticleType::kV0Child, cutContainerV0.at(1), cutContainerV0.at(2), 0., childIDs); const int rowOfPosTrack = outputTracks.lastIndex(); int negtrackID = v0.negTrackId(); int rowInPrimaryTrackTableNeg = -1; rowInPrimaryTrackTableNeg = getRowDaughters(negtrackID, tmpIDtrack); childIDs[0] = 0; childIDs[1] = rowInPrimaryTrackTableNeg; - outputTracks(outputCollision.lastIndex(), negtrackVec.Pt(), negtrackVec.Eta(), negtrackVec.Phi(), aod::femtodreamparticle::ParticleType::kV0Child, cutContainerV0.at(3), cutContainerV0.at(4), 0., childIDs); + outputTracks(outputCollision.lastIndex(), v0.negativept(), v0.negativeeta(), v0.negativephi(), aod::femtodreamparticle::ParticleType::kV0Child, cutContainerV0.at(3), cutContainerV0.at(4), 0., childIDs); const int rowOfNegTrack = outputTracks.lastIndex(); int indexChildID[2] = {rowOfPosTrack, rowOfNegTrack}; outputTracks(outputCollision.lastIndex(), v0.pt(), v0.eta(), v0.phi(), aod::femtodreamparticle::ParticleType::kV0, cutContainerV0.at(0), 0, v0.v0cosPA(col.posX(), col.posY(), col.posZ()), indexChildID); diff --git a/Analysis/Tasks/PWGCF/FemtoDream/include/FemtoDream/FemtoDreamTrackSelection.h b/Analysis/Tasks/PWGCF/FemtoDream/include/FemtoDream/FemtoDreamTrackSelection.h index 737abc6db18c9..d9c7c993064b6 100644 --- a/Analysis/Tasks/PWGCF/FemtoDream/include/FemtoDream/FemtoDreamTrackSelection.h +++ b/Analysis/Tasks/PWGCF/FemtoDream/include/FemtoDream/FemtoDreamTrackSelection.h @@ -55,7 +55,7 @@ class FemtoDreamTrackSelection : public FemtoDreamObjectSelection - void init(HistogramRegistry* registry); + void init(HistogramRegistry* registry, const std::string WhichDaugh = ""); /// Passes the species to the task for which PID needs to be stored /// \tparam T Data type of the configurable passed to the functions @@ -106,7 +106,7 @@ class FemtoDreamTrackSelection : public FemtoDreamObjectSelection - void fillQA(T const& track); + void fillQA(T const& track, const std::string WhichDaugh = ""); /// Helper function to obtain the name of a given selection criterion for consistent naming of the configurables /// \param iSel Track selection variable to be examined @@ -159,11 +159,18 @@ class FemtoDreamTrackSelection : public FemtoDreamObjectSelection -void FemtoDreamTrackSelection::init(HistogramRegistry* registry) +void FemtoDreamTrackSelection::init(HistogramRegistry* registry, const std::string WhichDaugh) { if (registry) { mHistogramRegistry = registry; - fillSelectionHistogram(); + std::string folderName; + if (WhichDaugh.empty()) { + fillSelectionHistogram(); + folderName = static_cast(o2::aod::femtodreamparticle::ParticleTypeName[part]); + } else { + printf("Are you working on Daughters? Not filling the selection criteria histogram!"); + folderName = static_cast(o2::aod::femtodreamparticle::ParticleTypeName[part]) + "/" + WhichDaugh; + } /// \todo this should be an automatic check in the parent class int nSelections = getNSelections() + mPIDspecies.size() * (getNSelections(femtoDreamTrackSelection::kPIDnSigmaMax) - 1); @@ -171,7 +178,6 @@ void FemtoDreamTrackSelection::init(HistogramRegistry* registry) LOG(FATAL) << "FemtoDreamTrackCuts: Number of selections to large for your container - quitting!"; } - std::string folderName = static_cast(o2::aod::femtodreamparticle::ParticleTypeName[part]); mHistogramRegistry->add((folderName + "/pThist").c_str(), "; #it{p}_{T} (GeV/#it{c}); Entries", kTH1F, {{1000, 0, 10}}); mHistogramRegistry->add((folderName + "/etahist").c_str(), "; #eta; Entries", kTH1F, {{1000, -1, 1}}); mHistogramRegistry->add((folderName + "/phihist").c_str(), "; #phi; Entries", kTH1F, {{1000, 0, 2. * M_PI}}); @@ -292,36 +298,56 @@ bool FemtoDreamTrackSelection::isSelectedMinimal(T const& track) const static float dcaMin = getMinimalSelection(femtoDreamTrackSelection::kDCAMin, femtoDreamSelection::kAbsLowerLimit); const static float nSigmaPIDMax = getMinimalSelection(femtoDreamTrackSelection::kPIDnSigmaMax, femtoDreamSelection::kAbsUpperLimit); + // printf("nPtMinSel > 0 ? %i --- pT < pTMin(%.2f) ? %.2f\n", nPtMinSel, pTMin, pT); if (nPtMinSel > 0 && pT < pTMin) { + // printf("nPtMinSel false\n"); return false; } if (nPtMaxSel > 0 && pT > pTMax) { + // printf("nPtMaxSel false\n"); return false; } + // printf("nEtaSel > 0 ? %i --- eta > etaMax(%.2f) ? %.2f\n", nEtaSel, etaMax, std::abs(eta)); if (nEtaSel > 0 && std::abs(eta) > etaMax) { + // printf("nEtaSel false\n"); return false; } + // printf("nTPCnMinSel > 0 ? %i --- tpcNClsF < nClsMin(%.2f) ? %.2f\n", nTPCnMinSel, nClsMin, tpcNClsF); if (nTPCnMinSel > 0 && tpcNClsF < nClsMin) { + // printf("nTPCnMinSel false\n"); return false; } + // printf("nTPCfMinSel > 0 ? %i --- tpcRClsC < fClsMin(%.2f) ? %.2f\n", nTPCfMinSel, fClsMin, tpcRClsC); if (nTPCfMinSel > 0 && tpcRClsC < fClsMin) { + // printf("nTPCfMinSel false\n"); return false; } + // printf("nTPCcMinSel > 0 ? %i --- tpcNClsC < cTPCMin(%.2f) ? %.2f\n", nTPCcMinSel, cTPCMin, tpcNClsC); if (nTPCcMinSel > 0 && tpcNClsC < cTPCMin) { + // printf("nTPCcMinSel false\n"); return false; } + // printf("nTPCsMaxSel > 0 ? %i --- tpcNClsS > sTPCMax(%.2f) ? %.2f\n", nTPCsMaxSel, sTPCMax, tpcNClsS); if (nTPCsMaxSel > 0 && tpcNClsS > sTPCMax) { + // printf("nTPCsMaxSel false\n"); return false; } + // printf("nDCAxyMaxSel > 0 ? %i --- std::abs(dcaXY) > dcaXYMax(%.2f) ? %.2f\n", nDCAxyMaxSel, dcaXYMax, std::abs(dcaXY)); if (nDCAxyMaxSel > 0 && std::abs(dcaXY) > dcaXYMax) { + // printf("nDCAxyMaxSel false\n"); return false; } + // printf("nDCAzMaxSel > 0 ? %i --- std::abs(dcaZ) > dcaZMax(%.2f) ? %.2f\n", nDCAzMaxSel, dcaZMax, std::abs(dcaZ)); if (nDCAzMaxSel > 0 && std::abs(dcaZ) > dcaZMax) { + // printf("nDCAzMaxSel false\n"); return false; } + // printf("nDCAMinSel > 0 ? %i --- std::abs(dca) < dcaMin(%.2f) ? %.2f\n", nDCAMinSel, dcaMin, std::abs(dca)); if (nDCAMinSel > 0 && std::abs(dca) < dcaMin) { + // printf("nDCAMinSel false\n"); return false; } + // printf("nPIDnSigmaSel > 0 ? %i\n", nPIDnSigmaSel); if (nPIDnSigmaSel > 0) { bool isFulfilled = false; for (size_t i = 0; i < pidTPC.size(); ++i) { @@ -329,10 +355,12 @@ bool FemtoDreamTrackSelection::isSelectedMinimal(T const& track) auto pidTOFVal = pidTOF.at(i); auto pidComb = std::sqrt(pidTPCVal * pidTPCVal + pidTOFVal * pidTOFVal); if (std::abs(pidTPCVal) < nSigmaPIDMax || pidComb < nSigmaPIDMax) { + // printf("isFulfilled true\n"); isFulfilled = true; } } if (!isFulfilled) { + // printf("isFulfilled ? %i\n", isFulfilled); return isFulfilled; } } @@ -420,7 +448,7 @@ std::array FemtoDreamTrackSelection::getCutContainer(T cons } template -void FemtoDreamTrackSelection::fillQA(T const& track) +void FemtoDreamTrackSelection::fillQA(T const& track, const std::string WhichDaugh) { if (mHistogramRegistry) { mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/pThist"), track.pt()); diff --git a/Analysis/Tasks/PWGCF/FemtoDream/include/FemtoDream/FemtoDreamV0Selection.h b/Analysis/Tasks/PWGCF/FemtoDream/include/FemtoDream/FemtoDreamV0Selection.h index cccc9ca89baa3..6c5bea0cfc036 100644 --- a/Analysis/Tasks/PWGCF/FemtoDream/include/FemtoDream/FemtoDreamV0Selection.h +++ b/Analysis/Tasks/PWGCF/FemtoDream/include/FemtoDream/FemtoDreamV0Selection.h @@ -31,8 +31,9 @@ namespace o2::analysis::femtoDream { namespace femtoDreamV0Selection { -enum V0Sel { kpTV0Min, - kpTV0Max, +/// The different selections this task is capable of doing +enum V0Sel { kpTV0Min, //!Min. p_T (GeV/c) + kpTV0Max, //!Max. p_T (GeV/c) kDCAV0DaughMax, kCPAV0Min, kTranRadV0Min, @@ -48,7 +49,7 @@ class FemtoDreamV0Selection : public FemtoDreamObjectSelection + template void init(HistogramRegistry* registry); template @@ -58,8 +59,8 @@ class FemtoDreamV0Selection : public FemtoDreamObjectSelection std::array getCutContainer(C const& col, V const& v0, T const& posTrack, T const& negTrack); - template - void fillQA(C const& col, V const& v0); + template + void fillQA(C const& col, V const& v0, T const& posTrack, T const& negTrack); template void setChildCuts(femtoDreamV0Selection::ChildTrackType child, T1 selVal, T2 selVar, femtoDreamSelection::SelectionType selType) @@ -70,35 +71,50 @@ class FemtoDreamV0Selection : public FemtoDreamObjectSelection + void setChildPIDSpecies(femtoDreamV0Selection::ChildTrackType child, T& pids) + { + if (child == femtoDreamV0Selection::kPosTrack) { + PosDaughTrack.setPIDSpecies(pids); + } else if (child == femtoDreamV0Selection::kNegTrack) { + NegDaughTrack.setPIDSpecies(pids); + } + } private: FemtoDreamTrackSelection PosDaughTrack; FemtoDreamTrackSelection NegDaughTrack; + }; // namespace femtoDream -template +template void FemtoDreamV0Selection::init(HistogramRegistry* registry) { if (registry) { mHistogramRegistry = registry; fillSelectionHistogram(); + fillSelectionHistogram(); /// \todo this should be an automatic check in the parent class, and the return type should be templated int nSelections = getNSelections(); if (8 * sizeof(cutContainerType) < nSelections) { - LOGF(error, "Number of selections to large for your container - quitting!"); + LOG(FATAL) << "FemtoDreamV0Cuts: Number of selections to large for your container - quitting!"; } + std::string folderName = static_cast(o2::aod::femtodreamparticle::ParticleTypeName[part]); /// \todo initialize histograms for children tracks of v0s - mHistogramRegistry->add("V0Cuts/pThist", "; #it{p}_{T} (GeV/#it{c}); Entries", kTH1F, {{1000, 0, 10}}); - mHistogramRegistry->add("V0Cuts/etahist", "; #eta; Entries", kTH1F, {{1000, -1, 1}}); - mHistogramRegistry->add("V0Cuts/phihist", "; #phi; Entries", kTH1F, {{1000, 0, 2. * M_PI}}); - mHistogramRegistry->add("V0Cuts/dcaDauToVtx", "; DCADaug_{Vtx} (cm); Entries", kTH1F, {{1000, 0, 10}}); - mHistogramRegistry->add("V0Cuts/transRadius", "; #it{r}_{xy} (cm); Entries", kTH1F, {{1500, 0, 150}}); - mHistogramRegistry->add("V0Cuts/decayVtxXPV", "; #it{iVtx}_{x} (cm); Entries", kTH1F, {{2000, 0, 200}}); - mHistogramRegistry->add("V0Cuts/decayVtxYPV", "; #it{iVtx}_{y} (cm)); Entries", kTH1F, {{2000, 0, 200}}); - mHistogramRegistry->add("V0Cuts/decayVtxZPV", "; #it{iVtx}_{z} (cm); Entries", kTH1F, {{2000, 0, 200}}); - mHistogramRegistry->add("V0Cuts/cpa", "; #it{cos(#alpha)}; Entries", kTH1F, {{1000, 0.9, 1.}}); - mHistogramRegistry->add("V0Cuts/cpapTBins", "; #it{p}_{T} (GeV/#it{c}); #it{cos(#alpha)}", kTH2F, {{8, 0.3, 4.3}, {1000, 0.9, 1.}}); + mHistogramRegistry->add((folderName + "/pThist").c_str(), "; #it{p}_{T} (GeV/#it{c}); Entries", kTH1F, {{1000, 0, 10}}); + mHistogramRegistry->add((folderName + "/etahist").c_str(), "; #eta; Entries", kTH1F, {{1000, -1, 1}}); + mHistogramRegistry->add((folderName + "/phihist").c_str(), "; #phi; Entries", kTH1F, {{1000, 0, 2. * M_PI}}); + mHistogramRegistry->add((folderName + "/dcaDauToVtx").c_str(), "; DCADaug_{Vtx} (cm); Entries", kTH1F, {{1000, 0, 10}}); + mHistogramRegistry->add((folderName + "/transRadius").c_str(), "; #it{r}_{xy} (cm); Entries", kTH1F, {{1500, 0, 150}}); + mHistogramRegistry->add((folderName + "/decayVtxXPV").c_str(), "; #it{iVtx}_{x} (cm); Entries", kTH1F, {{2000, 0, 200}}); + mHistogramRegistry->add((folderName + "/decayVtxYPV").c_str(), "; #it{iVtx}_{y} (cm)); Entries", kTH1F, {{2000, 0, 200}}); + mHistogramRegistry->add((folderName + "/decayVtxZPV").c_str(), "; #it{iVtx}_{z} (cm); Entries", kTH1F, {{2000, 0, 200}}); + mHistogramRegistry->add((folderName + "/cpa").c_str(), "; #it{cos(#alpha)}; Entries", kTH1F, {{1000, 0.9, 1.}}); + mHistogramRegistry->add((folderName + "/cpapTBins").c_str(), "; #it{p}_{T} (GeV/#it{c}); #it{cos(#alpha)}", kTH2F, {{8, 0.3, 4.3}, {1000, 0.9, 1.}}); + + PosDaughTrack.init(mHistogramRegistry, "Pos"); + NegDaughTrack.init(mHistogramRegistry, "Neg"); } } @@ -135,33 +151,51 @@ bool FemtoDreamV0Selection::isSelectedMinimal(C const& col, V const& v0, T const const static float TranRadV0Max = getMinimalSelection(femtoDreamV0Selection::kTranRadV0Max, femtoDreamSelection::kUpperLimit); const static float DecVtxMax = getMinimalSelection(femtoDreamV0Selection::kDecVtxMax, femtoDreamSelection::kAbsUpperLimit); + // printf("nPtV0MinSel <0 ? %i --- pT < pTV0Min(%.2f) ? %.2f\n", nPtV0MinSel, pTV0Min, pT); if (nPtV0MinSel > 0 && pT < pTV0Min) { return false; } + // printf("nPtV0MaxSel <0 ? %i --- pT < pTV0Max(%.2f) ? %.2f\n", nPtV0MaxSel, pTV0Max, pT); if (nPtV0MaxSel > 0 && pT > pTV0Max) { + // printf("nPtV0MaxSel false\n"); return false; } if (nDCAV0DaughMax > 0 && dcaDaughv0 > DCAV0DaughMax) { + // printf("nDCAV0DaughMax false\n"); return false; } if (nCPAV0Min > 0 && cpav0 < CPAV0Min) { + // printf("nCPAV0Min false\n"); return false; } if (nTranRadV0Min > 0 && tranRad < TranRadV0Min) { + // printf("nTranRadV0Min false\n"); return false; } if (nTranRadV0Max > 0 && tranRad > TranRadV0Max) { + // printf("nTranRadV0Max false\n"); return false; } for (int i = 0; i < decVtx.size(); i++) { if (nDecVtxMax > 0 && decVtx.at(i) > DecVtxMax) { + // printf("nDecVtxMax false\n"); return false; } } + // printf("Entering Positive daughter\n"); + const auto dcaXYpos = posTrack.dcaXY(); + const auto dcaZpos = posTrack.dcaZ(); + const auto dcapos = std::sqrt(pow(dcaXYpos, 2.) + pow(dcaZpos, 2.)); + // printf("dcaxy Positive Daughter = %.2f\n", dcaXYpos); + // printf("dcaz Positive Daughter = %.2f\n", dcaZpos); + // printf("dca Positive Daughter = %.2f\n",dcapos); + if (!PosDaughTrack.isSelectedMinimal(posTrack)) { + // printf("PosDaughTrack false\n"); return false; } if (!NegDaughTrack.isSelectedMinimal(negTrack)) { + // printf("NegDaughTrack false\n"); return false; } return true; @@ -215,20 +249,20 @@ std::array FemtoDreamV0Selection::getCutContainer(C const& return {{output, outputPosTrack.at(0), outputPosTrack.at(1), outputNegTrack.at(0), outputNegTrack.at(1)}}; } -template -void FemtoDreamV0Selection::fillQA(C const& col, V const& v0) +template +void FemtoDreamV0Selection::fillQA(C const& col, V const& v0, T const& posTrack, T const& negTrack) { if (mHistogramRegistry) { - mHistogramRegistry->fill(HIST("V0Cuts/pThist"), v0.pt()); - mHistogramRegistry->fill(HIST("V0Cuts/etahist"), v0.eta()); - mHistogramRegistry->fill(HIST("V0Cuts/phihist"), v0.phi()); - mHistogramRegistry->fill(HIST("V0Cuts/dcaDauToVtx"), v0.dcaV0daughters()); - mHistogramRegistry->fill(HIST("V0Cuts/transRadius"), v0.v0radius()); - mHistogramRegistry->fill(HIST("V0Cuts/decayVtxXPV"), v0.x()); - mHistogramRegistry->fill(HIST("V0Cuts/decayVtxYPV"), v0.y()); - mHistogramRegistry->fill(HIST("V0Cuts/decayVtxZPV"), v0.z()); - mHistogramRegistry->fill(HIST("V0Cuts/cpa"), v0.v0cosPA(col.posX(), col.posY(), col.posZ())); - mHistogramRegistry->fill(HIST("V0Cuts/cpapTBins"), v0.pt(), v0.v0cosPA(col.posX(), col.posY(), col.posZ())); + mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/pThist"), v0.pt()); + mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/etahist"), v0.eta()); + mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/phihist"), v0.phi()); + mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/dcaDauToVtx"), v0.dcaV0daughters()); + mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/transRadius"), v0.v0radius()); + mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/decayVtxXPV"), v0.x()); + mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/decayVtxYPV"), v0.y()); + mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/decayVtxZPV"), v0.z()); + mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/cpa"), v0.v0cosPA(col.posX(), col.posY(), col.posZ())); + mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/cpapTBins"), v0.pt(), v0.v0cosPA(col.posX(), col.posY(), col.posZ())); } }