From 833ee94c87fe9be4ae833e866b818a4ca4c3c2bb Mon Sep 17 00:00:00 2001 From: Lucia Anna Tarasovicova Date: Wed, 17 Jan 2024 11:04:45 +0100 Subject: [PATCH 1/3] add new task for analysing cascades based on derived data --- PWGLF/Tasks/CMakeLists.txt | 5 + PWGLF/Tasks/derivedcascadeanalysis.cxx | 785 +++++++++++++++++++++++++ 2 files changed, 790 insertions(+) create mode 100644 PWGLF/Tasks/derivedcascadeanalysis.cxx diff --git a/PWGLF/Tasks/CMakeLists.txt b/PWGLF/Tasks/CMakeLists.txt index 74dafa9618b..cadf2a948ec 100644 --- a/PWGLF/Tasks/CMakeLists.txt +++ b/PWGLF/Tasks/CMakeLists.txt @@ -160,6 +160,11 @@ o2physics_add_dpl_workflow(vzero-cascade-absorption PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(derivedcascadeanalysis + SOURCES derivedcascadeanalysis.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + # Resonance o2physics_add_dpl_workflow(rsnanalysis SOURCES rsnanalysis.cxx diff --git a/PWGLF/Tasks/derivedcascadeanalysis.cxx b/PWGLF/Tasks/derivedcascadeanalysis.cxx new file mode 100644 index 00000000000..0286ecff0c1 --- /dev/null +++ b/PWGLF/Tasks/derivedcascadeanalysis.cxx @@ -0,0 +1,785 @@ +// Copyright 2019-2020 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. +// +/// \ post processing for Cascade analysis runing on derived data +/// \author Lucia Anna Tarasovicova (lucia.anna.husova@cern.ch) + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "ReconstructionDataFormats/Track.h" +#include "Common/Core/RecoDecay.h" +#include "Common/Core/trackUtilities.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" +#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/PIDResponse.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "Framework/ASoAHelpers.h" + +// constants +const float ctauxiPDG = 4.91; // from PDG +const float ctauomegaPDG = 2.461; // from PDG + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using std::array; + +struct derivedCascadeAnalysis { + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + Configurable zVertexCut{"zVertexCut", 10, "Cut on PV position"}; + + ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "pt axis for QA histograms"}; + + ConfigurableAxis vertexZ{"vertexZ", {30, -15.0f, 15.0f}, ""}; + ConfigurableAxis axisXiMass{"axisXiMass", {200, 1.222f, 1.422f}, ""}; + ConfigurableAxis axisOmegaMass{"axisOmegaMass", {200, 1.572f, 1.772f}, ""}; + + Configurable isXi{"isXi", 1, "Apply cuts for Xi identification"}; + Configurable isMC{"isMC", false, "MC data are processed"}; + Configurable doPtDepCutStudy{"doPtDepCutStudy", false, "Fill histogram with a cutting paramer"}; + + Configurable minPt{"minPt", 0.0f, "minPt"}; + Configurable masswin{"masswin", 0.05, "Mass window limit"}; + Configurable lambdaMassWin{"lambdaMassWin", 0.005, "V0 Mass window limit"}; + Configurable rapCut{"rapCut", 0.5, "Rapidity acceptance"}; + Configurable etaDauCut{"etaDauCut", 0.8, "Pseudorapidity acceptance of the cascade daughters"}; + Configurable dcaBaryonToPV{"dcaBaryonToPV", 0.05, "DCA of baryon doughter track To PV"}; + Configurable dcaMesonToPV{"dcaMesonToPV", 0.1, "DCA of meson doughter track To PV"}; + Configurable dcaBachToPV{"dcaBachToPV", 0.04, "DCA Bach To PV"}; + Configurable casCosPaPtParameter{"casCosPaPtParameter", 0.341715, "Parameter for pt dependent cos PA cut"}; + Configurable casccospa{"casccospa", 0.97, "Casc CosPA"}; + Configurable v0CosPaPtParameter{"v0CosPaPtParameter", 0.341715, "Parameter for pt dependent cos PA cut of the V0 daughter"}; + Configurable v0cospa{"v0cospa", 0.97, "V0 CosPA"}; + Configurable dcacascdau{"dcacascdau", 1.3, "DCA Casc Daughters"}; + Configurable dcav0dau{"dcav0dau", 1.5, "DCA V0 Daughters"}; + Configurable dcaV0ToPV{"dcaV0ToPV", 0.06, "DCA V0 To PV"}; + Configurable minRadius{"minRadius", 0.6f, "minRadius"}; + Configurable maxRadius{"maxRadius", 100.0f, "maxRadius"}; + Configurable minV0Radius{"minV0Radius", 1.2f, "V0 transverse decay radius, minimum"}; + Configurable maxV0Radius{"maxV0Radius", 100.0f, "V0 transverse decay radius, maximum"}; + Configurable nsigmatpcPi{"nsigmatpcPi", 5, "N sigma TPC Pion"}; + Configurable nsigmatpcPr{"nsigmatpcPr", 5, "N sigma TPC Proton"}; + Configurable nsigmatpcKa{"nsigmatpcKa", 5, "N sigma TPC Kaon"}; + Configurable bachBaryonCosPA{"bachBaryonCosPA", 0.9999, "Bachelor baryon CosPA"}; + Configurable bachBaryonDCAxyToPV{"bachBaryonDCAxyToPV", 0.05, "DCA bachelor baryon to PV"}; + Configurable mintpccrrows{"mintpccrrows", 50, "min N TPC crossed rows"}; + Configurable dooobrej{"dooobrej", 0, "OOB rejection: 0 no selection, 1 = ITS||TOF, 2 = TOF only for pT > ptthrtof"}; + Configurable ptthrtof{"ptthrtof", 2, "Pt threshold for applying only tof oob rejection"}; + Configurable proplifetime{"proplifetime", 6, "ctau/"}; + Configurable rejcomp{"rejcomp", 0.008, "Competing Cascade rejection"}; + + Configurable doPtDepCosPaCut{"doPtDepCosPaCut", false, "Enable pt dependent cos PA cut"}; + Configurable doPtDepV0CosPaCut{"doPtDepV0CosPaCut", false, "Enable pt dependent cos PA cut of the V0 daughter"}; + Configurable doDCAdauToPVCut{"doDCAdauToPVCut", true, "Enable cut DCA daughter track to PV"}; + Configurable doCascadeCosPaCut{"doCascadeCosPaCut", true, "Enable cos PA cut"}; + Configurable doV0CosPaCut{"doV0CosPaCut", true, "Enable cos PA cut for the V0 daughter"}; + Configurable doDCACascadeDauCut{"doDCACascadeDauCut", true, "Enable cut DCA betweenn daughter tracks"}; + Configurable doDCAV0DauCut{"doDCAV0DauCut", true, "Enable cut DCA betweenn V0 daughter tracks"}; + Configurable doCascadeRadiusCut{"doCascadeRadiusCut", true, "Enable cut on the cascade radius"}; + Configurable doV0RadiusCut{"doV0RadiusCut", true, "Enable cut on the V0 radius"}; + Configurable doDCAV0ToPVCut{"doDCAV0ToPVCut", true, "Enable cut DCA of V0 to PV"}; + Configurable doNTPCSigmaCut{"doNTPCSigmaCut", false, "Enable cut N sigma TPC"}; + Configurable doBachelorBaryonCut{"doBachelorBaryonCut", true, "Enable Bachelor-Baryon cut "}; + Configurable doProperLifeTimeCut{"doProperLifeTimeCut", true, "Enable proper life-time cut "}; + + Service pdgDB; + + void init(InitContext const&) + { + histos.add("hEventVertexZ", "hEventVertexZ", kTH1F, {vertexZ}); + histos.add("hEventCentrality", "hEventCentrality", kTH1F, {{101, 0, 101}}); + histos.add("hEventSelection", "hEventSelection", kTH1F, {{4, 0, 4}}); + + histos.add("hCandidate", "hCandidate", HistType::kTH1F, {{22, -0.5, 21.5}}); + + TString CutLabel[22] = {"All", "MassWin", "y", "DCACascDau", "DCAV0Dau", "rCasc", "rCascMax", "rV0", "rV0Max", "LambdaMass", "Bach-baryon", "V0CosPA", "CompDecayMass", "DCADauToPV", "EtaDau", "CascCosPA", "DCAV0ToPV", "nSigmaTPCV0Dau", "NTPCrows", "OOBRej", "nSigmaTPCbachelor", "ctau"}; + for (Int_t i = 1; i <= histos.get(HIST("hCandidate"))->GetNbinsX(); i++) { + histos.get(HIST("hCandidate"))->GetXaxis()->SetBinLabel(i, CutLabel[i - 1]); + } + + histos.add("InvMassBefSel/hNegativeCascade", "hNegativeCascade", HistType::kTH3F, {axisPt, axisXiMass, {101, 0, 101}}); + histos.add("InvMassBefSel/hPositiveCascade", "hPositiveCascade", {HistType::kTH3F, {axisPt, axisXiMass, {101, 0, 101}}}); + + if (!isXi) { + histos.get(HIST("InvMassBefSel/hNegativeCascade"))->GetYaxis()->Set(200, 1.572f, 1.772f); + histos.get(HIST("InvMassBefSel/hPositiveCascade"))->GetYaxis()->Set(200, 1.572f, 1.772f); + } + + histos.addClone("InvMassBefSel/", "InvMassAfterSel/"); + if (isMC) + histos.addClone("InvMassBefSel/", "InvMassAfterSelMCrecTruth/"); + + if (doPtDepCutStudy && !doProperLifeTimeCut) { + histos.add("PtDepCutStudy/hNegativeCascadeProperLifeTime", "hNegativeCascadeProperLifeTime", HistType::kTH3F, {axisPt, axisXiMass, {100, 0, 10}}); + histos.add("PtDepCutStudy/hPositiveCascadeProperLifeTime", "hPositiveCascadeProperLifeTime", {HistType::kTH3F, {axisPt, axisXiMass, {100, 0, 10}}}); + if (!isXi) { + histos.get(HIST("PtDepCutStudy/hNegativeCascadeProperLifeTime"))->GetYaxis()->Set(200, 1.572f, 1.772f); + histos.get(HIST("PtDepCutStudy/hPositiveCascadeProperLifeTime"))->GetYaxis()->Set(200, 1.572f, 1.772f); + } + } + if (doPtDepCutStudy && !doBachelorBaryonCut) { + histos.add("PtDepCutStudy/hNegativeBachelorBaryonDCA", "hNegativeBachelorBaryonDCA", HistType::kTH3F, {axisPt, axisXiMass, {40, 0, 1}}); + histos.add("PtDepCutStudy/hPositiveBachelorBaryonDCA", "hPositiveBachelorBaryonDCA", {HistType::kTH3F, {axisPt, axisXiMass, {40, 0, 1}}}); + if (!isXi) { + histos.get(HIST("PtDepCutStudy/hNegativeBachelorBaryonDCA"))->GetYaxis()->Set(200, 1.572f, 1.772f); + histos.get(HIST("PtDepCutStudy/hPositiveBachelorBaryonDCA"))->GetYaxis()->Set(200, 1.572f, 1.772f); + } + } + if (doPtDepCutStudy && !doDCAV0ToPVCut) { + histos.add("PtDepCutStudy/hNegativeDCAV0ToPV", "hNegativeDCAV0ToPV", HistType::kTH3F, {axisPt, axisXiMass, {40, 0, 1}}); + histos.add("PtDepCutStudy/hPositiveDCAV0ToPV", "hPositiveDCAV0ToPV", {HistType::kTH3F, {axisPt, axisXiMass, {40, 0, 1}}}); + if (!isXi) { + histos.get(HIST("PtDepCutStudy/hNegativeDCAV0ToPV"))->GetYaxis()->Set(200, 1.572f, 1.772f); + histos.get(HIST("PtDepCutStudy/hPositiveDCAV0ToPV"))->GetYaxis()->Set(200, 1.572f, 1.772f); + } + } + if (doPtDepCutStudy && !doV0RadiusCut) { + histos.add("PtDepCutStudy/hNegativeV0Radius", "hNegativeV0Radius", HistType::kTH3F, {axisPt, axisXiMass, {20, 0, 10}}); + histos.add("PtDepCutStudy/hPositiveV0Radius", "hPositiveV0Radius", {HistType::kTH3F, {axisPt, axisXiMass, {20, 0, 10}}}); + if (!isXi) { + histos.get(HIST("PtDepCutStudy/hNegativeV0Radius"))->GetYaxis()->Set(200, 1.572f, 1.772f); + histos.get(HIST("PtDepCutStudy/hPositiveV0Radius"))->GetYaxis()->Set(200, 1.572f, 1.772f); + } + } + if (doPtDepCutStudy && !doCascadeRadiusCut) { + histos.add("PtDepCutStudy/hNegativeCascadeRadius", "hNegativeCascadeRadius", HistType::kTH3F, {axisPt, axisXiMass, {50, 0, 5}}); + histos.add("PtDepCutStudy/hPositiveCascadeRadius", "hPositiveCascadeRadius", {HistType::kTH3F, {axisPt, axisXiMass, {50, 0, 5}}}); + if (!isXi) { + histos.get(HIST("PtDepCutStudy/hNegativeCascadeRadius"))->GetYaxis()->Set(200, 1.572f, 1.772f); + histos.get(HIST("PtDepCutStudy/hPositiveCascadeRadius"))->GetYaxis()->Set(200, 1.572f, 1.772f); + } + } + + if (doPtDepCutStudy && !doDCAV0DauCut) { + histos.add("PtDepCutStudy/hNegativeDCAV0Daughters", "hNegativeDCAV0Daughters", HistType::kTH3F, {axisPt, axisXiMass, {50, 0, 5}}); + histos.add("PtDepCutStudy/hPositiveDCAV0Daughters", "hPositiveDCAV0Daughters", {HistType::kTH3F, {axisPt, axisXiMass, {50, 0, 5}}}); + if (!isXi) { + histos.get(HIST("PtDepCutStudy/hNegativeDCAV0Daughters"))->GetYaxis()->Set(200, 1.572f, 1.772f); + histos.get(HIST("PtDepCutStudy/hPositiveDCAV0Daughters"))->GetYaxis()->Set(200, 1.572f, 1.772f); + } + } + + if (doPtDepCutStudy && !doDCACascadeDauCut) { + histos.add("PtDepCutStudy/hNegativeDCACascDaughters", "hNegativeDCACascDaughters", HistType::kTH3F, {axisPt, axisXiMass, {50, 0, 5}}); + histos.add("PtDepCutStudy/hPositiveDCACascDaughters", "hPositiveDCACascDaughters", {HistType::kTH3F, {axisPt, axisXiMass, {50, 0, 5}}}); + if (!isXi) { + histos.get(HIST("PtDepCutStudy/hPositiveDCACascDaughters"))->GetYaxis()->Set(200, 1.572f, 1.772f); + histos.get(HIST("PtDepCutStudy/hNegativeDCACascDaughters"))->GetYaxis()->Set(200, 1.572f, 1.772f); + } + } + + if (doPtDepCutStudy && !doV0CosPaCut) { + histos.add("PtDepCutStudy/hNegativeV0pa", "hNegativeV0pa", HistType::kTH3F, {axisPt, axisXiMass, {40, 0, 0.4}}); + histos.add("PtDepCutStudy/hPositiveV0pa", "hPositiveV0pa", {HistType::kTH3F, {axisPt, axisXiMass, {40, 0, 0.4}}}); + if (!isXi) { + histos.get(HIST("PtDepCutStudy/hNegativeV0pa"))->GetYaxis()->Set(200, 1.572f, 1.772f); + histos.get(HIST("PtDepCutStudy/hPositiveV0pa"))->GetYaxis()->Set(200, 1.572f, 1.772f); + } + } + if (doPtDepCutStudy && !doDCAdauToPVCut) { + histos.add("PtDepCutStudy/hNegativeDCABachelorToPV", "hNegativeDCABachelorToPV", HistType::kTH3F, {axisPt, axisXiMass, {50, 0, 0.5}}); + histos.add("PtDepCutStudy/hNegativeDCABaryonToPV", "hNegativeDCABaryonToPV", HistType::kTH3F, {axisPt, axisXiMass, {50, 0, 0.5}}); + histos.add("PtDepCutStudy/hNegativeDCAMesonToPV", "hNegativeDCAMesonToPV", HistType::kTH3F, {axisPt, axisXiMass, {50, 0, 0.5}}); + histos.add("PtDepCutStudy/hPositiveDCABachelorToPV", "hPositiveDCABachelorToPV", {HistType::kTH3F, {axisPt, axisXiMass, {50, 0, 0.5}}}); + histos.add("PtDepCutStudy/hPositiveDCABaryonToPV", "hPositiveDCABaryonToPV", HistType::kTH3F, {axisPt, axisXiMass, {50, 0, 0.5}}); + histos.add("PtDepCutStudy/hPositiveDCAMesonToPV", "hPositiveDCAMesonToPV", HistType::kTH3F, {axisPt, axisXiMass, {50, 0, 0.5}}); + if (!isXi) { + histos.get(HIST("PtDepCutStudy/hNegativeDCABachelorToPV"))->GetYaxis()->Set(200, 1.572f, 1.772f); + histos.get(HIST("PtDepCutStudy/hNegativeDCABaryonToPV"))->GetYaxis()->Set(200, 1.572f, 1.772f); + histos.get(HIST("PtDepCutStudy/hNegativeDCAMesonToPV"))->GetYaxis()->Set(200, 1.572f, 1.772f); + histos.get(HIST("PtDepCutStudy/hPositiveDCABachelorToPV"))->GetYaxis()->Set(200, 1.572f, 1.772f); + histos.get(HIST("PtDepCutStudy/hPositiveDCABaryonToPV"))->GetYaxis()->Set(200, 1.572f, 1.772f); + histos.get(HIST("PtDepCutStudy/hPositiveDCAMesonToPV"))->GetYaxis()->Set(200, 1.572f, 1.772f); + } + } + + if (doPtDepCutStudy && !doCascadeCosPaCut) { + histos.add("PtDepCutStudy/hNegativeCascPA", "hNegativeCascPA", HistType::kTH3F, {axisPt, axisXiMass, {40, 0, 0.4}}); + histos.add("PtDepCutStudy/hPositiveCascPA", "hPositiveCascPA", {HistType::kTH3F, {axisPt, axisXiMass, {40, 0, 0.4}}}); + if (!isXi) { + histos.get(HIST("PtDepCutStudy/hNegativeCascPA"))->GetYaxis()->Set(200, 1.572f, 1.772f); + histos.get(HIST("PtDepCutStudy/hPositiveCascPA"))->GetYaxis()->Set(200, 1.572f, 1.772f); + } + } + + if (isMC) + histos.addClone("PtDepCutStudy/", "PtDepCutStudyMCTruth/"); + } + template + bool IsCosPAAccepted(TCascade casc, float x, float y, float z) + { + + if (doPtDepV0CosPaCut) { + double ptdepCut = v0CosPaPtParameter / casc.pt(); + if (ptdepCut > 0.3 || casc.pt() < 0.5) + ptdepCut = 0.3; + if (casc.casccosPA(x, y, z) < TMath::Cos(ptdepCut)) + return false; + } else if (casc.casccosPA(x, y, z) < v0cospa) + return false; + + return true; + } + template + bool IsEventAccepted(TCollision coll) + { + histos.fill(HIST("hEventSelection"), 0.5 /* all collisions */); + if (!coll.sel8()) { + return false; + } + histos.fill(HIST("hEventSelection"), 1.5 /* collisions after sel*/); + if (TMath::Abs(coll.posZ()) > zVertexCut) { + return false; + } + histos.fill(HIST("hEventVertexZ"), coll.posZ()); + histos.fill(HIST("hEventSelection"), 2.5 /* collisions after sel pvz sel*/); + + if (coll.centFT0C() > 100) { + return false; + } + histos.fill(HIST("hEventCentrality"), coll.centFT0C()); + histos.fill(HIST("hEventSelection"), 3.5 /* collisions after sel centrality sel*/); + return true; + } + + template + bool IsCascadeCandidateAccepted(TCascade casc, int counter) + { + + if (isXi) { + if (TMath::Abs(casc.mXi() - pdgDB->Mass(3312)) > masswin) + return false; + histos.fill(HIST("hCandidate"), ++counter); + if (TMath::Abs(casc.yXi()) > rapCut) + return false; + histos.fill(HIST("hCandidate"), ++counter); + } else { + if (TMath::Abs(casc.mOmega() - pdgDB->Mass(3334)) > masswin) + return false; + histos.fill(HIST("hCandidate"), ++counter); + if (TMath::Abs(casc.yOmega()) > rapCut) + return false; + histos.fill(HIST("hCandidate"), ++counter); + } + + if (doDCACascadeDauCut) { + if (casc.dcacascdaughters() > dcacascdau) + return false; + histos.fill(HIST("hCandidate"), ++counter); + } else + ++counter; + + if (doDCAV0DauCut) { + if (casc.dcaV0daughters() > dcav0dau) + return false; + histos.fill(HIST("hCandidate"), ++counter); + } else + ++counter; + + if (doCascadeRadiusCut) { + if (casc.cascradius() < minRadius) + return false; + histos.fill(HIST("hCandidate"), ++counter); + + if (casc.cascradius() > maxRadius) + return false; + histos.fill(HIST("hCandidate"), ++counter); + } else + counter += 2; + + if (doV0RadiusCut) { + if (casc.v0radius() < minV0Radius) + return false; + histos.fill(HIST("hCandidate"), ++counter); + if (casc.v0radius() > maxV0Radius) + return false; + histos.fill(HIST("hCandidate"), ++counter); + } else + counter += 2; + + if (TMath::Abs(casc.mLambda() - pdgDB->Mass(3122)) > lambdaMassWin) + return false; + histos.fill(HIST("hCandidate"), ++counter); + + if (doBachelorBaryonCut) { + if ((casc.bachBaryonCosPA() > bachBaryonCosPA || TMath::Abs(casc.bachBaryonDCAxyToPV()) < bachBaryonDCAxyToPV)) { // Bach-baryon selection if required + return false; + } + histos.fill(HIST("hCandidate"), ++counter); + } else + ++counter; + + if (doV0CosPaCut) { + if (!IsCosPAAccepted(casc, casc.x(), casc.y(), casc.z())) + return false; + histos.fill(HIST("hCandidate"), ++counter); + } else + ++counter; + + if (isXi) { + if (TMath::Abs(casc.mOmega() - pdgDB->Mass(3334)) < rejcomp) + return false; + histos.fill(HIST("hCandidate"), ++counter); + } else { + if (TMath::Abs(casc.mXi() - pdgDB->Mass(3312)) < rejcomp) + return false; + histos.fill(HIST("hCandidate"), ++counter); + } + + if (doDCAdauToPVCut) { + if (TMath::Abs(casc.dcabachtopv()) < dcaBachToPV) + return false; + if (casc.sign() > 0 && (TMath::Abs(casc.dcanegtopv()) < dcaBaryonToPV || TMath::Abs(casc.dcapostopv()) < dcaMesonToPV)) + return false; + if (casc.sign() < 0 && (TMath::Abs(casc.dcapostopv()) < dcaBaryonToPV || TMath::Abs(casc.dcanegtopv()) < dcaMesonToPV)) + return false; + histos.fill(HIST("hCandidate"), ++counter); + } else + ++counter; + + return true; + } + + void processCascades(soa::Join::iterator const& coll, soa::Join const& Cascades, soa::Join const&) + { + + if (!IsEventAccepted(coll)) + return; + + for (auto& casc : Cascades) { + + int counter = -1; + histos.fill(HIST("hCandidate"), ++counter); + + double invmass; + if (isXi) + invmass = casc.mXi(); + else + invmass = casc.mOmega(); + // To have trace of how it was before selections + if (casc.sign() < 0) { + histos.fill(HIST("InvMassBefSel/hNegativeCascade"), casc.pt(), invmass, coll.centFT0C()); + } + if (casc.sign() > 0) { + histos.fill(HIST("InvMassBefSel/hPositiveCascade"), casc.pt(), invmass, coll.centFT0C()); + } + + if (!IsCascadeCandidateAccepted(casc, counter)) + continue; + counter += 13; + + auto negExtra = casc.negTrackExtra_as>(); + auto posExtra = casc.posTrackExtra_as>(); + auto bachExtra = casc.bachTrackExtra_as>(); + + auto poseta = RecoDecay::eta(std::array{casc.pxpos(), casc.pypos(), casc.pzpos()}); + auto negeta = RecoDecay::eta(std::array{casc.pxneg(), casc.pyneg(), casc.pzneg()}); + auto bacheta = RecoDecay::eta(std::array{casc.pxbach(), casc.pybach(), casc.pzbach()}); + if (TMath::Abs(poseta) > etaDauCut || TMath::Abs(negeta) > etaDauCut || TMath::Abs(bacheta) > etaDauCut) + continue; + histos.fill(HIST("hCandidate"), ++counter); + + if (doCascadeCosPaCut) { + if (!IsCosPAAccepted(casc, coll.posX(), coll.posY(), coll.posZ())) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else + ++counter; + + if (doDCAV0ToPVCut) { + if (TMath::Abs(casc.dcav0topv(coll.posX(), coll.posY(), coll.posZ())) < dcaV0ToPV) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else + ++counter; + + if (doNTPCSigmaCut) { + if (casc.sign() < 0) { + if (TMath::Abs(posExtra.tpcNSigmaPr()) > nsigmatpcPr || TMath::Abs(negExtra.tpcNSigmaPi()) > nsigmatpcPi) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else if (casc.sign() > 0) { + if (TMath::Abs(posExtra.tpcNSigmaPi()) > nsigmatpcPi || TMath::Abs(negExtra.tpcNSigmaPr()) > nsigmatpcPr) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } + } else + ++counter; + + if (posExtra.tpcCrossedRows() < mintpccrrows || negExtra.tpcCrossedRows() < mintpccrrows || bachExtra.tpcCrossedRows() < mintpccrrows) + continue; + histos.fill(HIST("hCandidate"), ++counter); + + bool kHasTOF = (posExtra.hasTOF() || negExtra.hasTOF() || bachExtra.hasTOF()); + bool kHasITS = (posExtra.hasITS() || negExtra.hasITS() || bachExtra.hasITS()); + if (dooobrej == 1) { + if (!kHasTOF && !kHasITS) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else if (dooobrej == 2) { + if (!kHasTOF && (casc.pt() > ptthrtof)) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else { + ++counter; + } + + float cascpos = std::hypot(casc.x() - coll.posX(), casc.y() - coll.posY(), casc.z() - coll.posZ()); + float cascptotmom = std::hypot(casc.px(), casc.py(), casc.pz()); + float ctau = -10; + + if (isXi) { + if (doNTPCSigmaCut) { + if (TMath::Abs(bachExtra.tpcNSigmaPi()) > nsigmatpcPi) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else + ++counter; + + ctau = pdgDB->Mass(3312) * cascpos / ((cascptotmom + 1e-13) * ctauxiPDG); + if (doProperLifeTimeCut) { + if (ctau > proplifetime) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else { + ++counter; + } + } else { + if (doNTPCSigmaCut) { + if (TMath::Abs(bachExtra.tpcNSigmaKa()) > nsigmatpcKa) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else + ++counter; + + ctau = pdgDB->Mass(3334) * cascpos / ((cascptotmom + 1e-13) * ctauomegaPDG); + if (doProperLifeTimeCut) { + if (ctau > proplifetime) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else + ++counter; + } + + if (casc.sign() < 0) { + histos.fill(HIST("InvMassAfterSel/hNegativeCascade"), casc.pt(), invmass, coll.centFT0C()); + if (!doBachelorBaryonCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeBachelorBaryonDCA"), casc.pt(), invmass, casc.bachBaryonDCAxyToPV()); + if (!doDCAV0ToPVCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeDCAV0ToPV"), casc.pt(), invmass, TMath::Abs(casc.dcav0topv(casc.x(), casc.y(), casc.z()))); + if (!doV0RadiusCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeV0Radius"), casc.pt(), invmass, casc.v0radius()); + if (!doCascadeRadiusCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeCascadeRadius"), casc.pt(), invmass, casc.cascradius()); + if (!doDCAV0DauCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeDCAV0Daughters"), casc.pt(), invmass, casc.dcaV0daughters()); + if (!doDCACascadeDauCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeDCACascDaughters"), casc.pt(), invmass, casc.dcacascdaughters()); + if (!doV0CosPaCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeV0pa"), casc.pt(), invmass, TMath::ACos(casc.casccosPA(casc.x(), casc.y(), casc.z()))); + if (!doCascadeCosPaCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeCascPA"), casc.pt(), invmass, TMath::ACos(casc.casccosPA(coll.posX(), coll.posY(), coll.posZ()))); + if (!doDCAdauToPVCut && doPtDepCutStudy) { + histos.fill(HIST("PtDepCutStudy/hNegativeDCABachelorToPV"), casc.pt(), invmass, casc.dcabachtopv()); + histos.fill(HIST("PtDepCutStudy/hNegativeDCAMesonToPV"), casc.pt(), invmass, casc.dcanegtopv()); + histos.fill(HIST("PtDepCutStudy/hNegativeDCABaryonToPV"), casc.pt(), invmass, casc.dcapostopv()); + } + if (!doProperLifeTimeCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeCascadeProperLifeTime"), casc.pt(), invmass, ctau); + } else { + histos.fill(HIST("InvMassAfterSel/hPositiveCascade"), casc.pt(), invmass, coll.centFT0C()); + if (!doBachelorBaryonCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveBachelorBaryonDCA"), casc.pt(), invmass, casc.bachBaryonDCAxyToPV()); + if (!doDCAV0ToPVCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveDCAV0ToPV"), casc.pt(), invmass, TMath::Abs(casc.dcav0topv(casc.x(), casc.y(), casc.z()))); + if (!doV0RadiusCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveV0Radius"), casc.pt(), invmass, casc.v0radius()); + if (!doCascadeRadiusCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveCascadeRadius"), casc.pt(), invmass, casc.cascradius()); + if (!doDCAV0DauCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveDCAV0Daughters"), casc.pt(), invmass, casc.dcaV0daughters()); + if (!doDCACascadeDauCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveDCACascDaughters"), casc.pt(), invmass, casc.dcacascdaughters()); + if (!doV0CosPaCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveV0pa"), casc.pt(), invmass, TMath::ACos(casc.casccosPA(casc.x(), casc.y(), casc.z()))); + if (!doCascadeCosPaCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveCascPA"), casc.pt(), invmass, TMath::ACos(casc.casccosPA(coll.posX(), coll.posY(), coll.posZ()))); + if (!doDCAdauToPVCut && doPtDepCutStudy) { + histos.fill(HIST("PtDepCutStudy/hPositiveDCABachelorToPV"), casc.pt(), invmass, casc.dcabachtopv()); + histos.fill(HIST("PtDepCutStudy/hPositiveDCAMesonToPV"), casc.pt(), invmass, casc.dcapostopv()); + histos.fill(HIST("PtDepCutStudy/hPositiveDCABaryonToPV"), casc.pt(), invmass, casc.dcanegtopv()); + } + if (!doProperLifeTimeCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveCascadeProperLifeTime"), casc.pt(), invmass, ctau); + } + } + } + void processCascadesMCrec(soa::Join::iterator const& coll, soa::Join const& Cascades, soa::Join const&, aod::MotherMCParts const&) + { + if (!IsEventAccepted(coll)) + return; + + for (auto& casc : Cascades) { + + int counter = -1; + histos.fill(HIST("hCandidate"), ++counter); + + // To have trace of how it was before selections + if (casc.sign() < 0) { + if (isXi) + histos.fill(HIST("InvMassBefSel/hNegativeCascade"), casc.pt(), casc.mXi(), coll.centFT0C()); + else + histos.fill(HIST("InvMassBefSel/hNegativeCascade"), casc.pt(), casc.mOmega(), coll.centFT0C()); + } + if (casc.sign() > 0) { + if (isXi) + histos.fill(HIST("InvMassBefSel/hPositiveCascade"), casc.pt(), casc.mXi(), coll.centFT0C()); + else + histos.fill(HIST("InvMassBefSel/hPositiveCascade"), casc.pt(), casc.mOmega(), coll.centFT0C()); + } + + if (!IsCascadeCandidateAccepted(casc, counter)) + continue; + counter += 13; + + auto negExtra = casc.negTrackExtra_as>(); + auto posExtra = casc.posTrackExtra_as>(); + auto bachExtra = casc.bachTrackExtra_as>(); + + auto poseta = RecoDecay::eta(std::array{casc.pxpos(), casc.pypos(), casc.pzpos()}); + auto negeta = RecoDecay::eta(std::array{casc.pxneg(), casc.pyneg(), casc.pzneg()}); + auto bacheta = RecoDecay::eta(std::array{casc.pxbach(), casc.pybach(), casc.pzbach()}); + if (TMath::Abs(poseta) > etaDauCut || TMath::Abs(negeta) > etaDauCut || TMath::Abs(bacheta) > etaDauCut) + continue; + histos.fill(HIST("hCandidate"), ++counter); + + if (doCascadeCosPaCut) { + if (!IsCosPAAccepted(casc, coll.posX(), coll.posY(), coll.posZ())) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else + ++counter; + + if (doDCAV0ToPVCut) { + if (TMath::Abs(casc.dcav0topv(coll.posX(), coll.posY(), coll.posZ())) < dcaV0ToPV) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else + ++counter; + + if (doNTPCSigmaCut) { + if (casc.sign() < 0) { + if (TMath::Abs(posExtra.tpcNSigmaPr()) > nsigmatpcPr || TMath::Abs(negExtra.tpcNSigmaPi()) > nsigmatpcPi) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else if (casc.sign() > 0) { + if (TMath::Abs(posExtra.tpcNSigmaPi()) > nsigmatpcPi || TMath::Abs(negExtra.tpcNSigmaPr()) > nsigmatpcPr) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } + } else + ++counter; + + if (posExtra.tpcCrossedRows() < mintpccrrows || negExtra.tpcCrossedRows() < mintpccrrows || bachExtra.tpcCrossedRows() < mintpccrrows) + continue; + histos.fill(HIST("hCandidate"), ++counter); + + bool kHasTOF = (posExtra.hasTOF() || negExtra.hasTOF() || bachExtra.hasTOF()); + bool kHasITS = (posExtra.hasITS() || negExtra.hasITS() || bachExtra.hasITS()); + if (dooobrej == 1) { + if (!kHasTOF && !kHasITS) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else if (dooobrej == 2) { + if (!kHasTOF && (casc.pt() > ptthrtof)) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else { + ++counter; + } + + double invmass; + float cascpos = std::hypot(casc.x() - coll.posX(), casc.y() - coll.posY(), casc.z() - coll.posZ()); + float cascptotmom = std::hypot(casc.px(), casc.py(), casc.pz()); + float ctau = -10; + + if (isXi) { + if (doNTPCSigmaCut) { + if (TMath::Abs(bachExtra.tpcNSigmaPi()) > nsigmatpcPi) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else + ++counter; + + ctau = pdgDB->Mass(3312) * cascpos / ((cascptotmom + 1e-13) * ctauxiPDG); + if (doProperLifeTimeCut) { + if (ctau > proplifetime) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else { + ++counter; + } + + invmass = casc.mXi(); + } else { + if (doNTPCSigmaCut) { + if (TMath::Abs(bachExtra.tpcNSigmaKa()) > nsigmatpcKa) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else + ++counter; + ctau = pdgDB->Mass(3334) * cascpos / ((cascptotmom + 1e-13) * ctauomegaPDG); + if (doProperLifeTimeCut) { + if (ctau > proplifetime) + continue; + histos.fill(HIST("hCandidate"), ++counter); + } else + ++counter; + invmass = casc.mOmega(); + } + + if (casc.sign() < 0) { + histos.fill(HIST("InvMassAfterSel/hNegativeCascade"), casc.pt(), invmass, coll.centFT0C()); + if (!doBachelorBaryonCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeBachelorBaryonDCA"), casc.pt(), invmass, casc.bachBaryonDCAxyToPV()); + if (!doDCAV0ToPVCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeDCAV0ToPV"), casc.pt(), invmass, TMath::Abs(casc.dcav0topv(casc.x(), casc.y(), casc.z()))); + if (!doV0RadiusCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeV0Radius"), casc.pt(), invmass, casc.v0radius()); + if (!doCascadeRadiusCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeCascadeRadius"), casc.pt(), invmass, casc.cascradius()); + if (!doDCAV0DauCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeDCAV0Daughters"), casc.pt(), invmass, casc.dcaV0daughters()); + if (!doDCACascadeDauCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeDCACascDaughters"), casc.pt(), invmass, casc.dcacascdaughters()); + if (!doV0CosPaCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeV0pa"), casc.pt(), invmass, TMath::ACos(casc.casccosPA(casc.x(), casc.y(), casc.z()))); + if (!doCascadeCosPaCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeCascPA"), casc.pt(), invmass, TMath::ACos(casc.casccosPA(coll.posX(), coll.posY(), coll.posZ()))); + if (!doDCAdauToPVCut && doPtDepCutStudy) { + histos.fill(HIST("PtDepCutStudy/hNegativeDCABachelorToPV"), casc.pt(), invmass, casc.dcabachtopv()); + histos.fill(HIST("PtDepCutStudy/hNegativeDCAMesonToPV"), casc.pt(), invmass, casc.dcanegtopv()); + histos.fill(HIST("PtDepCutStudy/hNegativeDCABaryonToPV"), casc.pt(), invmass, casc.dcapostopv()); + } + if (!doProperLifeTimeCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hNegativeCascadeProperLifeTime"), casc.pt(), invmass, ctau); + if (casc.isPhysicalPrimary()) { + if ((isXi && casc.pdgCode() == 3312) || (!isXi && casc.pdgCode() == 3334)) { + histos.fill(HIST("InvMassAfterSelMCrecTruth/hNegativeCascade"), casc.pt(), invmass, coll.centFT0C()); + if (!doBachelorBaryonCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hNegativeBachelorBaryonDCA"), casc.pt(), invmass, casc.bachBaryonDCAxyToPV()); + if (!doDCAV0ToPVCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hNegativeDCAV0ToPV"), casc.pt(), invmass, TMath::Abs(casc.dcav0topv(casc.x(), casc.y(), casc.z()))); + if (!doV0RadiusCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hNegativeV0Radius"), casc.pt(), invmass, casc.v0radius()); + if (!doCascadeRadiusCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hNegativeCascadeRadius"), casc.pt(), invmass, casc.cascradius()); + if (!doDCAV0DauCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hNegativeDCAV0Daughters"), casc.pt(), invmass, casc.dcaV0daughters()); + if (!doDCACascadeDauCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hNegativeDCACascDaughters"), casc.pt(), invmass, casc.dcacascdaughters()); + if (!doV0CosPaCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hNegativeV0pa"), casc.pt(), invmass, TMath::ACos(casc.casccosPA(casc.x(), casc.y(), casc.z()))); + if (!doCascadeCosPaCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hNegativeCascPA"), casc.pt(), invmass, TMath::ACos(casc.casccosPA(coll.posX(), coll.posY(), coll.posZ()))); + if (!doDCAdauToPVCut && doPtDepCutStudy) { + histos.fill(HIST("PtDepCutStudyMCTruth/hNegativeDCABachelorToPV"), casc.pt(), invmass, casc.dcabachtopv()); + histos.fill(HIST("PtDepCutStudyMCTruth/hNegativeDCAMesonToPV"), casc.pt(), invmass, casc.dcanegtopv()); + histos.fill(HIST("PtDepCutStudyMCTruth/hNegativeDCABaryonToPV"), casc.pt(), invmass, casc.dcapostopv()); + } + if (!doProperLifeTimeCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hNegativeCascadeProperLifeTime"), casc.pt(), invmass, ctau); + } + } + } else { + histos.fill(HIST("InvMassAfterSel/hPositiveCascade"), casc.pt(), invmass, coll.centFT0C()); + if (!doBachelorBaryonCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveBachelorBaryonDCA"), casc.pt(), invmass, casc.bachBaryonDCAxyToPV()); + if (!doDCAV0ToPVCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveDCAV0ToPV"), casc.pt(), invmass, TMath::Abs(casc.dcav0topv(casc.x(), casc.y(), casc.z()))); + if (!doV0RadiusCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveV0Radius"), casc.pt(), invmass, casc.v0radius()); + if (!doCascadeRadiusCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveCascadeRadius"), casc.pt(), invmass, casc.cascradius()); + if (!doDCAV0DauCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveDCAV0Daughters"), casc.pt(), invmass, casc.dcaV0daughters()); + if (!doDCACascadeDauCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveDCACascDaughters"), casc.pt(), invmass, casc.dcacascdaughters()); + if (!doV0CosPaCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveV0pa"), casc.pt(), invmass, TMath::ACos(casc.casccosPA(casc.x(), casc.y(), casc.z()))); + if (!doCascadeCosPaCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveCascPA"), casc.pt(), invmass, TMath::ACos(casc.casccosPA(coll.posX(), coll.posY(), coll.posZ()))); + if (!doDCAdauToPVCut && doPtDepCutStudy) { + histos.fill(HIST("PtDepCutStudy/hPositiveDCABachelorToPV"), casc.pt(), invmass, casc.dcabachtopv()); + histos.fill(HIST("PtDepCutStudy/hPositiveDCAMesonToPV"), casc.pt(), invmass, casc.dcapostopv()); + histos.fill(HIST("PtDepCutStudy/hPositiveDCABaryonToPV"), casc.pt(), invmass, casc.dcanegtopv()); + } + if (!doProperLifeTimeCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudy/hPositiveCascadeProperLifeTime"), casc.pt(), invmass, ctau); + if (casc.isPhysicalPrimary()) { + if ((isXi && casc.pdgCode() == -3312) || (!isXi && casc.pdgCode() == -3334)) { + histos.fill(HIST("InvMassAfterSelMCrecTruth/hPositiveCascade"), casc.pt(), invmass, coll.centFT0C()); + if (!doBachelorBaryonCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hPositiveBachelorBaryonDCA"), casc.pt(), invmass, casc.bachBaryonDCAxyToPV()); + if (!doDCAV0ToPVCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hPositiveDCAV0ToPV"), casc.pt(), invmass, TMath::Abs(casc.dcav0topv(casc.x(), casc.y(), casc.z()))); + if (!doV0RadiusCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hPositiveV0Radius"), casc.pt(), invmass, casc.v0radius()); + if (!doCascadeRadiusCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hPositiveCascadeRadius"), casc.pt(), invmass, casc.cascradius()); + if (!doDCAV0DauCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hPositiveDCAV0Daughters"), casc.pt(), invmass, casc.dcaV0daughters()); + if (!doDCACascadeDauCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hPositiveDCACascDaughters"), casc.pt(), invmass, casc.dcacascdaughters()); + if (!doV0CosPaCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hPositiveV0pa"), casc.pt(), invmass, TMath::ACos(casc.casccosPA(casc.x(), casc.y(), casc.z()))); + if (!doCascadeCosPaCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hPositiveCascPA"), casc.pt(), invmass, TMath::ACos(casc.casccosPA(coll.posX(), coll.posY(), coll.posZ()))); + if (!doDCAdauToPVCut && doPtDepCutStudy) { + histos.fill(HIST("PtDepCutStudyMCTruth/hPositiveDCABachelorToPV"), casc.pt(), invmass, casc.dcabachtopv()); + histos.fill(HIST("PtDepCutStudyMCTruth/hPositiveDCAMesonToPV"), casc.pt(), invmass, casc.dcapostopv()); + histos.fill(HIST("PtDepCutStudyMCTruth/hPositiveDCABaryonToPV"), casc.pt(), invmass, casc.dcanegtopv()); + } + if (!doProperLifeTimeCut && doPtDepCutStudy) + histos.fill(HIST("PtDepCutStudyMCTruth/hPositiveCascadeProperLifeTime"), casc.pt(), invmass, ctau); + } + } + } + } + } + + PROCESS_SWITCH(derivedCascadeAnalysis, processCascades, "cascade analysis, run3 data ", true); + PROCESS_SWITCH(derivedCascadeAnalysis, processCascadesMCrec, "cascade analysis, run3 rec MC", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From 3fe7abc7bb8cfd27efaaaa824bf5e89523e51084 Mon Sep 17 00:00:00 2001 From: Lucia Anna Tarasovicova Date: Wed, 17 Jan 2024 13:16:05 +0100 Subject: [PATCH 2/3] add the event sel table --- PWGLF/Tasks/derivedcascadeanalysis.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/derivedcascadeanalysis.cxx b/PWGLF/Tasks/derivedcascadeanalysis.cxx index 0286ecff0c1..ebca65aa45e 100644 --- a/PWGLF/Tasks/derivedcascadeanalysis.cxx +++ b/PWGLF/Tasks/derivedcascadeanalysis.cxx @@ -366,7 +366,7 @@ struct derivedCascadeAnalysis { return true; } - void processCascades(soa::Join::iterator const& coll, soa::Join const& Cascades, soa::Join const&) + void processCascades(soa::Join::iterator const& coll, soa::Join const& Cascades, soa::Join const&) { if (!IsEventAccepted(coll)) @@ -540,7 +540,7 @@ struct derivedCascadeAnalysis { } } } - void processCascadesMCrec(soa::Join::iterator const& coll, soa::Join const& Cascades, soa::Join const&, aod::MotherMCParts const&) + void processCascadesMCrec(soa::Join::iterator const& coll, soa::Join const& Cascades, soa::Join const&, aod::MotherMCParts const&) { if (!IsEventAccepted(coll)) return; From c76f4ef274a6e0905edd64901a24af453f5171c4 Mon Sep 17 00:00:00 2001 From: Lucia Anna Tarasovicova Date: Wed, 17 Jan 2024 15:43:40 +0100 Subject: [PATCH 3/3] fix the collision subscription --- PWGLF/Tasks/derivedcascadeanalysis.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/derivedcascadeanalysis.cxx b/PWGLF/Tasks/derivedcascadeanalysis.cxx index ebca65aa45e..e18b3dffcc4 100644 --- a/PWGLF/Tasks/derivedcascadeanalysis.cxx +++ b/PWGLF/Tasks/derivedcascadeanalysis.cxx @@ -366,7 +366,7 @@ struct derivedCascadeAnalysis { return true; } - void processCascades(soa::Join::iterator const& coll, soa::Join const& Cascades, soa::Join const&) + void processCascades(soa::Join::iterator const& coll, soa::Join const& Cascades, soa::Join const&) { if (!IsEventAccepted(coll)) @@ -540,7 +540,7 @@ struct derivedCascadeAnalysis { } } } - void processCascadesMCrec(soa::Join::iterator const& coll, soa::Join const& Cascades, soa::Join const&, aod::MotherMCParts const&) + void processCascadesMCrec(soa::Join::iterator const& coll, soa::Join const& Cascades, soa::Join const&, aod::MotherMCParts const&) { if (!IsEventAccepted(coll)) return;