From 4c450ba8512580b938feee9324ae991afcfe2890 Mon Sep 17 00:00:00 2001 From: georgios Date: Fri, 22 Aug 2025 15:47:17 +0200 Subject: [PATCH 1/9] Merge the ProducerWithCascades with the Producer - also adding the CascadeCascade pair task - including before and after selection plots for all species --- .../Core/femtoDreamCascadeSelection.h | 5 +- PWGCF/FemtoDream/Core/femtoDreamSelection.h | 3 + .../Core/femtoDreamTrackSelection.h | 3 +- PWGCF/FemtoDream/Core/femtoDreamV0Selection.h | 114 ++- PWGCF/FemtoDream/TableProducer/CMakeLists.txt | 2 +- .../TableProducer/femtoDreamProducerTask.cxx | 342 ++++++- .../femtoDreamProducerTask_gg.cxx | 924 ++++++++++++++++++ PWGCF/FemtoDream/Tasks/CMakeLists.txt | 5 + .../femtoDreamPairTaskCascadeCascade.cxx | 513 ++++++++++ 9 files changed, 1805 insertions(+), 106 deletions(-) create mode 100644 PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask_gg.cxx create mode 100644 PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx diff --git a/PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h b/PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h index 2a07c851d09..9faba6d9bfd 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h +++ b/PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h @@ -37,6 +37,7 @@ #include "ReconstructionDataFormats/PID.h" using namespace o2::framework; +using namespace o2::analysis::femtoDream::femtoDreamSelection; namespace o2::analysis::femtoDream { @@ -346,8 +347,8 @@ class FemtoDreamCascadeSelection }; ///< Helper information for the ///< different selections - static constexpr int kNcutStages = 2; - static constexpr std::string_view mCutStage[kNcutStages] = {"BeforeSel", "AfterSel"}; + //static constexpr int kNcutStages = 2; + //static constexpr std::string_view mCutStage[kNcutStages] = {"BeforeSel", "AfterSel"}; }; // namespace femtoDream template diff --git a/PWGCF/FemtoDream/Core/femtoDreamSelection.h b/PWGCF/FemtoDream/Core/femtoDreamSelection.h index 0e3592bf650..6181c4b7f98 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamSelection.h +++ b/PWGCF/FemtoDream/Core/femtoDreamSelection.h @@ -35,6 +35,9 @@ enum SelectionType { kUpperLimit, ///< simple upper limit for the value, e.g. kAbsLowerLimit, ///< lower limit of the absolute value, e.g. |DCA_xyz| > 0.05 cm kEqual ///< values need to be equal, e.g. sign = 1 }; + +static constexpr int kNcutStages = 2; +static constexpr std::string_view mCutStage[kNcutStages] = {"BeforeSel", "AfterSel"}; } // namespace femtoDreamSelection diff --git a/PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h b/PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h index 9cab0f9e78b..6d6d58125e7 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h +++ b/PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h @@ -33,6 +33,7 @@ #include "Framework/HistogramRegistry.h" using namespace o2::framework; +using namespace o2::analysis::femtoDream::femtoDreamSelection; namespace o2::analysis::femtoDream { @@ -301,8 +302,6 @@ class FemtoDreamTrackSelection : public FemtoDreamObjectSelection diff --git a/PWGCF/FemtoDream/Core/femtoDreamV0Selection.h b/PWGCF/FemtoDream/Core/femtoDreamV0Selection.h index 40158105a5b..7d4e0bb88be 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamV0Selection.h +++ b/PWGCF/FemtoDream/Core/femtoDreamV0Selection.h @@ -31,6 +31,7 @@ #include "ReconstructionDataFormats/PID.h" using namespace o2::framework; +using namespace o2::analysis::femtoDream::femtoDreamSelection; namespace o2::analysis::femtoDream { @@ -91,7 +92,8 @@ class FemtoDreamV0Selection T const& posTrack, T const& negTrack); - template void fillQA(C const& col, V const& v0, T const& posTrack, T const& negTrack); @@ -296,43 +298,46 @@ void FemtoDreamV0Selection::init(HistogramRegistry* QAregistry, HistogramRegistr 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 - mQAHistogramRegistry->add((folderName + "/hPt").c_str(), - "; #it{p}_{T} (GeV/#it{c}); Entries", kTH1F, - {{1000, 0, 10}}); - mQAHistogramRegistry->add((folderName + "/hEta").c_str(), "; #eta; Entries", - kTH1F, {{1000, -1, 1}}); - mQAHistogramRegistry->add((folderName + "/hPhi").c_str(), "; #phi; Entries", - kTH1F, {{1000, 0, 2. * M_PI}}); - mQAHistogramRegistry->add((folderName + "/hDaughDCA").c_str(), - "; DCA^{daugh} (cm); Entries", kTH1F, - {{1000, 0, 10}}); - mQAHistogramRegistry->add((folderName + "/hTransRadius").c_str(), - "; #it{r}_{xy} (cm); Entries", kTH1F, - {{1500, 0, 150}}); - mQAHistogramRegistry->add((folderName + "/hDecayVtxX").c_str(), - "; #it{Vtx}_{x} (cm); Entries", kTH1F, - {{2000, 0, 200}}); - mQAHistogramRegistry->add((folderName + "/hDecayVtxY").c_str(), - "; #it{Vtx}_{y} (cm)); Entries", kTH1F, - {{2000, 0, 200}}); - mQAHistogramRegistry->add((folderName + "/hDecayVtxZ").c_str(), - "; #it{Vtx}_{z} (cm); Entries", kTH1F, - {{2000, 0, 200}}); - mQAHistogramRegistry->add((folderName + "/hCPA").c_str(), - "; #it{cos #theta_{p}}; Entries", kTH1F, - {{1000, 0.9, 1.}}); - mQAHistogramRegistry->add((folderName + "/hCPAvsPt").c_str(), - "; #it{p}_{T} (GeV/#it{c}); #it{cos #theta_{p}}", - kTH2F, {{8, 0.3, 4.3}, {1000, 0.9, 1.}}); - mQAHistogramRegistry->add((folderName + "/hInvMassLambda").c_str(), "", kTH1F, - {massAxisLambda}); - mQAHistogramRegistry->add((folderName + "/hInvMassAntiLambda").c_str(), "", - kTH1F, {massAxisAntiLambda}); - mQAHistogramRegistry->add((folderName + "/hInvMassLambdaAntiLambda").c_str(), - "", kTH2F, {massAxisLambda, massAxisAntiLambda}); + for (int istage = 0; istage < kNcutStages; istage++){ + std::string folderName = + static_cast(o2::aod::femtodreamparticle::ParticleTypeName[part]) + "/" + + static_cast(mCutStage[istage]); + /// \todo initialize histograms for children tracks of v0s + mQAHistogramRegistry->add((folderName + "/hPt").c_str(), + "; #it{p}_{T} (GeV/#it{c}); Entries", kTH1F, + {{1000, 0, 10}}); + mQAHistogramRegistry->add((folderName + "/hEta").c_str(), "; #eta; Entries", + kTH1F, {{1000, -1, 1}}); + mQAHistogramRegistry->add((folderName + "/hPhi").c_str(), "; #phi; Entries", + kTH1F, {{1000, 0, 2. * M_PI}}); + mQAHistogramRegistry->add((folderName + "/hDaughDCA").c_str(), + "; DCA^{daugh} (cm); Entries", kTH1F, + {{1000, 0, 10}}); + mQAHistogramRegistry->add((folderName + "/hTransRadius").c_str(), + "; #it{r}_{xy} (cm); Entries", kTH1F, + {{1500, 0, 150}}); + mQAHistogramRegistry->add((folderName + "/hDecayVtxX").c_str(), + "; #it{Vtx}_{x} (cm); Entries", kTH1F, + {{2000, 0, 200}}); + mQAHistogramRegistry->add((folderName + "/hDecayVtxY").c_str(), + "; #it{Vtx}_{y} (cm)); Entries", kTH1F, + {{2000, 0, 200}}); + mQAHistogramRegistry->add((folderName + "/hDecayVtxZ").c_str(), + "; #it{Vtx}_{z} (cm); Entries", kTH1F, + {{2000, 0, 200}}); + mQAHistogramRegistry->add((folderName + "/hCPA").c_str(), + "; #it{cos #theta_{p}}; Entries", kTH1F, + {{1000, 0.9, 1.}}); + mQAHistogramRegistry->add((folderName + "/hCPAvsPt").c_str(), + "; #it{p}_{T} (GeV/#it{c}); #it{cos #theta_{p}}", + kTH2F, {{8, 0.3, 4.3}, {1000, 0.9, 1.}}); + mQAHistogramRegistry->add((folderName + "/hInvMassLambda").c_str(), "", kTH1F, + {massAxisLambda}); + mQAHistogramRegistry->add((folderName + "/hInvMassAntiLambda").c_str(), "", + kTH1F, {massAxisAntiLambda}); + mQAHistogramRegistry->add((folderName + "/hInvMassLambdaAntiLambda").c_str(), + "", kTH2F, {massAxisLambda, massAxisAntiLambda}); + } PosDaughTrack.init outputNegTrack.at(femtoDreamTrackSelection::TrackContainerPosition::kPID)}; } -template void FemtoDreamV0Selection::fillQA(C const& /*col*/, V const& v0, T const& posTrack, @@ -645,62 +651,62 @@ void FemtoDreamV0Selection::fillQA(C const& /*col*/, V const& v0, T const& posTr if (mQAHistogramRegistry) { mQAHistogramRegistry->fill( HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + - HIST("/hPt"), + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hPt"), v0.pt()); mQAHistogramRegistry->fill( HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + - HIST("/hEta"), + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hEta"), v0.eta()); mQAHistogramRegistry->fill( HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + - HIST("/hPhi"), + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hPhi"), v0.phi()); mQAHistogramRegistry->fill( HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + - HIST("/hDaughDCA"), + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hDaughDCA"), v0.dcaV0daughters()); mQAHistogramRegistry->fill( HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + - HIST("/hTransRadius"), + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hTransRadius"), v0.v0radius()); mQAHistogramRegistry->fill( HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + - HIST("/hDecayVtxX"), + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hDecayVtxX"), v0.x()); mQAHistogramRegistry->fill( HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + - HIST("/hDecayVtxY"), + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hDecayVtxY"), v0.y()); mQAHistogramRegistry->fill( HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + - HIST("/hDecayVtxZ"), + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hDecayVtxZ"), v0.z()); mQAHistogramRegistry->fill( HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + - HIST("/hCPA"), + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hCPA"), v0.v0cosPA()); mQAHistogramRegistry->fill( HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + - HIST("/hCPAvsPt"), + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hCPAvsPt"), v0.pt(), v0.v0cosPA()); mQAHistogramRegistry->fill( HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + - HIST("/hInvMassLambda"), + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hInvMassLambda"), v0.mLambda()); mQAHistogramRegistry->fill( HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + - HIST("/hInvMassAntiLambda"), + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hInvMassAntiLambda"), v0.mAntiLambda()); mQAHistogramRegistry->fill( HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + - HIST("/hInvMassLambdaAntiLambda"), + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hInvMassLambdaAntiLambda"), v0.mLambda(), v0.mAntiLambda()); } PosDaughTrack.fillQA(posTrack); + aod::femtodreamparticle::TrackType::kPosChild, cutstage>(posTrack); NegDaughTrack.fillQA(negTrack); + aod::femtodreamparticle::TrackType::kNegChild, cutstage>(negTrack); } } // namespace o2::analysis::femtoDream diff --git a/PWGCF/FemtoDream/TableProducer/CMakeLists.txt b/PWGCF/FemtoDream/TableProducer/CMakeLists.txt index 3af1c541683..6085904e73e 100644 --- a/PWGCF/FemtoDream/TableProducer/CMakeLists.txt +++ b/PWGCF/FemtoDream/TableProducer/CMakeLists.txt @@ -22,4 +22,4 @@ o2physics_add_dpl_workflow(femtodream-producer-reduced o2physics_add_dpl_workflow(femtodream-producer-for-specific-analysis SOURCES femtoDreamProducerTaskForSpecificAnalysis.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx index f311518c56b..e72d959d136 100644 --- a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx +++ b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx @@ -131,6 +131,7 @@ struct femtoDreamProducerTask { Configurable ConfEvtAddOfflineCheck{"ConfEvtAddOfflineCheck", false, "Evt sel: additional checks for offline selection (not part of sel8 yet)"}; Configurable ConfIsActivateV0{"ConfIsActivateV0", true, "Activate filling of V0 into femtodream tables"}; Configurable ConfIsActivateReso{"ConfIsActivateReso", false, "Activate filling of sl Resonances into femtodream tables"}; + Configurable ConfIsActivateCascade{"ConfIsActivateCascade", false, "Activate filling of Cascades into femtodream tables"}; Configurable ConfEvtMinSphericity{"ConfEvtMinSphericity", 0.0f, "Evt sel: Min. sphericity of event"}; Configurable ConfEvtSphericityPtmin{"ConfEvtSphericityPtmin", 0.0f, "Evt sel: Min. Pt for sphericity calculation"}; @@ -179,22 +180,72 @@ struct femtoDreamProducerTask { Configurable> ConfChildPIDnSigmaMax{"ConfChildPIDnSigmaMax", std::vector{5.f, 4.f}, "V0 Child sel: Max. PID nSigma TPC"}; Configurable> ConfChildPIDspecies{"ConfChildPIDspecies", std::vector{o2::track::PID::Pion, o2::track::PID::Proton}, "V0 Child sel: Particles species for PID"}; + FemtoDreamCascadeSelection cascadeCuts; + struct : o2::framework::ConfigurableGroup { + Configurable ConfCascInvMassLowLimit{"ConfCascInvMassLowLimit", 1.2, "Lower limit of the Cascade invariant mass"}; + Configurable ConfCascInvMassUpLimit{"ConfCascInvMassUpLimit", 1.5, "Upper limit of the Cascade invariant mass"}; + Configurable ConfCascIsSelectedOmega{"ConfCascIsSelectedOmega", false, "Select Omegas instead of Xis (invariant mass)"}; + // Cascade + Configurable> ConfCascadeSign{FemtoDreamCascadeSelection::getSelectionName(femtoDreamCascadeSelection::kCascadeSign, "ConfCascade"), std::vector{-1, 1}, FemtoDreamCascadeSelection::getSelectionHelper(femtoDreamCascadeSelection::kCascadeSign, "Cascade selection: ")}; + Configurable> ConfCascadePtMin{FemtoDreamCascadeSelection::getSelectionName(femtoDreamCascadeSelection::kCascadePtMin, "ConfCascade"), std::vector{0.3f, 0.4f}, FemtoDreamCascadeSelection::getSelectionHelper(femtoDreamCascadeSelection::kCascadePtMin, "Cascade selection: ")}; + Configurable> ConfCascadePtMax{FemtoDreamCascadeSelection::getSelectionName(femtoDreamCascadeSelection::kCascadePtMax, "ConfCascade"), std::vector{5.5f, 6.0f}, FemtoDreamCascadeSelection::getSelectionHelper(femtoDreamCascadeSelection::kCascadePtMax, "Cascade selection: ")}; + Configurable> ConfCascadeEtaMax{FemtoDreamCascadeSelection::getSelectionName(femtoDreamCascadeSelection::kCascadeEtaMax, "ConfCascade"), std::vector{0.8f}, FemtoDreamCascadeSelection::getSelectionHelper(femtoDreamCascadeSelection::kCascadeEtaMax, "Cascade selection: ")}; + Configurable> ConfCascadeDCADaughMax{FemtoDreamCascadeSelection::getSelectionName(femtoDreamCascadeSelection::kCascadeDCADaughMax, "ConfCascade"), std::vector{1.f, 1.2f}, FemtoDreamCascadeSelection::getSelectionHelper(femtoDreamCascadeSelection::kCascadeDCADaughMax, "Cascade selection: ")}; + Configurable> ConfCascadeCPAMin{FemtoDreamCascadeSelection::getSelectionName(femtoDreamCascadeSelection::kCascadeCPAMin, "ConfCascade"), std::vector{0.99f, 0.95f}, FemtoDreamCascadeSelection::getSelectionHelper(femtoDreamCascadeSelection::kCascadeCPAMin, "Cascade selection: ")}; + Configurable> ConfCascadeTranRadMin{FemtoDreamCascadeSelection::getSelectionName(femtoDreamCascadeSelection::kCascadeTranRadMin, "ConfCascade"), std::vector{0.2f, 0.5f}, FemtoDreamCascadeSelection::getSelectionHelper(femtoDreamCascadeSelection::kCascadeTranRadMin, "Cascade selection: ")}; + Configurable> ConfCascadeTranRadMax{FemtoDreamCascadeSelection::getSelectionName(femtoDreamCascadeSelection::kCascadeTranRadMax, "ConfCascade"), std::vector{100.f}, FemtoDreamCascadeSelection::getSelectionHelper(femtoDreamCascadeSelection::kCascadeTranRadMax, "Cascade selection: ")}; + Configurable> ConfCascadeDecVtxMax{FemtoDreamCascadeSelection::getSelectionName(femtoDreamCascadeSelection::kCascadeDecVtxMax, "ConfCascade"), std::vector{100.f}, FemtoDreamCascadeSelection::getSelectionHelper(femtoDreamCascadeSelection::kCascadeDecVtxMax, "Cascade selection: ")}; + + // Cascade v0 daughters + Configurable> ConfCascadeV0DCADaughMax{FemtoDreamCascadeSelection::getSelectionName(femtoDreamCascadeSelection::kCascadeV0DCADaughMax, "ConfCascade"), std::vector{1.2f, 1.5f}, FemtoDreamCascadeSelection::getSelectionHelper(femtoDreamCascadeSelection::kCascadeV0DCADaughMax, "CascV0 selection: ")}; + Configurable> ConfCascadeV0CPAMin{FemtoDreamCascadeSelection::getSelectionName(femtoDreamCascadeSelection::kCascadeV0CPAMin, "ConfCascade"), std::vector{0.99f, 0.995f}, FemtoDreamCascadeSelection::getSelectionHelper(femtoDreamCascadeSelection::kCascadeV0CPAMin, "CascV0 selection: ")}; + Configurable> ConfCascadeV0TranRadMin{FemtoDreamCascadeSelection::getSelectionName(femtoDreamCascadeSelection::kCascadeV0TranRadMin, "ConfCascade"), std::vector{0.2f}, FemtoDreamCascadeSelection::getSelectionHelper(femtoDreamCascadeSelection::kCascadeV0TranRadMin, "CascV0 selection: ")}; + Configurable> ConfCascadeV0TranRadMax{FemtoDreamCascadeSelection::getSelectionName(femtoDreamCascadeSelection::kCascadeV0TranRadMax, "ConfCascade"), std::vector{100.f}, FemtoDreamCascadeSelection::getSelectionHelper(femtoDreamCascadeSelection::kCascadeV0TranRadMax, "CascV0 selection: ")}; + Configurable> ConfCascadeV0DCAtoPVMin{FemtoDreamCascadeSelection::getSelectionName(femtoDreamCascadeSelection::kCascadeV0DCAtoPVMin, "ConfCascade"), std::vector{100.f}, FemtoDreamCascadeSelection::getSelectionHelper(femtoDreamCascadeSelection::kCascadeV0DCAtoPVMin, "CascV0 selection: ")}; + Configurable> ConfCascadeV0DCAtoPVMax{FemtoDreamCascadeSelection::getSelectionName(femtoDreamCascadeSelection::kCascadeV0DCAtoPVMax, "ConfCascade"), std::vector{100.f}, FemtoDreamCascadeSelection::getSelectionHelper(femtoDreamCascadeSelection::kCascadeV0DCAtoPVMax, "CascV0 selection: ")}; + Configurable ConfCascV0InvMassLowLimit{"ConfCascV0InvMassLowLimit", 1.011461, "Lower limit of the Cascade invariant mass"}; + Configurable ConfCascV0InvMassUpLimit{"ConfCascV0InvMassUpLimit", 1.027461, "Upper limit of the Cascade invariant mass"}; + // Cascade Daughter Tracks + Configurable> ConfCascV0ChildCharge{"ConfCascV0ChildSign", std::vector{-1, 1}, "CascV0 Child sel: Charge"}; + Configurable> ConfCascV0ChildPtMin{"ConfCascV0ChildPtMin", std::vector{0.8f}, "CascV0 Child sel: min pt"}; + Configurable> ConfCascV0ChildEtaMax{"ConfCascV0ChildEtaMax", std::vector{0.8f}, "CascV0 Child sel: max eta"}; + Configurable> ConfCascV0ChildTPCnClsMin{"ConfCascV0ChildTPCnClsMin", std::vector{80.f, 70.f, 60.f}, "CascV0 Child sel: Min. nCls TPC"}; + Configurable> ConfCascV0ChildDCAMin{"ConfCascV0ChildDCAMin", std::vector{0.05f, 0.06f}, "CascV0 Child sel: Max. DCA Daugh to PV (cm)"}; + Configurable> ConfCascV0ChildPIDnSigmaMax{"ConfCascV0ChildPIDnSigmaMax", std::vector{5.f, 4.f}, "CascV0 Child sel: Max. PID nSigma TPC"}; + Configurable> ConfCascV0ChildPIDspecies{"ConfCascV0ChildPIDspecies", std::vector{o2::track::PID::Pion, o2::track::PID::Proton}, "CascV0 Child sel: Particles species for PID"}; + // Cascade Bachelor Track + Configurable> ConfCascBachelorCharge{"ConfCascBachelorSign", std::vector{-1, 1}, "Cascade Bachelor sel: Charge"}; + Configurable> ConfCascBachelorPtMin{"ConfCascBachelorPtMin", std::vector{0.8f}, "Cascade Bachelor sel: min pt"}; + Configurable> ConfCascBachelorEtaMax{"ConfCascBachelorEtaMax", std::vector{0.8f}, "Cascade Bachelor sel: max eta"}; + Configurable> ConfCascBachelorTPCnClsMin{"ConfCascBachelorTPCnClsMin", std::vector{80.f, 70.f, 60.f}, "Cascade Bachelor sel: Min. nCls TPC"}; + Configurable> ConfCascBachelorDCAMin{"ConfCascBachelorDCAMin", std::vector{0.05f, 0.06f}, "Cascade Bachelor sel: Max. DCA Daugh to PV (cm)"}; + Configurable> ConfCascBachelorPIDnSigmaMax{"ConfCascBachelorPIDnSigmaMax", std::vector{5.f, 4.f}, "Cascade Bachelor sel: Max. PID nSigma TPC"}; + Configurable> ConfCascBachelorPIDspecies{"ConfCascBachelorPIDspecies", std::vector{o2::track::PID::Pion}, "Cascade Bachelor sel: Particles species for PID"}; + + Configurable ConfCascRejectCompetingMass{"ConfCascRejectCompetingMass", false, "Switch on to reject Omegas (for Xi) or Xis (for Omegas)"}; + Configurable ConfCascInvCompetingMassLowLimit{"ConfCascInvCompetingMassLowLimit", 1.66, "Lower limit of the cascade invariant mass for competing mass rejection"}; + Configurable ConfCascInvCompetingMassUpLimit{"ConfCascInvCompetingMassUpLimit", 1.68, "Upper limit of the cascade invariant mass for competing mass rejection"}; + + } ConfCascSel; + // Resonances - Configurable ConfResoInvMassLowLimit{"ConfResoInvMassLowLimit", 1.011461, "Lower limit of the Reso invariant mass"}; - Configurable ConfResoInvMassUpLimit{"ConfResoInvMassUpLimit", 1.027461, "Upper limit of the Reso invariant mass"}; - Configurable> ConfDaughterCharge{"ConfDaughterCharge", std::vector{1, -1}, "Reso Daughter sel: Charge"}; - Configurable> ConfDaughterEta{"ConfDaughterEta", std::vector{0.8, 0.8}, "Reso Daughter sel: Eta"}; // 0.8 - Configurable> ConfDaughterDCAxy{"ConfDaughterDCAxy", std::vector{0.1, 0.1}, "Reso Daughter sel: DCAxy"}; // 0.1 - Configurable> ConfDaughterDCAz{"ConfDaughterDCAz", std::vector{0.2, 0.2}, "Reso Daughter sel: DCAz"}; // 0.2 - Configurable> ConfDaughterNClus{"ConfDaughterNClus", std::vector{80, 80}, "Reso Daughter sel: NClusters"}; // 0.2 - Configurable> ConfDaughterNCrossed{"ConfDaughterNCrossed", std::vector{70, 70}, "Reso Daughter sel: NCrossedRowss"}; - Configurable> ConfDaughterTPCfCls{"ConfDaughterTPCfCls", std::vector{0.8, 0.8}, "Reso Daughter sel: Minimum fraction of crossed rows over findable cluster"}; // 0.2 - Configurable> ConfDaughterPtUp{"ConfDaughterPtUp", std::vector{2.0, 2.0}, "Reso Daughter sel: Upper limit pT"}; // 2.0 - Configurable> ConfDaughterPtLow{"ConfDaughterPtLow", std::vector{0.15, 0.15}, "Reso Daughter sel: Lower limit pT"}; // 0.15 - Configurable> ConfDaughterPTPCThr{"ConfDaughterPTPCThr", std::vector{0.40, 0.40}, "Reso Daughter sel: momentum threshold TPC only PID, p_TPC,Thr"}; // 0.4 - Configurable> ConfDaughterPIDnSigmaMax{"ConfDaughterPIDnSigmaMax", std::vector{3.00, 3.00}, "Reso Daughter sel: Max. PID nSigma TPC"}; // 3.0 - Configurable> ConfDaughterPIDspecies{"ConfDaughterPIDspecies", std::vector{o2::track::PID::Kaon, o2::track::PID::Kaon}, "Reso Daughter sel: Particles species for PID"}; - Configurable> ConfDaug1Daugh2ResoMass{"ConfDaug1Daugh2ResoMass", std::vector{o2::constants::physics::MassKPlus, o2::constants::physics::MassKMinus, o2::constants::physics::MassPhi}, "Masses: Daughter1 - Daughter2 - Resonance"}; + struct : o2::framework::ConfigurableGroup { + Configurable ConfResoInvMassLowLimit{"ConfResoInvMassLowLimit", 1.011461, "Lower limit of the Reso invariant mass"}; + Configurable ConfResoInvMassUpLimit{"ConfResoInvMassUpLimit", 1.027461, "Upper limit of the Reso invariant mass"}; + Configurable> ConfDaughterCharge{"ConfDaughterCharge", std::vector{1, -1}, "Reso Daughter sel: Charge"}; + Configurable> ConfDaughterEta{"ConfDaughterEta", std::vector{0.8, 0.8}, "Reso Daughter sel: Eta"}; // 0.8 + Configurable> ConfDaughterDCAxy{"ConfDaughterDCAxy", std::vector{0.1, 0.1}, "Reso Daughter sel: DCAxy"}; // 0.1 + Configurable> ConfDaughterDCAz{"ConfDaughterDCAz", std::vector{0.2, 0.2}, "Reso Daughter sel: DCAz"}; // 0.2 + Configurable> ConfDaughterNClus{"ConfDaughterNClus", std::vector{80, 80}, "Reso Daughter sel: NClusters"}; // 0.2 + Configurable> ConfDaughterNCrossed{"ConfDaughterNCrossed", std::vector{70, 70}, "Reso Daughter sel: NCrossedRowss"}; + Configurable> ConfDaughterTPCfCls{"ConfDaughterTPCfCls", std::vector{0.8, 0.8}, "Reso Daughter sel: Minimum fraction of crossed rows over findable cluster"}; // 0.2 + Configurable> ConfDaughterPtUp{"ConfDaughterPtUp", std::vector{2.0, 2.0}, "Reso Daughter sel: Upper limit pT"}; // 2.0 + Configurable> ConfDaughterPtLow{"ConfDaughterPtLow", std::vector{0.15, 0.15}, "Reso Daughter sel: Lower limit pT"}; // 0.15 + Configurable> ConfDaughterPTPCThr{"ConfDaughterPTPCThr", std::vector{0.40, 0.40}, "Reso Daughter sel: momentum threshold TPC only PID, p_TPC,Thr"}; // 0.4 + Configurable> ConfDaughterPIDnSigmaMax{"ConfDaughterPIDnSigmaMax", std::vector{3.00, 3.00}, "Reso Daughter sel: Max. PID nSigma TPC"}; // 3.0 + Configurable> ConfDaughterPIDspecies{"ConfDaughterPIDspecies", std::vector{o2::track::PID::Kaon, o2::track::PID::Kaon}, "Reso Daughter sel: Particles species for PID"}; + Configurable> ConfDaug1Daugh2ResoMass{"ConfDaug1Daugh2ResoMass", std::vector{o2::constants::physics::MassKPlus, o2::constants::physics::MassKMinus, o2::constants::physics::MassPhi}, "Masses: Daughter1 - Daughter2 - Resonance"}; + }ConfResoSel; /// \todo should we add filter on min value pT/eta of V0 and daughters? /*Filter v0Filter = (nabs(aod::v0data::x) < V0DecVtxMax.value) && @@ -223,6 +274,7 @@ struct femtoDreamProducerTask { HistogramRegistry TrackRegistry{"Tracks", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry V0Registry{"V0", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry ResoRegistry{"Reso", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry CascadeRegistry{"Cascade", {}, OutputObjHandlingPolicy::AnalysisObject}; int mRunNumber; float mMagField; @@ -250,6 +302,7 @@ struct femtoDreamProducerTask { TrackRegistry.add("AnalysisQA/Mother", "; Bit; Entries", kTH1F, {{4000, -4000, 4000}}); TrackRegistry.add("AnalysisQA/Particle", "; Bit; Entries", kTH1F, {{4000, -4000, 4000}}); V0Registry.add("AnalysisQA/CutCounter", "; Bit; Counter", kTH1F, {{CutBits + 1, -0.5, CutBits + 0.5}}); + CascadeRegistry.add("AnalysisQA/CutCounter", "; Bit; Counter", kTH1F, {{CutBits + 1, -0.5, CutBits + 0.5}}); ResoRegistry.add("AnalysisQA/Reso/InvMass", "Invariant mass V0s;M_{KK};Entries", HistType::kTH1F, {{7000, 0.8, 1.5}}); ResoRegistry.add("AnalysisQA/Reso/InvMass_selected", "Invariant mass V0s;M_{KK};Entries", HistType::kTH1F, {{7000, 0.8, 1.5}}); ResoRegistry.add("AnalysisQA/Reso/Daughter1/Pt", "Transverse momentum of all processed tracks;p_{T} (GeV/c);Entries", HistType::kTH1F, {{1000, 0, 10}}); @@ -333,6 +386,58 @@ struct femtoDreamProducerTask { v0Cuts.setKaonInvMassLimits(ConfV0InvKaonMassLowLimit, ConfV0InvKaonMassUpLimit); } } + if (ConfIsActivateCascade) { + // Cascades + cascadeCuts.setSelection(ConfCascSel.ConfCascadeSign, femtoDreamCascadeSelection::kCascadeSign, FemtoDreamCascadeSelection::getSelectionType(femtoDreamCascadeSelection::kCascadeSign)); + cascadeCuts.setSelection(ConfCascSel.ConfCascadePtMin, femtoDreamCascadeSelection::kCascadePtMin, FemtoDreamCascadeSelection::getSelectionType(femtoDreamCascadeSelection::kCascadePtMin)); + cascadeCuts.setSelection(ConfCascSel.ConfCascadePtMax, femtoDreamCascadeSelection::kCascadePtMax, FemtoDreamCascadeSelection::getSelectionType(femtoDreamCascadeSelection::kCascadePtMax)); + cascadeCuts.setSelection(ConfCascSel.ConfCascadeEtaMax, femtoDreamCascadeSelection::kCascadeEtaMax, FemtoDreamCascadeSelection::getSelectionType(femtoDreamCascadeSelection::kCascadeEtaMax)); + cascadeCuts.setSelection(ConfCascSel.ConfCascadeDCADaughMax, femtoDreamCascadeSelection::kCascadeDCADaughMax, FemtoDreamCascadeSelection::getSelectionType(femtoDreamCascadeSelection::kCascadeDCADaughMax)); + cascadeCuts.setSelection(ConfCascSel.ConfCascadeCPAMin, femtoDreamCascadeSelection::kCascadeCPAMin, FemtoDreamCascadeSelection::getSelectionType(femtoDreamCascadeSelection::kCascadeCPAMin)); + cascadeCuts.setSelection(ConfCascSel.ConfCascadeTranRadMin, femtoDreamCascadeSelection::kCascadeTranRadMin, FemtoDreamCascadeSelection::getSelectionType(femtoDreamCascadeSelection::kCascadeTranRadMin)); + cascadeCuts.setSelection(ConfCascSel.ConfCascadeTranRadMax, femtoDreamCascadeSelection::kCascadeTranRadMax, FemtoDreamCascadeSelection::getSelectionType(femtoDreamCascadeSelection::kCascadeTranRadMax)); + cascadeCuts.setSelection(ConfCascSel.ConfCascadeDecVtxMax, femtoDreamCascadeSelection::kCascadeDecVtxMax, FemtoDreamCascadeSelection::getSelectionType(femtoDreamCascadeSelection::kCascadeDecVtxMax)); + // Cascade v0 + cascadeCuts.setSelection(ConfCascSel.ConfCascadeV0DCADaughMax, femtoDreamCascadeSelection::kCascadeV0DCADaughMax, FemtoDreamCascadeSelection::getSelectionType(femtoDreamCascadeSelection::kCascadeV0DCADaughMax)); + cascadeCuts.setSelection(ConfCascSel.ConfCascadeV0CPAMin, femtoDreamCascadeSelection::kCascadeV0CPAMin, FemtoDreamCascadeSelection::getSelectionType(femtoDreamCascadeSelection::kCascadeV0CPAMin)); + cascadeCuts.setSelection(ConfCascSel.ConfCascadeV0TranRadMin, femtoDreamCascadeSelection::kCascadeV0TranRadMin, FemtoDreamCascadeSelection::getSelectionType(femtoDreamCascadeSelection::kCascadeV0TranRadMin)); + cascadeCuts.setSelection(ConfCascSel.ConfCascadeV0TranRadMax, femtoDreamCascadeSelection::kCascadeV0TranRadMax, FemtoDreamCascadeSelection::getSelectionType(femtoDreamCascadeSelection::kCascadeV0TranRadMax)); + cascadeCuts.setSelection(ConfCascSel.ConfCascadeV0DCAtoPVMin, femtoDreamCascadeSelection::kCascadeV0DCAtoPVMin, FemtoDreamCascadeSelection::getSelectionType(femtoDreamCascadeSelection::kCascadeV0DCAtoPVMin)); + cascadeCuts.setSelection(ConfCascSel.ConfCascadeV0DCAtoPVMax, femtoDreamCascadeSelection::kCascadeV0DCAtoPVMax, FemtoDreamCascadeSelection::getSelectionType(femtoDreamCascadeSelection::kCascadeV0DCAtoPVMax)); + + // Cascade Daughter Tracks + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kPosTrack, ConfCascSel.ConfCascV0ChildCharge, femtoDreamTrackSelection::kSign, femtoDreamSelection::kEqual); + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kPosTrack, ConfCascSel.ConfCascV0ChildPtMin, femtoDreamTrackSelection::kpTMin, femtoDreamSelection::kLowerLimit); + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kPosTrack, ConfCascSel.ConfCascV0ChildEtaMax, femtoDreamTrackSelection::kEtaMax, femtoDreamSelection::kAbsUpperLimit); + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kPosTrack, ConfCascSel.ConfCascV0ChildTPCnClsMin, femtoDreamTrackSelection::kTPCnClsMin, femtoDreamSelection::kLowerLimit); + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kPosTrack, ConfCascSel.ConfCascV0ChildDCAMin, femtoDreamTrackSelection::kDCAMin, femtoDreamSelection::kAbsLowerLimit); + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kPosTrack, ConfCascSel.ConfCascV0ChildPIDnSigmaMax, femtoDreamTrackSelection::kPIDnSigmaMax, femtoDreamSelection::kAbsUpperLimit); + cascadeCuts.setChildPIDSpecies(femtoDreamCascadeSelection::kPosTrack, ConfCascSel.ConfCascV0ChildPIDspecies); + + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kNegTrack, ConfCascSel.ConfCascV0ChildCharge, femtoDreamTrackSelection::kSign, femtoDreamSelection::kEqual); + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kNegTrack, ConfCascSel.ConfCascV0ChildPtMin, femtoDreamTrackSelection::kpTMin, femtoDreamSelection::kLowerLimit); + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kNegTrack, ConfCascSel.ConfCascV0ChildEtaMax, femtoDreamTrackSelection::kEtaMax, femtoDreamSelection::kAbsUpperLimit); + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kNegTrack, ConfCascSel.ConfCascV0ChildTPCnClsMin, femtoDreamTrackSelection::kTPCnClsMin, femtoDreamSelection::kLowerLimit); + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kNegTrack, ConfCascSel.ConfCascV0ChildDCAMin, femtoDreamTrackSelection::kDCAMin, femtoDreamSelection::kAbsLowerLimit); + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kNegTrack, ConfCascSel.ConfCascV0ChildPIDnSigmaMax, femtoDreamTrackSelection::kPIDnSigmaMax, femtoDreamSelection::kAbsUpperLimit); + cascadeCuts.setChildPIDSpecies(femtoDreamCascadeSelection::kNegTrack, ConfCascSel.ConfCascV0ChildPIDspecies); + + // Cascade Bachelor Track + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kBachTrack, ConfCascSel.ConfCascBachelorCharge, femtoDreamTrackSelection::kSign, femtoDreamSelection::kEqual); + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kBachTrack, ConfCascSel.ConfCascBachelorPtMin, femtoDreamTrackSelection::kpTMin, femtoDreamSelection::kLowerLimit); + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kBachTrack, ConfCascSel.ConfCascBachelorEtaMax, femtoDreamTrackSelection::kEtaMax, femtoDreamSelection::kAbsUpperLimit); + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kBachTrack, ConfCascSel.ConfCascBachelorTPCnClsMin, femtoDreamTrackSelection::kTPCnClsMin, femtoDreamSelection::kLowerLimit); + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kBachTrack, ConfCascSel.ConfCascBachelorDCAMin, femtoDreamTrackSelection::kDCAMin, femtoDreamSelection::kAbsLowerLimit); + cascadeCuts.setChildCuts(femtoDreamCascadeSelection::kBachTrack, ConfCascSel.ConfCascBachelorPIDnSigmaMax, femtoDreamTrackSelection::kPIDnSigmaMax, femtoDreamSelection::kAbsUpperLimit); + cascadeCuts.setChildPIDSpecies(femtoDreamCascadeSelection::kBachTrack, ConfCascSel.ConfCascBachelorPIDspecies); + + cascadeCuts.init(&qaRegistry, &CascadeRegistry, ConfCascSel.ConfCascIsSelectedOmega); + cascadeCuts.setInvMassLimits(ConfCascSel.ConfCascInvMassLowLimit, ConfCascSel.ConfCascInvMassUpLimit); + cascadeCuts.setV0InvMassLimits(ConfCascSel.ConfCascV0InvMassLowLimit, ConfCascSel.ConfCascV0InvMassUpLimit); + if (ConfCascSel.ConfCascRejectCompetingMass) { + cascadeCuts.setCompetingInvMassLimits(ConfCascSel.ConfCascInvCompetingMassLowLimit, ConfCascSel.ConfCascInvCompetingMassUpLimit); + } + } mRunNumber = 0; mMagField = 0.0; @@ -474,6 +579,29 @@ struct femtoDreamProducerTask { } } + template + void fillDebugCascade(ParticleType const& cascade, CollisionType const& col) + { + outputDebugParts(cascade.sign(), // sign + -999., -999., -999., -999., -999., -999., -999., -999., -999., // track properties (DCA, NCls, crossed rows, etc.) + -999., -999., -999., -999., -999., -999., -999., -999., // TPC PID (TPC signal + particle hypothesis) + -999., -999., -999., -999., -999., -999., -999., // TOF PID + -999., -999., -999., -999., -999., -999., -999., -999., // ITS PID + cascade.dcaV0daughters(), + cascade.v0radius(), + -999., // DecVtxV0 x + -999., // DecVtxV0 y + -999., // DecVtxV0 z + -999., // mKaon + cascade.dcav0topv(col.posX(), col.posY(), col.posZ()), + cascade.dcacascdaughters(), + cascade.cascradius(), + cascade.x(), + cascade.y(), + cascade.z(), + cascade.mOmega()); // QA for Reso + } + template void fillMCParticle(CollisionType const& col, ParticleType const& particle, o2::aod::femtodreamparticle::ParticleType fdparttype) { @@ -547,8 +675,8 @@ struct femtoDreamProducerTask { outputCollsMCLabels(-1); } } - template - void fillCollisionsAndTracksAndV0(CollisionType const& col, TrackType const& tracks, TrackTypeWithItsPid const& tracksWithItsPid, V0Type const& fullV0s) + template + void fillCollisionsAndTracksAndV0AndCascade(CollisionType const& col, TrackType const& tracks, TrackTypeWithItsPid const& tracksWithItsPid, V0Type const& fullV0s, CascadeType const& fullCascades) { // If triggering is enabled, select only events which were triggered wit our triggers if (ConfEnableTriggerSelection) { @@ -585,7 +713,12 @@ struct femtoDreamProducerTask { if (!colCuts.isSelectedCollision(col)) { return; } - + //bool emptyCollision = false; + if (ConfIsActivateCascade.value) { + if (colCuts.isEmptyCollision(col, tracks, trackCuts) && colCuts.isCollisionWithoutTrkCasc(col, fullCascades, cascadeCuts, tracks)) { + return; + } + } if (ConfIsActivateV0.value) { if (colCuts.isEmptyCollision(col, tracks, trackCuts) && colCuts.isEmptyCollision(col, fullV0s, v0Cuts, tracks)) { return; @@ -605,14 +738,15 @@ struct femtoDreamProducerTask { fillMCCollision(col); } - std::vector childIDs = {0, 0}; // these IDs are necessary to keep track of the children - std::vector tmpIDtrack; // this vector keeps track of the matching of the primary track table row <-> aod::track table global index + std::vector childIDs = {0, 0}; // these IDs are necessary to keep track of the children + std::vector cascadechildIDs = {0, 0, 0}; // these IDs are necessary to keep track of the children + std::vector tmpIDtrack; // this vector keeps track of the matching of the primary track table row <-> aod::track table global index std::vector Daughter1, Daughter2; for (auto& track : tracksWithItsPid) { /// if the most open selection criteria are not fulfilled there is no /// point looking further at the track - trackCuts.fillQA(track); + trackCuts.fillQA(track); if (track.tpcChi2NCl() < OptionTrackSpecialSelections.ConfTrkMinChi2PerClusterTPC || track.tpcChi2NCl() > OptionTrackSpecialSelections.ConfTrkMaxChi2PerClusterTPC) { continue; @@ -631,7 +765,7 @@ struct femtoDreamProducerTask { TrackRegistry.fill(HIST("AnalysisQA/Chi2ITSTPCperCluster"), track.itsChi2NCl(), track.tpcChi2NCl()); TrackRegistry.fill(HIST("AnalysisQA/RefitITSTPC"), track.hasITS(), track.hasTPC()); - trackCuts.fillQA(track); + trackCuts.fillQA(track); // the bit-wise container of the systematic variations is obtained std::array cutContainer; cutContainer = trackCuts.getCutContainer(track, track.pt(), track.eta(), sqrtf(powf(track.dcaXY(), 2.f) + powf(track.dcaZ(), 2.f))); @@ -659,9 +793,9 @@ struct femtoDreamProducerTask { // TO DO: change TTV0 task to apply there the strict selection and have here only loose selection // select daugher 1 - if (track.sign() == ConfDaughterCharge.value[0] && track.pt() <= ConfDaughterPtUp.value[0] && track.pt() >= ConfDaughterPtLow.value[0] && std::abs(track.eta()) <= ConfDaughterEta.value[0] && std::abs(track.dcaXY()) <= ConfDaughterDCAxy.value[0] && std::abs(track.dcaZ()) <= ConfDaughterDCAz.value[0] && track.tpcNClsCrossedRows() >= ConfDaughterNCrossed.value[0] && track.tpcNClsFound() >= ConfDaughterNClus.value[0] && track.tpcCrossedRowsOverFindableCls() >= ConfDaughterTPCfCls.value[0]) { - if ((track.tpcInnerParam() < ConfDaughterPTPCThr.value[0] && std::abs(o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[0], track)) <= ConfDaughterPIDnSigmaMax.value[0]) || - (track.tpcInnerParam() >= ConfDaughterPTPCThr.value[0] && std::abs(std::sqrt(o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[0], track) * o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[0], track) + o2::aod::pidutils::tofNSigma(ConfDaughterPIDspecies.value[0], track) * o2::aod::pidutils::tofNSigma(ConfDaughterPIDspecies.value[0], track))) <= ConfDaughterPIDnSigmaMax.value[0])) { + if (track.sign() == ConfResoSel.ConfDaughterCharge.value[0] && track.pt() <= ConfResoSel.ConfDaughterPtUp.value[0] && track.pt() >= ConfResoSel.ConfDaughterPtLow.value[0] && std::abs(track.eta()) <= ConfResoSel.ConfDaughterEta.value[0] && std::abs(track.dcaXY()) <= ConfResoSel.ConfDaughterDCAxy.value[0] && std::abs(track.dcaZ()) <= ConfResoSel.ConfDaughterDCAz.value[0] && track.tpcNClsCrossedRows() >= ConfResoSel.ConfDaughterNCrossed.value[0] && track.tpcNClsFound() >= ConfResoSel.ConfDaughterNClus.value[0] && track.tpcCrossedRowsOverFindableCls() >= ConfResoSel.ConfDaughterTPCfCls.value[0]) { + if ((track.tpcInnerParam() < ConfResoSel.ConfDaughterPTPCThr.value[0] && std::abs(o2::aod::pidutils::tpcNSigma(ConfResoSel.ConfDaughterPIDspecies.value[0], track)) <= ConfResoSel.ConfDaughterPIDnSigmaMax.value[0]) || + (track.tpcInnerParam() >= ConfResoSel.ConfDaughterPTPCThr.value[0] && std::abs(std::sqrt(o2::aod::pidutils::tpcNSigma(ConfResoSel.ConfDaughterPIDspecies.value[0], track) * o2::aod::pidutils::tpcNSigma(ConfResoSel.ConfDaughterPIDspecies.value[0], track) + o2::aod::pidutils::tofNSigma(ConfResoSel.ConfDaughterPIDspecies.value[0], track) * o2::aod::pidutils::tofNSigma(ConfResoSel.ConfDaughterPIDspecies.value[0], track))) <= ConfResoSel.ConfDaughterPIDnSigmaMax.value[0])) { Daughter1.push_back(track); ResoRegistry.fill(HIST("AnalysisQA/Reso/Daughter1/Pt"), track.pt()); ResoRegistry.fill(HIST("AnalysisQA/Reso/Daughter1/Eta"), track.eta()); @@ -669,9 +803,9 @@ struct femtoDreamProducerTask { } } // select daugher 2 - if (track.sign() == ConfDaughterCharge.value[1] && track.pt() <= ConfDaughterPtUp.value[1] && track.pt() >= ConfDaughterPtLow.value[1] && std::abs(track.eta()) <= ConfDaughterEta.value[1] && std::abs(track.dcaXY()) <= ConfDaughterDCAxy.value[1] && std::abs(track.dcaZ()) <= ConfDaughterDCAz.value[1] && track.tpcNClsCrossedRows() >= ConfDaughterNCrossed.value[1] && track.tpcNClsFound() >= ConfDaughterNClus.value[1] && track.tpcCrossedRowsOverFindableCls() >= ConfDaughterTPCfCls.value[1]) { - if ((track.tpcInnerParam() < ConfDaughterPTPCThr.value[1] && std::abs(o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[1], track)) <= ConfDaughterPIDnSigmaMax.value[1]) || - (track.tpcInnerParam() >= ConfDaughterPTPCThr.value[1] && std::abs(std::sqrt(o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[1], track) * o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[1], track) + o2::aod::pidutils::tofNSigma(ConfDaughterPIDspecies.value[1], track) * o2::aod::pidutils::tofNSigma(ConfDaughterPIDspecies.value[1], track))) <= ConfDaughterPIDnSigmaMax.value[1])) { + if (track.sign() == ConfResoSel.ConfDaughterCharge.value[1] && track.pt() <= ConfResoSel.ConfDaughterPtUp.value[1] && track.pt() >= ConfResoSel.ConfDaughterPtLow.value[1] && std::abs(track.eta()) <= ConfResoSel.ConfDaughterEta.value[1] && std::abs(track.dcaXY()) <= ConfResoSel.ConfDaughterDCAxy.value[1] && std::abs(track.dcaZ()) <= ConfResoSel.ConfDaughterDCAz.value[1] && track.tpcNClsCrossedRows() >= ConfResoSel.ConfDaughterNCrossed.value[1] && track.tpcNClsFound() >= ConfResoSel.ConfDaughterNClus.value[1] && track.tpcCrossedRowsOverFindableCls() >= ConfResoSel.ConfDaughterTPCfCls.value[1]) { + if ((track.tpcInnerParam() < ConfResoSel.ConfDaughterPTPCThr.value[1] && std::abs(o2::aod::pidutils::tpcNSigma(ConfResoSel.ConfDaughterPIDspecies.value[1], track)) <= ConfResoSel.ConfDaughterPIDnSigmaMax.value[1]) || + (track.tpcInnerParam() >= ConfResoSel.ConfDaughterPTPCThr.value[1] && std::abs(std::sqrt(o2::aod::pidutils::tpcNSigma(ConfResoSel.ConfDaughterPIDspecies.value[1], track) * o2::aod::pidutils::tpcNSigma(ConfResoSel.ConfDaughterPIDspecies.value[1], track) + o2::aod::pidutils::tofNSigma(ConfResoSel.ConfDaughterPIDspecies.value[1], track) * o2::aod::pidutils::tofNSigma(ConfResoSel.ConfDaughterPIDspecies.value[1], track))) <= ConfResoSel.ConfDaughterPIDnSigmaMax.value[1])) { Daughter2.push_back(track); ResoRegistry.fill(HIST("AnalysisQA/Reso/Daughter2/Pt"), track.pt()); ResoRegistry.fill(HIST("AnalysisQA/Reso/Daughter2/Eta"), track.eta()); @@ -691,6 +825,8 @@ struct femtoDreamProducerTask { // const auto dcaXYpos = postrack.dcaXY(); // const auto dcaZpos = postrack.dcaZ(); // const auto dcapos = std::sqrt(pow(dcaXYpos, 2.) + pow(dcaZpos, 2.)); + + v0Cuts.fillQA<0, aod::femtodreamparticle::ParticleType::kV0, aod::femtodreamparticle::ParticleType::kV0Child>(col, v0, postrack, negtrack); v0Cuts.fillLambdaQA(col, v0, postrack, negtrack); if (!v0Cuts.isSelectedMinimal(col, v0, postrack, negtrack)) { @@ -705,7 +841,7 @@ struct femtoDreamProducerTask { // TrackSelection::TrackCuts::kITSHits); // } - v0Cuts.fillQA(col, v0, postrack, negtrack); ///\todo fill QA also for daughters + v0Cuts.fillQA<1, aod::femtodreamparticle::ParticleType::kV0, aod::femtodreamparticle::ParticleType::kV0Child>(col, v0, postrack, negtrack); ///\todo fill QA also for daughters auto cutContainerV0 = v0Cuts.getCutContainer(col, v0, postrack, negtrack); int postrackID = v0.posTrackId(); @@ -768,6 +904,112 @@ struct femtoDreamProducerTask { } } } + if (ConfIsActivateCascade.value) { + for (auto& casc : fullCascades) { + // get the daughter tracks + const auto& posTrackCasc = casc.template posTrack_as(); + const auto& negTrackCasc = casc.template negTrack_as(); + const auto& bachTrackCasc = casc.template bachelor_as(); + + cascadeCuts.fillQA<0, aod::femtodreamparticle::ParticleType::kCascade>(col, casc, posTrackCasc, negTrackCasc, bachTrackCasc); + if (!cascadeCuts.isSelectedMinimal(col, casc, posTrackCasc, negTrackCasc, bachTrackCasc)) { + continue; + } + cascadeCuts.fillQA<1, aod::femtodreamparticle::ParticleType::kCascade>(col, casc, posTrackCasc, negTrackCasc, bachTrackCasc); + + // auto cutContainerCasc = cascadeCuts.getCutContainer(col, casc, v0daugh, posTrackCasc, negTrackCasc, bachTrackCasc); + auto cutContainerCasc = cascadeCuts.getCutContainer(col, casc, posTrackCasc, negTrackCasc, bachTrackCasc); + + // Fill positive child + int poscasctrackID = casc.posTrackId(); + int rowInPrimaryTrackTablePosCasc = -1; + rowInPrimaryTrackTablePosCasc = getRowDaughters(poscasctrackID, tmpIDtrack); + cascadechildIDs[0] = rowInPrimaryTrackTablePosCasc; + cascadechildIDs[1] = 0; + cascadechildIDs[2] = 0; + outputParts(outputCollision.lastIndex(), + posTrackCasc.pt(), + posTrackCasc.eta(), + posTrackCasc.phi(), + aod::femtodreamparticle::ParticleType::kCascadeV0Child, + cutContainerCasc.at(femtoDreamCascadeSelection::CascadeContainerPosition::kPosCuts), + cutContainerCasc.at(femtoDreamCascadeSelection::CascadeContainerPosition::kPosPID), + posTrackCasc.dcaXY(), + cascadechildIDs, + 0, + 0); + const int rowOfPosCascadeTrack = outputParts.lastIndex(); + // TODO: include here MC filling + //------ + + // Fill negative child + int negcasctrackID = casc.negTrackId(); + int rowInPrimaryTrackTableNegCasc = -1; + rowInPrimaryTrackTableNegCasc = getRowDaughters(negcasctrackID, tmpIDtrack); + cascadechildIDs[0] = 0; + cascadechildIDs[1] = rowInPrimaryTrackTableNegCasc; + cascadechildIDs[2] = 0; + outputParts(outputCollision.lastIndex(), + negTrackCasc.pt(), + negTrackCasc.eta(), + negTrackCasc.phi(), + aod::femtodreamparticle::ParticleType::kCascadeV0Child, + cutContainerCasc.at(femtoDreamCascadeSelection::CascadeContainerPosition::kNegCuts), + cutContainerCasc.at(femtoDreamCascadeSelection::CascadeContainerPosition::kNegPID), + negTrackCasc.dcaXY(), + cascadechildIDs, + 0, + 0); + const int rowOfNegCascadeTrack = outputParts.lastIndex(); + // TODO: include here MC filling + //------ + + // Fill bachelor child + int bachelorcasctrackID = casc.bachelorId(); + int rowInPrimaryTrackTableBachelorCasc = -1; + rowInPrimaryTrackTableBachelorCasc = getRowDaughters(bachelorcasctrackID, tmpIDtrack); + cascadechildIDs[0] = 0; + cascadechildIDs[1] = 0; + cascadechildIDs[2] = rowInPrimaryTrackTableBachelorCasc; + outputParts(outputCollision.lastIndex(), + bachTrackCasc.pt(), + bachTrackCasc.eta(), + bachTrackCasc.phi(), + aod::femtodreamparticle::ParticleType::kCascadeBachelor, + cutContainerCasc.at(femtoDreamCascadeSelection::CascadeContainerPosition::kBachCuts), + cutContainerCasc.at(femtoDreamCascadeSelection::CascadeContainerPosition::kBachPID), + bachTrackCasc.dcaXY(), + cascadechildIDs, + 0, + 0); + const int rowOfBachelorCascadeTrack = outputParts.lastIndex(); + // TODO: include here MC filling + //------ + + // Fill cascades + std::vector indexCascadeChildID = {rowOfPosCascadeTrack, rowOfNegCascadeTrack, rowOfBachelorCascadeTrack}; + outputParts(outputCollision.lastIndex(), + casc.pt(), + casc.eta(), + casc.phi(), + aod::femtodreamparticle::ParticleType::kCascade, + cutContainerCasc.at(femtoDreamCascadeSelection::CascadeContainerPosition::kCascade), + 0, + casc.casccosPA(col.posX(), col.posY(), col.posZ()), + indexCascadeChildID, + casc.mXi(), + casc.mLambda()); + // TODO: include here MC filling + //------ + + if (ConfIsDebug.value) { + fillDebugParticle(posTrackCasc); // QA for positive daughter + fillDebugParticle(negTrackCasc); // QA for negative daughter + fillDebugParticle(bachTrackCasc); // QA for negative daughter + fillDebugCascade(casc, col); // QA for Cascade + } + } + } if (ConfIsActivateReso.value) { for (std::size_t iDaug1 = 0; iDaug1 < Daughter1.size(); ++iDaug1) { @@ -775,14 +1017,14 @@ struct femtoDreamProducerTask { // MC stuff is still missing, also V0 QA // ALSO: fix indices and other table entries which are now set to 0 as deflaut as not needed for p-p-phi cf ana - ROOT::Math::PtEtaPhiMVector tempD1(Daughter1.at(iDaug1).pt(), Daughter1.at(iDaug1).eta(), Daughter1.at(iDaug1).phi(), ConfDaug1Daugh2ResoMass.value[0]); - ROOT::Math::PtEtaPhiMVector tempD2(Daughter2.at(iDaug2).pt(), Daughter2.at(iDaug2).eta(), Daughter2.at(iDaug2).phi(), ConfDaug1Daugh2ResoMass.value[1]); + ROOT::Math::PtEtaPhiMVector tempD1(Daughter1.at(iDaug1).pt(), Daughter1.at(iDaug1).eta(), Daughter1.at(iDaug1).phi(), ConfResoSel.ConfDaug1Daugh2ResoMass.value[0]); + ROOT::Math::PtEtaPhiMVector tempD2(Daughter2.at(iDaug2).pt(), Daughter2.at(iDaug2).eta(), Daughter2.at(iDaug2).phi(), ConfResoSel.ConfDaug1Daugh2ResoMass.value[1]); ROOT::Math::PtEtaPhiMVector tempPhi = tempD1 + tempD2; ResoRegistry.fill(HIST("AnalysisQA/Reso/InvMass"), tempPhi.M()); - if ((tempPhi.M() >= ConfResoInvMassLowLimit.value) && (tempPhi.M() <= ConfResoInvMassUpLimit.value)) { + if ((tempPhi.M() >= ConfResoSel.ConfResoInvMassLowLimit.value) && (tempPhi.M() <= ConfResoSel.ConfResoInvMassUpLimit.value)) { ResoRegistry.fill(HIST("AnalysisQA/Reso/InvMass_selected"), tempPhi.M()); ResoRegistry.fill(HIST("AnalysisQA/Reso/PtD1_selected"), Daughter1.at(iDaug1).pt()); @@ -841,7 +1083,8 @@ struct femtoDreamProducerTask { processData(aod::FemtoFullCollision const& col, aod::BCsWithTimestamps const&, aod::FemtoFullTracks const& tracks, - o2::aod::V0Datas const& fullV0s) + o2::aod::V0Datas const& fullV0s, + o2::aod::CascDatas const& fullCascades) { // get magnetic field for run initCCDB_Mag_Trig(col.bc_as()); @@ -849,9 +1092,9 @@ struct femtoDreamProducerTask { auto tracksWithItsPid = soa::Attach(tracks); if (ConfUseItsPid.value) { - fillCollisionsAndTracksAndV0(col, tracks, tracksWithItsPid, fullV0s); + fillCollisionsAndTracksAndV0AndCascade(col, tracks, tracksWithItsPid, fullV0s, fullCascades); } else { - fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); + fillCollisionsAndTracksAndV0AndCascade(col, tracks, tracks, fullV0s, fullCascades); } } PROCESS_SWITCH(femtoDreamProducerTask, processData, @@ -861,7 +1104,8 @@ struct femtoDreamProducerTask { processData_noCentrality(aod::FemtoFullCollision_noCent const& col, aod::BCsWithTimestamps const&, aod::FemtoFullTracks const& tracks, - o2::aod::V0Datas const& fullV0s) + o2::aod::V0Datas const& fullV0s, + o2::aod::CascDatas const& fullCascades) { // get magnetic field for run initCCDB_Mag_Trig(col.bc_as()); @@ -869,9 +1113,9 @@ struct femtoDreamProducerTask { auto tracksWithItsPid = soa::Attach(tracks); if (ConfUseItsPid.value) { - fillCollisionsAndTracksAndV0(col, tracks, tracksWithItsPid, fullV0s); + fillCollisionsAndTracksAndV0AndCascade(col, tracks, tracksWithItsPid, fullV0s, fullCascades); } else { - fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); + fillCollisionsAndTracksAndV0AndCascade(col, tracks, tracks, fullV0s, fullCascades); } } PROCESS_SWITCH(femtoDreamProducerTask, processData_noCentrality, @@ -880,7 +1124,8 @@ struct femtoDreamProducerTask { void processData_CentPbPb(aod::FemtoFullCollision_CentPbPb const& col, aod::BCsWithTimestamps const&, aod::FemtoFullTracks const& tracks, - o2::aod::V0Datas const& fullV0s) + o2::aod::V0Datas const& fullV0s, + o2::aod::CascDatas const& fullCascades) { // get magnetic field for run initCCDB_Mag_Trig(col.bc_as()); @@ -888,9 +1133,9 @@ struct femtoDreamProducerTask { auto tracksWithItsPid = soa::Attach(tracks); if (ConfUseItsPid.value) { - fillCollisionsAndTracksAndV0(col, tracks, tracksWithItsPid, fullV0s); + fillCollisionsAndTracksAndV0AndCascade(col, tracks, tracksWithItsPid, fullV0s, fullCascades); } else { - fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); + fillCollisionsAndTracksAndV0AndCascade(col, tracks, tracks, fullV0s, fullCascades); } } PROCESS_SWITCH(femtoDreamProducerTask, processData_CentPbPb, @@ -901,12 +1146,13 @@ struct femtoDreamProducerTask { soa::Join const& tracks, aod::FemtoFullMCgenCollisions const&, aod::McParticles const&, - soa::Join const& fullV0s) /// \todo with FilteredFullV0s + soa::Join const& fullV0s, /// \todo with FilteredFullV0s + soa::Join const& fullCascades) { // get magnetic field for run initCCDB_Mag_Trig(col.bc_as()); // fill the tables - fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); + fillCollisionsAndTracksAndV0AndCascade(col, tracks, tracks, fullV0s, fullCascades); } PROCESS_SWITCH(femtoDreamProducerTask, processMC, "Provide MC data", false); @@ -915,12 +1161,13 @@ struct femtoDreamProducerTask { soa::Join const& tracks, aod::FemtoFullMCgenCollisions const&, aod::McParticles const&, - soa::Join const& fullV0s) /// \todo with FilteredFullV0s + soa::Join const& fullV0s, /// \todo with FilteredFullV0s + soa::Join const& fullCascades) { // get magnetic field for run initCCDB_Mag_Trig(col.bc_as()); // fill the tables - fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); + fillCollisionsAndTracksAndV0AndCascade(col, tracks, tracks, fullV0s, fullCascades); } PROCESS_SWITCH(femtoDreamProducerTask, processMC_noCentrality, "Provide MC data without requiring a centrality calibration", false); @@ -929,12 +1176,13 @@ struct femtoDreamProducerTask { soa::Join const& tracks, aod::FemtoFullMCgenCollisions const&, aod::McParticles const&, - soa::Join const& fullV0s) /// \todo with FilteredFullV0s + soa::Join const& fullV0s, /// \todo with FilteredFullV0s + soa::Join const& fullCascades) { // get magnetic field for run initCCDB_Mag_Trig(col.bc_as()); // fill the tables - fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); + fillCollisionsAndTracksAndV0AndCascade(col, tracks, tracks, fullV0s, fullCascades); } PROCESS_SWITCH(femtoDreamProducerTask, processMC_CentPbPb, "Provide MC data with centrality information for PbPb collisions", false); }; diff --git a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask_gg.cxx b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask_gg.cxx new file mode 100644 index 00000000000..50150f94f67 --- /dev/null +++ b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask_gg.cxx @@ -0,0 +1,924 @@ +// Copyright 2019-2025 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file femtoDreamProducerTask.cxx +/// \brief Tasks that produces the track tables used for the pairing +/// \author Laura Serksnyte, TU München, laura.serksnyte@tum.de + +#include +#include +#include +#include +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/PIDResponseITS.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DataFormatsParameters/GRPObject.h" +#include "PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h" +#include "PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h" +#include "PWGCF/FemtoDream/Core/femtoDreamV0Selection.h" +#include "PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h" +#include "PWGCF/FemtoDream/Core/femtoDreamUtils.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" +#include "EventFiltering/Zorro.h" +#include "PWGCF/DataModel/FemtoDerived.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "ReconstructionDataFormats/Track.h" +#include "TMath.h" +#include "Math/Vector4D.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::analysis::femtoDream; + +namespace o2::aod +{ + +using FemtoFullCollision = soa::Join::iterator; +using FemtoFullCollision_noCent = soa::Join::iterator; +using FemtoFullCollision_CentPbPb = soa::Join::iterator; +using FemtoFullCollisionMC = soa::Join::iterator; +using FemtoFullCollision_noCent_MC = soa::Join::iterator; +using FemtoFullCollisionMC_CentPbPb = soa::Join::iterator; +using FemtoFullMCgenCollisions = soa::Join; +using FemtoFullMCgenCollision = FemtoFullMCgenCollisions::iterator; + +using FemtoFullTracks = + soa::Join; +} // namespace o2::aod + +namespace softwareTriggers +{ +static const int nTriggers = 6; +static const std::vector triggerNames{"fPPP", "fPPL", "fPLL", "fLLL", "fPD", "fLD"}; +static const float triggerSwitches[1][nTriggers]{ + {0, 0, 0, 0, 0, 0}}; +} // namespace softwareTriggers + +template +int getRowDaughters(int daughID, T const& vecID) +{ + int rowInPrimaryTrackTableDaugh = -1; + for (size_t i = 0; i < vecID.size(); i++) { + if (vecID.at(i) == daughID) { + rowInPrimaryTrackTableDaugh = i; + break; + } + } + return rowInPrimaryTrackTableDaugh; +} + +struct femtoDreamProducerTask { + + Zorro zorro; + + Produces outputCollision; + Produces outputMCCollision; + Produces outputCollsMCLabels; + Produces outputParts; + Produces outputPartsMC; + Produces outputDebugParts; + Produces outputPartsMCLabels; + Produces outputDebugPartsMC; + Produces outputPartsExtMCLabels; + + Configurable ConfIsDebug{"ConfIsDebug", true, "Enable Debug tables"}; + Configurable ConfUseItsPid{"ConfUseItsPid", false, "Enable Debug tables"}; + Configurable ConfIsRun3{"ConfIsRun3", false, "Running on Run3 or pilot"}; + Configurable ConfIsForceGRP{"ConfIsForceGRP", false, "Set true if the magnetic field configuration is not available in the usual CCDB directory (e.g. for Run 2 converted data or unanchorad Monte Carlo)"}; + /// Event cuts + FemtoDreamCollisionSelection colCuts; + // Event cuts - Triggers + Configurable ConfEnableTriggerSelection{"ConfEnableTriggerSelection", false, "Should the trigger selection be enabled for collisions?"}; + Configurable> ConfTriggerSwitches{ + "ConfTriggerSwitches", + {softwareTriggers::triggerSwitches[0], 1, softwareTriggers::nTriggers, std::vector{"Switch"}, softwareTriggers::triggerNames}, + "Turn on which trigger should be checked for recorded events to pass selection"}; + Configurable ConfBaseCCDBPathForTriggers{"ConfBaseCCDBPathForTriggers", "Users/m/mpuccio/EventFiltering/OTS/Chunked/", "Provide ccdb path for trigger table; default - trigger coordination"}; + + // Event cuts - usual selection criteria + Configurable ConfEvtZvtx{"ConfEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; + Configurable ConfEvtTriggerCheck{"ConfEvtTriggerCheck", true, "Evt sel: check for trigger"}; + Configurable ConfEvtTriggerSel{"ConfEvtTriggerSel", kINT7, "Evt sel: trigger"}; + Configurable ConfEvtOfflineCheck{"ConfEvtOfflineCheck", false, "Evt sel: check for offline selection"}; + Configurable ConfEvtAddOfflineCheck{"ConfEvtAddOfflineCheck", false, "Evt sel: additional checks for offline selection (not part of sel8 yet)"}; + Configurable ConfIsActivateV0{"ConfIsActivateV0", true, "Activate filling of V0 into femtodream tables"}; + Configurable ConfIsActivateReso{"ConfIsActivateReso", false, "Activate filling of sl Resonances into femtodream tables"}; + + Configurable ConfTrkRejectNotPropagated{"ConfTrkRejectNotPropagated", false, "True: reject not propagated tracks"}; + // Configurable ConfRejectITSHitandTOFMissing{ "ConfRejectITSHitandTOFMissing", false, "True: reject if neither ITS hit nor TOF timing satisfied"}; + Configurable ConfTrkPDGCode{"ConfTrkPDGCode", 2212, "PDG code of the selected track for Monte Carlo truth"}; + FemtoDreamTrackSelection trackCuts; + Configurable> ConfTrkCharge{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kSign, "ConfTrk"), std::vector{-1, 1}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kSign, "Track selection: ")}; + Configurable> ConfTrkPtmin{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kpTMin, "ConfTrk"), std::vector{0.5f, 0.4f, 0.6f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kpTMin, "Track selection: ")}; + Configurable> ConfTrkPtmax{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kpTMax, "ConfTrk"), std::vector{5.4f, 5.6f, 5.5f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kpTMax, "Track selection: ")}; + Configurable> ConfTrkEta{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kEtaMax, "ConfTrk"), std::vector{0.8f, 0.7f, 0.9f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kEtaMax, "Track selection: ")}; + Configurable> ConfTrkTPCnclsMin{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kTPCnClsMin, "ConfTrk"), std::vector{80.f, 70.f, 60.f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kTPCnClsMin, "Track selection: ")}; + Configurable> ConfTrkTPCfCls{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kTPCfClsMin, "ConfTrk"), std::vector{0.7f, 0.83f, 0.9f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kTPCfClsMin, "Track selection: ")}; + Configurable> ConfTrkTPCcRowsMin{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kTPCcRowsMin, "ConfTrk"), std::vector{70.f, 60.f, 80.f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kTPCcRowsMin, "Track selection: ")}; + Configurable> ConfTrkTPCsCls{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kTPCsClsMax, "ConfTrk"), std::vector{0.1f, 160.f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kTPCsClsMax, "Track selection: ")}; + Configurable> ConfTrkITSnclsMin{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kITSnClsMin, "ConfTrk"), std::vector{-1.f, 2.f, 4.f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kITSnClsMin, "Track selection: ")}; + Configurable> ConfTrkITSnclsIbMin{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kITSnClsIbMin, "ConfTrk"), std::vector{-1.f, 1.f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kITSnClsIbMin, "Track selection: ")}; + Configurable> ConfTrkDCAxyMax{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kDCAxyMax, "ConfTrk"), std::vector{0.1f, 3.5f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kDCAxyMax, "Track selection: ")}; + Configurable> ConfTrkDCAzMax{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kDCAzMax, "ConfTrk"), std::vector{0.2f, 3.5f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kDCAzMax, "Track selection: ")}; + Configurable> ConfTrkPIDnSigmaMax{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kPIDnSigmaMax, "ConfTrk"), std::vector{3.5f, 3.f, 2.5f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kPIDnSigmaMax, "Track selection: ")}; + Configurable ConfTrkPIDnSigmaOffsetTPC{"ConfTrkPIDnSigmaOffsetTPC", 0., "Offset for TPC nSigma because of bad calibration"}; + Configurable ConfTrkPIDnSigmaOffsetTOF{"ConfTrkPIDnSigmaOffsetTOF", 0., "Offset for TOF nSigma because of bad calibration"}; + Configurable> ConfTrkPIDspecies{"ConfTrkPIDspecies", std::vector{o2::track::PID::Pion, o2::track::PID::Kaon, o2::track::PID::Proton, o2::track::PID::Deuteron}, "Trk sel: Particles species for PID"}; + + FemtoDreamV0Selection v0Cuts; + Configurable> ConfV0Sign{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0Sign, "ConfV0"), std::vector{-1, 1}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0Sign, "V0 selection: ")}; + Configurable> ConfV0PtMin{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0pTMin, "ConfV0"), std::vector{0.3f, 0.4f, 0.5f}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0pTMin, "V0 selection: ")}; + Configurable> ConfV0PtMax{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0pTMax, "ConfV0"), std::vector{3.3f, 3.4f, 3.5f}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0pTMax, "V0 selection: ")}; + Configurable> ConfV0EtaMax{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0etaMax, "ConfV0"), std::vector{0.8f, 0.7f, 0.9f}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0etaMax, "V0 selection: ")}; + Configurable> ConfV0DCADaughMax{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0DCADaughMax, "ConfV0"), std::vector{1.2f, 1.5f}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0DCADaughMax, "V0 selection: ")}; + Configurable> ConfV0CPAMin{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0CPAMin, "ConfV0"), std::vector{0.99f, 0.995f}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0CPAMin, "V0 selection: ")}; + Configurable> ConfV0TranRadMin{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0TranRadMin, "ConfV0"), std::vector{0.2f}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0TranRadMin, "V0 selection: ")}; + Configurable> ConfV0TranRadMax{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0TranRadMax, "ConfV0"), std::vector{100.f}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0TranRadMax, "V0 selection: ")}; + Configurable> ConfV0DecVtxMax{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0DecVtxMax, "ConfV0"), std::vector{100.f}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0DecVtxMax, "V0 selection: ")}; + + Configurable ConfV0InvMassLowLimit{"ConfV0InvV0MassLowLimit", 1.05, "Lower limit of the V0 invariant mass"}; + Configurable ConfV0InvMassUpLimit{"ConfV0InvV0MassUpLimit", 1.30, "Upper limit of the V0 invariant mass"}; + Configurable ConfV0RejectKaons{"ConfV0RejectKaons", false, "Switch to reject kaons"}; + Configurable ConfV0InvKaonMassLowLimit{"ConfV0InvKaonMassLowLimit", 0.48, "Lower limit of the V0 invariant mass for Kaon rejection"}; + Configurable ConfV0InvKaonMassUpLimit{"ConfV0InvKaonMassUpLimit", 0.515, "Upper limit of the V0 invariant mass for Kaon rejection"}; + + Configurable> ConfChildCharge{"ConfChildSign", std::vector{-1, 1}, "V0 Child sel: Charge"}; + Configurable> ConfChildEtaMax{"ConfChildEtaMax", std::vector{0.8f}, "V0 Child sel: max eta"}; + Configurable> ConfChildTPCnClsMin{"ConfChildTPCnClsMin", std::vector{80.f, 70.f, 60.f}, "V0 Child sel: Min. nCls TPC"}; + Configurable> ConfChildDCAMin{"ConfChildDCAMin", std::vector{0.05f, 0.06f}, "V0 Child sel: Max. DCA Daugh to PV (cm)"}; + Configurable> ConfChildPIDnSigmaMax{"ConfChildPIDnSigmaMax", std::vector{5.f, 4.f}, "V0 Child sel: Max. PID nSigma TPC"}; + Configurable> ConfChildPIDspecies{"ConfChildPIDspecies", std::vector{o2::track::PID::Pion, o2::track::PID::Proton}, "V0 Child sel: Particles species for PID"}; + + // Resonances + Configurable ConfResoInvMassLowLimit{"ConfResoInvMassLowLimit", 1.011461, "Lower limit of the Reso invariant mass"}; + Configurable ConfResoInvMassUpLimit{"ConfResoInvMassUpLimit", 1.027461, "Upper limit of the Reso invariant mass"}; + Configurable> ConfDaughterCharge{"ConfDaughterCharge", std::vector{1, -1}, "Reso Daughter sel: Charge"}; + Configurable> ConfDaughterEta{"ConfDaughterEta", std::vector{0.8, 0.8}, "Reso Daughter sel: Eta"}; // 0.8 + Configurable> ConfDaughterDCAxy{"ConfDaughterDCAxy", std::vector{0.1, 0.1}, "Reso Daughter sel: DCAxy"}; // 0.1 + Configurable> ConfDaughterDCAz{"ConfDaughterDCAz", std::vector{0.2, 0.2}, "Reso Daughter sel: DCAz"}; // 0.2 + Configurable> ConfDaughterNClus{"ConfDaughterNClus", std::vector{80, 80}, "Reso Daughter sel: NClusters"}; // 0.2 + Configurable> ConfDaughterNCrossed{"ConfDaughterNCrossed", std::vector{70, 70}, "Reso Daughter sel: NCrossedRowss"}; + Configurable> ConfDaughterTPCfCls{"ConfDaughterTPCfCls", std::vector{0.8, 0.8}, "Reso Daughter sel: Minimum fraction of crossed rows over findable cluster"}; // 0.2 + Configurable> ConfDaughterPtUp{"ConfDaughterPtUp", std::vector{2.0, 2.0}, "Reso Daughter sel: Upper limit pT"}; // 2.0 + Configurable> ConfDaughterPtLow{"ConfDaughterPtLow", std::vector{0.15, 0.15}, "Reso Daughter sel: Lower limit pT"}; // 0.15 + Configurable> ConfDaughterPTPCThr{"ConfDaughterPTPCThr", std::vector{0.40, 0.40}, "Reso Daughter sel: momentum threshold TPC only PID, p_TPC,Thr"}; // 0.4 + Configurable> ConfDaughterPIDnSigmaMax{"ConfDaughterPIDnSigmaMax", std::vector{3.00, 3.00}, "Reso Daughter sel: Max. PID nSigma TPC"}; // 3.0 + Configurable> ConfDaughterPIDspecies{"ConfDaughterPIDspecies", std::vector{o2::track::PID::Kaon, o2::track::PID::Kaon}, "Reso Daughter sel: Particles species for PID"}; + Configurable> ConfDaug1Daugh2ResoMass{"ConfDaug1Daugh2ResoMass", std::vector{o2::constants::physics::MassKPlus, o2::constants::physics::MassKMinus, o2::constants::physics::MassPhi}, "Masses: Daughter1 - Daughter2 - Resonance"}; + + /// \todo should we add filter on min value pT/eta of V0 and daughters? + /*Filter v0Filter = (nabs(aod::v0data::x) < V0DecVtxMax.value) && + (nabs(aod::v0data::y) < V0DecVtxMax.value) && + (nabs(aod::v0data::z) < V0DecVtxMax.value);*/ + // (aod::v0data::v0radius > V0TranRadV0Min.value); to be added, not working + // for now do not know why + + /// General options + struct : o2::framework::ConfigurableGroup { + Configurable ConfTrkMinChi2PerClusterTPC{"ConfTrkMinChi2PerClusterTPC", 0.f, "Lower limit for chi2 of TPC; currently for testing only"}; + Configurable ConfTrkMaxChi2PerClusterTPC{"ConfTrkMaxChi2PerClusterTPC", 1000.f, "Upper limit for chi2 of TPC; currently for testing only"}; + Configurable ConfTrkMaxChi2PerClusterITS{"ConfTrkMaxChi2PerClusterITS", 1000.0f, "Minimal track selection: max allowed chi2 per ITS cluster"}; // 36.0 is default + Configurable ConfTrkTPCRefit{"ConfTrkTPCRefit", false, "True: require TPC refit"}; + Configurable ConfTrkITSRefit{"ConfTrkITSRefit", false, "True: require ITS refit"}; + + } OptionTrackSpecialSelections; + + HistogramRegistry qaRegistry{"QAHistos", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry TrackRegistry{"Tracks", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry V0Registry{"V0", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry ResoRegistry{"Reso", {}, OutputObjHandlingPolicy::AnalysisObject}; + + int mRunNumber; + float mMagField; + std::string zorroTriggerNames = ""; + Service ccdb; /// Accessing the CCDB + + void init(InitContext&) + { + if (doprocessData == false && doprocessData_noCentrality == false && doprocessData_CentPbPb == false && doprocessMC == false && doprocessMC_noCentrality == false && doprocessMC_CentPbPb == false) { + LOGF(fatal, "Neither processData nor processMC enabled. Please choose one."); + } + if ((doprocessData == true && doprocessMC == true) || (doprocessData == true && doprocessMC_noCentrality == true) || (doprocessMC == true && doprocessMC_noCentrality == true) || (doprocessData_noCentrality == true && doprocessData == true) || (doprocessData_noCentrality == true && doprocessMC == true) || (doprocessData_noCentrality == true && doprocessMC_noCentrality == true) || (doprocessData_CentPbPb == true && doprocessData == true) || (doprocessData_CentPbPb == true && doprocessData_noCentrality == true) || (doprocessData_CentPbPb == true && doprocessMC == true) || (doprocessData_CentPbPb == true && doprocessMC_noCentrality == true) || (doprocessData_CentPbPb == true && doprocessMC_CentPbPb == true)) { + LOGF(fatal, + "Cannot enable more than one process switch at the same time. " + "Please choose one."); + } + + int CutBits = 8 * sizeof(o2::aod::femtodreamparticle::cutContainerType); + TrackRegistry.add("AnalysisQA/CutCounter", "; Bit; Counter", kTH1F, {{CutBits + 1, -0.5, CutBits + 0.5}}); + TrackRegistry.add("AnalysisQA/Chi2ITSTPCperCluster", "; ITS_Chi2; TPC_Chi2", kTH2F, {{100, 0, 50}, {100, 0, 20}}); + TrackRegistry.add("AnalysisQA/RefitITSTPC", "; ITS_Refit; TPC_Refit", kTH2F, {{2, 0, 2}, {2, 0, 2}}); + TrackRegistry.add("AnalysisQA/getGenStatusCode", "; Bit; Entries", kTH1F, {{200, 0, 200}}); + TrackRegistry.add("AnalysisQA/getProcess", "; Bit; Entries", kTH1F, {{200, 0, 200}}); + TrackRegistry.add("AnalysisQA/Mother", "; Bit; Entries", kTH1F, {{4000, -4000, 4000}}); + TrackRegistry.add("AnalysisQA/Particle", "; Bit; Entries", kTH1F, {{4000, -4000, 4000}}); + V0Registry.add("AnalysisQA/CutCounter", "; Bit; Counter", kTH1F, {{CutBits + 1, -0.5, CutBits + 0.5}}); + ResoRegistry.add("AnalysisQA/Reso/InvMass", "Invariant mass V0s;M_{KK};Entries", HistType::kTH1F, {{7000, 0.8, 1.5}}); + ResoRegistry.add("AnalysisQA/Reso/InvMass_selected", "Invariant mass V0s;M_{KK};Entries", HistType::kTH1F, {{7000, 0.8, 1.5}}); + ResoRegistry.add("AnalysisQA/Reso/Daughter1/Pt", "Transverse momentum of all processed tracks;p_{T} (GeV/c);Entries", HistType::kTH1F, {{1000, 0, 10}}); + ResoRegistry.add("AnalysisQA/Reso/Daughter1/Eta", "Pseudorapidity of all processed tracks;#eta;Entries", HistType::kTH1F, {{1000, -2, 2}}); + ResoRegistry.add("AnalysisQA/Reso/Daughter1/Phi", "Azimuthal angle of all processed tracks;#phi;Entries", HistType::kTH1F, {{720, 0, TMath::TwoPi()}}); + ResoRegistry.add("AnalysisQA/Reso/Daughter2/Pt", "Transverse momentum of all processed tracks;p_{T} (GeV/c);Entries", HistType::kTH1F, {{1000, 0, 10}}); + ResoRegistry.add("AnalysisQA/Reso/Daughter2/Eta", "Pseudorapidity of all processed tracks;#eta;Entries", HistType::kTH1F, {{1000, -2, 2}}); + ResoRegistry.add("AnalysisQA/Reso/Daughter2/Phi", "Azimuthal angle of all processed tracks;#phi;Entries", HistType::kTH1F, {{720, 0, TMath::TwoPi()}}); + ResoRegistry.add("AnalysisQA/Reso/PtD1_selected", "Transverse momentum of all processed tracks;p_{T} (GeV/c);Entries", HistType::kTH1F, {{1000, 0, 10}}); + ResoRegistry.add("AnalysisQA/Reso/PtD2_selected", "Transverse momentum of all processed tracks;p_{T} (GeV/c);Entries", HistType::kTH1F, {{1000, 0, 10}}); + + if (ConfEnableTriggerSelection) { + for (const std::string& triggerName : softwareTriggers::triggerNames) { + if (ConfTriggerSwitches->get("Switch", triggerName.c_str())) { + zorroTriggerNames += triggerName + ","; + } + } + zorroTriggerNames.pop_back(); + } + + colCuts.setCuts(ConfEvtZvtx.value, ConfEvtTriggerCheck.value, ConfEvtTriggerSel.value, ConfEvtOfflineCheck.value, ConfEvtAddOfflineCheck.value, ConfIsRun3.value); + colCuts.init(&qaRegistry); + + trackCuts.setSelection(ConfTrkCharge, femtoDreamTrackSelection::kSign, femtoDreamSelection::kEqual); + trackCuts.setSelection(ConfTrkPtmin, femtoDreamTrackSelection::kpTMin, femtoDreamSelection::kLowerLimit); + trackCuts.setSelection(ConfTrkPtmax, femtoDreamTrackSelection::kpTMax, femtoDreamSelection::kUpperLimit); + trackCuts.setSelection(ConfTrkEta, femtoDreamTrackSelection::kEtaMax, femtoDreamSelection::kAbsUpperLimit); + trackCuts.setSelection(ConfTrkTPCnclsMin, femtoDreamTrackSelection::kTPCnClsMin, femtoDreamSelection::kLowerLimit); + trackCuts.setSelection(ConfTrkTPCfCls, femtoDreamTrackSelection::kTPCfClsMin, femtoDreamSelection::kLowerLimit); + trackCuts.setSelection(ConfTrkTPCcRowsMin, femtoDreamTrackSelection::kTPCcRowsMin, femtoDreamSelection::kLowerLimit); + trackCuts.setSelection(ConfTrkTPCsCls, femtoDreamTrackSelection::kTPCsClsMax, femtoDreamSelection::kUpperLimit); + trackCuts.setSelection(ConfTrkITSnclsMin, femtoDreamTrackSelection::kITSnClsMin, femtoDreamSelection::kLowerLimit); + trackCuts.setSelection(ConfTrkITSnclsIbMin, femtoDreamTrackSelection::kITSnClsIbMin, femtoDreamSelection::kLowerLimit); + trackCuts.setSelection(ConfTrkDCAxyMax, femtoDreamTrackSelection::kDCAxyMax, femtoDreamSelection::kAbsUpperLimit); + trackCuts.setSelection(ConfTrkDCAzMax, femtoDreamTrackSelection::kDCAzMax, femtoDreamSelection::kAbsUpperLimit); + trackCuts.setSelection(ConfTrkPIDnSigmaMax, femtoDreamTrackSelection::kPIDnSigmaMax, femtoDreamSelection::kAbsUpperLimit); + trackCuts.setPIDSpecies(ConfTrkPIDspecies); + trackCuts.setnSigmaPIDOffset(ConfTrkPIDnSigmaOffsetTPC, ConfTrkPIDnSigmaOffsetTOF); + trackCuts.init(&qaRegistry, &TrackRegistry); + + /// \todo fix how to pass array to setSelection, getRow() passing a + /// different type! + // v0Cuts.setSelection(ConfV0Selection->getRow(0), + // femtoDreamV0Selection::kDecVtxMax, femtoDreamSelection::kAbsUpperLimit); + if (ConfIsActivateV0) { + v0Cuts.setSelection(ConfV0Sign, femtoDreamV0Selection::kV0Sign, femtoDreamSelection::kEqual); + v0Cuts.setSelection(ConfV0PtMin, femtoDreamV0Selection::kV0pTMin, femtoDreamSelection::kLowerLimit); + v0Cuts.setSelection(ConfV0PtMax, femtoDreamV0Selection::kV0pTMax, femtoDreamSelection::kUpperLimit); + v0Cuts.setSelection(ConfV0EtaMax, femtoDreamV0Selection::kV0etaMax, femtoDreamSelection::kAbsUpperLimit); + v0Cuts.setSelection(ConfV0DCADaughMax, femtoDreamV0Selection::kV0DCADaughMax, femtoDreamSelection::kUpperLimit); + v0Cuts.setSelection(ConfV0CPAMin, femtoDreamV0Selection::kV0CPAMin, femtoDreamSelection::kLowerLimit); + v0Cuts.setSelection(ConfV0TranRadMin, femtoDreamV0Selection::kV0TranRadMin, femtoDreamSelection::kLowerLimit); + v0Cuts.setSelection(ConfV0TranRadMax, femtoDreamV0Selection::kV0TranRadMax, femtoDreamSelection::kUpperLimit); + v0Cuts.setSelection(ConfV0DecVtxMax, femtoDreamV0Selection::kV0DecVtxMax, femtoDreamSelection::kUpperLimit); + v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfChildCharge, femtoDreamTrackSelection::kSign, femtoDreamSelection::kEqual); + v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfChildEtaMax, femtoDreamTrackSelection::kEtaMax, femtoDreamSelection::kAbsUpperLimit); + v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfChildTPCnClsMin, femtoDreamTrackSelection::kTPCnClsMin, femtoDreamSelection::kLowerLimit); + v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfChildDCAMin, femtoDreamTrackSelection::kDCAMin, femtoDreamSelection::kAbsLowerLimit); + v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfChildPIDnSigmaMax, femtoDreamTrackSelection::kPIDnSigmaMax, femtoDreamSelection::kAbsUpperLimit); + + v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfChildCharge, femtoDreamTrackSelection::kSign, femtoDreamSelection::kEqual); + v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfChildEtaMax, femtoDreamTrackSelection::kEtaMax, femtoDreamSelection::kAbsUpperLimit); + v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfChildTPCnClsMin, femtoDreamTrackSelection::kTPCnClsMin, femtoDreamSelection::kLowerLimit); + v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfChildDCAMin, femtoDreamTrackSelection::kDCAMin, femtoDreamSelection::kAbsLowerLimit); + v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfChildPIDnSigmaMax, femtoDreamTrackSelection::kPIDnSigmaMax, femtoDreamSelection::kAbsUpperLimit); + v0Cuts.setChildPIDSpecies(femtoDreamV0Selection::kPosTrack, ConfChildPIDspecies); + v0Cuts.setChildPIDSpecies(femtoDreamV0Selection::kNegTrack, ConfChildPIDspecies); + v0Cuts.init(&qaRegistry, &V0Registry); + v0Cuts.setInvMassLimits(ConfV0InvMassLowLimit, ConfV0InvMassUpLimit); + + v0Cuts.setChildRejectNotPropagatedTracks(femtoDreamV0Selection::kPosTrack, ConfTrkRejectNotPropagated); + v0Cuts.setChildRejectNotPropagatedTracks(femtoDreamV0Selection::kNegTrack, ConfTrkRejectNotPropagated); + + v0Cuts.setnSigmaPIDOffsetTPC(ConfTrkPIDnSigmaOffsetTPC); + v0Cuts.setChildnSigmaPIDOffset(femtoDreamV0Selection::kPosTrack, ConfTrkPIDnSigmaOffsetTPC, ConfTrkPIDnSigmaOffsetTOF); + v0Cuts.setChildnSigmaPIDOffset(femtoDreamV0Selection::kNegTrack, ConfTrkPIDnSigmaOffsetTPC, ConfTrkPIDnSigmaOffsetTOF); + + if (ConfV0RejectKaons) { + v0Cuts.setKaonInvMassLimits(ConfV0InvKaonMassLowLimit, ConfV0InvKaonMassUpLimit); + } + } + + mRunNumber = 0; + mMagField = 0.0; + /// Initializing CCDB + ccdb->setURL("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + + int64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + ccdb->setCreatedNotAfter(now); + } + + /// Function to retrieve the nominal magnetic field in kG (0.1T) and convert it directly to T + void initCCDB_Mag_Trig(aod::BCsWithTimestamps::iterator bc) + { + // TODO done only once (and not per run). Will be replaced by CCDBConfigurable + // get magnetic field for run + if (mRunNumber == bc.runNumber()) + return; + auto timestamp = bc.timestamp(); + float output = -999; + + if (ConfIsRun3 && !ConfIsForceGRP) { + static o2::parameters::GRPMagField* grpo = nullptr; + grpo = ccdb->getForTimeStamp("GLO/Config/GRPMagField", timestamp); + if (grpo == nullptr) { + LOGF(fatal, "GRP object not found for timestamp %llu", timestamp); + return; + } + LOGF(info, "Retrieved GRP for timestamp %llu with L3 ", timestamp, grpo->getL3Current()); + // taken from GRP onject definition of getNominalL3Field; update later to something smarter (mNominalL3Field = std::lround(5.f * mL3Current / 30000.f);) + auto NominalL3Field = std::lround(5.f * grpo->getL3Current() / 30000.f); + output = 0.1 * (NominalL3Field); + + } else { + + static o2::parameters::GRPObject* grpo = nullptr; + grpo = ccdb->getForTimeStamp("GLO/GRP/GRP", timestamp); + if (grpo == nullptr) { + LOGF(fatal, "GRP object not found for timestamp %llu", timestamp); + return; + } + LOGF(info, "Retrieved GRP for timestamp %llu with magnetic field of %d kG", timestamp, grpo->getNominalL3Field()); + output = 0.1 * (grpo->getNominalL3Field()); + } + mMagField = output; + mRunNumber = bc.runNumber(); + + // Init for zorro to get trigger flags + if (ConfEnableTriggerSelection) { + zorro.setCCDBpath(ConfBaseCCDBPathForTriggers); + zorro.initCCDB(ccdb.service, mRunNumber, timestamp, zorroTriggerNames); + } + } + + template + void fillDebugParticle(ParticleType const& particle) + { + if constexpr (isTrackOrV0) { + if constexpr (hasItsPid) { + outputDebugParts(particle.sign(), + (uint8_t)particle.tpcNClsFound(), + particle.tpcNClsFindable(), + (uint8_t)particle.tpcNClsCrossedRows(), + particle.tpcNClsShared(), + particle.tpcInnerParam(), + particle.itsNCls(), + particle.itsNClsInnerBarrel(), + particle.dcaXY(), + particle.dcaZ(), + particle.tpcSignal(), + particle.tpcNSigmaEl(), + particle.tpcNSigmaPi(), + particle.tpcNSigmaKa(), + particle.tpcNSigmaPr(), + particle.tpcNSigmaDe(), + particle.tpcNSigmaTr(), + particle.tpcNSigmaHe(), + particle.tofNSigmaEl(), + particle.tofNSigmaPi(), + particle.tofNSigmaKa(), + particle.tofNSigmaPr(), + particle.tofNSigmaDe(), + particle.tofNSigmaTr(), + particle.tofNSigmaHe(), + o2::analysis::femtoDream::itsSignal(particle), + particle.itsNSigmaEl(), + particle.itsNSigmaPi(), + particle.itsNSigmaKa(), + particle.itsNSigmaPr(), + particle.itsNSigmaDe(), + particle.itsNSigmaTr(), + particle.itsNSigmaHe(), + -999., -999., -999., -999., -999., -999., + -999., -999., -999., -999., -999., -999., -999.); + } else { + outputDebugParts(particle.sign(), + (uint8_t)particle.tpcNClsFound(), + particle.tpcNClsFindable(), + (uint8_t)particle.tpcNClsCrossedRows(), + particle.tpcNClsShared(), + particle.tpcInnerParam(), + particle.itsNCls(), + particle.itsNClsInnerBarrel(), + particle.dcaXY(), + particle.dcaZ(), + particle.tpcSignal(), + particle.tpcNSigmaEl(), + particle.tpcNSigmaPi(), + particle.tpcNSigmaKa(), + particle.tpcNSigmaPr(), + particle.tpcNSigmaDe(), + particle.tpcNSigmaTr(), + particle.tpcNSigmaHe(), + particle.tofNSigmaEl(), + particle.tofNSigmaPi(), + particle.tofNSigmaKa(), + particle.tofNSigmaPr(), + particle.tofNSigmaDe(), + particle.tofNSigmaTr(), + particle.tofNSigmaHe(), + -999., -999., -999., -999., -999., -999., -999., -999., + -999., -999., -999., -999., -999., -999., + -999., -999., -999., -999., -999., -999., -999.); + } + } else { + outputDebugParts(-999., // sign + -999., -999., -999., -999., -999., -999., -999., -999., -999., // track properties (DCA, NCls, crossed rows, etc.) + -999., -999., -999., -999., -999., -999., -999., -999., // TPC PID (TPC signal + particle hypothesis) + -999., -999., -999., -999., -999., -999., -999., // TOF PID + -999., -999., -999., -999., -999., -999., -999., -999., // ITS PID + particle.dcaV0daughters(), + particle.v0radius(), + particle.x(), + particle.y(), + particle.z(), + particle.mK0Short(), + -999., -999., -999., -999., -999., -999., -999.); // Cascade properties + } + } + + template + void fillMCParticle(CollisionType const& col, ParticleType const& particle, o2::aod::femtodreamparticle::ParticleType fdparttype) + { + if (particle.has_mcParticle()) { + // get corresponding MC particle and its info + auto particleMC = particle.mcParticle(); + auto pdgCode = particleMC.pdgCode(); + TrackRegistry.fill(HIST("AnalysisQA/Particle"), pdgCode); + int particleOrigin = 99; + int pdgCodeMother = -1; + // get list of mothers, but it could be empty (for example in case of injected light nuclei) + auto motherparticlesMC = particleMC.template mothers_as(); + // check pdg code + TrackRegistry.fill(HIST("AnalysisQA/getGenStatusCode"), particleMC.getGenStatusCode()); + TrackRegistry.fill(HIST("AnalysisQA/getProcess"), particleMC.getProcess()); + // if this fails, the particle is a fake + if (abs(pdgCode) == abs(ConfTrkPDGCode.value)) { + // check first if particle is from pile up + // check if the collision associated with the particle is the same as the analyzed collision by checking their Ids + if ((col.has_mcCollision() && (particleMC.mcCollisionId() != col.mcCollisionId())) || !col.has_mcCollision()) { + particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kWrongCollision; + // check if particle is primary + } else if (particleMC.isPhysicalPrimary()) { + particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kPrimary; + // check if particle is secondary + // particle is from a decay -> getProcess() == 4 + // particle is generated during transport -> getGenStatusCode() == -1 + // list of mothers is not empty + } else if (particleMC.getProcess() == 4 && particleMC.getGenStatusCode() == -1 && !motherparticlesMC.empty()) { + // get direct mother + auto motherparticleMC = motherparticlesMC.front(); + pdgCodeMother = motherparticleMC.pdgCode(); + TrackRegistry.fill(HIST("AnalysisQA/Mother"), pdgCodeMother); + particleOrigin = checkDaughterType(fdparttype, motherparticleMC.pdgCode()); + // check if particle is material + // particle is from inelastic hadronic interaction -> getProcess() == 23 + // particle is generated during transport -> getGenStatusCode() == -1 + } else if (particleMC.getProcess() == 23 && particleMC.getGenStatusCode() == -1) { + particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kMaterial; + // cross check to see if we missed a case + } else { + particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kElse; + } + // if pdg code is wrong, particle is fake + } else { + particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kFake; + } + + outputPartsMC(particleOrigin, pdgCode, particleMC.pt(), particleMC.eta(), particleMC.phi()); + outputPartsMCLabels(outputPartsMC.lastIndex()); + if (ConfIsDebug) { + outputPartsExtMCLabels(outputPartsMC.lastIndex()); + outputDebugPartsMC(pdgCodeMother); + } + } else { + outputPartsMCLabels(-1); + if (ConfIsDebug) { + outputPartsExtMCLabels(-1); + } + } + } + + template + void fillMCCollision(CollisionType const& col) + { + if (col.has_mcCollision()) { + auto genMCcol = col.template mcCollision_as(); + outputMCCollision(genMCcol.multMCNParticlesEta08()); + outputCollsMCLabels(outputMCCollision.lastIndex()); + } else { + outputCollsMCLabels(-1); + } + } + template + void fillCollisionsAndTracksAndV0(CollisionType const& col, TrackType const& tracks, TrackTypeWithItsPid const& tracksWithItsPid, V0Type const& fullV0s) + { + // If triggering is enabled, select only events which were triggered wit our triggers + if (ConfEnableTriggerSelection) { + bool zorroSelected = zorro.isSelected(col.template bc_as().globalBC()); /// check if event was selected by triggers of interest + if (!zorroSelected) { + return; + } + } + + const auto vtxZ = col.posZ(); + const auto spher = colCuts.computeSphericity(col, tracks); + float mult = 0; + int multNtr = 0; + if (ConfIsRun3) { + if constexpr (useCentrality) { + if constexpr (analysePbPb) { + mult = col.centFT0C(); + } else { + mult = col.centFT0M(); + } + } else { + mult = 0; + } + multNtr = col.multNTracksPV(); + } else { + mult = 1; // multiplicity percentile is know in Run 2 + multNtr = col.multTracklets(); + } + + colCuts.fillQA(col, mult); + + // check whether the basic event selection criteria are fulfilled + // that included checking if there is at least on usable track or V0 + if (!colCuts.isSelectedCollision(col)) { + return; + } + if (ConfIsActivateV0.value) { + if (colCuts.isEmptyCollision(col, tracks, trackCuts) && colCuts.isEmptyCollision(col, fullV0s, v0Cuts, tracks)) { + return; + } + } else { + if (colCuts.isEmptyCollision(col, tracks, trackCuts)) { + return; + } + } + + outputCollision(vtxZ, mult, multNtr, spher, mMagField); + if constexpr (isMC) { + fillMCCollision(col); + } + + std::vector childIDs = {0, 0}; // these IDs are necessary to keep track of the children + std::vector tmpIDtrack; // this vector keeps track of the matching of the primary track table row <-> aod::track table global index + std::vector Daughter1, Daughter2; + + for (auto& track : tracksWithItsPid) { + /// if the most open selection criteria are not fulfilled there is no + /// point looking further at the track + trackCuts.fillQA(track); + + if (track.tpcChi2NCl() < OptionTrackSpecialSelections.ConfTrkMinChi2PerClusterTPC || track.tpcChi2NCl() > OptionTrackSpecialSelections.ConfTrkMaxChi2PerClusterTPC) { + continue; + } + if (track.itsChi2NCl() > OptionTrackSpecialSelections.ConfTrkMaxChi2PerClusterITS) { + continue; + } + if ((OptionTrackSpecialSelections.ConfTrkTPCRefit && !track.hasTPC()) || (OptionTrackSpecialSelections.ConfTrkITSRefit && !track.hasITS())) { + continue; + } + + if (!trackCuts.isSelectedMinimal(track)) { + continue; + } + + TrackRegistry.fill(HIST("AnalysisQA/Chi2ITSTPCperCluster"), track.itsChi2NCl(), track.tpcChi2NCl()); + TrackRegistry.fill(HIST("AnalysisQA/RefitITSTPC"), track.hasITS(), track.hasTPC()); + + trackCuts.fillQA(track); + // the bit-wise container of the systematic variations is obtained + std::array cutContainer; + cutContainer = trackCuts.getCutContainer(track, track.pt(), track.eta(), sqrtf(powf(track.dcaXY(), 2.f) + powf(track.dcaZ(), 2.f))); + + // now the table is filled + outputParts(outputCollision.lastIndex(), + track.pt(), + track.eta(), + track.phi(), + aod::femtodreamparticle::ParticleType::kTrack, + cutContainer.at(femtoDreamTrackSelection::TrackContainerPosition::kCuts), + cutContainer.at(femtoDreamTrackSelection::TrackContainerPosition::kPID), + track.dcaXY(), childIDs, 0, 0); + tmpIDtrack.push_back(track.globalIndex()); + if (ConfIsDebug.value) { + fillDebugParticle(track); + } + + if constexpr (isMC) { + fillMCParticle(col, track, o2::aod::femtodreamparticle::ParticleType::kTrack); + } + + if (ConfIsActivateReso.value) { + // Already strict cuts for Daughter of reso selection + // TO DO: change TTV0 task to apply there the strict selection and have here only loose selection + + // select daugher 1 + if (track.sign() == ConfDaughterCharge.value[0] && track.pt() <= ConfDaughterPtUp.value[0] && track.pt() >= ConfDaughterPtLow.value[0] && std::abs(track.eta()) <= ConfDaughterEta.value[0] && std::abs(track.dcaXY()) <= ConfDaughterDCAxy.value[0] && std::abs(track.dcaZ()) <= ConfDaughterDCAz.value[0] && track.tpcNClsCrossedRows() >= ConfDaughterNCrossed.value[0] && track.tpcNClsFound() >= ConfDaughterNClus.value[0] && track.tpcCrossedRowsOverFindableCls() >= ConfDaughterTPCfCls.value[0]) { + if ((track.tpcInnerParam() < ConfDaughterPTPCThr.value[0] && std::abs(o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[0], track)) <= ConfDaughterPIDnSigmaMax.value[0]) || + (track.tpcInnerParam() >= ConfDaughterPTPCThr.value[0] && std::abs(std::sqrt(o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[0], track) * o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[0], track) + o2::aod::pidutils::tofNSigma(ConfDaughterPIDspecies.value[0], track) * o2::aod::pidutils::tofNSigma(ConfDaughterPIDspecies.value[0], track))) <= ConfDaughterPIDnSigmaMax.value[0])) { + Daughter1.push_back(track); + ResoRegistry.fill(HIST("AnalysisQA/Reso/Daughter1/Pt"), track.pt()); + ResoRegistry.fill(HIST("AnalysisQA/Reso/Daughter1/Eta"), track.eta()); + ResoRegistry.fill(HIST("AnalysisQA/Reso/Daughter1/Phi"), track.phi()); + } + } + // select daugher 2 + if (track.sign() == ConfDaughterCharge.value[1] && track.pt() <= ConfDaughterPtUp.value[1] && track.pt() >= ConfDaughterPtLow.value[1] && std::abs(track.eta()) <= ConfDaughterEta.value[1] && std::abs(track.dcaXY()) <= ConfDaughterDCAxy.value[1] && std::abs(track.dcaZ()) <= ConfDaughterDCAz.value[1] && track.tpcNClsCrossedRows() >= ConfDaughterNCrossed.value[1] && track.tpcNClsFound() >= ConfDaughterNClus.value[1] && track.tpcCrossedRowsOverFindableCls() >= ConfDaughterTPCfCls.value[1]) { + if ((track.tpcInnerParam() < ConfDaughterPTPCThr.value[1] && std::abs(o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[1], track)) <= ConfDaughterPIDnSigmaMax.value[1]) || + (track.tpcInnerParam() >= ConfDaughterPTPCThr.value[1] && std::abs(std::sqrt(o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[1], track) * o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[1], track) + o2::aod::pidutils::tofNSigma(ConfDaughterPIDspecies.value[1], track) * o2::aod::pidutils::tofNSigma(ConfDaughterPIDspecies.value[1], track))) <= ConfDaughterPIDnSigmaMax.value[1])) { + Daughter2.push_back(track); + ResoRegistry.fill(HIST("AnalysisQA/Reso/Daughter2/Pt"), track.pt()); + ResoRegistry.fill(HIST("AnalysisQA/Reso/Daughter2/Eta"), track.eta()); + ResoRegistry.fill(HIST("AnalysisQA/Reso/Daughter2/Phi"), track.phi()); + } + } + } + } + + if (ConfIsActivateV0.value) { + for (auto& v0 : fullV0s) { + + auto postrack = v0.template posTrack_as(); + auto negtrack = v0.template negTrack_as(); + ///\tocheck funnily enough if we apply the filter the + /// sign of Pos and Neg track is always negative + // const auto dcaXYpos = postrack.dcaXY(); + // const auto dcaZpos = postrack.dcaZ(); + // const auto dcapos = std::sqrt(pow(dcaXYpos, 2.) + pow(dcaZpos, 2.)); + v0Cuts.fillQA<0, aod::femtodreamparticle::ParticleType::kV0, aod::femtodreamparticle::ParticleType::kV0Child>(col, v0, postrack, negtrack); ///\todo fill QA also for daughters + v0Cuts.fillLambdaQA(col, v0, postrack, negtrack); + + if (!v0Cuts.isSelectedMinimal(col, v0, postrack, negtrack)) { + continue; + } + + // if (ConfRejectITSHitandTOFMissing) { + // Uncomment only when TOF timing is solved + // bool itsHit = o2PhysicsTrackSelection->IsSelected(postrack, + // TrackSelection::TrackCuts::kITSHits); bool itsHit = + // o2PhysicsTrackSelection->IsSelected(negtrack, + // TrackSelection::TrackCuts::kITSHits); + // } + + v0Cuts.fillQA<1, aod::femtodreamparticle::ParticleType::kV0, aod::femtodreamparticle::ParticleType::kV0Child>(col, v0, postrack, negtrack); ///\todo fill QA also for daughters + auto cutContainerV0 = v0Cuts.getCutContainer(col, v0, postrack, negtrack); + + int postrackID = v0.posTrackId(); + int rowInPrimaryTrackTablePos = -1; + rowInPrimaryTrackTablePos = getRowDaughters(postrackID, tmpIDtrack); + childIDs[0] = rowInPrimaryTrackTablePos; + childIDs[1] = 0; + outputParts(outputCollision.lastIndex(), + v0.positivept(), v0.positiveeta(), v0.positivephi(), + aod::femtodreamparticle::ParticleType::kV0Child, + cutContainerV0.at(femtoDreamV0Selection::V0ContainerPosition::kPosCuts), + cutContainerV0.at(femtoDreamV0Selection::V0ContainerPosition::kPosPID), + postrack.dcaXY(), + childIDs, + 0, + 0); + const int rowOfPosTrack = outputParts.lastIndex(); + if constexpr (isMC) { + fillMCParticle(col, postrack, o2::aod::femtodreamparticle::ParticleType::kV0Child); + } + int negtrackID = v0.negTrackId(); + int rowInPrimaryTrackTableNeg = -1; + rowInPrimaryTrackTableNeg = getRowDaughters(negtrackID, tmpIDtrack); + childIDs[0] = 0; + childIDs[1] = rowInPrimaryTrackTableNeg; + outputParts(outputCollision.lastIndex(), + v0.negativept(), + v0.negativeeta(), + v0.negativephi(), + aod::femtodreamparticle::ParticleType::kV0Child, + cutContainerV0.at(femtoDreamV0Selection::V0ContainerPosition::kNegCuts), + cutContainerV0.at(femtoDreamV0Selection::V0ContainerPosition::kNegPID), + negtrack.dcaXY(), + childIDs, + 0, + 0); + const int rowOfNegTrack = outputParts.lastIndex(); + if constexpr (isMC) { + fillMCParticle(col, negtrack, o2::aod::femtodreamparticle::ParticleType::kV0Child); + } + std::vector indexChildID = {rowOfPosTrack, rowOfNegTrack}; + outputParts(outputCollision.lastIndex(), + v0.pt(), + v0.eta(), + v0.phi(), + aod::femtodreamparticle::ParticleType::kV0, + cutContainerV0.at(femtoDreamV0Selection::V0ContainerPosition::kV0), + 0, + v0.v0cosPA(), + indexChildID, + v0.mLambda(), + v0.mAntiLambda()); + if (ConfIsDebug.value) { + fillDebugParticle(postrack); // QA for positive daughter + fillDebugParticle(negtrack); // QA for negative daughter + fillDebugParticle(v0); // QA for v0 + } + if constexpr (isMC) { + fillMCParticle(col, v0, o2::aod::femtodreamparticle::ParticleType::kV0); + } + } + } + + if (ConfIsActivateReso.value) { + for (std::size_t iDaug1 = 0; iDaug1 < Daughter1.size(); ++iDaug1) { + for (std::size_t iDaug2 = 0; iDaug2 < Daughter2.size(); ++iDaug2) { + // MC stuff is still missing, also V0 QA + // ALSO: fix indices and other table entries which are now set to 0 as deflaut as not needed for p-p-phi cf ana + + ROOT::Math::PtEtaPhiMVector tempD1(Daughter1.at(iDaug1).pt(), Daughter1.at(iDaug1).eta(), Daughter1.at(iDaug1).phi(), ConfDaug1Daugh2ResoMass.value[0]); + ROOT::Math::PtEtaPhiMVector tempD2(Daughter2.at(iDaug2).pt(), Daughter2.at(iDaug2).eta(), Daughter2.at(iDaug2).phi(), ConfDaug1Daugh2ResoMass.value[1]); + + ROOT::Math::PtEtaPhiMVector tempPhi = tempD1 + tempD2; + + ResoRegistry.fill(HIST("AnalysisQA/Reso/InvMass"), tempPhi.M()); + + if ((tempPhi.M() >= ConfResoInvMassLowLimit.value) && (tempPhi.M() <= ConfResoInvMassUpLimit.value)) { + + ResoRegistry.fill(HIST("AnalysisQA/Reso/InvMass_selected"), tempPhi.M()); + ResoRegistry.fill(HIST("AnalysisQA/Reso/PtD1_selected"), Daughter1.at(iDaug1).pt()); + ResoRegistry.fill(HIST("AnalysisQA/Reso/PtD2_selected"), Daughter2.at(iDaug2).pt()); + + childIDs[0] = 0; + childIDs[1] = 0; + std::vector indexChildID = {0, 0}; + outputParts(outputCollision.lastIndex(), + static_cast(Daughter1.at(iDaug1).pt()), static_cast(Daughter1.at(iDaug1).eta()), static_cast(Daughter1.at(iDaug1).phi()), + aod::femtodreamparticle::ParticleType::kV0Child, + static_cast(0), + static_cast(0), + static_cast(Daughter1.at(iDaug1).dcaXY()), + childIDs, + 0, + 0); + outputParts(outputCollision.lastIndex(), + static_cast(Daughter2.at(iDaug2).pt()), static_cast(Daughter2.at(iDaug2).eta()), static_cast(Daughter2.at(iDaug2).phi()), + aod::femtodreamparticle::ParticleType::kV0Child, + static_cast(0), + static_cast(0), + static_cast(Daughter2.at(iDaug2).dcaXY()), + childIDs, + 0, + 0); + outputParts(outputCollision.lastIndex(), + static_cast(tempPhi.pt()), + static_cast(tempPhi.eta()), + static_cast(tempPhi.phi()), + aod::femtodreamparticle::ParticleType::kV0, + static_cast(0), + 0, + 0.f, + indexChildID, + tempPhi.M(), + tempPhi.M()); + if (ConfIsDebug.value) { + fillDebugParticle(Daughter1.at(iDaug1)); // QA for positive daughter + fillDebugParticle(Daughter2.at(iDaug2)); // QA for negative daughter + outputDebugParts(-999., // sign + -999., -999., -999., -999., -999., -999., -999., -999., -999., // track properties (DCA, NCls, crossed rows, etc.) + -999., -999., -999., -999., -999., -999., -999., -999., // TPC PID (TPC signal + particle hypothesis) + -999., -999., -999., -999., -999., -999., -999., // TOF PID + -999., -999., -999., -999., -999., -999., -999., -999., // ITS PID + -999., -999., -999., -999., -999., -999., // V0 properties + -999., -999., -999., -999., -999., -999., -999.); // Cascade properties + } + } + } + } + } + } + + void + processData(aod::FemtoFullCollision const& col, + aod::BCsWithTimestamps const&, + aod::FemtoFullTracks const& tracks, + o2::aod::V0Datas const& fullV0s) + { + // get magnetic field for run + initCCDB_Mag_Trig(col.bc_as()); + // fill the tables + auto tracksWithItsPid = soa::Attach(tracks); + if (ConfUseItsPid.value) { + fillCollisionsAndTracksAndV0(col, tracks, tracksWithItsPid, fullV0s); + } else { + fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); + } + } + PROCESS_SWITCH(femtoDreamProducerTask, processData, + "Provide experimental data", true); + + void + processData_noCentrality(aod::FemtoFullCollision_noCent const& col, + aod::BCsWithTimestamps const&, + aod::FemtoFullTracks const& tracks, + o2::aod::V0Datas const& fullV0s) + { + // get magnetic field for run + initCCDB_Mag_Trig(col.bc_as()); + // fill the tables + auto tracksWithItsPid = soa::Attach(tracks); + if (ConfUseItsPid.value) { + fillCollisionsAndTracksAndV0(col, tracks, tracksWithItsPid, fullV0s); + } else { + fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); + } + } + PROCESS_SWITCH(femtoDreamProducerTask, processData_noCentrality, + "Provide experimental data without centrality information", false); + + void processData_CentPbPb(aod::FemtoFullCollision_CentPbPb const& col, + aod::BCsWithTimestamps const&, + aod::FemtoFullTracks const& tracks, + o2::aod::V0Datas const& fullV0s) + { + // get magnetic field for run + initCCDB_Mag_Trig(col.bc_as()); + // fill the tables + auto tracksWithItsPid = soa::Attach(tracks); + if (ConfUseItsPid.value) { + fillCollisionsAndTracksAndV0(col, tracks, tracksWithItsPid, fullV0s); + } else { + fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); + } + } + PROCESS_SWITCH(femtoDreamProducerTask, processData_CentPbPb, + "Provide experimental data with centrality information for PbPb collisions", false); + + void processMC(aod::FemtoFullCollisionMC const& col, + aod::BCsWithTimestamps const&, + soa::Join const& tracks, + aod::FemtoFullMCgenCollisions const&, + aod::McParticles const&, + soa::Join const& fullV0s) /// \todo with FilteredFullV0s + { + // get magnetic field for run + initCCDB_Mag_Trig(col.bc_as()); + // fill the tables + fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); + } + PROCESS_SWITCH(femtoDreamProducerTask, processMC, "Provide MC data", false); + + void processMC_noCentrality(aod::FemtoFullCollision_noCent_MC const& col, + aod::BCsWithTimestamps const&, + soa::Join const& tracks, + aod::FemtoFullMCgenCollisions const&, + aod::McParticles const&, + soa::Join const& fullV0s) /// \todo with FilteredFullV0s + { + // get magnetic field for run + initCCDB_Mag_Trig(col.bc_as()); + // fill the tables + fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); + } + PROCESS_SWITCH(femtoDreamProducerTask, processMC_noCentrality, "Provide MC data without requiring a centrality calibration", false); + + void processMC_CentPbPb(aod::FemtoFullCollisionMC_CentPbPb const& col, + aod::BCsWithTimestamps const&, + soa::Join const& tracks, + aod::FemtoFullMCgenCollisions const&, + aod::McParticles const&, + soa::Join const& fullV0s) /// \todo with FilteredFullV0s + { + // get magnetic field for run + initCCDB_Mag_Trig(col.bc_as()); + // fill the tables + fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); + } + PROCESS_SWITCH(femtoDreamProducerTask, processMC_CentPbPb, "Provide MC data with centrality information for PbPb collisions", false); +}; +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + return workflow; +} diff --git a/PWGCF/FemtoDream/Tasks/CMakeLists.txt b/PWGCF/FemtoDream/Tasks/CMakeLists.txt index 933d50035a9..113ab736824 100644 --- a/PWGCF/FemtoDream/Tasks/CMakeLists.txt +++ b/PWGCF/FemtoDream/Tasks/CMakeLists.txt @@ -29,6 +29,11 @@ o2physics_add_dpl_workflow(femtodream-pair-track-cascade PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(femtodream-pair-casdcade-cascade + SOURCES femtoDreamPairTaskCascadeCascade.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(femtodream-triplet-track-track-v0 SOURCES femtoDreamTripletTaskTrackTrackV0.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx new file mode 100644 index 00000000000..0d4beadd521 --- /dev/null +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx @@ -0,0 +1,513 @@ +// Copyright 2019-2022 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +/// \authors Andi Mathis, Anton Riedel, Georgios Mantzaridis, Oton Vazquez Doce. +#include +#include +#include +#include +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/Expressions.h" +#include "PWGCF/DataModel/FemtoDerived.h" +#include "PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h" +#include "PWGCF/FemtoDream/Core/femtoDreamEventHisto.h" +#include "PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h" +#include "PWGCF/FemtoDream/Core/femtoDreamContainer.h" +#include "PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h" +#include "PWGCF/FemtoDream/Core/femtoDreamUtils.h" +using namespace o2; +using namespace o2::aod; +using namespace o2::soa; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::analysis::femtoDream; +struct femtoDreamPairTaskCascadeCascade { + SliceCache cache; + Preslice perCol = aod::femtodreamparticle::fdCollisionId; + + /// General options + struct : ConfigurableGroup { + std::string prefix = std::string("Option"); + Configurable IsMC{"IsMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"}; + Configurable Use4D{"Use4D", false, "Enable four dimensional histogramms (to be used only for analysis with high statistics): k* vs multiplicity vs multiplicity percentil vs mT"}; + Configurable ExtendedPlots{"ExtendedPlots", false, "Enable additional three dimensional histogramms. High memory consumption. Use for debugging"}; + Configurable HighkstarCut{"HighkstarCut", -1., "Set a cut for high k*, above which the pairs are rejected. Set it to -1 to deactivate it"}; + Configurable CPROn{"CPROn", true, "Close Pair Rejection"}; + Configurable CPROld{"CPROld", false, "Set to FALSE to use fixed version of CPR (for testing now, will be default soon)"}; + Configurable CPRPlotPerRadii{"CPRPlotPerRadii", false, "Plot CPR per radii"}; + Configurable CPRdeltaPhiMax{"CPRdeltaPhiMax", 0.01, "Max. Delta Phi for Close Pair Rejection"}; + Configurable CPRdeltaEtaMax{"CPRdeltaEtaMax", 0.01, "Max. Delta Eta for Close Pair Rejection"}; + Configurable DCACutPtDep{"DCACutPtDep", false, "Use pt dependent dca cut"}; + Configurable MixEventWithPairs{"MixEventWithPairs", false, "Only use events that contain particle 1 and partile 2 for the event mixing"}; + Configurable smearingByOrigin{"smearingByOrigin", false, "Obtain the smearing matrix differential in the MC origin of particle 1 and particle 2. High memory consumption. Use with care!"}; + ConfigurableAxis Dummy{"Dummy", {1, 0, 1}, "Dummy axis"}; + } Option; + + + /// Event selection + struct : ConfigurableGroup { + std::string prefix = std::string("EventSel"); + Configurable MultMin{"MultMin", 0, "Minimum Multiplicity (MultNtr)"}; + Configurable MultMax{"MultMax", 99999, "Maximum Multiplicity (MultNtr)"}; + Configurable MultPercentileMin{"MultPercentileMin", 0, "Minimum Multiplicity Percentile"}; + Configurable MultPercentileMax{"MultPercentileMax", 100, "Maximum Multiplicity Percentile"}; + } EventSel; + + + // Filter EventMultiplicity = aod::femtodreamcollision::multNtr >= EventSel.MultMin && aod::femtodreamcollision::multNtr <= EventSel.MultMax; + // Filter EventMultiplicityPercentile = aod::femtodreamcollision::multV0M >= EventSel.MultPercentileMin && aod::femtodreamcollision::multV0M <= EventSel.MultPercentileMax; + + + /// Histogramming for Event + FemtoDreamEventHisto eventHisto; + // using FilteredCollisions = soa::Filtered; + using FilteredCollisions = FDCollisions; + using FilteredCollision = FilteredCollisions::iterator; + using FDMCParts = soa::Join; + using FDMCPart = FDMCParts::iterator; + femtodreamcollision::BitMaskType BitMask = 1; //??????????????????? + + + + /// Cascade 1 (Cascade) + struct : ConfigurableGroup { + std::string prefix = std::string("Cascade1"); + Configurable PDGCode{"PDGCode", 3334, "PDG code of Particle 1 (Cascade)"}; + Configurable CutBit{"CutBit", 5542474, "Particle 1 (Cascade) - Selection bit from cutCulator"}; + Configurable ChildPos_CutBit{"ChildPos_CutBit", 278, "Selection bit for positive child of Cascade"}; + Configurable ChildPos_TPCBit{"ChildPos_TPCBit", 1024, "PID TPC bit for positive child of Cascade"}; + Configurable ChildNeg_CutBit{"ChildNeg_CutBit", 277, "Selection bit for negative child of Cascade"}; + Configurable ChildNeg_TPCBit{"ChildNeg_TPCBit", 4096, "PID TPC bit for negative child of Cascade"}; + Configurable ChildBach_CutBit{"ChildBach_CutBit", 277, "Selection bit for bachelor child of Cascade"}; + Configurable ChildBach_TPCBit{"ChildBach_TPCBit", 64, "PID TPC bit for bachelor child of Cascade"}; + + + Configurable InvMassMin{"InvMassMin", 1.6, "Minimum invariant mass of Partricle 1 (Cascade)"}; + Configurable InvMassMax{"InvMassMax", 1.8, "Maximum invariant mass of Partricle 1 (Cascade)"}; + Configurable InvMassV0DaughMin{"InvMassV0DaugMin", 0., "Minimum invariant mass of the V0 Daughter"}; + Configurable InvMassV0DaughMax{"InvMassV0DaugMax", 999., "Maximum invariant mass of the V0 Daughter"}; + Configurable PtMin{"PtMin", 0., "Minimum pT of Particle 2 (Cascade)"}; + Configurable PtMax{"PtMax", 999., "Maximum pT of Particle 2 (Cascade)"}; + Configurable EtaMin{"EtaMin", -10., "Minimum eta of Particle 2 (Cascade)"}; + Configurable EtaMax{"EtaMax", 10., "Maximum eta of Particle 2 (Cascade)"}; + Configurable UseChildCuts{"UseChildCuts", true, "Use cuts on the children of the Cascades additional to those of the selection of the cascade builder (for debugging purposes)"}; + Configurable UseChildPIDCuts{"UseChildPIDCuts", true, "Use PID cuts on the children of the Cascades additional to those of the selection of the cascade builder (for debugging purposes)"}; + } Cascade1; + + + /// Partition for particle 1 + Partition PartitionCascade1 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kCascade)) && + ((aod::femtodreamparticle::cut & Cascade1.CutBit) == Cascade1.CutBit) && + (aod::femtodreamparticle::pt > Cascade1.PtMin) && + (aod::femtodreamparticle::pt < Cascade1.PtMax) && + (aod::femtodreamparticle::eta > Cascade1.EtaMin) && + (aod::femtodreamparticle::eta < Cascade1.EtaMax) && + (aod::femtodreamparticle::mLambda > Cascade1.InvMassMin) && + (aod::femtodreamparticle::mLambda < Cascade1.InvMassMax) && + (aod::femtodreamparticle::mAntiLambda > Cascade1.InvMassV0DaughMin) && + (aod::femtodreamparticle::mAntiLambda < Cascade1.InvMassV0DaughMax); + /// Histogramming for particle 1 + FemtoDreamParticleHisto CascHistoPartOne; + FemtoDreamParticleHisto posChildHistosPartOne; + FemtoDreamParticleHisto negChildHistosPartOne; + FemtoDreamParticleHisto bachChildHistosPartOne; + + + + /// Particle 2 (Cascade) + struct : ConfigurableGroup { + std::string prefix = std::string("Cascade2"); + Configurable PDGCode{"PDGCode", 3334, "PDG code of particle 2 (Cascade)"}; + Configurable CutBit{"CutBit", 32221874, "Selection bit for particle 2 (Cascade)"}; + Configurable ChildPos_CutBit{"ChildPos_CutBit", 278, "Selection bit for positive child of Cascade"}; + Configurable ChildPos_TPCBit{"ChildPos_TPCBit", 1024, "PID TPC bit for positive child of Cascade"}; + Configurable ChildNeg_CutBit{"ChildNeg_CutBit", 277, "Selection bit for negative child of Cascade"}; + Configurable ChildNeg_TPCBit{"ChildNeg_TPCBit", 4096, "PID TPC bit for negative child of Cascade"}; + Configurable ChildBach_CutBit{"ChildBach_CutBit", 277, "Selection bit for negative child of Cascade"}; + Configurable ChildBach_TPCBit{"ChildBach_TPCBit", 64, "PID TPC bit for bachelor child of Cascade"}; + Configurable InvMassMin{"InvMassMin", 1.2, "Minimum invariant mass of Particle 2 (Cascade)"}; + Configurable InvMassMax{"InvMassMax", 1.4, "Maximum invariant mass of Particle 2 (Cascade)"}; + Configurable InvMassV0DaughMin{"InvMassV0DaugMin", 0., "Minimum invariant mass of the V0 Daughter"}; // (???????) + Configurable InvMassV0DaughMax{"InvMassV0DaugMax", 999., "Maximum invariant mass of the V0 Daughter"}; // (???????) + Configurable PtMin{"PtMin", 0., "Minimum pT of Particle 2 (Cascade)"}; + Configurable PtMax{"PtMax", 999., "Maximum pT of Particle 2 (Cascade)"}; + Configurable EtaMin{"EtaMin", -10., "Minimum eta of Particle 2 (Cascade)"}; + Configurable EtaMax{"EtaMax", 10., "Maximum eta of Particle 2 (Cascade)"}; + Configurable UseChildCuts{"UseChildCuts", true, "Use cuts on the children of the Cascades additional to those of the selection of the cascade builder (for debugging purposes)"}; + Configurable UseChildPIDCuts{"UseChildPIDCuts", true, "Use PID cuts on the children of the Cascades additional to those of the selection of the cascade builder (for debugging purposes)"}; + } Cascade2; + + + + /// Partition for particle 2 + Partition PartitionCascade2 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kCascade)) && + ((aod::femtodreamparticle::cut & Cascade2.CutBit) == Cascade2.CutBit) && + (aod::femtodreamparticle::pt > Cascade2.PtMin) && + (aod::femtodreamparticle::pt < Cascade2.PtMax) && + (aod::femtodreamparticle::eta > Cascade2.EtaMin) && + (aod::femtodreamparticle::eta < Cascade2.EtaMax) && + (aod::femtodreamparticle::mLambda > Cascade2.InvMassMin) && + (aod::femtodreamparticle::mLambda < Cascade2.InvMassMax) && + (aod::femtodreamparticle::mAntiLambda > Cascade2.InvMassV0DaughMin) && + (aod::femtodreamparticle::mAntiLambda < Cascade2.InvMassV0DaughMax); + /// Histogramming for particle 2 + FemtoDreamParticleHisto CascHistoPartTwo; + FemtoDreamParticleHisto posChildHistosPartTwo; + FemtoDreamParticleHisto negChildHistosPartTwo; + FemtoDreamParticleHisto bachChildHistosPartTwo; + + + + /// Binning configurables + struct : ConfigurableGroup { + std::string prefix = std::string("Binning"); + ConfigurableAxis TempFitVarCascade{"TempFitVarCascade", {300, 0.9, 1}, "binning of the TempFitVar in the pT vs. TempFitVar plot (Cascade)"}; + ConfigurableAxis TempFitVarCascadeChild{"TempFitVarCascadeChild", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot (Cascade child)"}; + ConfigurableAxis InvMass{"InvMass", {200, 1.22, 1.42}, "InvMass binning"}; + ConfigurableAxis pTCascade{"pTCascade", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot (Cascade)"}; + ConfigurableAxis pTCascadeChild{"pTCascadeChild", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot (Cascade)"}; + ConfigurableAxis pT{"pT", {20, 0.5, 4.05}, "pT binning"}; + ConfigurableAxis kstar{"kstar", {1500, 0., 6.}, "binning kstar"}; + ConfigurableAxis kT{"kT", {150, 0., 9.}, "binning kT"}; + ConfigurableAxis mT{"mT", {225, 0., 7.5}, "binning mT"}; + ConfigurableAxis multTempFit{"multTempFit", {1, 0, 1}, "multiplicity for the TempFitVar plot"}; + } Binning; + struct : ConfigurableGroup { + std::string prefix = std::string("Binning4D"); + ConfigurableAxis kstar{"kstar", {1500, 0., 6.}, "binning kstar for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true in order to use)"}; + ConfigurableAxis mT{"mT", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true in order to use)"}; + ConfigurableAxis Mult{"mult", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f}, "multiplicity Binning for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true in order to use)"}; + ConfigurableAxis multPercentile{"multPercentile", {10, 0.0f, 100.0f}, "multiplicity percentile Binning for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true in order to use)"}; + } Binning4D; + + + + // Mixing configurables + struct : ConfigurableGroup { + std::string prefix = std::string("Mixing"); + ConfigurableAxis BinMult{"BinMult", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f}, "bins - multiplicity"}; + ConfigurableAxis BinMultPercentile{"BinMultPercentile", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f}, "bins - multiplicity percentile"}; + ConfigurableAxis BinVztx{"BinVztx", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "bins - z-vertex"}; + Configurable Depth{"Depth", 5, "Number of events for mixing"}; + Configurable Policy{"BinPolicy", 0, "Binning policy for mixing - 0: multiplicity, 1: multipliciy percentile, 2: both"}; + } Mixing; + ColumnBinningPolicy colBinningMult{{Mixing.BinVztx, Mixing.BinMult}, true}; + ColumnBinningPolicy colBinningMultPercentile{{Mixing.BinVztx, Mixing.BinMultPercentile}, true}; + ColumnBinningPolicy colBinningMultMultPercentile{{Mixing.BinVztx, Mixing.BinMult, Mixing.BinMultPercentile}, true}; + FemtoDreamContainer sameEventCont; + FemtoDreamContainer mixedEventCont; + FemtoDreamPairCleaner pairCleaner; + FemtoDreamDetaDphiStar pairCloseRejectionSE; + FemtoDreamDetaDphiStar pairCloseRejectionME; + + static constexpr uint32_t kSignPlusMask = 1 << 1; + + + + /// Histogram output + HistogramRegistry Registry{"Output", {}, OutputObjHandlingPolicy::AnalysisObject}; + void init(InitContext&) + { + // setup binnnig policy for mixing + colBinningMult = {{Mixing.BinVztx, Mixing.BinMult}, true}; + colBinningMultPercentile = {{Mixing.BinVztx, Mixing.BinMultPercentile}, true}; + colBinningMultMultPercentile = {{Mixing.BinVztx, Mixing.BinMult, Mixing.BinMultPercentile}, true}; + eventHisto.init(&Registry, Option.IsMC); + + CascHistoPartOne.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTCascade, Option.Dummy, Option.Dummy, Binning.TempFitVarCascade, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.IsMC, Cascade1.PDGCode); + CascHistoPartTwo.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTCascade, Option.Dummy, Option.Dummy, Binning.TempFitVarCascade, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Binning.InvMass, Option.Dummy, Option.IsMC, Cascade2.PDGCode); + + posChildHistosPartOne.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTCascadeChild, Option.Dummy, Option.Dummy, Binning.TempFitVarCascadeChild, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, false, 0); + negChildHistosPartOne.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTCascadeChild, Option.Dummy, Option.Dummy, Binning.TempFitVarCascadeChild, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, false, 0); + bachChildHistosPartOne.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTCascadeChild, Option.Dummy, Option.Dummy, Binning.TempFitVarCascadeChild, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, false, 0); + + posChildHistosPartTwo.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTCascadeChild, Option.Dummy, Option.Dummy, Binning.TempFitVarCascadeChild, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, false, 0); + negChildHistosPartTwo.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTCascadeChild, Option.Dummy, Option.Dummy, Binning.TempFitVarCascadeChild, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, false, 0); + bachChildHistosPartTwo.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTCascadeChild, Option.Dummy, Option.Dummy, Binning.TempFitVarCascadeChild, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, false, 0); + + sameEventCont.init(&Registry, + Binning.kstar, Binning.pT, Binning.kT, Binning.mT, Mixing.BinMult, Mixing.BinMultPercentile, + Binning4D.kstar, Binning4D.mT, Binning4D.Mult, Binning4D.multPercentile, + Option.IsMC, Option.Use4D, Option.ExtendedPlots, + Option.HighkstarCut, + Option.smearingByOrigin); + + sameEventCont.setPDGCodes(Cascade1.PDGCode, Cascade2.PDGCode); + + mixedEventCont.init(&Registry, + Binning.kstar, Binning.pT, Binning.kT, Binning.mT, Mixing.BinMult, Mixing.BinMultPercentile, + Binning4D.kstar, Binning4D.mT, Binning4D.Mult, Binning4D.multPercentile, + Option.IsMC, Option.Use4D, Option.ExtendedPlots, + Option.HighkstarCut, + Option.smearingByOrigin); + + mixedEventCont.setPDGCodes(Cascade1.PDGCode, Cascade2.PDGCode); + + pairCleaner.init(&Registry); + if (Option.CPROn.value) { + pairCloseRejectionSE.init(&Registry, &Registry, Option.CPRdeltaPhiMax.value, Option.CPRdeltaEtaMax.value, Option.CPRPlotPerRadii.value, 1, Option.CPROld.value); + pairCloseRejectionME.init(&Registry, &Registry, Option.CPRdeltaPhiMax.value, Option.CPRdeltaEtaMax.value, Option.CPRPlotPerRadii.value, 2, Option.CPROld.value, 99, true); + } + } + + /// This function processes the same event and takes care of all the histogramming + template + void doSameEvent(PartitionType& SliceCascade1, PartitionType& SliceCascade2, TableTracks const& parts, Collision const& col) + { + /// Histogramming same event + for (auto const& casc : SliceCascade1) { + const auto& posChild1 = parts.iteratorAt(casc.index() - 3); + const auto& negChild1 = parts.iteratorAt(casc.index() - 2); + const auto& bachChild1 = parts.iteratorAt(casc.index() - 1); + // This is how it is supposed to work but there seems to be an issue + // with partitions and accessing elements in tables that have been declared + // with an SELF_INDEX column. Under investigation. Maybe need to change + // femtdream dataformat to take special care of v0 candidates + // auto posChild = v0.template children_as().front(); + // auto negChild = v0.template children_as().back(); + // check cuts on V0 children + if (Cascade1.UseChildCuts) { + if (!(((posChild1.cut() & Cascade2.ChildPos_CutBit) == Cascade1.ChildPos_CutBit) && + ((negChild1.cut() & Cascade2.ChildNeg_CutBit) == Cascade1.ChildNeg_CutBit) && + ((bachChild1.cut() & Cascade2.ChildBach_CutBit) == Cascade1.ChildBach_CutBit))) { + continue; + } + } + if (Cascade1.UseChildPIDCuts) { + if (!(((posChild1.pidcut() & Cascade2.ChildPos_TPCBit) == Cascade1.ChildPos_TPCBit) && + ((negChild1.pidcut() & Cascade2.ChildNeg_TPCBit) == Cascade1.ChildNeg_TPCBit) && + ((bachChild1.pidcut() & Cascade2.ChildBach_TPCBit) == Cascade1.ChildBach_TPCBit))) { + continue; + } + } + CascHistoPartOne.fillQA(casc, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + posChildHistosPartOne.fillQA(posChild1, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + negChildHistosPartOne.fillQA(negChild1, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + bachChildHistosPartOne.fillQA(bachChild1, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + + } + for (auto& casc : SliceCascade2) { + const auto& posChild2 = parts.iteratorAt(casc.index() - 3); + const auto& negChild2 = parts.iteratorAt(casc.index() - 2); + const auto& bachChild2 = parts.iteratorAt(casc.index() - 1); + // This is how it is supposed to work but there seems to be an issue + // with partitions and accessing elements in tables that have been declared + // with an SELF_INDEX column. Under investigation. Maybe need to change + // femtdream dataformat to take special care of v0 candidates + // auto posChild = v0.template children_as().front(); + // auto negChild = v0.template children_as().back(); + // check cuts on V0 children + if (Cascade2.UseChildCuts) { + if (!(((posChild2.cut() & Cascade2.ChildPos_CutBit) == Cascade2.ChildPos_CutBit) && + ((negChild2.cut() & Cascade2.ChildNeg_CutBit) == Cascade2.ChildNeg_CutBit) && + ((bachChild2.cut() & Cascade2.ChildBach_CutBit) == Cascade2.ChildBach_CutBit))) { + continue; + } + } + if (Cascade2.UseChildPIDCuts) { + if (!(((posChild2.pidcut() & Cascade2.ChildPos_TPCBit) == Cascade2.ChildPos_TPCBit) && + ((negChild2.pidcut() & Cascade2.ChildNeg_TPCBit) == Cascade2.ChildNeg_TPCBit) && + ((bachChild2.pidcut() & Cascade2.ChildBach_TPCBit) == Cascade2.ChildBach_TPCBit))) { + continue; + } + } + CascHistoPartTwo.fillQA(casc, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + posChildHistosPartTwo.fillQA(posChild2, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + negChildHistosPartTwo.fillQA(negChild2, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + bachChildHistosPartTwo.fillQA(bachChild2, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + } + + /// Now build particle combinations + for (auto const& [p1, p2] : combinations(CombinationsFullIndexPolicy(SliceCascade1, SliceCascade2))) { + const auto& posChild1 = parts.iteratorAt(p1.index() - 3); + const auto& negChild1 = parts.iteratorAt(p1.index() - 2); + const auto& bachChild1 = parts.iteratorAt(p1.index() - 1); + const auto& posChild2 = parts.iteratorAt(p2.index() - 3); + const auto& negChild2 = parts.iteratorAt(p2.index() - 2); + const auto& bachChild2 = parts.iteratorAt(p2.index() - 1); + + // cuts on Cascade children still need to be applied + if (Cascade1.UseChildCuts) { + if (!(((posChild1.cut() & Cascade1.ChildPos_CutBit) == Cascade1.ChildPos_CutBit) && + ((negChild1.cut() & Cascade1.ChildNeg_CutBit) == Cascade1.ChildNeg_CutBit) && + ((bachChild1.cut() & Cascade1.ChildBach_CutBit) == Cascade1.ChildBach_CutBit))) { + continue; + } + } + if (Cascade1.UseChildPIDCuts) { + if (!(((posChild1.pidcut() & Cascade1.ChildPos_TPCBit) == Cascade1.ChildPos_TPCBit) && + ((negChild1.pidcut() & Cascade1.ChildNeg_TPCBit) == Cascade1.ChildNeg_TPCBit) && + ((bachChild1.pidcut() & Cascade1.ChildBach_TPCBit) == Cascade1.ChildBach_TPCBit))) { + continue; + } + } + + if (Cascade2.UseChildCuts) { + if (!(((posChild2.cut() & Cascade2.ChildPos_CutBit) == Cascade2.ChildPos_CutBit) && + ((negChild2.cut() & Cascade2.ChildNeg_CutBit) == Cascade2.ChildNeg_CutBit) && + ((bachChild2.cut() & Cascade2.ChildBach_CutBit) == Cascade2.ChildBach_CutBit))) { + continue; + } + } + if (Cascade2.UseChildPIDCuts) { + if (!(((posChild2.pidcut() & Cascade2.ChildPos_TPCBit) == Cascade2.ChildPos_TPCBit) && + ((negChild2.pidcut() & Cascade2.ChildNeg_TPCBit) == Cascade2.ChildNeg_TPCBit) && + ((bachChild2.pidcut() & Cascade2.ChildBach_TPCBit) == Cascade2.ChildBach_TPCBit))) { + continue; + } + } + + //CPR cuts // HERE I NEED HELP FROM GEORGIOS. This was for track-cascade: + // we can start with no CPR for Cascade-Cascade for the moment + //if (Option.CPROn.value) { + // if ((p1.cut() & kSignPlusMask) == kSignPlusMask) { + // if (pairCloseRejectionSE.isClosePair(p1, posChild, parts, col.magField())) { + // continue; + // } + // } else { + // if (pairCloseRejectionSE.isClosePair(p1, posChild, parts, col.magField())) { + // continue; + // } + // } + //} + + //Pair Cleaner //-> This should now work for cascades! + if (!pairCleaner.isCleanPair(p1, p2, parts)) { + continue; + } + + //SE pair set: + sameEventCont.setPair(p1, p2, col.multNtr(), col.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.smearingByOrigin); + } + } + + //process Same Event + void processSameEvent(FilteredCollision const& col, FDParticles const& parts) + { + // if ((col.bitmaskTrackOne() & BitMask) != BitMask || (col.bitmaskTrackTwo() & BitMask) != BitMask) { + // return; + // } + eventHisto.fillQA(col); + auto SliceCascade1 = PartitionCascade1->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + auto SliceCascade2 = PartitionCascade2->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + doSameEvent(SliceCascade1, SliceCascade2, parts, col); + } + PROCESS_SWITCH(femtoDreamPairTaskCascadeCascade, processSameEvent, "Enable processing same event", true); + + + //Mixed events + template + void doMixedEvent(CollisionType const& cols, PartType const& parts, PartitionType& part1, PartitionType& part2, BinningType policy) + { + // Partition PartitionMaskedCol = ncheckbit(aod::femtodreamcollision::bitmaskTrackOne, BitMask) && ncheckbit(aod::femtodreamcollision::bitmaskTrackTwo, BitMask);// && aod::femtodreamcollision::downsample == true; + // PartitionMaskedCol.bindTable(cols); + + // use *Partition.mFiltered when passing the partition to mixing object + // there is an issue when the partition is passed directly + // workaround for now, change back once it is fixed + for (auto const& [collision1, collision2] : soa::selfCombinations(policy, Mixing.Depth.value, -1, cols, cols)) { + // make sure that tracks in same events are not mixed + if (collision1.globalIndex() == collision2.globalIndex()) { + continue; + } + auto SliceCasc1 = part1->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision1.globalIndex(), cache); + auto SliceCasc2 = part2->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision2.globalIndex(), cache); + for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(SliceCasc1, SliceCasc2))) { + const auto& posChild1 = parts.iteratorAt(p1.index() - 3); + const auto& negChild1 = parts.iteratorAt(p1.index() - 2); + const auto& bachChild1 = parts.iteratorAt(p1.index() - 1); + const auto& posChild2 = parts.iteratorAt(p2.index() - 3); + const auto& negChild2 = parts.iteratorAt(p2.index() - 2); + const auto& bachChild2 = parts.iteratorAt(p2.index() - 1); + // check cuts on Cascade children + if (Cascade1.UseChildCuts) { + if (!(((posChild1.cut() & Cascade1.ChildPos_CutBit) == Cascade1.ChildPos_CutBit) && + ((negChild1.cut() & Cascade1.ChildNeg_CutBit) == Cascade1.ChildNeg_CutBit) && + ((bachChild1.cut() & Cascade1.ChildBach_CutBit) == Cascade1.ChildBach_CutBit))) { + continue; + } + } + if (Cascade1.UseChildPIDCuts) { + if (!(((posChild1.pidcut() & Cascade1.ChildPos_TPCBit) == Cascade1.ChildPos_TPCBit) && + ((negChild1.pidcut() & Cascade1.ChildNeg_TPCBit) == Cascade1.ChildNeg_TPCBit) && + ((bachChild1.pidcut() & Cascade1.ChildBach_TPCBit) == Cascade1.ChildBach_TPCBit))) { + continue; + } + } + + if (Cascade2.UseChildCuts) { + if (!(((posChild2.cut() & Cascade2.ChildPos_CutBit) == Cascade2.ChildPos_CutBit) && + ((negChild2.cut() & Cascade2.ChildNeg_CutBit) == Cascade2.ChildNeg_CutBit) && + ((bachChild2.cut() & Cascade2.ChildBach_CutBit) == Cascade2.ChildBach_CutBit))) { + continue; + } + } + if (Cascade2.UseChildPIDCuts) { + if (!(((posChild2.pidcut() & Cascade2.ChildPos_TPCBit) == Cascade2.ChildPos_TPCBit) && + ((negChild2.pidcut() & Cascade2.ChildNeg_TPCBit) == Cascade2.ChildNeg_TPCBit) && + ((bachChild2.pidcut() & Cascade2.ChildBach_TPCBit) == Cascade2.ChildBach_TPCBit))) { + continue; + } + } + + //CPR cuts // HERE I NEED HELP FROM GEORGIOS. This was for track-cascade: + // we can start with no CPR for Cascade-Cascade for the moment + //if (Option.CPROn.value) { + // if ((p1.cut() & kSignPlusMask) == kSignPlusMask) { + // if (pairCloseRejectionME.isClosePair(p1, posChild, parts, collision1.magField())) { + // continue; + // } + // } else { + // if (pairCloseRejectionME.isClosePair(p1, negChild, parts, collision1.magField())) { + // continue; + // } + // } + //} + + // Pair cleaner not needed in the mixing + // if (!pairCleaner.isCleanPair(p1, p2, parts)) { + // continue; + //} + + mixedEventCont.setPair(p1, p2, collision1.multNtr(), collision1.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.smearingByOrigin); + } + } + } + + //process Mixed Event + void processMixedEvent(FilteredCollisions const& cols, FDParticles const& parts) + { + switch (Mixing.Policy.value) { + case femtodreamcollision::kMult: + doMixedEvent(cols, parts, PartitionCascade1, PartitionCascade2, colBinningMult); + break; + case femtodreamcollision::kMultPercentile: + doMixedEvent(cols, parts, PartitionCascade1, PartitionCascade2, colBinningMultPercentile); + break; + case femtodreamcollision::kMultMultPercentile: + doMixedEvent(cols, parts, PartitionCascade1, PartitionCascade2, colBinningMultMultPercentile); + break; + default: + LOG(fatal) << "Invalid binning policiy specifed. Breaking..."; + } + } + PROCESS_SWITCH(femtoDreamPairTaskCascadeCascade, processMixedEvent, "Enable processing mixed events", true); +}; +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow{ + adaptAnalysisTask(cfgc), + }; + return workflow; +} From 7c245dffdacd701f986e3868bc4c28625c711f6e Mon Sep 17 00:00:00 2001 From: georgios Date: Fri, 22 Aug 2025 15:49:00 +0200 Subject: [PATCH 2/9] Removing file which was created for testing --- .../femtoDreamProducerTask_gg.cxx | 924 ------------------ 1 file changed, 924 deletions(-) delete mode 100644 PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask_gg.cxx diff --git a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask_gg.cxx b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask_gg.cxx deleted file mode 100644 index 50150f94f67..00000000000 --- a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask_gg.cxx +++ /dev/null @@ -1,924 +0,0 @@ -// Copyright 2019-2025 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file femtoDreamProducerTask.cxx -/// \brief Tasks that produces the track tables used for the pairing -/// \author Laura Serksnyte, TU München, laura.serksnyte@tum.de - -#include -#include -#include -#include -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/PIDResponse.h" -#include "Common/DataModel/PIDResponseITS.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h" -#include "PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h" -#include "PWGCF/FemtoDream/Core/femtoDreamV0Selection.h" -#include "PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h" -#include "PWGCF/FemtoDream/Core/femtoDreamUtils.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "EventFiltering/Zorro.h" -#include "PWGCF/DataModel/FemtoDerived.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "ReconstructionDataFormats/Track.h" -#include "TMath.h" -#include "Math/Vector4D.h" - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::analysis::femtoDream; - -namespace o2::aod -{ - -using FemtoFullCollision = soa::Join::iterator; -using FemtoFullCollision_noCent = soa::Join::iterator; -using FemtoFullCollision_CentPbPb = soa::Join::iterator; -using FemtoFullCollisionMC = soa::Join::iterator; -using FemtoFullCollision_noCent_MC = soa::Join::iterator; -using FemtoFullCollisionMC_CentPbPb = soa::Join::iterator; -using FemtoFullMCgenCollisions = soa::Join; -using FemtoFullMCgenCollision = FemtoFullMCgenCollisions::iterator; - -using FemtoFullTracks = - soa::Join; -} // namespace o2::aod - -namespace softwareTriggers -{ -static const int nTriggers = 6; -static const std::vector triggerNames{"fPPP", "fPPL", "fPLL", "fLLL", "fPD", "fLD"}; -static const float triggerSwitches[1][nTriggers]{ - {0, 0, 0, 0, 0, 0}}; -} // namespace softwareTriggers - -template -int getRowDaughters(int daughID, T const& vecID) -{ - int rowInPrimaryTrackTableDaugh = -1; - for (size_t i = 0; i < vecID.size(); i++) { - if (vecID.at(i) == daughID) { - rowInPrimaryTrackTableDaugh = i; - break; - } - } - return rowInPrimaryTrackTableDaugh; -} - -struct femtoDreamProducerTask { - - Zorro zorro; - - Produces outputCollision; - Produces outputMCCollision; - Produces outputCollsMCLabels; - Produces outputParts; - Produces outputPartsMC; - Produces outputDebugParts; - Produces outputPartsMCLabels; - Produces outputDebugPartsMC; - Produces outputPartsExtMCLabels; - - Configurable ConfIsDebug{"ConfIsDebug", true, "Enable Debug tables"}; - Configurable ConfUseItsPid{"ConfUseItsPid", false, "Enable Debug tables"}; - Configurable ConfIsRun3{"ConfIsRun3", false, "Running on Run3 or pilot"}; - Configurable ConfIsForceGRP{"ConfIsForceGRP", false, "Set true if the magnetic field configuration is not available in the usual CCDB directory (e.g. for Run 2 converted data or unanchorad Monte Carlo)"}; - /// Event cuts - FemtoDreamCollisionSelection colCuts; - // Event cuts - Triggers - Configurable ConfEnableTriggerSelection{"ConfEnableTriggerSelection", false, "Should the trigger selection be enabled for collisions?"}; - Configurable> ConfTriggerSwitches{ - "ConfTriggerSwitches", - {softwareTriggers::triggerSwitches[0], 1, softwareTriggers::nTriggers, std::vector{"Switch"}, softwareTriggers::triggerNames}, - "Turn on which trigger should be checked for recorded events to pass selection"}; - Configurable ConfBaseCCDBPathForTriggers{"ConfBaseCCDBPathForTriggers", "Users/m/mpuccio/EventFiltering/OTS/Chunked/", "Provide ccdb path for trigger table; default - trigger coordination"}; - - // Event cuts - usual selection criteria - Configurable ConfEvtZvtx{"ConfEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; - Configurable ConfEvtTriggerCheck{"ConfEvtTriggerCheck", true, "Evt sel: check for trigger"}; - Configurable ConfEvtTriggerSel{"ConfEvtTriggerSel", kINT7, "Evt sel: trigger"}; - Configurable ConfEvtOfflineCheck{"ConfEvtOfflineCheck", false, "Evt sel: check for offline selection"}; - Configurable ConfEvtAddOfflineCheck{"ConfEvtAddOfflineCheck", false, "Evt sel: additional checks for offline selection (not part of sel8 yet)"}; - Configurable ConfIsActivateV0{"ConfIsActivateV0", true, "Activate filling of V0 into femtodream tables"}; - Configurable ConfIsActivateReso{"ConfIsActivateReso", false, "Activate filling of sl Resonances into femtodream tables"}; - - Configurable ConfTrkRejectNotPropagated{"ConfTrkRejectNotPropagated", false, "True: reject not propagated tracks"}; - // Configurable ConfRejectITSHitandTOFMissing{ "ConfRejectITSHitandTOFMissing", false, "True: reject if neither ITS hit nor TOF timing satisfied"}; - Configurable ConfTrkPDGCode{"ConfTrkPDGCode", 2212, "PDG code of the selected track for Monte Carlo truth"}; - FemtoDreamTrackSelection trackCuts; - Configurable> ConfTrkCharge{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kSign, "ConfTrk"), std::vector{-1, 1}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kSign, "Track selection: ")}; - Configurable> ConfTrkPtmin{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kpTMin, "ConfTrk"), std::vector{0.5f, 0.4f, 0.6f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kpTMin, "Track selection: ")}; - Configurable> ConfTrkPtmax{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kpTMax, "ConfTrk"), std::vector{5.4f, 5.6f, 5.5f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kpTMax, "Track selection: ")}; - Configurable> ConfTrkEta{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kEtaMax, "ConfTrk"), std::vector{0.8f, 0.7f, 0.9f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kEtaMax, "Track selection: ")}; - Configurable> ConfTrkTPCnclsMin{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kTPCnClsMin, "ConfTrk"), std::vector{80.f, 70.f, 60.f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kTPCnClsMin, "Track selection: ")}; - Configurable> ConfTrkTPCfCls{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kTPCfClsMin, "ConfTrk"), std::vector{0.7f, 0.83f, 0.9f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kTPCfClsMin, "Track selection: ")}; - Configurable> ConfTrkTPCcRowsMin{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kTPCcRowsMin, "ConfTrk"), std::vector{70.f, 60.f, 80.f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kTPCcRowsMin, "Track selection: ")}; - Configurable> ConfTrkTPCsCls{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kTPCsClsMax, "ConfTrk"), std::vector{0.1f, 160.f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kTPCsClsMax, "Track selection: ")}; - Configurable> ConfTrkITSnclsMin{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kITSnClsMin, "ConfTrk"), std::vector{-1.f, 2.f, 4.f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kITSnClsMin, "Track selection: ")}; - Configurable> ConfTrkITSnclsIbMin{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kITSnClsIbMin, "ConfTrk"), std::vector{-1.f, 1.f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kITSnClsIbMin, "Track selection: ")}; - Configurable> ConfTrkDCAxyMax{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kDCAxyMax, "ConfTrk"), std::vector{0.1f, 3.5f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kDCAxyMax, "Track selection: ")}; - Configurable> ConfTrkDCAzMax{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kDCAzMax, "ConfTrk"), std::vector{0.2f, 3.5f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kDCAzMax, "Track selection: ")}; - Configurable> ConfTrkPIDnSigmaMax{FemtoDreamTrackSelection::getSelectionName(femtoDreamTrackSelection::kPIDnSigmaMax, "ConfTrk"), std::vector{3.5f, 3.f, 2.5f}, FemtoDreamTrackSelection::getSelectionHelper(femtoDreamTrackSelection::kPIDnSigmaMax, "Track selection: ")}; - Configurable ConfTrkPIDnSigmaOffsetTPC{"ConfTrkPIDnSigmaOffsetTPC", 0., "Offset for TPC nSigma because of bad calibration"}; - Configurable ConfTrkPIDnSigmaOffsetTOF{"ConfTrkPIDnSigmaOffsetTOF", 0., "Offset for TOF nSigma because of bad calibration"}; - Configurable> ConfTrkPIDspecies{"ConfTrkPIDspecies", std::vector{o2::track::PID::Pion, o2::track::PID::Kaon, o2::track::PID::Proton, o2::track::PID::Deuteron}, "Trk sel: Particles species for PID"}; - - FemtoDreamV0Selection v0Cuts; - Configurable> ConfV0Sign{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0Sign, "ConfV0"), std::vector{-1, 1}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0Sign, "V0 selection: ")}; - Configurable> ConfV0PtMin{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0pTMin, "ConfV0"), std::vector{0.3f, 0.4f, 0.5f}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0pTMin, "V0 selection: ")}; - Configurable> ConfV0PtMax{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0pTMax, "ConfV0"), std::vector{3.3f, 3.4f, 3.5f}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0pTMax, "V0 selection: ")}; - Configurable> ConfV0EtaMax{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0etaMax, "ConfV0"), std::vector{0.8f, 0.7f, 0.9f}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0etaMax, "V0 selection: ")}; - Configurable> ConfV0DCADaughMax{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0DCADaughMax, "ConfV0"), std::vector{1.2f, 1.5f}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0DCADaughMax, "V0 selection: ")}; - Configurable> ConfV0CPAMin{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0CPAMin, "ConfV0"), std::vector{0.99f, 0.995f}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0CPAMin, "V0 selection: ")}; - Configurable> ConfV0TranRadMin{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0TranRadMin, "ConfV0"), std::vector{0.2f}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0TranRadMin, "V0 selection: ")}; - Configurable> ConfV0TranRadMax{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0TranRadMax, "ConfV0"), std::vector{100.f}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0TranRadMax, "V0 selection: ")}; - Configurable> ConfV0DecVtxMax{FemtoDreamV0Selection::getSelectionName(femtoDreamV0Selection::kV0DecVtxMax, "ConfV0"), std::vector{100.f}, FemtoDreamV0Selection::getSelectionHelper(femtoDreamV0Selection::kV0DecVtxMax, "V0 selection: ")}; - - Configurable ConfV0InvMassLowLimit{"ConfV0InvV0MassLowLimit", 1.05, "Lower limit of the V0 invariant mass"}; - Configurable ConfV0InvMassUpLimit{"ConfV0InvV0MassUpLimit", 1.30, "Upper limit of the V0 invariant mass"}; - Configurable ConfV0RejectKaons{"ConfV0RejectKaons", false, "Switch to reject kaons"}; - Configurable ConfV0InvKaonMassLowLimit{"ConfV0InvKaonMassLowLimit", 0.48, "Lower limit of the V0 invariant mass for Kaon rejection"}; - Configurable ConfV0InvKaonMassUpLimit{"ConfV0InvKaonMassUpLimit", 0.515, "Upper limit of the V0 invariant mass for Kaon rejection"}; - - Configurable> ConfChildCharge{"ConfChildSign", std::vector{-1, 1}, "V0 Child sel: Charge"}; - Configurable> ConfChildEtaMax{"ConfChildEtaMax", std::vector{0.8f}, "V0 Child sel: max eta"}; - Configurable> ConfChildTPCnClsMin{"ConfChildTPCnClsMin", std::vector{80.f, 70.f, 60.f}, "V0 Child sel: Min. nCls TPC"}; - Configurable> ConfChildDCAMin{"ConfChildDCAMin", std::vector{0.05f, 0.06f}, "V0 Child sel: Max. DCA Daugh to PV (cm)"}; - Configurable> ConfChildPIDnSigmaMax{"ConfChildPIDnSigmaMax", std::vector{5.f, 4.f}, "V0 Child sel: Max. PID nSigma TPC"}; - Configurable> ConfChildPIDspecies{"ConfChildPIDspecies", std::vector{o2::track::PID::Pion, o2::track::PID::Proton}, "V0 Child sel: Particles species for PID"}; - - // Resonances - Configurable ConfResoInvMassLowLimit{"ConfResoInvMassLowLimit", 1.011461, "Lower limit of the Reso invariant mass"}; - Configurable ConfResoInvMassUpLimit{"ConfResoInvMassUpLimit", 1.027461, "Upper limit of the Reso invariant mass"}; - Configurable> ConfDaughterCharge{"ConfDaughterCharge", std::vector{1, -1}, "Reso Daughter sel: Charge"}; - Configurable> ConfDaughterEta{"ConfDaughterEta", std::vector{0.8, 0.8}, "Reso Daughter sel: Eta"}; // 0.8 - Configurable> ConfDaughterDCAxy{"ConfDaughterDCAxy", std::vector{0.1, 0.1}, "Reso Daughter sel: DCAxy"}; // 0.1 - Configurable> ConfDaughterDCAz{"ConfDaughterDCAz", std::vector{0.2, 0.2}, "Reso Daughter sel: DCAz"}; // 0.2 - Configurable> ConfDaughterNClus{"ConfDaughterNClus", std::vector{80, 80}, "Reso Daughter sel: NClusters"}; // 0.2 - Configurable> ConfDaughterNCrossed{"ConfDaughterNCrossed", std::vector{70, 70}, "Reso Daughter sel: NCrossedRowss"}; - Configurable> ConfDaughterTPCfCls{"ConfDaughterTPCfCls", std::vector{0.8, 0.8}, "Reso Daughter sel: Minimum fraction of crossed rows over findable cluster"}; // 0.2 - Configurable> ConfDaughterPtUp{"ConfDaughterPtUp", std::vector{2.0, 2.0}, "Reso Daughter sel: Upper limit pT"}; // 2.0 - Configurable> ConfDaughterPtLow{"ConfDaughterPtLow", std::vector{0.15, 0.15}, "Reso Daughter sel: Lower limit pT"}; // 0.15 - Configurable> ConfDaughterPTPCThr{"ConfDaughterPTPCThr", std::vector{0.40, 0.40}, "Reso Daughter sel: momentum threshold TPC only PID, p_TPC,Thr"}; // 0.4 - Configurable> ConfDaughterPIDnSigmaMax{"ConfDaughterPIDnSigmaMax", std::vector{3.00, 3.00}, "Reso Daughter sel: Max. PID nSigma TPC"}; // 3.0 - Configurable> ConfDaughterPIDspecies{"ConfDaughterPIDspecies", std::vector{o2::track::PID::Kaon, o2::track::PID::Kaon}, "Reso Daughter sel: Particles species for PID"}; - Configurable> ConfDaug1Daugh2ResoMass{"ConfDaug1Daugh2ResoMass", std::vector{o2::constants::physics::MassKPlus, o2::constants::physics::MassKMinus, o2::constants::physics::MassPhi}, "Masses: Daughter1 - Daughter2 - Resonance"}; - - /// \todo should we add filter on min value pT/eta of V0 and daughters? - /*Filter v0Filter = (nabs(aod::v0data::x) < V0DecVtxMax.value) && - (nabs(aod::v0data::y) < V0DecVtxMax.value) && - (nabs(aod::v0data::z) < V0DecVtxMax.value);*/ - // (aod::v0data::v0radius > V0TranRadV0Min.value); to be added, not working - // for now do not know why - - /// General options - struct : o2::framework::ConfigurableGroup { - Configurable ConfTrkMinChi2PerClusterTPC{"ConfTrkMinChi2PerClusterTPC", 0.f, "Lower limit for chi2 of TPC; currently for testing only"}; - Configurable ConfTrkMaxChi2PerClusterTPC{"ConfTrkMaxChi2PerClusterTPC", 1000.f, "Upper limit for chi2 of TPC; currently for testing only"}; - Configurable ConfTrkMaxChi2PerClusterITS{"ConfTrkMaxChi2PerClusterITS", 1000.0f, "Minimal track selection: max allowed chi2 per ITS cluster"}; // 36.0 is default - Configurable ConfTrkTPCRefit{"ConfTrkTPCRefit", false, "True: require TPC refit"}; - Configurable ConfTrkITSRefit{"ConfTrkITSRefit", false, "True: require ITS refit"}; - - } OptionTrackSpecialSelections; - - HistogramRegistry qaRegistry{"QAHistos", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry TrackRegistry{"Tracks", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry V0Registry{"V0", {}, OutputObjHandlingPolicy::AnalysisObject}; - HistogramRegistry ResoRegistry{"Reso", {}, OutputObjHandlingPolicy::AnalysisObject}; - - int mRunNumber; - float mMagField; - std::string zorroTriggerNames = ""; - Service ccdb; /// Accessing the CCDB - - void init(InitContext&) - { - if (doprocessData == false && doprocessData_noCentrality == false && doprocessData_CentPbPb == false && doprocessMC == false && doprocessMC_noCentrality == false && doprocessMC_CentPbPb == false) { - LOGF(fatal, "Neither processData nor processMC enabled. Please choose one."); - } - if ((doprocessData == true && doprocessMC == true) || (doprocessData == true && doprocessMC_noCentrality == true) || (doprocessMC == true && doprocessMC_noCentrality == true) || (doprocessData_noCentrality == true && doprocessData == true) || (doprocessData_noCentrality == true && doprocessMC == true) || (doprocessData_noCentrality == true && doprocessMC_noCentrality == true) || (doprocessData_CentPbPb == true && doprocessData == true) || (doprocessData_CentPbPb == true && doprocessData_noCentrality == true) || (doprocessData_CentPbPb == true && doprocessMC == true) || (doprocessData_CentPbPb == true && doprocessMC_noCentrality == true) || (doprocessData_CentPbPb == true && doprocessMC_CentPbPb == true)) { - LOGF(fatal, - "Cannot enable more than one process switch at the same time. " - "Please choose one."); - } - - int CutBits = 8 * sizeof(o2::aod::femtodreamparticle::cutContainerType); - TrackRegistry.add("AnalysisQA/CutCounter", "; Bit; Counter", kTH1F, {{CutBits + 1, -0.5, CutBits + 0.5}}); - TrackRegistry.add("AnalysisQA/Chi2ITSTPCperCluster", "; ITS_Chi2; TPC_Chi2", kTH2F, {{100, 0, 50}, {100, 0, 20}}); - TrackRegistry.add("AnalysisQA/RefitITSTPC", "; ITS_Refit; TPC_Refit", kTH2F, {{2, 0, 2}, {2, 0, 2}}); - TrackRegistry.add("AnalysisQA/getGenStatusCode", "; Bit; Entries", kTH1F, {{200, 0, 200}}); - TrackRegistry.add("AnalysisQA/getProcess", "; Bit; Entries", kTH1F, {{200, 0, 200}}); - TrackRegistry.add("AnalysisQA/Mother", "; Bit; Entries", kTH1F, {{4000, -4000, 4000}}); - TrackRegistry.add("AnalysisQA/Particle", "; Bit; Entries", kTH1F, {{4000, -4000, 4000}}); - V0Registry.add("AnalysisQA/CutCounter", "; Bit; Counter", kTH1F, {{CutBits + 1, -0.5, CutBits + 0.5}}); - ResoRegistry.add("AnalysisQA/Reso/InvMass", "Invariant mass V0s;M_{KK};Entries", HistType::kTH1F, {{7000, 0.8, 1.5}}); - ResoRegistry.add("AnalysisQA/Reso/InvMass_selected", "Invariant mass V0s;M_{KK};Entries", HistType::kTH1F, {{7000, 0.8, 1.5}}); - ResoRegistry.add("AnalysisQA/Reso/Daughter1/Pt", "Transverse momentum of all processed tracks;p_{T} (GeV/c);Entries", HistType::kTH1F, {{1000, 0, 10}}); - ResoRegistry.add("AnalysisQA/Reso/Daughter1/Eta", "Pseudorapidity of all processed tracks;#eta;Entries", HistType::kTH1F, {{1000, -2, 2}}); - ResoRegistry.add("AnalysisQA/Reso/Daughter1/Phi", "Azimuthal angle of all processed tracks;#phi;Entries", HistType::kTH1F, {{720, 0, TMath::TwoPi()}}); - ResoRegistry.add("AnalysisQA/Reso/Daughter2/Pt", "Transverse momentum of all processed tracks;p_{T} (GeV/c);Entries", HistType::kTH1F, {{1000, 0, 10}}); - ResoRegistry.add("AnalysisQA/Reso/Daughter2/Eta", "Pseudorapidity of all processed tracks;#eta;Entries", HistType::kTH1F, {{1000, -2, 2}}); - ResoRegistry.add("AnalysisQA/Reso/Daughter2/Phi", "Azimuthal angle of all processed tracks;#phi;Entries", HistType::kTH1F, {{720, 0, TMath::TwoPi()}}); - ResoRegistry.add("AnalysisQA/Reso/PtD1_selected", "Transverse momentum of all processed tracks;p_{T} (GeV/c);Entries", HistType::kTH1F, {{1000, 0, 10}}); - ResoRegistry.add("AnalysisQA/Reso/PtD2_selected", "Transverse momentum of all processed tracks;p_{T} (GeV/c);Entries", HistType::kTH1F, {{1000, 0, 10}}); - - if (ConfEnableTriggerSelection) { - for (const std::string& triggerName : softwareTriggers::triggerNames) { - if (ConfTriggerSwitches->get("Switch", triggerName.c_str())) { - zorroTriggerNames += triggerName + ","; - } - } - zorroTriggerNames.pop_back(); - } - - colCuts.setCuts(ConfEvtZvtx.value, ConfEvtTriggerCheck.value, ConfEvtTriggerSel.value, ConfEvtOfflineCheck.value, ConfEvtAddOfflineCheck.value, ConfIsRun3.value); - colCuts.init(&qaRegistry); - - trackCuts.setSelection(ConfTrkCharge, femtoDreamTrackSelection::kSign, femtoDreamSelection::kEqual); - trackCuts.setSelection(ConfTrkPtmin, femtoDreamTrackSelection::kpTMin, femtoDreamSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkPtmax, femtoDreamTrackSelection::kpTMax, femtoDreamSelection::kUpperLimit); - trackCuts.setSelection(ConfTrkEta, femtoDreamTrackSelection::kEtaMax, femtoDreamSelection::kAbsUpperLimit); - trackCuts.setSelection(ConfTrkTPCnclsMin, femtoDreamTrackSelection::kTPCnClsMin, femtoDreamSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkTPCfCls, femtoDreamTrackSelection::kTPCfClsMin, femtoDreamSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkTPCcRowsMin, femtoDreamTrackSelection::kTPCcRowsMin, femtoDreamSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkTPCsCls, femtoDreamTrackSelection::kTPCsClsMax, femtoDreamSelection::kUpperLimit); - trackCuts.setSelection(ConfTrkITSnclsMin, femtoDreamTrackSelection::kITSnClsMin, femtoDreamSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkITSnclsIbMin, femtoDreamTrackSelection::kITSnClsIbMin, femtoDreamSelection::kLowerLimit); - trackCuts.setSelection(ConfTrkDCAxyMax, femtoDreamTrackSelection::kDCAxyMax, femtoDreamSelection::kAbsUpperLimit); - trackCuts.setSelection(ConfTrkDCAzMax, femtoDreamTrackSelection::kDCAzMax, femtoDreamSelection::kAbsUpperLimit); - trackCuts.setSelection(ConfTrkPIDnSigmaMax, femtoDreamTrackSelection::kPIDnSigmaMax, femtoDreamSelection::kAbsUpperLimit); - trackCuts.setPIDSpecies(ConfTrkPIDspecies); - trackCuts.setnSigmaPIDOffset(ConfTrkPIDnSigmaOffsetTPC, ConfTrkPIDnSigmaOffsetTOF); - trackCuts.init(&qaRegistry, &TrackRegistry); - - /// \todo fix how to pass array to setSelection, getRow() passing a - /// different type! - // v0Cuts.setSelection(ConfV0Selection->getRow(0), - // femtoDreamV0Selection::kDecVtxMax, femtoDreamSelection::kAbsUpperLimit); - if (ConfIsActivateV0) { - v0Cuts.setSelection(ConfV0Sign, femtoDreamV0Selection::kV0Sign, femtoDreamSelection::kEqual); - v0Cuts.setSelection(ConfV0PtMin, femtoDreamV0Selection::kV0pTMin, femtoDreamSelection::kLowerLimit); - v0Cuts.setSelection(ConfV0PtMax, femtoDreamV0Selection::kV0pTMax, femtoDreamSelection::kUpperLimit); - v0Cuts.setSelection(ConfV0EtaMax, femtoDreamV0Selection::kV0etaMax, femtoDreamSelection::kAbsUpperLimit); - v0Cuts.setSelection(ConfV0DCADaughMax, femtoDreamV0Selection::kV0DCADaughMax, femtoDreamSelection::kUpperLimit); - v0Cuts.setSelection(ConfV0CPAMin, femtoDreamV0Selection::kV0CPAMin, femtoDreamSelection::kLowerLimit); - v0Cuts.setSelection(ConfV0TranRadMin, femtoDreamV0Selection::kV0TranRadMin, femtoDreamSelection::kLowerLimit); - v0Cuts.setSelection(ConfV0TranRadMax, femtoDreamV0Selection::kV0TranRadMax, femtoDreamSelection::kUpperLimit); - v0Cuts.setSelection(ConfV0DecVtxMax, femtoDreamV0Selection::kV0DecVtxMax, femtoDreamSelection::kUpperLimit); - v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfChildCharge, femtoDreamTrackSelection::kSign, femtoDreamSelection::kEqual); - v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfChildEtaMax, femtoDreamTrackSelection::kEtaMax, femtoDreamSelection::kAbsUpperLimit); - v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfChildTPCnClsMin, femtoDreamTrackSelection::kTPCnClsMin, femtoDreamSelection::kLowerLimit); - v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfChildDCAMin, femtoDreamTrackSelection::kDCAMin, femtoDreamSelection::kAbsLowerLimit); - v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfChildPIDnSigmaMax, femtoDreamTrackSelection::kPIDnSigmaMax, femtoDreamSelection::kAbsUpperLimit); - - v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfChildCharge, femtoDreamTrackSelection::kSign, femtoDreamSelection::kEqual); - v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfChildEtaMax, femtoDreamTrackSelection::kEtaMax, femtoDreamSelection::kAbsUpperLimit); - v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfChildTPCnClsMin, femtoDreamTrackSelection::kTPCnClsMin, femtoDreamSelection::kLowerLimit); - v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfChildDCAMin, femtoDreamTrackSelection::kDCAMin, femtoDreamSelection::kAbsLowerLimit); - v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfChildPIDnSigmaMax, femtoDreamTrackSelection::kPIDnSigmaMax, femtoDreamSelection::kAbsUpperLimit); - v0Cuts.setChildPIDSpecies(femtoDreamV0Selection::kPosTrack, ConfChildPIDspecies); - v0Cuts.setChildPIDSpecies(femtoDreamV0Selection::kNegTrack, ConfChildPIDspecies); - v0Cuts.init(&qaRegistry, &V0Registry); - v0Cuts.setInvMassLimits(ConfV0InvMassLowLimit, ConfV0InvMassUpLimit); - - v0Cuts.setChildRejectNotPropagatedTracks(femtoDreamV0Selection::kPosTrack, ConfTrkRejectNotPropagated); - v0Cuts.setChildRejectNotPropagatedTracks(femtoDreamV0Selection::kNegTrack, ConfTrkRejectNotPropagated); - - v0Cuts.setnSigmaPIDOffsetTPC(ConfTrkPIDnSigmaOffsetTPC); - v0Cuts.setChildnSigmaPIDOffset(femtoDreamV0Selection::kPosTrack, ConfTrkPIDnSigmaOffsetTPC, ConfTrkPIDnSigmaOffsetTOF); - v0Cuts.setChildnSigmaPIDOffset(femtoDreamV0Selection::kNegTrack, ConfTrkPIDnSigmaOffsetTPC, ConfTrkPIDnSigmaOffsetTOF); - - if (ConfV0RejectKaons) { - v0Cuts.setKaonInvMassLimits(ConfV0InvKaonMassLowLimit, ConfV0InvKaonMassUpLimit); - } - } - - mRunNumber = 0; - mMagField = 0.0; - /// Initializing CCDB - ccdb->setURL("http://alice-ccdb.cern.ch"); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - - int64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); - ccdb->setCreatedNotAfter(now); - } - - /// Function to retrieve the nominal magnetic field in kG (0.1T) and convert it directly to T - void initCCDB_Mag_Trig(aod::BCsWithTimestamps::iterator bc) - { - // TODO done only once (and not per run). Will be replaced by CCDBConfigurable - // get magnetic field for run - if (mRunNumber == bc.runNumber()) - return; - auto timestamp = bc.timestamp(); - float output = -999; - - if (ConfIsRun3 && !ConfIsForceGRP) { - static o2::parameters::GRPMagField* grpo = nullptr; - grpo = ccdb->getForTimeStamp("GLO/Config/GRPMagField", timestamp); - if (grpo == nullptr) { - LOGF(fatal, "GRP object not found for timestamp %llu", timestamp); - return; - } - LOGF(info, "Retrieved GRP for timestamp %llu with L3 ", timestamp, grpo->getL3Current()); - // taken from GRP onject definition of getNominalL3Field; update later to something smarter (mNominalL3Field = std::lround(5.f * mL3Current / 30000.f);) - auto NominalL3Field = std::lround(5.f * grpo->getL3Current() / 30000.f); - output = 0.1 * (NominalL3Field); - - } else { - - static o2::parameters::GRPObject* grpo = nullptr; - grpo = ccdb->getForTimeStamp("GLO/GRP/GRP", timestamp); - if (grpo == nullptr) { - LOGF(fatal, "GRP object not found for timestamp %llu", timestamp); - return; - } - LOGF(info, "Retrieved GRP for timestamp %llu with magnetic field of %d kG", timestamp, grpo->getNominalL3Field()); - output = 0.1 * (grpo->getNominalL3Field()); - } - mMagField = output; - mRunNumber = bc.runNumber(); - - // Init for zorro to get trigger flags - if (ConfEnableTriggerSelection) { - zorro.setCCDBpath(ConfBaseCCDBPathForTriggers); - zorro.initCCDB(ccdb.service, mRunNumber, timestamp, zorroTriggerNames); - } - } - - template - void fillDebugParticle(ParticleType const& particle) - { - if constexpr (isTrackOrV0) { - if constexpr (hasItsPid) { - outputDebugParts(particle.sign(), - (uint8_t)particle.tpcNClsFound(), - particle.tpcNClsFindable(), - (uint8_t)particle.tpcNClsCrossedRows(), - particle.tpcNClsShared(), - particle.tpcInnerParam(), - particle.itsNCls(), - particle.itsNClsInnerBarrel(), - particle.dcaXY(), - particle.dcaZ(), - particle.tpcSignal(), - particle.tpcNSigmaEl(), - particle.tpcNSigmaPi(), - particle.tpcNSigmaKa(), - particle.tpcNSigmaPr(), - particle.tpcNSigmaDe(), - particle.tpcNSigmaTr(), - particle.tpcNSigmaHe(), - particle.tofNSigmaEl(), - particle.tofNSigmaPi(), - particle.tofNSigmaKa(), - particle.tofNSigmaPr(), - particle.tofNSigmaDe(), - particle.tofNSigmaTr(), - particle.tofNSigmaHe(), - o2::analysis::femtoDream::itsSignal(particle), - particle.itsNSigmaEl(), - particle.itsNSigmaPi(), - particle.itsNSigmaKa(), - particle.itsNSigmaPr(), - particle.itsNSigmaDe(), - particle.itsNSigmaTr(), - particle.itsNSigmaHe(), - -999., -999., -999., -999., -999., -999., - -999., -999., -999., -999., -999., -999., -999.); - } else { - outputDebugParts(particle.sign(), - (uint8_t)particle.tpcNClsFound(), - particle.tpcNClsFindable(), - (uint8_t)particle.tpcNClsCrossedRows(), - particle.tpcNClsShared(), - particle.tpcInnerParam(), - particle.itsNCls(), - particle.itsNClsInnerBarrel(), - particle.dcaXY(), - particle.dcaZ(), - particle.tpcSignal(), - particle.tpcNSigmaEl(), - particle.tpcNSigmaPi(), - particle.tpcNSigmaKa(), - particle.tpcNSigmaPr(), - particle.tpcNSigmaDe(), - particle.tpcNSigmaTr(), - particle.tpcNSigmaHe(), - particle.tofNSigmaEl(), - particle.tofNSigmaPi(), - particle.tofNSigmaKa(), - particle.tofNSigmaPr(), - particle.tofNSigmaDe(), - particle.tofNSigmaTr(), - particle.tofNSigmaHe(), - -999., -999., -999., -999., -999., -999., -999., -999., - -999., -999., -999., -999., -999., -999., - -999., -999., -999., -999., -999., -999., -999.); - } - } else { - outputDebugParts(-999., // sign - -999., -999., -999., -999., -999., -999., -999., -999., -999., // track properties (DCA, NCls, crossed rows, etc.) - -999., -999., -999., -999., -999., -999., -999., -999., // TPC PID (TPC signal + particle hypothesis) - -999., -999., -999., -999., -999., -999., -999., // TOF PID - -999., -999., -999., -999., -999., -999., -999., -999., // ITS PID - particle.dcaV0daughters(), - particle.v0radius(), - particle.x(), - particle.y(), - particle.z(), - particle.mK0Short(), - -999., -999., -999., -999., -999., -999., -999.); // Cascade properties - } - } - - template - void fillMCParticle(CollisionType const& col, ParticleType const& particle, o2::aod::femtodreamparticle::ParticleType fdparttype) - { - if (particle.has_mcParticle()) { - // get corresponding MC particle and its info - auto particleMC = particle.mcParticle(); - auto pdgCode = particleMC.pdgCode(); - TrackRegistry.fill(HIST("AnalysisQA/Particle"), pdgCode); - int particleOrigin = 99; - int pdgCodeMother = -1; - // get list of mothers, but it could be empty (for example in case of injected light nuclei) - auto motherparticlesMC = particleMC.template mothers_as(); - // check pdg code - TrackRegistry.fill(HIST("AnalysisQA/getGenStatusCode"), particleMC.getGenStatusCode()); - TrackRegistry.fill(HIST("AnalysisQA/getProcess"), particleMC.getProcess()); - // if this fails, the particle is a fake - if (abs(pdgCode) == abs(ConfTrkPDGCode.value)) { - // check first if particle is from pile up - // check if the collision associated with the particle is the same as the analyzed collision by checking their Ids - if ((col.has_mcCollision() && (particleMC.mcCollisionId() != col.mcCollisionId())) || !col.has_mcCollision()) { - particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kWrongCollision; - // check if particle is primary - } else if (particleMC.isPhysicalPrimary()) { - particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kPrimary; - // check if particle is secondary - // particle is from a decay -> getProcess() == 4 - // particle is generated during transport -> getGenStatusCode() == -1 - // list of mothers is not empty - } else if (particleMC.getProcess() == 4 && particleMC.getGenStatusCode() == -1 && !motherparticlesMC.empty()) { - // get direct mother - auto motherparticleMC = motherparticlesMC.front(); - pdgCodeMother = motherparticleMC.pdgCode(); - TrackRegistry.fill(HIST("AnalysisQA/Mother"), pdgCodeMother); - particleOrigin = checkDaughterType(fdparttype, motherparticleMC.pdgCode()); - // check if particle is material - // particle is from inelastic hadronic interaction -> getProcess() == 23 - // particle is generated during transport -> getGenStatusCode() == -1 - } else if (particleMC.getProcess() == 23 && particleMC.getGenStatusCode() == -1) { - particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kMaterial; - // cross check to see if we missed a case - } else { - particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kElse; - } - // if pdg code is wrong, particle is fake - } else { - particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kFake; - } - - outputPartsMC(particleOrigin, pdgCode, particleMC.pt(), particleMC.eta(), particleMC.phi()); - outputPartsMCLabels(outputPartsMC.lastIndex()); - if (ConfIsDebug) { - outputPartsExtMCLabels(outputPartsMC.lastIndex()); - outputDebugPartsMC(pdgCodeMother); - } - } else { - outputPartsMCLabels(-1); - if (ConfIsDebug) { - outputPartsExtMCLabels(-1); - } - } - } - - template - void fillMCCollision(CollisionType const& col) - { - if (col.has_mcCollision()) { - auto genMCcol = col.template mcCollision_as(); - outputMCCollision(genMCcol.multMCNParticlesEta08()); - outputCollsMCLabels(outputMCCollision.lastIndex()); - } else { - outputCollsMCLabels(-1); - } - } - template - void fillCollisionsAndTracksAndV0(CollisionType const& col, TrackType const& tracks, TrackTypeWithItsPid const& tracksWithItsPid, V0Type const& fullV0s) - { - // If triggering is enabled, select only events which were triggered wit our triggers - if (ConfEnableTriggerSelection) { - bool zorroSelected = zorro.isSelected(col.template bc_as().globalBC()); /// check if event was selected by triggers of interest - if (!zorroSelected) { - return; - } - } - - const auto vtxZ = col.posZ(); - const auto spher = colCuts.computeSphericity(col, tracks); - float mult = 0; - int multNtr = 0; - if (ConfIsRun3) { - if constexpr (useCentrality) { - if constexpr (analysePbPb) { - mult = col.centFT0C(); - } else { - mult = col.centFT0M(); - } - } else { - mult = 0; - } - multNtr = col.multNTracksPV(); - } else { - mult = 1; // multiplicity percentile is know in Run 2 - multNtr = col.multTracklets(); - } - - colCuts.fillQA(col, mult); - - // check whether the basic event selection criteria are fulfilled - // that included checking if there is at least on usable track or V0 - if (!colCuts.isSelectedCollision(col)) { - return; - } - if (ConfIsActivateV0.value) { - if (colCuts.isEmptyCollision(col, tracks, trackCuts) && colCuts.isEmptyCollision(col, fullV0s, v0Cuts, tracks)) { - return; - } - } else { - if (colCuts.isEmptyCollision(col, tracks, trackCuts)) { - return; - } - } - - outputCollision(vtxZ, mult, multNtr, spher, mMagField); - if constexpr (isMC) { - fillMCCollision(col); - } - - std::vector childIDs = {0, 0}; // these IDs are necessary to keep track of the children - std::vector tmpIDtrack; // this vector keeps track of the matching of the primary track table row <-> aod::track table global index - std::vector Daughter1, Daughter2; - - for (auto& track : tracksWithItsPid) { - /// if the most open selection criteria are not fulfilled there is no - /// point looking further at the track - trackCuts.fillQA(track); - - if (track.tpcChi2NCl() < OptionTrackSpecialSelections.ConfTrkMinChi2PerClusterTPC || track.tpcChi2NCl() > OptionTrackSpecialSelections.ConfTrkMaxChi2PerClusterTPC) { - continue; - } - if (track.itsChi2NCl() > OptionTrackSpecialSelections.ConfTrkMaxChi2PerClusterITS) { - continue; - } - if ((OptionTrackSpecialSelections.ConfTrkTPCRefit && !track.hasTPC()) || (OptionTrackSpecialSelections.ConfTrkITSRefit && !track.hasITS())) { - continue; - } - - if (!trackCuts.isSelectedMinimal(track)) { - continue; - } - - TrackRegistry.fill(HIST("AnalysisQA/Chi2ITSTPCperCluster"), track.itsChi2NCl(), track.tpcChi2NCl()); - TrackRegistry.fill(HIST("AnalysisQA/RefitITSTPC"), track.hasITS(), track.hasTPC()); - - trackCuts.fillQA(track); - // the bit-wise container of the systematic variations is obtained - std::array cutContainer; - cutContainer = trackCuts.getCutContainer(track, track.pt(), track.eta(), sqrtf(powf(track.dcaXY(), 2.f) + powf(track.dcaZ(), 2.f))); - - // now the table is filled - outputParts(outputCollision.lastIndex(), - track.pt(), - track.eta(), - track.phi(), - aod::femtodreamparticle::ParticleType::kTrack, - cutContainer.at(femtoDreamTrackSelection::TrackContainerPosition::kCuts), - cutContainer.at(femtoDreamTrackSelection::TrackContainerPosition::kPID), - track.dcaXY(), childIDs, 0, 0); - tmpIDtrack.push_back(track.globalIndex()); - if (ConfIsDebug.value) { - fillDebugParticle(track); - } - - if constexpr (isMC) { - fillMCParticle(col, track, o2::aod::femtodreamparticle::ParticleType::kTrack); - } - - if (ConfIsActivateReso.value) { - // Already strict cuts for Daughter of reso selection - // TO DO: change TTV0 task to apply there the strict selection and have here only loose selection - - // select daugher 1 - if (track.sign() == ConfDaughterCharge.value[0] && track.pt() <= ConfDaughterPtUp.value[0] && track.pt() >= ConfDaughterPtLow.value[0] && std::abs(track.eta()) <= ConfDaughterEta.value[0] && std::abs(track.dcaXY()) <= ConfDaughterDCAxy.value[0] && std::abs(track.dcaZ()) <= ConfDaughterDCAz.value[0] && track.tpcNClsCrossedRows() >= ConfDaughterNCrossed.value[0] && track.tpcNClsFound() >= ConfDaughterNClus.value[0] && track.tpcCrossedRowsOverFindableCls() >= ConfDaughterTPCfCls.value[0]) { - if ((track.tpcInnerParam() < ConfDaughterPTPCThr.value[0] && std::abs(o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[0], track)) <= ConfDaughterPIDnSigmaMax.value[0]) || - (track.tpcInnerParam() >= ConfDaughterPTPCThr.value[0] && std::abs(std::sqrt(o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[0], track) * o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[0], track) + o2::aod::pidutils::tofNSigma(ConfDaughterPIDspecies.value[0], track) * o2::aod::pidutils::tofNSigma(ConfDaughterPIDspecies.value[0], track))) <= ConfDaughterPIDnSigmaMax.value[0])) { - Daughter1.push_back(track); - ResoRegistry.fill(HIST("AnalysisQA/Reso/Daughter1/Pt"), track.pt()); - ResoRegistry.fill(HIST("AnalysisQA/Reso/Daughter1/Eta"), track.eta()); - ResoRegistry.fill(HIST("AnalysisQA/Reso/Daughter1/Phi"), track.phi()); - } - } - // select daugher 2 - if (track.sign() == ConfDaughterCharge.value[1] && track.pt() <= ConfDaughterPtUp.value[1] && track.pt() >= ConfDaughterPtLow.value[1] && std::abs(track.eta()) <= ConfDaughterEta.value[1] && std::abs(track.dcaXY()) <= ConfDaughterDCAxy.value[1] && std::abs(track.dcaZ()) <= ConfDaughterDCAz.value[1] && track.tpcNClsCrossedRows() >= ConfDaughterNCrossed.value[1] && track.tpcNClsFound() >= ConfDaughterNClus.value[1] && track.tpcCrossedRowsOverFindableCls() >= ConfDaughterTPCfCls.value[1]) { - if ((track.tpcInnerParam() < ConfDaughterPTPCThr.value[1] && std::abs(o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[1], track)) <= ConfDaughterPIDnSigmaMax.value[1]) || - (track.tpcInnerParam() >= ConfDaughterPTPCThr.value[1] && std::abs(std::sqrt(o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[1], track) * o2::aod::pidutils::tpcNSigma(ConfDaughterPIDspecies.value[1], track) + o2::aod::pidutils::tofNSigma(ConfDaughterPIDspecies.value[1], track) * o2::aod::pidutils::tofNSigma(ConfDaughterPIDspecies.value[1], track))) <= ConfDaughterPIDnSigmaMax.value[1])) { - Daughter2.push_back(track); - ResoRegistry.fill(HIST("AnalysisQA/Reso/Daughter2/Pt"), track.pt()); - ResoRegistry.fill(HIST("AnalysisQA/Reso/Daughter2/Eta"), track.eta()); - ResoRegistry.fill(HIST("AnalysisQA/Reso/Daughter2/Phi"), track.phi()); - } - } - } - } - - if (ConfIsActivateV0.value) { - for (auto& v0 : fullV0s) { - - auto postrack = v0.template posTrack_as(); - auto negtrack = v0.template negTrack_as(); - ///\tocheck funnily enough if we apply the filter the - /// sign of Pos and Neg track is always negative - // const auto dcaXYpos = postrack.dcaXY(); - // const auto dcaZpos = postrack.dcaZ(); - // const auto dcapos = std::sqrt(pow(dcaXYpos, 2.) + pow(dcaZpos, 2.)); - v0Cuts.fillQA<0, aod::femtodreamparticle::ParticleType::kV0, aod::femtodreamparticle::ParticleType::kV0Child>(col, v0, postrack, negtrack); ///\todo fill QA also for daughters - v0Cuts.fillLambdaQA(col, v0, postrack, negtrack); - - if (!v0Cuts.isSelectedMinimal(col, v0, postrack, negtrack)) { - continue; - } - - // if (ConfRejectITSHitandTOFMissing) { - // Uncomment only when TOF timing is solved - // bool itsHit = o2PhysicsTrackSelection->IsSelected(postrack, - // TrackSelection::TrackCuts::kITSHits); bool itsHit = - // o2PhysicsTrackSelection->IsSelected(negtrack, - // TrackSelection::TrackCuts::kITSHits); - // } - - v0Cuts.fillQA<1, aod::femtodreamparticle::ParticleType::kV0, aod::femtodreamparticle::ParticleType::kV0Child>(col, v0, postrack, negtrack); ///\todo fill QA also for daughters - auto cutContainerV0 = v0Cuts.getCutContainer(col, v0, postrack, negtrack); - - int postrackID = v0.posTrackId(); - int rowInPrimaryTrackTablePos = -1; - rowInPrimaryTrackTablePos = getRowDaughters(postrackID, tmpIDtrack); - childIDs[0] = rowInPrimaryTrackTablePos; - childIDs[1] = 0; - outputParts(outputCollision.lastIndex(), - v0.positivept(), v0.positiveeta(), v0.positivephi(), - aod::femtodreamparticle::ParticleType::kV0Child, - cutContainerV0.at(femtoDreamV0Selection::V0ContainerPosition::kPosCuts), - cutContainerV0.at(femtoDreamV0Selection::V0ContainerPosition::kPosPID), - postrack.dcaXY(), - childIDs, - 0, - 0); - const int rowOfPosTrack = outputParts.lastIndex(); - if constexpr (isMC) { - fillMCParticle(col, postrack, o2::aod::femtodreamparticle::ParticleType::kV0Child); - } - int negtrackID = v0.negTrackId(); - int rowInPrimaryTrackTableNeg = -1; - rowInPrimaryTrackTableNeg = getRowDaughters(negtrackID, tmpIDtrack); - childIDs[0] = 0; - childIDs[1] = rowInPrimaryTrackTableNeg; - outputParts(outputCollision.lastIndex(), - v0.negativept(), - v0.negativeeta(), - v0.negativephi(), - aod::femtodreamparticle::ParticleType::kV0Child, - cutContainerV0.at(femtoDreamV0Selection::V0ContainerPosition::kNegCuts), - cutContainerV0.at(femtoDreamV0Selection::V0ContainerPosition::kNegPID), - negtrack.dcaXY(), - childIDs, - 0, - 0); - const int rowOfNegTrack = outputParts.lastIndex(); - if constexpr (isMC) { - fillMCParticle(col, negtrack, o2::aod::femtodreamparticle::ParticleType::kV0Child); - } - std::vector indexChildID = {rowOfPosTrack, rowOfNegTrack}; - outputParts(outputCollision.lastIndex(), - v0.pt(), - v0.eta(), - v0.phi(), - aod::femtodreamparticle::ParticleType::kV0, - cutContainerV0.at(femtoDreamV0Selection::V0ContainerPosition::kV0), - 0, - v0.v0cosPA(), - indexChildID, - v0.mLambda(), - v0.mAntiLambda()); - if (ConfIsDebug.value) { - fillDebugParticle(postrack); // QA for positive daughter - fillDebugParticle(negtrack); // QA for negative daughter - fillDebugParticle(v0); // QA for v0 - } - if constexpr (isMC) { - fillMCParticle(col, v0, o2::aod::femtodreamparticle::ParticleType::kV0); - } - } - } - - if (ConfIsActivateReso.value) { - for (std::size_t iDaug1 = 0; iDaug1 < Daughter1.size(); ++iDaug1) { - for (std::size_t iDaug2 = 0; iDaug2 < Daughter2.size(); ++iDaug2) { - // MC stuff is still missing, also V0 QA - // ALSO: fix indices and other table entries which are now set to 0 as deflaut as not needed for p-p-phi cf ana - - ROOT::Math::PtEtaPhiMVector tempD1(Daughter1.at(iDaug1).pt(), Daughter1.at(iDaug1).eta(), Daughter1.at(iDaug1).phi(), ConfDaug1Daugh2ResoMass.value[0]); - ROOT::Math::PtEtaPhiMVector tempD2(Daughter2.at(iDaug2).pt(), Daughter2.at(iDaug2).eta(), Daughter2.at(iDaug2).phi(), ConfDaug1Daugh2ResoMass.value[1]); - - ROOT::Math::PtEtaPhiMVector tempPhi = tempD1 + tempD2; - - ResoRegistry.fill(HIST("AnalysisQA/Reso/InvMass"), tempPhi.M()); - - if ((tempPhi.M() >= ConfResoInvMassLowLimit.value) && (tempPhi.M() <= ConfResoInvMassUpLimit.value)) { - - ResoRegistry.fill(HIST("AnalysisQA/Reso/InvMass_selected"), tempPhi.M()); - ResoRegistry.fill(HIST("AnalysisQA/Reso/PtD1_selected"), Daughter1.at(iDaug1).pt()); - ResoRegistry.fill(HIST("AnalysisQA/Reso/PtD2_selected"), Daughter2.at(iDaug2).pt()); - - childIDs[0] = 0; - childIDs[1] = 0; - std::vector indexChildID = {0, 0}; - outputParts(outputCollision.lastIndex(), - static_cast(Daughter1.at(iDaug1).pt()), static_cast(Daughter1.at(iDaug1).eta()), static_cast(Daughter1.at(iDaug1).phi()), - aod::femtodreamparticle::ParticleType::kV0Child, - static_cast(0), - static_cast(0), - static_cast(Daughter1.at(iDaug1).dcaXY()), - childIDs, - 0, - 0); - outputParts(outputCollision.lastIndex(), - static_cast(Daughter2.at(iDaug2).pt()), static_cast(Daughter2.at(iDaug2).eta()), static_cast(Daughter2.at(iDaug2).phi()), - aod::femtodreamparticle::ParticleType::kV0Child, - static_cast(0), - static_cast(0), - static_cast(Daughter2.at(iDaug2).dcaXY()), - childIDs, - 0, - 0); - outputParts(outputCollision.lastIndex(), - static_cast(tempPhi.pt()), - static_cast(tempPhi.eta()), - static_cast(tempPhi.phi()), - aod::femtodreamparticle::ParticleType::kV0, - static_cast(0), - 0, - 0.f, - indexChildID, - tempPhi.M(), - tempPhi.M()); - if (ConfIsDebug.value) { - fillDebugParticle(Daughter1.at(iDaug1)); // QA for positive daughter - fillDebugParticle(Daughter2.at(iDaug2)); // QA for negative daughter - outputDebugParts(-999., // sign - -999., -999., -999., -999., -999., -999., -999., -999., -999., // track properties (DCA, NCls, crossed rows, etc.) - -999., -999., -999., -999., -999., -999., -999., -999., // TPC PID (TPC signal + particle hypothesis) - -999., -999., -999., -999., -999., -999., -999., // TOF PID - -999., -999., -999., -999., -999., -999., -999., -999., // ITS PID - -999., -999., -999., -999., -999., -999., // V0 properties - -999., -999., -999., -999., -999., -999., -999.); // Cascade properties - } - } - } - } - } - } - - void - processData(aod::FemtoFullCollision const& col, - aod::BCsWithTimestamps const&, - aod::FemtoFullTracks const& tracks, - o2::aod::V0Datas const& fullV0s) - { - // get magnetic field for run - initCCDB_Mag_Trig(col.bc_as()); - // fill the tables - auto tracksWithItsPid = soa::Attach(tracks); - if (ConfUseItsPid.value) { - fillCollisionsAndTracksAndV0(col, tracks, tracksWithItsPid, fullV0s); - } else { - fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); - } - } - PROCESS_SWITCH(femtoDreamProducerTask, processData, - "Provide experimental data", true); - - void - processData_noCentrality(aod::FemtoFullCollision_noCent const& col, - aod::BCsWithTimestamps const&, - aod::FemtoFullTracks const& tracks, - o2::aod::V0Datas const& fullV0s) - { - // get magnetic field for run - initCCDB_Mag_Trig(col.bc_as()); - // fill the tables - auto tracksWithItsPid = soa::Attach(tracks); - if (ConfUseItsPid.value) { - fillCollisionsAndTracksAndV0(col, tracks, tracksWithItsPid, fullV0s); - } else { - fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); - } - } - PROCESS_SWITCH(femtoDreamProducerTask, processData_noCentrality, - "Provide experimental data without centrality information", false); - - void processData_CentPbPb(aod::FemtoFullCollision_CentPbPb const& col, - aod::BCsWithTimestamps const&, - aod::FemtoFullTracks const& tracks, - o2::aod::V0Datas const& fullV0s) - { - // get magnetic field for run - initCCDB_Mag_Trig(col.bc_as()); - // fill the tables - auto tracksWithItsPid = soa::Attach(tracks); - if (ConfUseItsPid.value) { - fillCollisionsAndTracksAndV0(col, tracks, tracksWithItsPid, fullV0s); - } else { - fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); - } - } - PROCESS_SWITCH(femtoDreamProducerTask, processData_CentPbPb, - "Provide experimental data with centrality information for PbPb collisions", false); - - void processMC(aod::FemtoFullCollisionMC const& col, - aod::BCsWithTimestamps const&, - soa::Join const& tracks, - aod::FemtoFullMCgenCollisions const&, - aod::McParticles const&, - soa::Join const& fullV0s) /// \todo with FilteredFullV0s - { - // get magnetic field for run - initCCDB_Mag_Trig(col.bc_as()); - // fill the tables - fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); - } - PROCESS_SWITCH(femtoDreamProducerTask, processMC, "Provide MC data", false); - - void processMC_noCentrality(aod::FemtoFullCollision_noCent_MC const& col, - aod::BCsWithTimestamps const&, - soa::Join const& tracks, - aod::FemtoFullMCgenCollisions const&, - aod::McParticles const&, - soa::Join const& fullV0s) /// \todo with FilteredFullV0s - { - // get magnetic field for run - initCCDB_Mag_Trig(col.bc_as()); - // fill the tables - fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); - } - PROCESS_SWITCH(femtoDreamProducerTask, processMC_noCentrality, "Provide MC data without requiring a centrality calibration", false); - - void processMC_CentPbPb(aod::FemtoFullCollisionMC_CentPbPb const& col, - aod::BCsWithTimestamps const&, - soa::Join const& tracks, - aod::FemtoFullMCgenCollisions const&, - aod::McParticles const&, - soa::Join const& fullV0s) /// \todo with FilteredFullV0s - { - // get magnetic field for run - initCCDB_Mag_Trig(col.bc_as()); - // fill the tables - fillCollisionsAndTracksAndV0(col, tracks, tracks, fullV0s); - } - PROCESS_SWITCH(femtoDreamProducerTask, processMC_CentPbPb, "Provide MC data with centrality information for PbPb collisions", false); -}; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; - return workflow; -} From d44ae0819e0da3cee877496fec1638a8f4d47631 Mon Sep 17 00:00:00 2001 From: georgios Date: Wed, 27 Aug 2025 07:03:34 +0200 Subject: [PATCH 3/9] Fix runtime bugs for cascade-casdcade: - Added OmegaMinus PDG code in the histogram class - Added naming scheme for Cascade-Cascade daughters - Some other small fixes --- .../FemtoDream/Core/femtoDreamParticleHisto.h | 4 +- PWGCF/FemtoDream/Core/femtoDreamUtils.h | 6 +- .../femtoDreamPairTaskCascadeCascade.cxx | 456 +++++++++--------- 3 files changed, 239 insertions(+), 227 deletions(-) diff --git a/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h b/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h index 4148e8b3efc..be7786bf282 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h +++ b/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h @@ -693,7 +693,9 @@ class FemtoDreamParticleHisto HistogramRegistry* mHistogramRegistry; ///< For QA output static constexpr o2::aod::femtodreamparticle::ParticleType mParticleType = particleType; ///< Type of the particle under analysis static constexpr int mFolderSuffixType = suffixType; ///< Counter for the folder suffix specified below - static constexpr std::string_view mFolderSuffix[9] = {"", "_one", "_two", "_pos", "_neg", "_allSelected", "_allSelected_pos", "_allSelected_neg", "_bach"}; ///< Suffix for the folder name in case of analyses of pairs of the same kind (T-T, V-V, C-C) + static constexpr std::string_view mFolderSuffix[12] = {"", "_one", "_two", "_pos", "_neg", + "_allSelected", "_allSelected_pos", "_allSelected_neg", "_bach", + "_two_pos", "_two_neg", "_two_bach"}; ///< Suffix for the folder name in case of analyses of pairs of the same kind (T-T, V-V, C-C) int mPDG = 0; ///< PDG code of the selected particle }; } // namespace o2::analysis::femtoDream diff --git a/PWGCF/FemtoDream/Core/femtoDreamUtils.h b/PWGCF/FemtoDream/Core/femtoDreamUtils.h index f9bb60633f3..252e11d82d1 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamUtils.h +++ b/PWGCF/FemtoDream/Core/femtoDreamUtils.h @@ -67,8 +67,12 @@ inline float getMass(int pdgCode) case o2::constants::physics::Pdg::kHelium3: mass = o2::constants::physics::MassHelium3; break; + //case o2::constants::physics::Pdg::kOmegaMinus: + case kOmegaMinus: + mass = o2::constants::physics::MassOmegaMinus; + break; default: - LOG(fatal) << "PDG code is not suppored"; + LOG(fatal) << "PDG code is not supported"; } return mass; } diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx index 0d4beadd521..d0c8b15cf94 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx @@ -8,7 +8,9 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \authors Andi Mathis, Anton Riedel, Georgios Mantzaridis, Oton Vazquez Doce. +/// \file femtoDreamPairTaskCascadeCascade.cxx +/// \brief Tasks that reads the track tables used for the pairing and builds pairs of two cascades +/// \author Andi Mathis, Anton Riedel, Georgios Mantzaridis, Oton Vazquez Doce. #include #include #include @@ -32,41 +34,42 @@ using namespace o2::soa; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::analysis::femtoDream; -struct femtoDreamPairTaskCascadeCascade { +struct FemtoDreamPairTaskCascadeCascade { SliceCache cache; Preslice perCol = aod::femtodreamparticle::fdCollisionId; /// General options struct : ConfigurableGroup { std::string prefix = std::string("Option"); - Configurable IsMC{"IsMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"}; - Configurable Use4D{"Use4D", false, "Enable four dimensional histogramms (to be used only for analysis with high statistics): k* vs multiplicity vs multiplicity percentil vs mT"}; - Configurable ExtendedPlots{"ExtendedPlots", false, "Enable additional three dimensional histogramms. High memory consumption. Use for debugging"}; - Configurable HighkstarCut{"HighkstarCut", -1., "Set a cut for high k*, above which the pairs are rejected. Set it to -1 to deactivate it"}; - Configurable CPROn{"CPROn", true, "Close Pair Rejection"}; - Configurable CPROld{"CPROld", false, "Set to FALSE to use fixed version of CPR (for testing now, will be default soon)"}; - Configurable CPRPlotPerRadii{"CPRPlotPerRadii", false, "Plot CPR per radii"}; - Configurable CPRdeltaPhiMax{"CPRdeltaPhiMax", 0.01, "Max. Delta Phi for Close Pair Rejection"}; - Configurable CPRdeltaEtaMax{"CPRdeltaEtaMax", 0.01, "Max. Delta Eta for Close Pair Rejection"}; - Configurable DCACutPtDep{"DCACutPtDep", false, "Use pt dependent dca cut"}; - Configurable MixEventWithPairs{"MixEventWithPairs", false, "Only use events that contain particle 1 and partile 2 for the event mixing"}; + Configurable sameSpecies{"sameSpecies", false, "Set to true if particle 1 and particle 2 are the same species"}; + Configurable isMC{"isMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"}; + Configurable use4D{"use4D", false, "Enable four dimensional histogramms (to be used only for analysis with high statistics): k* vs multiplicity vs multiplicity percentil vs mT"}; + Configurable extendedPlots{"extendedPlots", false, "Enable additional three dimensional histogramms. High memory consumption. Use for debugging"}; + Configurable highkstarCut{"highkstarCut", -1., "Set a cut for high k*, above which the pairs are rejected. Set it to -1 to deactivate it"}; + Configurable cprOn{"cprOn", true, "Close Pair Rejection"}; + Configurable cprOld{"cprOld", false, "Set to FALSE to use fixed version of CPR (for testing now, will be default soon)"}; + Configurable cprPlotPerRadii{"cprPlotPerRadii", false, "Plot CPR per radii"}; + Configurable cprDeltaPhiMax{"cprDeltaPhiMax", 0.01, "Max. Delta Phi for Close Pair Rejection"}; + Configurable cprDeltaEtaMax{"cprDeltaEtaMax", 0.01, "Max. Delta Eta for Close Pair Rejection"}; + Configurable dcaCutPtDep{"dcaCutPtDep", false, "Use pt dependent dca cut"}; + Configurable mixEventWithPairs{"mixEventWithPairs", false, "Only use events that contain particle 1 and partile 2 for the event mixing"}; Configurable smearingByOrigin{"smearingByOrigin", false, "Obtain the smearing matrix differential in the MC origin of particle 1 and particle 2. High memory consumption. Use with care!"}; - ConfigurableAxis Dummy{"Dummy", {1, 0, 1}, "Dummy axis"}; + ConfigurableAxis dummy{"dummy", {1, 0, 1}, "dummy axis"}; } Option; /// Event selection struct : ConfigurableGroup { std::string prefix = std::string("EventSel"); - Configurable MultMin{"MultMin", 0, "Minimum Multiplicity (MultNtr)"}; - Configurable MultMax{"MultMax", 99999, "Maximum Multiplicity (MultNtr)"}; - Configurable MultPercentileMin{"MultPercentileMin", 0, "Minimum Multiplicity Percentile"}; - Configurable MultPercentileMax{"MultPercentileMax", 100, "Maximum Multiplicity Percentile"}; + Configurable multMin{"multMin", 0, "Minimum Multiplicity (MultNtr)"}; + Configurable multMax{"multMax", 99999, "Maximum Multiplicity (MultNtr)"}; + Configurable multPercentileMin{"multPercentileMin", 0, "Minimum Multiplicity Percentile"}; + Configurable multPercentileMax{"multPercentileMax", 100, "Maximum Multiplicity Percentile"}; } EventSel; - // Filter EventMultiplicity = aod::femtodreamcollision::multNtr >= EventSel.MultMin && aod::femtodreamcollision::multNtr <= EventSel.MultMax; - // Filter EventMultiplicityPercentile = aod::femtodreamcollision::multV0M >= EventSel.MultPercentileMin && aod::femtodreamcollision::multV0M <= EventSel.MultPercentileMax; + // Filter EventMultiplicity = aod::femtodreamcollision::multNtr >= EventSel.multMin && aod::femtodreamcollision::multNtr <= EventSel.multMax; + // Filter EventMultiplicityPercentile = aod::femtodreamcollision::multV0M >= EventSel.multPercentileMin && aod::femtodreamcollision::multV0M <= EventSel.multPercentileMax; /// Histogramming for Event @@ -76,49 +79,49 @@ struct femtoDreamPairTaskCascadeCascade { using FilteredCollision = FilteredCollisions::iterator; using FDMCParts = soa::Join; using FDMCPart = FDMCParts::iterator; - femtodreamcollision::BitMaskType BitMask = 1; //??????????????????? + femtodreamcollision::BitMaskType bitMask = 1; //??????????????????? /// Cascade 1 (Cascade) struct : ConfigurableGroup { std::string prefix = std::string("Cascade1"); - Configurable PDGCode{"PDGCode", 3334, "PDG code of Particle 1 (Cascade)"}; - Configurable CutBit{"CutBit", 5542474, "Particle 1 (Cascade) - Selection bit from cutCulator"}; - Configurable ChildPos_CutBit{"ChildPos_CutBit", 278, "Selection bit for positive child of Cascade"}; - Configurable ChildPos_TPCBit{"ChildPos_TPCBit", 1024, "PID TPC bit for positive child of Cascade"}; - Configurable ChildNeg_CutBit{"ChildNeg_CutBit", 277, "Selection bit for negative child of Cascade"}; - Configurable ChildNeg_TPCBit{"ChildNeg_TPCBit", 4096, "PID TPC bit for negative child of Cascade"}; - Configurable ChildBach_CutBit{"ChildBach_CutBit", 277, "Selection bit for bachelor child of Cascade"}; - Configurable ChildBach_TPCBit{"ChildBach_TPCBit", 64, "PID TPC bit for bachelor child of Cascade"}; - - - Configurable InvMassMin{"InvMassMin", 1.6, "Minimum invariant mass of Partricle 1 (Cascade)"}; - Configurable InvMassMax{"InvMassMax", 1.8, "Maximum invariant mass of Partricle 1 (Cascade)"}; - Configurable InvMassV0DaughMin{"InvMassV0DaugMin", 0., "Minimum invariant mass of the V0 Daughter"}; - Configurable InvMassV0DaughMax{"InvMassV0DaugMax", 999., "Maximum invariant mass of the V0 Daughter"}; - Configurable PtMin{"PtMin", 0., "Minimum pT of Particle 2 (Cascade)"}; - Configurable PtMax{"PtMax", 999., "Maximum pT of Particle 2 (Cascade)"}; - Configurable EtaMin{"EtaMin", -10., "Minimum eta of Particle 2 (Cascade)"}; - Configurable EtaMax{"EtaMax", 10., "Maximum eta of Particle 2 (Cascade)"}; - Configurable UseChildCuts{"UseChildCuts", true, "Use cuts on the children of the Cascades additional to those of the selection of the cascade builder (for debugging purposes)"}; - Configurable UseChildPIDCuts{"UseChildPIDCuts", true, "Use PID cuts on the children of the Cascades additional to those of the selection of the cascade builder (for debugging purposes)"}; + Configurable pdgCode{"pdgCode", 3334, "PDG code of Particle 1 (Cascade)"}; + Configurable cutBit{"cutBit", 5542474, "Particle 1 (Cascade) - Selection bit from cutCulator"}; + Configurable childPosCutBit{"childPosCutBit", 278, "Selection bit for positive child of Cascade"}; + Configurable childPosTPCBit{"childPosTPCBit", 1024, "PID TPC bit for positive child of Cascade"}; + Configurable childNegCutBit{"childNegCutBit", 277, "Selection bit for negative child of Cascade"}; + Configurable childNegTPCBit{"childNegTPCBit", 4096, "PID TPC bit for negative child of Cascade"}; + Configurable childBachCutBit{"childBachCutBit", 277, "Selection bit for bachelor child of Cascade"}; + Configurable childBachTPCBit{"childBachTPCBit", 64, "PID TPC bit for bachelor child of Cascade"}; + + + Configurable invMassMin{"invMassMin", 1.6, "Minimum invariant mass of Partricle 1 (Cascade)"}; + Configurable invMassMax{"invMassMax", 1.8, "Maximum invariant mass of Partricle 1 (Cascade)"}; + Configurable invMassV0DaughMin{"invMassV0DaughMin", 0., "Minimum invariant mass of the V0 Daughter"}; + Configurable invMassV0DaughMax{"invMassV0DaughMax", 999., "Maximum invariant mass of the V0 Daughter"}; + Configurable ptMin{"ptMin", 0., "Minimum pT of Particle 2 (Cascade)"}; + Configurable ptMax{"ptMax", 999., "Maximum pT of Particle 2 (Cascade)"}; + Configurable etaMin{"etaMin", -10., "Minimum eta of Particle 2 (Cascade)"}; + Configurable etaMax{"etaMax", 10., "Maximum eta of Particle 2 (Cascade)"}; + Configurable useChildCuts{"useChildCuts", true, "Use cuts on the children of the Cascades additional to those of the selection of the cascade builder (for debugging purposes)"}; + Configurable useChildPIDCuts{"useChildPIDCuts", true, "Use PID cuts on the children of the Cascades additional to those of the selection of the cascade builder (for debugging purposes)"}; } Cascade1; /// Partition for particle 1 - Partition PartitionCascade1 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kCascade)) && - ((aod::femtodreamparticle::cut & Cascade1.CutBit) == Cascade1.CutBit) && - (aod::femtodreamparticle::pt > Cascade1.PtMin) && - (aod::femtodreamparticle::pt < Cascade1.PtMax) && - (aod::femtodreamparticle::eta > Cascade1.EtaMin) && - (aod::femtodreamparticle::eta < Cascade1.EtaMax) && - (aod::femtodreamparticle::mLambda > Cascade1.InvMassMin) && - (aod::femtodreamparticle::mLambda < Cascade1.InvMassMax) && - (aod::femtodreamparticle::mAntiLambda > Cascade1.InvMassV0DaughMin) && - (aod::femtodreamparticle::mAntiLambda < Cascade1.InvMassV0DaughMax); + Partition partitionCascade1 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kCascade)) && + ((aod::femtodreamparticle::cut & Cascade1.cutBit) == Cascade1.cutBit) && + (aod::femtodreamparticle::pt > Cascade1.ptMin) && + (aod::femtodreamparticle::pt < Cascade1.ptMax) && + (aod::femtodreamparticle::eta > Cascade1.etaMin) && + (aod::femtodreamparticle::eta < Cascade1.etaMax) && + (aod::femtodreamparticle::mLambda > Cascade1.invMassMin) && + (aod::femtodreamparticle::mLambda < Cascade1.invMassMax) && + (aod::femtodreamparticle::mAntiLambda > Cascade1.invMassV0DaughMin) && + (aod::femtodreamparticle::mAntiLambda < Cascade1.invMassV0DaughMax); /// Histogramming for particle 1 - FemtoDreamParticleHisto CascHistoPartOne; + FemtoDreamParticleHisto cascHistoPartOne; FemtoDreamParticleHisto posChildHistosPartOne; FemtoDreamParticleHisto negChildHistosPartOne; FemtoDreamParticleHisto bachChildHistosPartOne; @@ -128,53 +131,53 @@ struct femtoDreamPairTaskCascadeCascade { /// Particle 2 (Cascade) struct : ConfigurableGroup { std::string prefix = std::string("Cascade2"); - Configurable PDGCode{"PDGCode", 3334, "PDG code of particle 2 (Cascade)"}; - Configurable CutBit{"CutBit", 32221874, "Selection bit for particle 2 (Cascade)"}; - Configurable ChildPos_CutBit{"ChildPos_CutBit", 278, "Selection bit for positive child of Cascade"}; - Configurable ChildPos_TPCBit{"ChildPos_TPCBit", 1024, "PID TPC bit for positive child of Cascade"}; - Configurable ChildNeg_CutBit{"ChildNeg_CutBit", 277, "Selection bit for negative child of Cascade"}; - Configurable ChildNeg_TPCBit{"ChildNeg_TPCBit", 4096, "PID TPC bit for negative child of Cascade"}; - Configurable ChildBach_CutBit{"ChildBach_CutBit", 277, "Selection bit for negative child of Cascade"}; - Configurable ChildBach_TPCBit{"ChildBach_TPCBit", 64, "PID TPC bit for bachelor child of Cascade"}; - Configurable InvMassMin{"InvMassMin", 1.2, "Minimum invariant mass of Particle 2 (Cascade)"}; - Configurable InvMassMax{"InvMassMax", 1.4, "Maximum invariant mass of Particle 2 (Cascade)"}; - Configurable InvMassV0DaughMin{"InvMassV0DaugMin", 0., "Minimum invariant mass of the V0 Daughter"}; // (???????) - Configurable InvMassV0DaughMax{"InvMassV0DaugMax", 999., "Maximum invariant mass of the V0 Daughter"}; // (???????) - Configurable PtMin{"PtMin", 0., "Minimum pT of Particle 2 (Cascade)"}; - Configurable PtMax{"PtMax", 999., "Maximum pT of Particle 2 (Cascade)"}; - Configurable EtaMin{"EtaMin", -10., "Minimum eta of Particle 2 (Cascade)"}; - Configurable EtaMax{"EtaMax", 10., "Maximum eta of Particle 2 (Cascade)"}; - Configurable UseChildCuts{"UseChildCuts", true, "Use cuts on the children of the Cascades additional to those of the selection of the cascade builder (for debugging purposes)"}; - Configurable UseChildPIDCuts{"UseChildPIDCuts", true, "Use PID cuts on the children of the Cascades additional to those of the selection of the cascade builder (for debugging purposes)"}; + Configurable pdgCode{"pdgCode", 3334, "PDG code of particle 2 (Cascade)"}; + Configurable cutBit{"cutBit", 32221874, "Selection bit for particle 2 (Cascade)"}; + Configurable childPosCutBit{"childPosCutBit", 278, "Selection bit for positive child of Cascade"}; + Configurable childPosTPCBit{"childPosTPCBit", 1024, "PID TPC bit for positive child of Cascade"}; + Configurable childNegCutBit{"childNegCutBit", 277, "Selection bit for negative child of Cascade"}; + Configurable childNegTPCBit{"childNegTPCBit", 4096, "PID TPC bit for negative child of Cascade"}; + Configurable childBachCutBit{"childBachCutBit", 277, "Selection bit for negative child of Cascade"}; + Configurable childBachTPCBit{"childBachTPCBit", 64, "PID TPC bit for bachelor child of Cascade"}; + Configurable invMassMin{"invMassMin", 1.2, "Minimum invariant mass of Particle 2 (Cascade)"}; + Configurable invMassMax{"invMassMax", 1.4, "Maximum invariant mass of Particle 2 (Cascade)"}; + Configurable invMassV0DaughMin{"invMassV0DaughMin", 0., "Minimum invariant mass of the V0 Daughter"}; // (???????) + Configurable invMassV0DaughMax{"invMassV0DaughMax", 999., "Maximum invariant mass of the V0 Daughter"}; // (???????) + Configurable ptMin{"ptMin", 0., "Minimum pT of Particle 2 (Cascade)"}; + Configurable ptMax{"ptMax", 999., "Maximum pT of Particle 2 (Cascade)"}; + Configurable etaMin{"etaMin", -10., "Minimum eta of Particle 2 (Cascade)"}; + Configurable etaMax{"etaMax", 10., "Maximum eta of Particle 2 (Cascade)"}; + Configurable useChildCuts{"useChildCuts", true, "Use cuts on the children of the Cascades additional to those of the selection of the cascade builder (for debugging purposes)"}; + Configurable useChildPIDCuts{"useChildPIDCuts", true, "Use PID cuts on the children of the Cascades additional to those of the selection of the cascade builder (for debugging purposes)"}; } Cascade2; /// Partition for particle 2 - Partition PartitionCascade2 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kCascade)) && - ((aod::femtodreamparticle::cut & Cascade2.CutBit) == Cascade2.CutBit) && - (aod::femtodreamparticle::pt > Cascade2.PtMin) && - (aod::femtodreamparticle::pt < Cascade2.PtMax) && - (aod::femtodreamparticle::eta > Cascade2.EtaMin) && - (aod::femtodreamparticle::eta < Cascade2.EtaMax) && - (aod::femtodreamparticle::mLambda > Cascade2.InvMassMin) && - (aod::femtodreamparticle::mLambda < Cascade2.InvMassMax) && - (aod::femtodreamparticle::mAntiLambda > Cascade2.InvMassV0DaughMin) && - (aod::femtodreamparticle::mAntiLambda < Cascade2.InvMassV0DaughMax); + Partition partitionCascade2 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kCascade)) && + ((aod::femtodreamparticle::cut & Cascade2.cutBit) == Cascade2.cutBit) && + (aod::femtodreamparticle::pt > Cascade2.ptMin) && + (aod::femtodreamparticle::pt < Cascade2.ptMax) && + (aod::femtodreamparticle::eta > Cascade2.etaMin) && + (aod::femtodreamparticle::eta < Cascade2.etaMax) && + (aod::femtodreamparticle::mLambda > Cascade2.invMassMin) && + (aod::femtodreamparticle::mLambda < Cascade2.invMassMax) && + (aod::femtodreamparticle::mAntiLambda > Cascade2.invMassV0DaughMin) && + (aod::femtodreamparticle::mAntiLambda < Cascade2.invMassV0DaughMax); /// Histogramming for particle 2 - FemtoDreamParticleHisto CascHistoPartTwo; - FemtoDreamParticleHisto posChildHistosPartTwo; - FemtoDreamParticleHisto negChildHistosPartTwo; - FemtoDreamParticleHisto bachChildHistosPartTwo; + FemtoDreamParticleHisto cascHistoPartTwo; + FemtoDreamParticleHisto posChildHistosPartTwo; + FemtoDreamParticleHisto negChildHistosPartTwo; + FemtoDreamParticleHisto bachChildHistosPartTwo; /// Binning configurables struct : ConfigurableGroup { std::string prefix = std::string("Binning"); - ConfigurableAxis TempFitVarCascade{"TempFitVarCascade", {300, 0.9, 1}, "binning of the TempFitVar in the pT vs. TempFitVar plot (Cascade)"}; - ConfigurableAxis TempFitVarCascadeChild{"TempFitVarCascadeChild", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot (Cascade child)"}; - ConfigurableAxis InvMass{"InvMass", {200, 1.22, 1.42}, "InvMass binning"}; + ConfigurableAxis tempFitVarCascade{"tempFitVarCascade", {300, 0.9, 1}, "binning of the TempFitVar in the pT vs. TempFitVar plot (Cascade)"}; + ConfigurableAxis tempFitVarCascadeChild{"tempFitVarCascadeChild", {300, -0.15, 0.15}, "binning of the TempFitVar in the pT vs. TempFitVar plot (Cascade child)"}; + ConfigurableAxis invMass{"invMass", {200, 1.22, 1.42}, "invMass binning"}; ConfigurableAxis pTCascade{"pTCascade", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot (Cascade)"}; ConfigurableAxis pTCascadeChild{"pTCascadeChild", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot (Cascade)"}; ConfigurableAxis pT{"pT", {20, 0.5, 4.05}, "pT binning"}; @@ -187,7 +190,7 @@ struct femtoDreamPairTaskCascadeCascade { std::string prefix = std::string("Binning4D"); ConfigurableAxis kstar{"kstar", {1500, 0., 6.}, "binning kstar for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true in order to use)"}; ConfigurableAxis mT{"mT", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT Binning for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true in order to use)"}; - ConfigurableAxis Mult{"mult", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f}, "multiplicity Binning for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true in order to use)"}; + ConfigurableAxis mult{"mult", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f}, "multiplicity Binning for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true in order to use)"}; ConfigurableAxis multPercentile{"multPercentile", {10, 0.0f, 100.0f}, "multiplicity percentile Binning for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true in order to use)"}; } Binning4D; @@ -196,15 +199,15 @@ struct femtoDreamPairTaskCascadeCascade { // Mixing configurables struct : ConfigurableGroup { std::string prefix = std::string("Mixing"); - ConfigurableAxis BinMult{"BinMult", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f}, "bins - multiplicity"}; - ConfigurableAxis BinMultPercentile{"BinMultPercentile", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f}, "bins - multiplicity percentile"}; - ConfigurableAxis BinVztx{"BinVztx", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "bins - z-vertex"}; - Configurable Depth{"Depth", 5, "Number of events for mixing"}; - Configurable Policy{"BinPolicy", 0, "Binning policy for mixing - 0: multiplicity, 1: multipliciy percentile, 2: both"}; + ConfigurableAxis binMult{"binMult", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f}, "bins - multiplicity"}; + ConfigurableAxis binMultPercentile{"binMultPercentile", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f}, "bins - multiplicity percentile"}; + ConfigurableAxis binVztx{"binVztx", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "bins - z-vertex"}; + Configurable depth{"depth", 5, "Number of events for mixing"}; + Configurable binPolicy{"binPolicy", 0, "Binning binPolicy for mixing - 0: multiplicity, 1: multipliciy percentile, 2: both"}; } Mixing; - ColumnBinningPolicy colBinningMult{{Mixing.BinVztx, Mixing.BinMult}, true}; - ColumnBinningPolicy colBinningMultPercentile{{Mixing.BinVztx, Mixing.BinMultPercentile}, true}; - ColumnBinningPolicy colBinningMultMultPercentile{{Mixing.BinVztx, Mixing.BinMult, Mixing.BinMultPercentile}, true}; + ColumnBinningPolicy colBinningMult{{Mixing.binVztx, Mixing.binMult}, true}; + ColumnBinningPolicy colBinningMultPercentile{{Mixing.binVztx, Mixing.binMultPercentile}, true}; + ColumnBinningPolicy colBinningMultMultPercentile{{Mixing.binVztx, Mixing.binMult, Mixing.binMultPercentile}, true}; FemtoDreamContainer sameEventCont; FemtoDreamContainer mixedEventCont; FemtoDreamPairCleaner pairCleaner; @@ -216,57 +219,58 @@ struct femtoDreamPairTaskCascadeCascade { /// Histogram output - HistogramRegistry Registry{"Output", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry registry{"Output", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(InitContext&) { - // setup binnnig policy for mixing - colBinningMult = {{Mixing.BinVztx, Mixing.BinMult}, true}; - colBinningMultPercentile = {{Mixing.BinVztx, Mixing.BinMultPercentile}, true}; - colBinningMultMultPercentile = {{Mixing.BinVztx, Mixing.BinMult, Mixing.BinMultPercentile}, true}; - eventHisto.init(&Registry, Option.IsMC); - - CascHistoPartOne.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTCascade, Option.Dummy, Option.Dummy, Binning.TempFitVarCascade, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.IsMC, Cascade1.PDGCode); - CascHistoPartTwo.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTCascade, Option.Dummy, Option.Dummy, Binning.TempFitVarCascade, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Binning.InvMass, Option.Dummy, Option.IsMC, Cascade2.PDGCode); - - posChildHistosPartOne.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTCascadeChild, Option.Dummy, Option.Dummy, Binning.TempFitVarCascadeChild, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, false, 0); - negChildHistosPartOne.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTCascadeChild, Option.Dummy, Option.Dummy, Binning.TempFitVarCascadeChild, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, false, 0); - bachChildHistosPartOne.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTCascadeChild, Option.Dummy, Option.Dummy, Binning.TempFitVarCascadeChild, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, false, 0); - - posChildHistosPartTwo.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTCascadeChild, Option.Dummy, Option.Dummy, Binning.TempFitVarCascadeChild, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, false, 0); - negChildHistosPartTwo.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTCascadeChild, Option.Dummy, Option.Dummy, Binning.TempFitVarCascadeChild, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, false, 0); - bachChildHistosPartTwo.init(&Registry, Binning.multTempFit, Option.Dummy, Binning.pTCascadeChild, Option.Dummy, Option.Dummy, Binning.TempFitVarCascadeChild, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, Option.Dummy, false, 0); - - sameEventCont.init(&Registry, - Binning.kstar, Binning.pT, Binning.kT, Binning.mT, Mixing.BinMult, Mixing.BinMultPercentile, - Binning4D.kstar, Binning4D.mT, Binning4D.Mult, Binning4D.multPercentile, - Option.IsMC, Option.Use4D, Option.ExtendedPlots, - Option.HighkstarCut, + // setup binnnig binPolicy for mixing + colBinningMult = {{Mixing.binVztx, Mixing.binMult}, true}; + colBinningMultPercentile = {{Mixing.binVztx, Mixing.binMultPercentile}, true}; + colBinningMultMultPercentile = {{Mixing.binVztx, Mixing.binMult, Mixing.binMultPercentile}, true}; + eventHisto.init(®istry, Option.isMC); + + cascHistoPartOne.init(®istry, Binning.multTempFit, Option.dummy, Binning.pTCascade, Option.dummy, Option.dummy, Binning.tempFitVarCascade, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.isMC, Cascade1.pdgCode); + posChildHistosPartOne.init(®istry, Binning.multTempFit, Option.dummy, Binning.pTCascadeChild, Option.dummy, Option.dummy, Binning.tempFitVarCascadeChild, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, false, 0); + negChildHistosPartOne.init(®istry, Binning.multTempFit, Option.dummy, Binning.pTCascadeChild, Option.dummy, Option.dummy, Binning.tempFitVarCascadeChild, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, false, 0); + bachChildHistosPartOne.init(®istry, Binning.multTempFit, Option.dummy, Binning.pTCascadeChild, Option.dummy, Option.dummy, Binning.tempFitVarCascadeChild, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, false, 0); + + if(!Option.sameSpecies){ + cascHistoPartTwo.init(®istry, Binning.multTempFit, Option.dummy, Binning.pTCascade, Option.dummy, Option.dummy, Binning.tempFitVarCascade, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Binning.invMass, Option.dummy, Option.isMC, Cascade2.pdgCode); + posChildHistosPartTwo.init(®istry, Binning.multTempFit, Option.dummy, Binning.pTCascadeChild, Option.dummy, Option.dummy, Binning.tempFitVarCascadeChild, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, false, 0); + negChildHistosPartTwo.init(®istry, Binning.multTempFit, Option.dummy, Binning.pTCascadeChild, Option.dummy, Option.dummy, Binning.tempFitVarCascadeChild, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, false, 0); + bachChildHistosPartTwo.init(®istry, Binning.multTempFit, Option.dummy, Binning.pTCascadeChild, Option.dummy, Option.dummy, Binning.tempFitVarCascadeChild, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, false, 0); + } + + sameEventCont.init(®istry, + Binning.kstar, Binning.pT, Binning.kT, Binning.mT, Mixing.binMult, Mixing.binMultPercentile, + Binning4D.kstar, Binning4D.mT, Binning4D.mult, Binning4D.multPercentile, + Option.isMC, Option.use4D, Option.extendedPlots, + Option.highkstarCut, Option.smearingByOrigin); - sameEventCont.setPDGCodes(Cascade1.PDGCode, Cascade2.PDGCode); + sameEventCont.setPDGCodes(Cascade1.pdgCode, Cascade2.pdgCode); - mixedEventCont.init(&Registry, - Binning.kstar, Binning.pT, Binning.kT, Binning.mT, Mixing.BinMult, Mixing.BinMultPercentile, - Binning4D.kstar, Binning4D.mT, Binning4D.Mult, Binning4D.multPercentile, - Option.IsMC, Option.Use4D, Option.ExtendedPlots, - Option.HighkstarCut, + mixedEventCont.init(®istry, + Binning.kstar, Binning.pT, Binning.kT, Binning.mT, Mixing.binMult, Mixing.binMultPercentile, + Binning4D.kstar, Binning4D.mT, Binning4D.mult, Binning4D.multPercentile, + Option.isMC, Option.use4D, Option.extendedPlots, + Option.highkstarCut, Option.smearingByOrigin); - mixedEventCont.setPDGCodes(Cascade1.PDGCode, Cascade2.PDGCode); + mixedEventCont.setPDGCodes(Cascade1.pdgCode, Cascade2.pdgCode); - pairCleaner.init(&Registry); - if (Option.CPROn.value) { - pairCloseRejectionSE.init(&Registry, &Registry, Option.CPRdeltaPhiMax.value, Option.CPRdeltaEtaMax.value, Option.CPRPlotPerRadii.value, 1, Option.CPROld.value); - pairCloseRejectionME.init(&Registry, &Registry, Option.CPRdeltaPhiMax.value, Option.CPRdeltaEtaMax.value, Option.CPRPlotPerRadii.value, 2, Option.CPROld.value, 99, true); + pairCleaner.init(®istry); + if (Option.cprOn.value) { + pairCloseRejectionSE.init(®istry, ®istry, Option.cprDeltaPhiMax.value, Option.cprDeltaEtaMax.value, Option.cprPlotPerRadii.value, 1, Option.cprOld.value); + pairCloseRejectionME.init(®istry, ®istry, Option.cprDeltaPhiMax.value, Option.cprDeltaEtaMax.value, Option.cprPlotPerRadii.value, 2, Option.cprOld.value, 99, true); } } /// This function processes the same event and takes care of all the histogramming template - void doSameEvent(PartitionType& SliceCascade1, PartitionType& SliceCascade2, TableTracks const& parts, Collision const& col) + void doSameEvent(PartitionType& sliceCascade1, PartitionType& sliceCascade2, TableTracks const& parts, Collision const& col) { /// Histogramming same event - for (auto const& casc : SliceCascade1) { + for (auto const& casc : sliceCascade1) { const auto& posChild1 = parts.iteratorAt(casc.index() - 3); const auto& negChild1 = parts.iteratorAt(casc.index() - 2); const auto& bachChild1 = parts.iteratorAt(casc.index() - 1); @@ -277,59 +281,61 @@ struct femtoDreamPairTaskCascadeCascade { // auto posChild = v0.template children_as().front(); // auto negChild = v0.template children_as().back(); // check cuts on V0 children - if (Cascade1.UseChildCuts) { - if (!(((posChild1.cut() & Cascade2.ChildPos_CutBit) == Cascade1.ChildPos_CutBit) && - ((negChild1.cut() & Cascade2.ChildNeg_CutBit) == Cascade1.ChildNeg_CutBit) && - ((bachChild1.cut() & Cascade2.ChildBach_CutBit) == Cascade1.ChildBach_CutBit))) { + if (Cascade1.useChildCuts) { + if (!(((posChild1.cut() & Cascade1.childPosCutBit) == Cascade1.childPosCutBit) && + ((negChild1.cut() & Cascade1.childNegCutBit) == Cascade1.childNegCutBit) && + ((bachChild1.cut() & Cascade1.childBachCutBit) == Cascade1.childBachCutBit))) { continue; } } - if (Cascade1.UseChildPIDCuts) { - if (!(((posChild1.pidcut() & Cascade2.ChildPos_TPCBit) == Cascade1.ChildPos_TPCBit) && - ((negChild1.pidcut() & Cascade2.ChildNeg_TPCBit) == Cascade1.ChildNeg_TPCBit) && - ((bachChild1.pidcut() & Cascade2.ChildBach_TPCBit) == Cascade1.ChildBach_TPCBit))) { + if (Cascade1.useChildPIDCuts) { + if (!(((posChild1.pidcut() & Cascade1.childPosTPCBit) == Cascade1.childPosTPCBit) && + ((negChild1.pidcut() & Cascade1.childNegTPCBit) == Cascade1.childNegTPCBit) && + ((bachChild1.pidcut() & Cascade1.childBachTPCBit) == Cascade1.childBachTPCBit))) { continue; } } - CascHistoPartOne.fillQA(casc, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + cascHistoPartOne.fillQA(casc, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); posChildHistosPartOne.fillQA(posChild1, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); negChildHistosPartOne.fillQA(negChild1, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); bachChildHistosPartOne.fillQA(bachChild1, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); } - for (auto& casc : SliceCascade2) { - const auto& posChild2 = parts.iteratorAt(casc.index() - 3); - const auto& negChild2 = parts.iteratorAt(casc.index() - 2); - const auto& bachChild2 = parts.iteratorAt(casc.index() - 1); - // This is how it is supposed to work but there seems to be an issue - // with partitions and accessing elements in tables that have been declared - // with an SELF_INDEX column. Under investigation. Maybe need to change - // femtdream dataformat to take special care of v0 candidates - // auto posChild = v0.template children_as().front(); - // auto negChild = v0.template children_as().back(); - // check cuts on V0 children - if (Cascade2.UseChildCuts) { - if (!(((posChild2.cut() & Cascade2.ChildPos_CutBit) == Cascade2.ChildPos_CutBit) && - ((negChild2.cut() & Cascade2.ChildNeg_CutBit) == Cascade2.ChildNeg_CutBit) && - ((bachChild2.cut() & Cascade2.ChildBach_CutBit) == Cascade2.ChildBach_CutBit))) { - continue; + if(!Option.sameSpecies){ + for (auto const& casc : sliceCascade2) { + const auto& posChild2 = parts.iteratorAt(casc.index() - 3); + const auto& negChild2 = parts.iteratorAt(casc.index() - 2); + const auto& bachChild2 = parts.iteratorAt(casc.index() - 1); + // This is how it is supposed to work but there seems to be an issue + // with partitions and accessing elements in tables that have been declared + // with an SELF_INDEX column. Under investigation. Maybe need to change + // femtdream dataformat to take special care of v0 candidates + // auto posChild = v0.template children_as().front(); + // auto negChild = v0.template children_as().back(); + // check cuts on V0 children + if (Cascade2.useChildCuts) { + if (!(((posChild2.cut() & Cascade2.childPosCutBit) == Cascade2.childPosCutBit) && + ((negChild2.cut() & Cascade2.childNegCutBit) == Cascade2.childNegCutBit) && + ((bachChild2.cut() & Cascade2.childBachCutBit) == Cascade2.childBachCutBit))) { + continue; + } } - } - if (Cascade2.UseChildPIDCuts) { - if (!(((posChild2.pidcut() & Cascade2.ChildPos_TPCBit) == Cascade2.ChildPos_TPCBit) && - ((negChild2.pidcut() & Cascade2.ChildNeg_TPCBit) == Cascade2.ChildNeg_TPCBit) && - ((bachChild2.pidcut() & Cascade2.ChildBach_TPCBit) == Cascade2.ChildBach_TPCBit))) { - continue; + if (Cascade2.useChildPIDCuts) { + if (!(((posChild2.pidcut() & Cascade2.childPosTPCBit) == Cascade2.childPosTPCBit) && + ((negChild2.pidcut() & Cascade2.childNegTPCBit) == Cascade2.childNegTPCBit) && + ((bachChild2.pidcut() & Cascade2.childBachTPCBit) == Cascade2.childBachTPCBit))) { + continue; + } } + cascHistoPartTwo.fillQA(casc, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + posChildHistosPartTwo.fillQA(posChild2, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + negChildHistosPartTwo.fillQA(negChild2, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); + bachChildHistosPartTwo.fillQA(bachChild2, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); } - CascHistoPartTwo.fillQA(casc, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); - posChildHistosPartTwo.fillQA(posChild2, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); - negChildHistosPartTwo.fillQA(negChild2, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); - bachChildHistosPartTwo.fillQA(bachChild2, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); - } + } /// Now build particle combinations - for (auto const& [p1, p2] : combinations(CombinationsFullIndexPolicy(SliceCascade1, SliceCascade2))) { + for (auto const& [p1, p2] : combinations(CombinationsFullIndexPolicy(sliceCascade1, sliceCascade2))) { const auto& posChild1 = parts.iteratorAt(p1.index() - 3); const auto& negChild1 = parts.iteratorAt(p1.index() - 2); const auto& bachChild1 = parts.iteratorAt(p1.index() - 1); @@ -338,39 +344,39 @@ struct femtoDreamPairTaskCascadeCascade { const auto& bachChild2 = parts.iteratorAt(p2.index() - 1); // cuts on Cascade children still need to be applied - if (Cascade1.UseChildCuts) { - if (!(((posChild1.cut() & Cascade1.ChildPos_CutBit) == Cascade1.ChildPos_CutBit) && - ((negChild1.cut() & Cascade1.ChildNeg_CutBit) == Cascade1.ChildNeg_CutBit) && - ((bachChild1.cut() & Cascade1.ChildBach_CutBit) == Cascade1.ChildBach_CutBit))) { + if (Cascade1.useChildCuts) { + if (!(((posChild1.cut() & Cascade1.childPosCutBit) == Cascade1.childPosCutBit) && + ((negChild1.cut() & Cascade1.childNegCutBit) == Cascade1.childNegCutBit) && + ((bachChild1.cut() & Cascade1.childBachCutBit) == Cascade1.childBachCutBit))) { continue; } } - if (Cascade1.UseChildPIDCuts) { - if (!(((posChild1.pidcut() & Cascade1.ChildPos_TPCBit) == Cascade1.ChildPos_TPCBit) && - ((negChild1.pidcut() & Cascade1.ChildNeg_TPCBit) == Cascade1.ChildNeg_TPCBit) && - ((bachChild1.pidcut() & Cascade1.ChildBach_TPCBit) == Cascade1.ChildBach_TPCBit))) { + if (Cascade1.useChildPIDCuts) { + if (!(((posChild1.pidcut() & Cascade1.childPosTPCBit) == Cascade1.childPosTPCBit) && + ((negChild1.pidcut() & Cascade1.childNegTPCBit) == Cascade1.childNegTPCBit) && + ((bachChild1.pidcut() & Cascade1.childBachTPCBit) == Cascade1.childBachTPCBit))) { continue; } } - if (Cascade2.UseChildCuts) { - if (!(((posChild2.cut() & Cascade2.ChildPos_CutBit) == Cascade2.ChildPos_CutBit) && - ((negChild2.cut() & Cascade2.ChildNeg_CutBit) == Cascade2.ChildNeg_CutBit) && - ((bachChild2.cut() & Cascade2.ChildBach_CutBit) == Cascade2.ChildBach_CutBit))) { + if (Cascade2.useChildCuts) { + if (!(((posChild2.cut() & Cascade2.childPosCutBit) == Cascade2.childPosCutBit) && + ((negChild2.cut() & Cascade2.childNegCutBit) == Cascade2.childNegCutBit) && + ((bachChild2.cut() & Cascade2.childBachCutBit) == Cascade2.childBachCutBit))) { continue; } } - if (Cascade2.UseChildPIDCuts) { - if (!(((posChild2.pidcut() & Cascade2.ChildPos_TPCBit) == Cascade2.ChildPos_TPCBit) && - ((negChild2.pidcut() & Cascade2.ChildNeg_TPCBit) == Cascade2.ChildNeg_TPCBit) && - ((bachChild2.pidcut() & Cascade2.ChildBach_TPCBit) == Cascade2.ChildBach_TPCBit))) { + if (Cascade2.useChildPIDCuts) { + if (!(((posChild2.pidcut() & Cascade2.childPosTPCBit) == Cascade2.childPosTPCBit) && + ((negChild2.pidcut() & Cascade2.childNegTPCBit) == Cascade2.childNegTPCBit) && + ((bachChild2.pidcut() & Cascade2.childBachTPCBit) == Cascade2.childBachTPCBit))) { continue; } } //CPR cuts // HERE I NEED HELP FROM GEORGIOS. This was for track-cascade: // we can start with no CPR for Cascade-Cascade for the moment - //if (Option.CPROn.value) { + //if (Option.cprOn.value) { // if ((p1.cut() & kSignPlusMask) == kSignPlusMask) { // if (pairCloseRejectionSE.isClosePair(p1, posChild, parts, col.magField())) { // continue; @@ -383,47 +389,47 @@ struct femtoDreamPairTaskCascadeCascade { //} //Pair Cleaner //-> This should now work for cascades! - if (!pairCleaner.isCleanPair(p1, p2, parts)) { - continue; - } + //if (!pairCleaner.isCleanPair(p1, p2, parts)) { + // continue; + //} //SE pair set: - sameEventCont.setPair(p1, p2, col.multNtr(), col.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.smearingByOrigin); + sameEventCont.setPair(p1, p2, col.multNtr(), col.multV0M(), Option.use4D, Option.extendedPlots, Option.smearingByOrigin); } } //process Same Event void processSameEvent(FilteredCollision const& col, FDParticles const& parts) { - // if ((col.bitmaskTrackOne() & BitMask) != BitMask || (col.bitmaskTrackTwo() & BitMask) != BitMask) { + // if ((col.bitmaskTrackOne() & bitMask) != bitMask || (col.bitmaskTrackTwo() & bitMask) != bitMask) { // return; // } eventHisto.fillQA(col); - auto SliceCascade1 = PartitionCascade1->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - auto SliceCascade2 = PartitionCascade2->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); - doSameEvent(SliceCascade1, SliceCascade2, parts, col); + auto sliceCascade1 = partitionCascade1->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + auto sliceCascade2 = partitionCascade2->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); + doSameEvent(sliceCascade1, sliceCascade2, parts, col); } - PROCESS_SWITCH(femtoDreamPairTaskCascadeCascade, processSameEvent, "Enable processing same event", true); + PROCESS_SWITCH(FemtoDreamPairTaskCascadeCascade, processSameEvent, "Enable processing same event", true); //Mixed events template - void doMixedEvent(CollisionType const& cols, PartType const& parts, PartitionType& part1, PartitionType& part2, BinningType policy) + void doMixedEvent(CollisionType const& cols, PartType const& parts, PartitionType& part1, PartitionType& part2, BinningType binPolicy) { - // Partition PartitionMaskedCol = ncheckbit(aod::femtodreamcollision::bitmaskTrackOne, BitMask) && ncheckbit(aod::femtodreamcollision::bitmaskTrackTwo, BitMask);// && aod::femtodreamcollision::downsample == true; + // Partition PartitionMaskedCol = ncheckbit(aod::femtodreamcollision::bitmaskTrackOne, bitMask) && ncheckbit(aod::femtodreamcollision::bitmaskTrackTwo, bitMask);// && aod::femtodreamcollision::downsample == true; // PartitionMaskedCol.bindTable(cols); // use *Partition.mFiltered when passing the partition to mixing object // there is an issue when the partition is passed directly // workaround for now, change back once it is fixed - for (auto const& [collision1, collision2] : soa::selfCombinations(policy, Mixing.Depth.value, -1, cols, cols)) { + for (auto const& [collision1, collision2] : soa::selfCombinations(binPolicy, Mixing.depth.value, -1, cols, cols)) { // make sure that tracks in same events are not mixed if (collision1.globalIndex() == collision2.globalIndex()) { continue; } - auto SliceCasc1 = part1->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision1.globalIndex(), cache); - auto SliceCasc2 = part2->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision2.globalIndex(), cache); - for (auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(SliceCasc1, SliceCasc2))) { + auto sliceCasc1 = part1->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision1.globalIndex(), cache); + auto sliceCasc2 = part2->sliceByCached(aod::femtodreamparticle::fdCollisionId, collision2.globalIndex(), cache); + for (auto const& [p1, p2] : combinations(CombinationsFullIndexPolicy(sliceCasc1, sliceCasc2))) { const auto& posChild1 = parts.iteratorAt(p1.index() - 3); const auto& negChild1 = parts.iteratorAt(p1.index() - 2); const auto& bachChild1 = parts.iteratorAt(p1.index() - 1); @@ -431,39 +437,39 @@ struct femtoDreamPairTaskCascadeCascade { const auto& negChild2 = parts.iteratorAt(p2.index() - 2); const auto& bachChild2 = parts.iteratorAt(p2.index() - 1); // check cuts on Cascade children - if (Cascade1.UseChildCuts) { - if (!(((posChild1.cut() & Cascade1.ChildPos_CutBit) == Cascade1.ChildPos_CutBit) && - ((negChild1.cut() & Cascade1.ChildNeg_CutBit) == Cascade1.ChildNeg_CutBit) && - ((bachChild1.cut() & Cascade1.ChildBach_CutBit) == Cascade1.ChildBach_CutBit))) { + if (Cascade1.useChildCuts) { + if (!(((posChild1.cut() & Cascade1.childPosCutBit) == Cascade1.childPosCutBit) && + ((negChild1.cut() & Cascade1.childNegCutBit) == Cascade1.childNegCutBit) && + ((bachChild1.cut() & Cascade1.childBachCutBit) == Cascade1.childBachCutBit))) { continue; } } - if (Cascade1.UseChildPIDCuts) { - if (!(((posChild1.pidcut() & Cascade1.ChildPos_TPCBit) == Cascade1.ChildPos_TPCBit) && - ((negChild1.pidcut() & Cascade1.ChildNeg_TPCBit) == Cascade1.ChildNeg_TPCBit) && - ((bachChild1.pidcut() & Cascade1.ChildBach_TPCBit) == Cascade1.ChildBach_TPCBit))) { + if (Cascade1.useChildPIDCuts) { + if (!(((posChild1.pidcut() & Cascade1.childPosTPCBit) == Cascade1.childPosTPCBit) && + ((negChild1.pidcut() & Cascade1.childNegTPCBit) == Cascade1.childNegTPCBit) && + ((bachChild1.pidcut() & Cascade1.childBachTPCBit) == Cascade1.childBachTPCBit))) { continue; } } - if (Cascade2.UseChildCuts) { - if (!(((posChild2.cut() & Cascade2.ChildPos_CutBit) == Cascade2.ChildPos_CutBit) && - ((negChild2.cut() & Cascade2.ChildNeg_CutBit) == Cascade2.ChildNeg_CutBit) && - ((bachChild2.cut() & Cascade2.ChildBach_CutBit) == Cascade2.ChildBach_CutBit))) { + if (Cascade2.useChildCuts) { + if (!(((posChild2.cut() & Cascade2.childPosCutBit) == Cascade2.childPosCutBit) && + ((negChild2.cut() & Cascade2.childNegCutBit) == Cascade2.childNegCutBit) && + ((bachChild2.cut() & Cascade2.childBachCutBit) == Cascade2.childBachCutBit))) { continue; } } - if (Cascade2.UseChildPIDCuts) { - if (!(((posChild2.pidcut() & Cascade2.ChildPos_TPCBit) == Cascade2.ChildPos_TPCBit) && - ((negChild2.pidcut() & Cascade2.ChildNeg_TPCBit) == Cascade2.ChildNeg_TPCBit) && - ((bachChild2.pidcut() & Cascade2.ChildBach_TPCBit) == Cascade2.ChildBach_TPCBit))) { + if (Cascade2.useChildPIDCuts) { + if (!(((posChild2.pidcut() & Cascade2.childPosTPCBit) == Cascade2.childPosTPCBit) && + ((negChild2.pidcut() & Cascade2.childNegTPCBit) == Cascade2.childNegTPCBit) && + ((bachChild2.pidcut() & Cascade2.childBachTPCBit) == Cascade2.childBachTPCBit))) { continue; } } //CPR cuts // HERE I NEED HELP FROM GEORGIOS. This was for track-cascade: // we can start with no CPR for Cascade-Cascade for the moment - //if (Option.CPROn.value) { + //if (Option.cprOn.value) { // if ((p1.cut() & kSignPlusMask) == kSignPlusMask) { // if (pairCloseRejectionME.isClosePair(p1, posChild, parts, collision1.magField())) { // continue; @@ -480,7 +486,7 @@ struct femtoDreamPairTaskCascadeCascade { // continue; //} - mixedEventCont.setPair(p1, p2, collision1.multNtr(), collision1.multV0M(), Option.Use4D, Option.ExtendedPlots, Option.smearingByOrigin); + mixedEventCont.setPair(p1, p2, collision1.multNtr(), collision1.multV0M(), Option.use4D, Option.extendedPlots, Option.smearingByOrigin); } } } @@ -488,26 +494,26 @@ struct femtoDreamPairTaskCascadeCascade { //process Mixed Event void processMixedEvent(FilteredCollisions const& cols, FDParticles const& parts) { - switch (Mixing.Policy.value) { + switch (Mixing.binPolicy.value) { case femtodreamcollision::kMult: - doMixedEvent(cols, parts, PartitionCascade1, PartitionCascade2, colBinningMult); + doMixedEvent(cols, parts, partitionCascade1, partitionCascade2, colBinningMult); break; case femtodreamcollision::kMultPercentile: - doMixedEvent(cols, parts, PartitionCascade1, PartitionCascade2, colBinningMultPercentile); + doMixedEvent(cols, parts, partitionCascade1, partitionCascade2, colBinningMultPercentile); break; case femtodreamcollision::kMultMultPercentile: - doMixedEvent(cols, parts, PartitionCascade1, PartitionCascade2, colBinningMultMultPercentile); + doMixedEvent(cols, parts, partitionCascade1, partitionCascade2, colBinningMultMultPercentile); break; default: LOG(fatal) << "Invalid binning policiy specifed. Breaking..."; } } - PROCESS_SWITCH(femtoDreamPairTaskCascadeCascade, processMixedEvent, "Enable processing mixed events", true); + PROCESS_SWITCH(FemtoDreamPairTaskCascadeCascade, processMixedEvent, "Enable processing mixed events", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), }; return workflow; } From 1ad5e462535ef3c4cac716e79e0b7f14c4c049a6 Mon Sep 17 00:00:00 2001 From: gmantzar Date: Mon, 1 Sep 2025 18:55:05 +0200 Subject: [PATCH 4/9] fixing bug in the omega selection and clang format --- .../Core/femtoDreamCascadeSelection.h | 21 +-- .../FemtoDream/Core/femtoDreamParticleHisto.h | 21 +-- PWGCF/FemtoDream/Core/femtoDreamSelection.h | 8 +- .../Core/femtoDreamTrackSelection.h | 22 +-- PWGCF/FemtoDream/Core/femtoDreamUtils.h | 10 +- PWGCF/FemtoDream/Core/femtoDreamV0Selection.h | 15 +- .../TableProducer/femtoDreamProducerTask.cxx | 9 +- .../femtoDreamPairTaskCascadeCascade.cxx | 132 ++++++++---------- 8 files changed, 118 insertions(+), 120 deletions(-) diff --git a/PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h b/PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h index 9faba6d9bfd..f9b52686567 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h +++ b/PWGCF/FemtoDream/Core/femtoDreamCascadeSelection.h @@ -22,20 +22,21 @@ #ifndef PWGCF_FEMTODREAM_CORE_FEMTODREAMCASCADESELECTION_H_ #define PWGCF_FEMTODREAM_CORE_FEMTODREAMCASCADESELECTION_H_ -#include -#include -#include - -#include // FIXME - #include "PWGCF/FemtoDream/Core/femtoDreamObjectSelection.h" #include "PWGCF/FemtoDream/Core/femtoDreamSelection.h" #include "PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h" #include "Common/Core/RecoDecay.h" + #include "Framework/HistogramRegistry.h" #include "ReconstructionDataFormats/PID.h" +#include // FIXME + +#include +#include +#include + using namespace o2::framework; using namespace o2::analysis::femtoDream::femtoDreamSelection; @@ -347,8 +348,8 @@ class FemtoDreamCascadeSelection }; ///< Helper information for the ///< different selections - //static constexpr int kNcutStages = 2; - //static constexpr std::string_view mCutStage[kNcutStages] = {"BeforeSel", "AfterSel"}; + // static constexpr int kNcutStages = 2; + // static constexpr std::string_view mCutStage[kNcutStages] = {"BeforeSel", "AfterSel"}; }; // namespace femtoDream template @@ -664,6 +665,8 @@ void FemtoDreamCascadeSelection::fillQA(Col const& col, Casc const& casc, Track const float cpaCasc = casc.casccosPA(col.posX(), col.posY(), col.posZ()); const float cpav0 = casc.v0cosPA(col.posX(), col.posY(), col.posZ()); const float v0dcatopv = casc.dcav0topv(col.posX(), col.posY(), col.posZ()); + const float invMass = isCascOmega ? casc.mOmega() : casc.mXi(); + if (mQAHistogramRegistry) { mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hSign"), casc.sign()); mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hPt"), casc.pt()); @@ -675,7 +678,7 @@ void FemtoDreamCascadeSelection::fillQA(Col const& col, Casc const& casc, Track mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hDecVtxX"), decVtx.at(0)); mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hDecVtxY"), decVtx.at(1)); mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hDecVtxZ"), decVtx.at(2)); - mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hInvMass"), casc.mXi()); + mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hInvMass"), invMass); mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hV0DCADaugh"), casc.dcaV0daughters()); mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hV0CPA"), cpav0); mQAHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/") + HIST(mCutStage[cutstage]) + HIST("/hV0TranRad"), casc.v0radius()); diff --git a/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h b/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h index be7786bf282..af1caf11879 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h +++ b/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h @@ -18,11 +18,14 @@ #ifndef PWGCF_FEMTODREAM_CORE_FEMTODREAMPARTICLEHISTO_H_ #define PWGCF_FEMTODREAM_CORE_FEMTODREAMPARTICLEHISTO_H_ -#include -#include #include "PWGCF/DataModel/FemtoDerived.h" -#include "Framework/HistogramRegistry.h" + #include "CommonConstants/PhysicsConstants.h" +#include "Framework/HistogramRegistry.h" + +#include + +#include using namespace o2::framework; @@ -690,13 +693,13 @@ class FemtoDreamParticleHisto } private: - HistogramRegistry* mHistogramRegistry; ///< For QA output - static constexpr o2::aod::femtodreamparticle::ParticleType mParticleType = particleType; ///< Type of the particle under analysis - static constexpr int mFolderSuffixType = suffixType; ///< Counter for the folder suffix specified below + HistogramRegistry* mHistogramRegistry; ///< For QA output + static constexpr o2::aod::femtodreamparticle::ParticleType mParticleType = particleType; ///< Type of the particle under analysis + static constexpr int mFolderSuffixType = suffixType; ///< Counter for the folder suffix specified below static constexpr std::string_view mFolderSuffix[12] = {"", "_one", "_two", "_pos", "_neg", - "_allSelected", "_allSelected_pos", "_allSelected_neg", "_bach", - "_two_pos", "_two_neg", "_two_bach"}; ///< Suffix for the folder name in case of analyses of pairs of the same kind (T-T, V-V, C-C) - int mPDG = 0; ///< PDG code of the selected particle + "_allSelected", "_allSelected_pos", "_allSelected_neg", "_bach", + "_two_pos", "_two_neg", "_two_bach"}; ///< Suffix for the folder name in case of analyses of pairs of the same kind (T-T, V-V, C-C) + int mPDG = 0; ///< PDG code of the selected particle }; } // namespace o2::analysis::femtoDream diff --git a/PWGCF/FemtoDream/Core/femtoDreamSelection.h b/PWGCF/FemtoDream/Core/femtoDreamSelection.h index 6181c4b7f98..90fd8f58046 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamSelection.h +++ b/PWGCF/FemtoDream/Core/femtoDreamSelection.h @@ -16,10 +16,12 @@ #ifndef PWGCF_FEMTODREAM_CORE_FEMTODREAMSELECTION_H_ #define PWGCF_FEMTODREAM_CORE_FEMTODREAMSELECTION_H_ -#include -#include "Framework/HistogramRegistry.h" #include "PWGCF/DataModel/FemtoDerived.h" +#include "Framework/HistogramRegistry.h" + +#include + using namespace o2; using namespace o2::framework; @@ -35,7 +37,7 @@ enum SelectionType { kUpperLimit, ///< simple upper limit for the value, e.g. kAbsLowerLimit, ///< lower limit of the absolute value, e.g. |DCA_xyz| > 0.05 cm kEqual ///< values need to be equal, e.g. sign = 1 }; - + static constexpr int kNcutStages = 2; static constexpr std::string_view mCutStage[kNcutStages] = {"BeforeSel", "AfterSel"}; diff --git a/PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h b/PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h index 6d6d58125e7..13d1ba5280b 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h +++ b/PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h @@ -17,20 +17,22 @@ #ifndef PWGCF_FEMTODREAM_CORE_FEMTODREAMTRACKSELECTION_H_ #define PWGCF_FEMTODREAM_CORE_FEMTODREAMTRACKSELECTION_H_ -#include -#include -#include -#include - #include "PWGCF/DataModel/FemtoDerived.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/PIDResponse.h" -#include "Common/DataModel/PIDResponseITS.h" +#include "PWGCF/FemtoDream/Core/femtoDreamObjectSelection.h" + #include "Common/Core/TrackSelection.h" #include "Common/Core/TrackSelectionDefaults.h" -#include "PWGCF/FemtoDream/Core/femtoDreamObjectSelection.h" -#include "ReconstructionDataFormats/PID.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/PIDResponseITS.h" +#include "Common/DataModel/TrackSelectionTables.h" + #include "Framework/HistogramRegistry.h" +#include "ReconstructionDataFormats/PID.h" + +#include +#include +#include +#include using namespace o2::framework; using namespace o2::analysis::femtoDream::femtoDreamSelection; diff --git a/PWGCF/FemtoDream/Core/femtoDreamUtils.h b/PWGCF/FemtoDream/Core/femtoDreamUtils.h index 252e11d82d1..3030a1b45ef 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamUtils.h +++ b/PWGCF/FemtoDream/Core/femtoDreamUtils.h @@ -16,11 +16,13 @@ #ifndef PWGCF_FEMTODREAM_CORE_FEMTODREAMUTILS_H_ #define PWGCF_FEMTODREAM_CORE_FEMTODREAMUTILS_H_ -#include -#include -#include "CommonConstants/PhysicsConstants.h" #include "PWGCF/DataModel/FemtoDerived.h" +#include "CommonConstants/PhysicsConstants.h" + +#include +#include + namespace o2::analysis::femtoDream { @@ -67,7 +69,7 @@ inline float getMass(int pdgCode) case o2::constants::physics::Pdg::kHelium3: mass = o2::constants::physics::MassHelium3; break; - //case o2::constants::physics::Pdg::kOmegaMinus: + // case o2::constants::physics::Pdg::kOmegaMinus: case kOmegaMinus: mass = o2::constants::physics::MassOmegaMinus; break; diff --git a/PWGCF/FemtoDream/Core/femtoDreamV0Selection.h b/PWGCF/FemtoDream/Core/femtoDreamV0Selection.h index 7d4e0bb88be..3cd52ebd219 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamV0Selection.h +++ b/PWGCF/FemtoDream/Core/femtoDreamV0Selection.h @@ -18,18 +18,19 @@ #ifndef PWGCF_FEMTODREAM_CORE_FEMTODREAMV0SELECTION_H_ #define PWGCF_FEMTODREAM_CORE_FEMTODREAMV0SELECTION_H_ -#include -#include -#include - #include "PWGCF/FemtoDream/Core/femtoDreamObjectSelection.h" #include "PWGCF/FemtoDream/Core/femtoDreamSelection.h" #include "PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h" #include "Common/Core/RecoDecay.h" + #include "Framework/HistogramRegistry.h" #include "ReconstructionDataFormats/PID.h" +#include +#include +#include + using namespace o2::framework; using namespace o2::analysis::femtoDream::femtoDreamSelection; @@ -298,10 +299,10 @@ void FemtoDreamV0Selection::init(HistogramRegistry* QAregistry, HistogramRegistr LOG(fatal) << "FemtoDreamV0Cuts: Number of selections to large for your " "container - quitting!"; } - for (int istage = 0; istage < kNcutStages; istage++){ + for (int istage = 0; istage < kNcutStages; istage++) { std::string folderName = - static_cast(o2::aod::femtodreamparticle::ParticleTypeName[part]) + "/" + - static_cast(mCutStage[istage]); + static_cast(o2::aod::femtodreamparticle::ParticleTypeName[part]) + "/" + + static_cast(mCutStage[istage]); /// \todo initialize histograms for children tracks of v0s mQAHistogramRegistry->add((folderName + "/hPt").c_str(), "; #it{p}_{T} (GeV/#it{c}); Entries", kTH1F, diff --git a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx index e72d959d136..95cd078ae78 100644 --- a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx +++ b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx @@ -245,7 +245,7 @@ struct femtoDreamProducerTask { Configurable> ConfDaughterPIDnSigmaMax{"ConfDaughterPIDnSigmaMax", std::vector{3.00, 3.00}, "Reso Daughter sel: Max. PID nSigma TPC"}; // 3.0 Configurable> ConfDaughterPIDspecies{"ConfDaughterPIDspecies", std::vector{o2::track::PID::Kaon, o2::track::PID::Kaon}, "Reso Daughter sel: Particles species for PID"}; Configurable> ConfDaug1Daugh2ResoMass{"ConfDaug1Daugh2ResoMass", std::vector{o2::constants::physics::MassKPlus, o2::constants::physics::MassKMinus, o2::constants::physics::MassPhi}, "Masses: Daughter1 - Daughter2 - Resonance"}; - }ConfResoSel; + } ConfResoSel; /// \todo should we add filter on min value pT/eta of V0 and daughters? /*Filter v0Filter = (nabs(aod::v0data::x) < V0DecVtxMax.value) && @@ -713,7 +713,7 @@ struct femtoDreamProducerTask { if (!colCuts.isSelectedCollision(col)) { return; } - //bool emptyCollision = false; + // bool emptyCollision = false; if (ConfIsActivateCascade.value) { if (colCuts.isEmptyCollision(col, tracks, trackCuts) && colCuts.isCollisionWithoutTrkCasc(col, fullCascades, cascadeCuts, tracks)) { return; @@ -825,7 +825,7 @@ struct femtoDreamProducerTask { // const auto dcaXYpos = postrack.dcaXY(); // const auto dcaZpos = postrack.dcaZ(); // const auto dcapos = std::sqrt(pow(dcaXYpos, 2.) + pow(dcaZpos, 2.)); - + v0Cuts.fillQA<0, aod::femtodreamparticle::ParticleType::kV0, aod::femtodreamparticle::ParticleType::kV0Child>(col, v0, postrack, negtrack); v0Cuts.fillLambdaQA(col, v0, postrack, negtrack); @@ -987,6 +987,7 @@ struct femtoDreamProducerTask { //------ // Fill cascades + float invMassCasc = ConfCascIsSelectedOmega.value() ? casc.mOmega() : casc.mXi(); std::vector indexCascadeChildID = {rowOfPosCascadeTrack, rowOfNegCascadeTrack, rowOfBachelorCascadeTrack}; outputParts(outputCollision.lastIndex(), casc.pt(), @@ -997,7 +998,7 @@ struct femtoDreamProducerTask { 0, casc.casccosPA(col.posX(), col.posY(), col.posZ()), indexCascadeChildID, - casc.mXi(), + invMassCasc, casc.mLambda()); // TODO: include here MC filling //------ diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx index d0c8b15cf94..e778ee657e7 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx @@ -9,25 +9,28 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// \file femtoDreamPairTaskCascadeCascade.cxx -/// \brief Tasks that reads the track tables used for the pairing and builds pairs of two cascades +/// \brief Tasks that reads the track tables used for the pairing and builds pairs of two cascades /// \author Andi Mathis, Anton Riedel, Georgios Mantzaridis, Oton Vazquez Doce. -#include -#include -#include -#include -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/Expressions.h" #include "PWGCF/DataModel/FemtoDerived.h" -#include "PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h" -#include "PWGCF/FemtoDream/Core/femtoDreamEventHisto.h" -#include "PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h" #include "PWGCF/FemtoDream/Core/femtoDreamContainer.h" #include "PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h" +#include "PWGCF/FemtoDream/Core/femtoDreamEventHisto.h" +#include "PWGCF/FemtoDream/Core/femtoDreamPairCleaner.h" +#include "PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h" #include "PWGCF/FemtoDream/Core/femtoDreamUtils.h" + +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/Expressions.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/runDataProcessing.h" + +#include + +#include +#include +#include using namespace o2; using namespace o2::aod; using namespace o2::soa; @@ -57,7 +60,6 @@ struct FemtoDreamPairTaskCascadeCascade { ConfigurableAxis dummy{"dummy", {1, 0, 1}, "dummy axis"}; } Option; - /// Event selection struct : ConfigurableGroup { std::string prefix = std::string("EventSel"); @@ -67,11 +69,9 @@ struct FemtoDreamPairTaskCascadeCascade { Configurable multPercentileMax{"multPercentileMax", 100, "Maximum Multiplicity Percentile"}; } EventSel; - // Filter EventMultiplicity = aod::femtodreamcollision::multNtr >= EventSel.multMin && aod::femtodreamcollision::multNtr <= EventSel.multMax; // Filter EventMultiplicityPercentile = aod::femtodreamcollision::multV0M >= EventSel.multPercentileMin && aod::femtodreamcollision::multV0M <= EventSel.multPercentileMax; - /// Histogramming for Event FemtoDreamEventHisto eventHisto; // using FilteredCollisions = soa::Filtered; @@ -79,9 +79,7 @@ struct FemtoDreamPairTaskCascadeCascade { using FilteredCollision = FilteredCollisions::iterator; using FDMCParts = soa::Join; using FDMCPart = FDMCParts::iterator; - femtodreamcollision::BitMaskType bitMask = 1; //??????????????????? - - + femtodreamcollision::BitMaskType bitMask = 1; //??????????????????? /// Cascade 1 (Cascade) struct : ConfigurableGroup { @@ -95,7 +93,6 @@ struct FemtoDreamPairTaskCascadeCascade { Configurable childBachCutBit{"childBachCutBit", 277, "Selection bit for bachelor child of Cascade"}; Configurable childBachTPCBit{"childBachTPCBit", 64, "PID TPC bit for bachelor child of Cascade"}; - Configurable invMassMin{"invMassMin", 1.6, "Minimum invariant mass of Partricle 1 (Cascade)"}; Configurable invMassMax{"invMassMax", 1.8, "Maximum invariant mass of Partricle 1 (Cascade)"}; Configurable invMassV0DaughMin{"invMassV0DaughMin", 0., "Minimum invariant mass of the V0 Daughter"}; @@ -108,7 +105,6 @@ struct FemtoDreamPairTaskCascadeCascade { Configurable useChildPIDCuts{"useChildPIDCuts", true, "Use PID cuts on the children of the Cascades additional to those of the selection of the cascade builder (for debugging purposes)"}; } Cascade1; - /// Partition for particle 1 Partition partitionCascade1 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kCascade)) && ((aod::femtodreamparticle::cut & Cascade1.cutBit) == Cascade1.cutBit) && @@ -126,8 +122,6 @@ struct FemtoDreamPairTaskCascadeCascade { FemtoDreamParticleHisto negChildHistosPartOne; FemtoDreamParticleHisto bachChildHistosPartOne; - - /// Particle 2 (Cascade) struct : ConfigurableGroup { std::string prefix = std::string("Cascade2"); @@ -141,7 +135,7 @@ struct FemtoDreamPairTaskCascadeCascade { Configurable childBachTPCBit{"childBachTPCBit", 64, "PID TPC bit for bachelor child of Cascade"}; Configurable invMassMin{"invMassMin", 1.2, "Minimum invariant mass of Particle 2 (Cascade)"}; Configurable invMassMax{"invMassMax", 1.4, "Maximum invariant mass of Particle 2 (Cascade)"}; - Configurable invMassV0DaughMin{"invMassV0DaughMin", 0., "Minimum invariant mass of the V0 Daughter"}; // (???????) + Configurable invMassV0DaughMin{"invMassV0DaughMin", 0., "Minimum invariant mass of the V0 Daughter"}; // (???????) Configurable invMassV0DaughMax{"invMassV0DaughMax", 999., "Maximum invariant mass of the V0 Daughter"}; // (???????) Configurable ptMin{"ptMin", 0., "Minimum pT of Particle 2 (Cascade)"}; Configurable ptMax{"ptMax", 999., "Maximum pT of Particle 2 (Cascade)"}; @@ -151,8 +145,6 @@ struct FemtoDreamPairTaskCascadeCascade { Configurable useChildPIDCuts{"useChildPIDCuts", true, "Use PID cuts on the children of the Cascades additional to those of the selection of the cascade builder (for debugging purposes)"}; } Cascade2; - - /// Partition for particle 2 Partition partitionCascade2 = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kCascade)) && ((aod::femtodreamparticle::cut & Cascade2.cutBit) == Cascade2.cutBit) && @@ -170,8 +162,6 @@ struct FemtoDreamPairTaskCascadeCascade { FemtoDreamParticleHisto negChildHistosPartTwo; FemtoDreamParticleHisto bachChildHistosPartTwo; - - /// Binning configurables struct : ConfigurableGroup { std::string prefix = std::string("Binning"); @@ -194,8 +184,6 @@ struct FemtoDreamPairTaskCascadeCascade { ConfigurableAxis multPercentile{"multPercentile", {10, 0.0f, 100.0f}, "multiplicity percentile Binning for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <> to true in order to use)"}; } Binning4D; - - // Mixing configurables struct : ConfigurableGroup { std::string prefix = std::string("Mixing"); @@ -216,8 +204,6 @@ struct FemtoDreamPairTaskCascadeCascade { static constexpr uint32_t kSignPlusMask = 1 << 1; - - /// Histogram output HistogramRegistry registry{"Output", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(InitContext&) @@ -233,7 +219,7 @@ struct FemtoDreamPairTaskCascadeCascade { negChildHistosPartOne.init(®istry, Binning.multTempFit, Option.dummy, Binning.pTCascadeChild, Option.dummy, Option.dummy, Binning.tempFitVarCascadeChild, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, false, 0); bachChildHistosPartOne.init(®istry, Binning.multTempFit, Option.dummy, Binning.pTCascadeChild, Option.dummy, Option.dummy, Binning.tempFitVarCascadeChild, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, false, 0); - if(!Option.sameSpecies){ + if (!Option.sameSpecies) { cascHistoPartTwo.init(®istry, Binning.multTempFit, Option.dummy, Binning.pTCascade, Option.dummy, Option.dummy, Binning.tempFitVarCascade, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Binning.invMass, Option.dummy, Option.isMC, Cascade2.pdgCode); posChildHistosPartTwo.init(®istry, Binning.multTempFit, Option.dummy, Binning.pTCascadeChild, Option.dummy, Option.dummy, Binning.tempFitVarCascadeChild, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, false, 0); negChildHistosPartTwo.init(®istry, Binning.multTempFit, Option.dummy, Binning.pTCascadeChild, Option.dummy, Option.dummy, Binning.tempFitVarCascadeChild, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, Option.dummy, false, 0); @@ -299,9 +285,8 @@ struct FemtoDreamPairTaskCascadeCascade { posChildHistosPartOne.fillQA(posChild1, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); negChildHistosPartOne.fillQA(negChild1, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); bachChildHistosPartOne.fillQA(bachChild1, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); - } - if(!Option.sameSpecies){ + if (!Option.sameSpecies) { for (auto const& casc : sliceCascade2) { const auto& posChild2 = parts.iteratorAt(casc.index() - 3); const auto& negChild2 = parts.iteratorAt(casc.index() - 2); @@ -332,7 +317,7 @@ struct FemtoDreamPairTaskCascadeCascade { negChildHistosPartTwo.fillQA(negChild2, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); bachChildHistosPartTwo.fillQA(bachChild2, aod::femtodreamparticle::kPt, col.multNtr(), col.multV0M()); } - } + } /// Now build particle combinations for (auto const& [p1, p2] : combinations(CombinationsFullIndexPolicy(sliceCascade1, sliceCascade2))) { @@ -374,31 +359,31 @@ struct FemtoDreamPairTaskCascadeCascade { } } - //CPR cuts // HERE I NEED HELP FROM GEORGIOS. This was for track-cascade: - // we can start with no CPR for Cascade-Cascade for the moment - //if (Option.cprOn.value) { - // if ((p1.cut() & kSignPlusMask) == kSignPlusMask) { - // if (pairCloseRejectionSE.isClosePair(p1, posChild, parts, col.magField())) { - // continue; - // } - // } else { - // if (pairCloseRejectionSE.isClosePair(p1, posChild, parts, col.magField())) { - // continue; - // } - // } - //} - - //Pair Cleaner //-> This should now work for cascades! - //if (!pairCleaner.isCleanPair(p1, p2, parts)) { - // continue; - //} - - //SE pair set: + // CPR cuts // HERE I NEED HELP FROM GEORGIOS. This was for track-cascade: + // we can start with no CPR for Cascade-Cascade for the moment + // if (Option.cprOn.value) { + // if ((p1.cut() & kSignPlusMask) == kSignPlusMask) { + // if (pairCloseRejectionSE.isClosePair(p1, posChild, parts, col.magField())) { + // continue; + // } + // } else { + // if (pairCloseRejectionSE.isClosePair(p1, posChild, parts, col.magField())) { + // continue; + // } + // } + // } + + // Pair Cleaner //-> This should now work for cascades! + // if (!pairCleaner.isCleanPair(p1, p2, parts)) { + // continue; + // } + + // SE pair set: sameEventCont.setPair(p1, p2, col.multNtr(), col.multV0M(), Option.use4D, Option.extendedPlots, Option.smearingByOrigin); } } - //process Same Event + // process Same Event void processSameEvent(FilteredCollision const& col, FDParticles const& parts) { // if ((col.bitmaskTrackOne() & bitMask) != bitMask || (col.bitmaskTrackTwo() & bitMask) != bitMask) { @@ -411,8 +396,7 @@ struct FemtoDreamPairTaskCascadeCascade { } PROCESS_SWITCH(FemtoDreamPairTaskCascadeCascade, processSameEvent, "Enable processing same event", true); - - //Mixed events + // Mixed events template void doMixedEvent(CollisionType const& cols, PartType const& parts, PartitionType& part1, PartitionType& part2, BinningType binPolicy) { @@ -467,19 +451,19 @@ struct FemtoDreamPairTaskCascadeCascade { } } - //CPR cuts // HERE I NEED HELP FROM GEORGIOS. This was for track-cascade: - // we can start with no CPR for Cascade-Cascade for the moment - //if (Option.cprOn.value) { - // if ((p1.cut() & kSignPlusMask) == kSignPlusMask) { - // if (pairCloseRejectionME.isClosePair(p1, posChild, parts, collision1.magField())) { - // continue; - // } - // } else { - // if (pairCloseRejectionME.isClosePair(p1, negChild, parts, collision1.magField())) { - // continue; - // } - // } - //} + // CPR cuts // HERE I NEED HELP FROM GEORGIOS. This was for track-cascade: + // we can start with no CPR for Cascade-Cascade for the moment + // if (Option.cprOn.value) { + // if ((p1.cut() & kSignPlusMask) == kSignPlusMask) { + // if (pairCloseRejectionME.isClosePair(p1, posChild, parts, collision1.magField())) { + // continue; + // } + // } else { + // if (pairCloseRejectionME.isClosePair(p1, negChild, parts, collision1.magField())) { + // continue; + // } + // } + // } // Pair cleaner not needed in the mixing // if (!pairCleaner.isCleanPair(p1, p2, parts)) { @@ -491,7 +475,7 @@ struct FemtoDreamPairTaskCascadeCascade { } } - //process Mixed Event + // process Mixed Event void processMixedEvent(FilteredCollisions const& cols, FDParticles const& parts) { switch (Mixing.binPolicy.value) { From 0f338c9539fc2b4ed0c1c543aa9b7400566a125a Mon Sep 17 00:00:00 2001 From: gmantzar Date: Tue, 2 Sep 2025 09:39:11 +0200 Subject: [PATCH 5/9] small fix when accessing the configurable --- PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx index 95cd078ae78..2103cf6f305 100644 --- a/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx +++ b/PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx @@ -987,7 +987,7 @@ struct femtoDreamProducerTask { //------ // Fill cascades - float invMassCasc = ConfCascIsSelectedOmega.value() ? casc.mOmega() : casc.mXi(); + float invMassCasc = ConfCascSel.ConfCascIsSelectedOmega ? casc.mOmega() : casc.mXi(); std::vector indexCascadeChildID = {rowOfPosCascadeTrack, rowOfNegCascadeTrack, rowOfBachelorCascadeTrack}; outputParts(outputCollision.lastIndex(), casc.pt(), From 49b0f07c5e67e42845bb10eaff5bb346c9d0ef70 Mon Sep 17 00:00:00 2001 From: gmantzar Date: Tue, 2 Sep 2025 10:04:42 +0200 Subject: [PATCH 6/9] Removed commented code --- .../femtoDreamPairTaskCascadeCascade.cxx | 61 +------------------ 1 file changed, 2 insertions(+), 59 deletions(-) diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx index e778ee657e7..0dc1dd96dfa 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx @@ -260,12 +260,7 @@ struct FemtoDreamPairTaskCascadeCascade { const auto& posChild1 = parts.iteratorAt(casc.index() - 3); const auto& negChild1 = parts.iteratorAt(casc.index() - 2); const auto& bachChild1 = parts.iteratorAt(casc.index() - 1); - // This is how it is supposed to work but there seems to be an issue - // with partitions and accessing elements in tables that have been declared - // with an SELF_INDEX column. Under investigation. Maybe need to change - // femtdream dataformat to take special care of v0 candidates - // auto posChild = v0.template children_as().front(); - // auto negChild = v0.template children_as().back(); + // check cuts on V0 children if (Cascade1.useChildCuts) { if (!(((posChild1.cut() & Cascade1.childPosCutBit) == Cascade1.childPosCutBit) && @@ -291,12 +286,7 @@ struct FemtoDreamPairTaskCascadeCascade { const auto& posChild2 = parts.iteratorAt(casc.index() - 3); const auto& negChild2 = parts.iteratorAt(casc.index() - 2); const auto& bachChild2 = parts.iteratorAt(casc.index() - 1); - // This is how it is supposed to work but there seems to be an issue - // with partitions and accessing elements in tables that have been declared - // with an SELF_INDEX column. Under investigation. Maybe need to change - // femtdream dataformat to take special care of v0 candidates - // auto posChild = v0.template children_as().front(); - // auto negChild = v0.template children_as().back(); + // check cuts on V0 children if (Cascade2.useChildCuts) { if (!(((posChild2.cut() & Cascade2.childPosCutBit) == Cascade2.childPosCutBit) && @@ -359,25 +349,6 @@ struct FemtoDreamPairTaskCascadeCascade { } } - // CPR cuts // HERE I NEED HELP FROM GEORGIOS. This was for track-cascade: - // we can start with no CPR for Cascade-Cascade for the moment - // if (Option.cprOn.value) { - // if ((p1.cut() & kSignPlusMask) == kSignPlusMask) { - // if (pairCloseRejectionSE.isClosePair(p1, posChild, parts, col.magField())) { - // continue; - // } - // } else { - // if (pairCloseRejectionSE.isClosePair(p1, posChild, parts, col.magField())) { - // continue; - // } - // } - // } - - // Pair Cleaner //-> This should now work for cascades! - // if (!pairCleaner.isCleanPair(p1, p2, parts)) { - // continue; - // } - // SE pair set: sameEventCont.setPair(p1, p2, col.multNtr(), col.multV0M(), Option.use4D, Option.extendedPlots, Option.smearingByOrigin); } @@ -386,9 +357,6 @@ struct FemtoDreamPairTaskCascadeCascade { // process Same Event void processSameEvent(FilteredCollision const& col, FDParticles const& parts) { - // if ((col.bitmaskTrackOne() & bitMask) != bitMask || (col.bitmaskTrackTwo() & bitMask) != bitMask) { - // return; - // } eventHisto.fillQA(col); auto sliceCascade1 = partitionCascade1->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); auto sliceCascade2 = partitionCascade2->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); @@ -400,12 +368,6 @@ struct FemtoDreamPairTaskCascadeCascade { template void doMixedEvent(CollisionType const& cols, PartType const& parts, PartitionType& part1, PartitionType& part2, BinningType binPolicy) { - // Partition PartitionMaskedCol = ncheckbit(aod::femtodreamcollision::bitmaskTrackOne, bitMask) && ncheckbit(aod::femtodreamcollision::bitmaskTrackTwo, bitMask);// && aod::femtodreamcollision::downsample == true; - // PartitionMaskedCol.bindTable(cols); - - // use *Partition.mFiltered when passing the partition to mixing object - // there is an issue when the partition is passed directly - // workaround for now, change back once it is fixed for (auto const& [collision1, collision2] : soa::selfCombinations(binPolicy, Mixing.depth.value, -1, cols, cols)) { // make sure that tracks in same events are not mixed if (collision1.globalIndex() == collision2.globalIndex()) { @@ -451,25 +413,6 @@ struct FemtoDreamPairTaskCascadeCascade { } } - // CPR cuts // HERE I NEED HELP FROM GEORGIOS. This was for track-cascade: - // we can start with no CPR for Cascade-Cascade for the moment - // if (Option.cprOn.value) { - // if ((p1.cut() & kSignPlusMask) == kSignPlusMask) { - // if (pairCloseRejectionME.isClosePair(p1, posChild, parts, collision1.magField())) { - // continue; - // } - // } else { - // if (pairCloseRejectionME.isClosePair(p1, negChild, parts, collision1.magField())) { - // continue; - // } - // } - // } - - // Pair cleaner not needed in the mixing - // if (!pairCleaner.isCleanPair(p1, p2, parts)) { - // continue; - //} - mixedEventCont.setPair(p1, p2, collision1.multNtr(), collision1.multV0M(), Option.use4D, Option.extendedPlots, Option.smearingByOrigin); } } From 0fc74e2438464d7fe59bf969ccf6fff859d38a78 Mon Sep 17 00:00:00 2001 From: gmantzar Date: Tue, 2 Sep 2025 10:41:34 +0200 Subject: [PATCH 7/9] Changing combination policy for CascadeCascade to StricltyUpperIndex --> later the option needs to be added to switch, in case someone wants on analyse two different cascades --- PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx index 0dc1dd96dfa..0a0d085af2d 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx @@ -310,7 +310,7 @@ struct FemtoDreamPairTaskCascadeCascade { } /// Now build particle combinations - for (auto const& [p1, p2] : combinations(CombinationsFullIndexPolicy(sliceCascade1, sliceCascade2))) { + for (auto const& [p1, p2] : combinations(CombinationsStrictlyUpperIndexPolicy(sliceCascade1, sliceCascade2))) { const auto& posChild1 = parts.iteratorAt(p1.index() - 3); const auto& negChild1 = parts.iteratorAt(p1.index() - 2); const auto& bachChild1 = parts.iteratorAt(p1.index() - 1); From 80e82f1a176f71a28d80486d6f4ab942d8c32440 Mon Sep 17 00:00:00 2001 From: gmantzar Date: Thu, 4 Sep 2025 17:38:59 +0200 Subject: [PATCH 8/9] Fix O2 Linter Errors for the CascadeCascade Task --- PWGCF/FemtoDream/Tasks/CMakeLists.txt | 2 +- ...eCascade.cxx => femtoDreamPairCascadeCascade.cxx} | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) rename PWGCF/FemtoDream/Tasks/{femtoDreamPairTaskCascadeCascade.cxx => femtoDreamPairCascadeCascade.cxx} (98%) diff --git a/PWGCF/FemtoDream/Tasks/CMakeLists.txt b/PWGCF/FemtoDream/Tasks/CMakeLists.txt index 113ab736824..0547b5932bc 100644 --- a/PWGCF/FemtoDream/Tasks/CMakeLists.txt +++ b/PWGCF/FemtoDream/Tasks/CMakeLists.txt @@ -30,7 +30,7 @@ o2physics_add_dpl_workflow(femtodream-pair-track-cascade COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(femtodream-pair-casdcade-cascade - SOURCES femtoDreamPairTaskCascadeCascade.cxx + SOURCES femtoDreamPairCascadeCascade.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx b/PWGCF/FemtoDream/Tasks/femtoDreamPairCascadeCascade.cxx similarity index 98% rename from PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx rename to PWGCF/FemtoDream/Tasks/femtoDreamPairCascadeCascade.cxx index 0a0d085af2d..fbf164378a1 100644 --- a/PWGCF/FemtoDream/Tasks/femtoDreamPairTaskCascadeCascade.cxx +++ b/PWGCF/FemtoDream/Tasks/femtoDreamPairCascadeCascade.cxx @@ -8,9 +8,11 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file femtoDreamPairTaskCascadeCascade.cxx + +/// \file femtoDreamPairCascadeCascade.cxx /// \brief Tasks that reads the track tables used for the pairing and builds pairs of two cascades /// \author Andi Mathis, Anton Riedel, Georgios Mantzaridis, Oton Vazquez Doce. + #include "PWGCF/DataModel/FemtoDerived.h" #include "PWGCF/FemtoDream/Core/femtoDreamContainer.h" #include "PWGCF/FemtoDream/Core/femtoDreamDetaDphiStar.h" @@ -37,7 +39,7 @@ using namespace o2::soa; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::analysis::femtoDream; -struct FemtoDreamPairTaskCascadeCascade { +struct FemtoDreamPairCascadeCascade { SliceCache cache; Preslice perCol = aod::femtodreamparticle::fdCollisionId; @@ -362,7 +364,7 @@ struct FemtoDreamPairTaskCascadeCascade { auto sliceCascade2 = partitionCascade2->sliceByCached(aod::femtodreamparticle::fdCollisionId, col.globalIndex(), cache); doSameEvent(sliceCascade1, sliceCascade2, parts, col); } - PROCESS_SWITCH(FemtoDreamPairTaskCascadeCascade, processSameEvent, "Enable processing same event", true); + PROCESS_SWITCH(FemtoDreamPairCascadeCascade, processSameEvent, "Enable processing same event", true); // Mixed events template @@ -435,12 +437,12 @@ struct FemtoDreamPairTaskCascadeCascade { LOG(fatal) << "Invalid binning policiy specifed. Breaking..."; } } - PROCESS_SWITCH(FemtoDreamPairTaskCascadeCascade, processMixedEvent, "Enable processing mixed events", true); + PROCESS_SWITCH(FemtoDreamPairCascadeCascade, processMixedEvent, "Enable processing mixed events", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { WorkflowSpec workflow{ - adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), }; return workflow; } From 3846a6f59ce7e45abb3b45bcdd3d6d9aa94e3496 Mon Sep 17 00:00:00 2001 From: gmantzar Date: Thu, 4 Sep 2025 17:46:38 +0200 Subject: [PATCH 9/9] Fix o2linter Error in CMakeLists relatest to the CascadeCascade task --- PWGCF/FemtoDream/Tasks/CMakeLists.txt | 2 +- ...mPairCascadeCascade.cxx => femtodreamPairCascadeCascade.cxx} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename PWGCF/FemtoDream/Tasks/{femtoDreamPairCascadeCascade.cxx => femtodreamPairCascadeCascade.cxx} (100%) diff --git a/PWGCF/FemtoDream/Tasks/CMakeLists.txt b/PWGCF/FemtoDream/Tasks/CMakeLists.txt index 0547b5932bc..95c4f8cdaa0 100644 --- a/PWGCF/FemtoDream/Tasks/CMakeLists.txt +++ b/PWGCF/FemtoDream/Tasks/CMakeLists.txt @@ -30,7 +30,7 @@ o2physics_add_dpl_workflow(femtodream-pair-track-cascade COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(femtodream-pair-casdcade-cascade - SOURCES femtoDreamPairCascadeCascade.cxx + SOURCES femtodreamPairCascadeCascade.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) diff --git a/PWGCF/FemtoDream/Tasks/femtoDreamPairCascadeCascade.cxx b/PWGCF/FemtoDream/Tasks/femtodreamPairCascadeCascade.cxx similarity index 100% rename from PWGCF/FemtoDream/Tasks/femtoDreamPairCascadeCascade.cxx rename to PWGCF/FemtoDream/Tasks/femtodreamPairCascadeCascade.cxx