From ace4a2d1ffe7b885e33aaeb8285c4c059477323d Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Fri, 8 Mar 2024 01:57:35 +0100 Subject: [PATCH 1/7] Define ev. sel. function, and add it to candidateCreator3Prong. --- .../TableProducer/candidateCreator3Prong.cxx | 22 ++++++--- PWGHF/Utils/utilsEvSelHf.h | 46 +++++++++++++++++++ 2 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 PWGHF/Utils/utilsEvSelHf.h diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 62592028761..6a23f20a658 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -28,6 +28,7 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" +#include "PWGHF/Utils/utilsEvSelHf.h" using namespace o2; using namespace o2::analysis; @@ -44,6 +45,10 @@ struct HfCandidateCreator3Prong { // centrality Configurable centralityMin{"centralityMin", 0., "Minimum centrality"}; Configurable centralityMax{"centralityMax", 100., "Maximum centrality"}; + // event selection + Configurable useSel8Trigger{"useSel8Trigger", true, "apply the sel8 event selection"}; + Configurable maxPvPosZ{"maxPvPosZ", 10.f, "max. PV posZ (cm)"}; + Configurable useTimeFrameBorderCut{"useTimeFrameBorderCut", true, "apply TF border cut"}; // vertexing Configurable propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"}; Configurable useAbsDCA{"useAbsDCA", false, "Minimise abs. distance rather than chi2"}; @@ -154,6 +159,11 @@ struct HfCandidateCreator3Prong { } } + /// event selection: sel8, PV posZ, TF border cut + if (!applyEventSelectionHfCollision(collision, useSel8Trigger, maxPvPosZ, useTimeFrameBorderCut)) { + continue; + } + auto track0 = rowTrackIndexProng3.template prong0_as(); auto track1 = rowTrackIndexProng3.template prong1_as(); auto track2 = rowTrackIndexProng3.template prong2_as(); @@ -284,7 +294,7 @@ struct HfCandidateCreator3Prong { /////////////////////////////////// /// @brief process function w/ PV refit and w/o centrality selections - void processPvRefit(aod::Collisions const& collisions, + void processPvRefit(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) @@ -294,7 +304,7 @@ struct HfCandidateCreator3Prong { PROCESS_SWITCH(HfCandidateCreator3Prong, processPvRefit, "Run candidate creator with PV refit and w/o centrality selections", false); /// @brief process function w/o PV refit and w/o centrality selections - void processNoPvRefit(aod::Collisions const& collisions, + void processNoPvRefit(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) @@ -310,7 +320,7 @@ struct HfCandidateCreator3Prong { ///////////////////////////////////////////// /// @brief process function w/ PV refit and w/ centrality selection on FT0C - void processPvRefitCentFT0C(soa::Join const& collisions, + void processPvRefitCentFT0C(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) @@ -320,7 +330,7 @@ struct HfCandidateCreator3Prong { PROCESS_SWITCH(HfCandidateCreator3Prong, processPvRefitCentFT0C, "Run candidate creator with PV refit and w/ centrality selection on FT0C", false); /// @brief process function w/o PV refit and w/ centrality selection on FT0C - void processNoPvRefitCentFT0C(soa::Join const& collisions, + void processNoPvRefitCentFT0C(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) @@ -336,7 +346,7 @@ struct HfCandidateCreator3Prong { ///////////////////////////////////////////// /// @brief process function w/ PV refit and w/ centrality selection on FT0M - void processPvRefitCentFT0M(soa::Join const& collisions, + void processPvRefitCentFT0M(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) @@ -346,7 +356,7 @@ struct HfCandidateCreator3Prong { PROCESS_SWITCH(HfCandidateCreator3Prong, processPvRefitCentFT0M, "Run candidate creator with PV refit and w/ centrality selection on FT0M", false); /// @brief process function w/o PV refit and w/ centrality selection on FT0M - void processNoPvRefitCentFT0M(soa::Join const& collisions, + void processNoPvRefitCentFT0M(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h new file mode 100644 index 00000000000..1e32adba893 --- /dev/null +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -0,0 +1,46 @@ +// 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. + +/// \file eventselectionHf.h +/// \brief Utility set the event selections for HF analyses +/// \author Mattia Faggin , CERN + +#ifndef PWGHF_UTILS_UTILSEVSELHF_H_ +#define PWGHF_UTILS_UTILSEVSELHF_H_ + +/// @brief Function to apply the event selections for HF analyses +/// \param collision the current collision that has to satisfy the selection criteria +/// \param useSel8Trigger bool to activate the sel8() event selection +/// \param maxPvPosZ maximum primary-vertex Z allowed +/// \param useTimeFrameBorderCutbool to activate the TF border cut +template +bool applyEventSelectionHfCollision(const Coll& collision, const bool& useSel8Trigger, const float& maxPvPosZ, const bool& useTimeFrameBorderCut) +{ + + /// sel8() condition + if (useSel8Trigger && !collision.sel8()) { + return false; + } + + /// primary vertex z + if (std::fabs(collision.posZ()) > maxPvPosZ) { + return false; + } + + /// TF border cut + if (useTimeFrameBorderCut && !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { + return false; + } + + /// all conditions satisfied + return true; +} +#endif // PWGHF_UTILS_UTILSEVSELHF_H_ \ No newline at end of file From 7837a5198fa9440323a3f462890eb65f89697a59 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Fri, 8 Mar 2024 02:03:32 +0100 Subject: [PATCH 2/7] Add ev. sel. to candidateCreator3Prong. --- .../TableProducer/candidateCreator2Prong.cxx | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 78eab6edfb5..bc92c7e89b8 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -39,6 +39,7 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" +#include "PWGHF/Utils/utilsEvSelHf.h" using namespace o2; using namespace o2::analysis; @@ -55,6 +56,10 @@ struct HfCandidateCreator2Prong { // centrality Configurable centralityMin{"centralityMin", 0., "Minimum centrality"}; Configurable centralityMax{"centralityMax", 100., "Maximum centrality"}; + // event selection + Configurable useSel8Trigger{"useSel8Trigger", true, "apply the sel8 event selection"}; + Configurable maxPvPosZ{"maxPvPosZ", 10.f, "max. PV posZ (cm)"}; + Configurable useTimeFrameBorderCut{"useTimeFrameBorderCut", true, "apply TF border cut"}; // vertexing Configurable constrainKfToPv{"constrainKfToPv", true, "constraint KFParticle to PV"}; Configurable propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"}; @@ -161,6 +166,11 @@ struct HfCandidateCreator2Prong { } } + /// event selection: sel8, PV posZ, TF border cut + if (!applyEventSelectionHfCollision(collision, useSel8Trigger, maxPvPosZ, useTimeFrameBorderCut)) { + continue; + } + auto track0 = rowTrackIndexProng2.template prong0_as(); auto track1 = rowTrackIndexProng2.template prong1_as(); auto trackParVarPos1 = getTrackParCov(track0); @@ -427,7 +437,7 @@ struct HfCandidateCreator2Prong { /////////////////////////////////// /// @brief process function using DCA fitter w/ PV refit and w/o centrality selections - void processPvRefitWithDCAFitterN(aod::Collisions const& collisions, + void processPvRefitWithDCAFitterN(soa::Join const& collisions, soa::Join const& rowsTrackIndexProng2, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) @@ -437,7 +447,7 @@ struct HfCandidateCreator2Prong { PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithDCAFitterN, "Run candidate creator using DCA fitter w/ PV refit and w/o centrality selections", false); /// @brief process function using DCA fitter w/o PV refit and w/o centrality selections - void processNoPvRefitWithDCAFitterN(aod::Collisions const& collisions, + void processNoPvRefitWithDCAFitterN(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexProng2, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) @@ -447,7 +457,7 @@ struct HfCandidateCreator2Prong { PROCESS_SWITCH(HfCandidateCreator2Prong, processNoPvRefitWithDCAFitterN, "Run candidate creator using DCA fitter w/o PV refit and w/o centrality selections", true); /// @brief process function using KFParticle package w/ PV refit and w/o centrality selections - void processPvRefitWithKFParticle(aod::Collisions const& collisions, + void processPvRefitWithKFParticle(soa::Join const& collisions, soa::Join const& rowsTrackIndexProng2, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) @@ -457,7 +467,7 @@ struct HfCandidateCreator2Prong { PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithKFParticle, "Run candidate creator using KFParticle package w/ PV refit and w/o centrality selections", false); /// @brief process function using KFParticle package w/o PV refit and w/o centrality selections - void processNoPvRefitWithKFParticle(aod::Collisions const& collisions, + void processNoPvRefitWithKFParticle(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexProng2, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) @@ -473,7 +483,7 @@ struct HfCandidateCreator2Prong { ///////////////////////////////////////////// /// @brief process function using DCA fitter w/ PV refit and w/ centrality selection on FT0C - void processPvRefitWithDCAFitterNCentFT0C(soa::Join const& collisions, + void processPvRefitWithDCAFitterNCentFT0C(soa::Join const& collisions, soa::Join const& rowsTrackIndexProng2, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) @@ -483,7 +493,7 @@ struct HfCandidateCreator2Prong { PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithDCAFitterNCentFT0C, "Run candidate creator using DCA fitter w/ PV refit and w/ centrality selection on FT0C", false); /// @brief process function using DCA fitter w/o PV refit and w/ centrality selection FT0C - void processNoPvRefitWithDCAFitterNCentFT0C(soa::Join const& collisions, + void processNoPvRefitWithDCAFitterNCentFT0C(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexProng2, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) @@ -493,7 +503,7 @@ struct HfCandidateCreator2Prong { PROCESS_SWITCH(HfCandidateCreator2Prong, processNoPvRefitWithDCAFitterNCentFT0C, "Run candidate creator using DCA fitter w/o PV refit and w/ centrality selection FT0C", false); /// @brief process function using KFParticle package w/ PV refit and w/ centrality selection on FT0C - void processPvRefitWithKFParticleCentFT0C(soa::Join const& collisions, + void processPvRefitWithKFParticleCentFT0C(soa::Join const& collisions, soa::Join const& rowsTrackIndexProng2, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) @@ -503,7 +513,7 @@ struct HfCandidateCreator2Prong { PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithKFParticleCentFT0C, "Run candidate creator using KFParticle package w/ PV refit and w/ centrality selection on FT0C", false); /// @brief process function using KFParticle package w/o PV refit and w/o centrality selections - void processNoPvRefitWithKFParticleCentFT0C(soa::Join const& collisions, + void processNoPvRefitWithKFParticleCentFT0C(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexProng2, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) @@ -519,7 +529,7 @@ struct HfCandidateCreator2Prong { ///////////////////////////////////////////// /// @brief process function using DCA fitter w/ PV refit and w/ centrality selection on FT0M - void processPvRefitWithDCAFitterNCentFT0M(soa::Join const& collisions, + void processPvRefitWithDCAFitterNCentFT0M(soa::Join const& collisions, soa::Join const& rowsTrackIndexProng2, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) @@ -529,7 +539,7 @@ struct HfCandidateCreator2Prong { PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithDCAFitterNCentFT0M, "Run candidate creator using DCA fitter w/ PV refit and w/ centrality selection on FT0M", false); /// @brief process function using DCA fitter w/o PV refit and w/ centrality selection FT0M - void processNoPvRefitWithDCAFitterNCentFT0M(soa::Join const& collisions, + void processNoPvRefitWithDCAFitterNCentFT0M(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexProng2, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) @@ -539,7 +549,7 @@ struct HfCandidateCreator2Prong { PROCESS_SWITCH(HfCandidateCreator2Prong, processNoPvRefitWithDCAFitterNCentFT0M, "Run candidate creator using DCA fitter w/o PV refit and w/ centrality selection FT0M", false); /// @brief process function using KFParticle package w/ PV refit and w/ centrality selection on FT0M - void processPvRefitWithKFParticleCentFT0M(soa::Join const& collisions, + void processPvRefitWithKFParticleCentFT0M(soa::Join const& collisions, soa::Join const& rowsTrackIndexProng2, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) @@ -549,7 +559,7 @@ struct HfCandidateCreator2Prong { PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithKFParticleCentFT0M, "Run candidate creator using KFParticle package w/ PV refit and w/ centrality selection on FT0M", false); /// @brief process function using KFParticle package w/o PV refit and w/o centrality selections - void processNoPvRefitWithKFParticleCentFT0M(soa::Join const& collisions, + void processNoPvRefitWithKFParticleCentFT0M(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexProng2, aod::TracksWCovExtra const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) From 55344852697e65c8ab8e8ed2804a0a91a1c8f021 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Fri, 8 Mar 2024 02:06:50 +0100 Subject: [PATCH 3/7] Add ev. sel. to candidateCreatorDstar. --- PWGHF/TableProducer/candidateCreatorDstar.cxx | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index 2c0c75b348b..06d01b878ce 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -29,6 +29,7 @@ // PWGHF #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" +#include "PWGHF/Utils/utilsEvSelHf.h" using namespace o2; using namespace o2::aod::hf_collision_centrality; @@ -58,6 +59,11 @@ struct HfCandidateCreatorDstar { Configurable centralityMin{"centralityMin", 0., "Minimum centrality"}; Configurable centralityMax{"centralityMax", 100., "Maximum centrality"}; + // event selection + Configurable useSel8Trigger{"useSel8Trigger", true, "apply the sel8 event selection"}; + Configurable maxPvPosZ{"maxPvPosZ", 10.f, "max. PV posZ (cm)"}; + Configurable useTimeFrameBorderCut{"useTimeFrameBorderCut", true, "apply TF border cut"}; + // vertexing Configurable propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"}; Configurable maxR{"maxR", 200., "reject PCA's above this radius"}; // ........... what is unit of this? @@ -167,6 +173,11 @@ struct HfCandidateCreatorDstar { } } + /// event selection: sel8, PV posZ, TF border cut + if (!applyEventSelectionHfCollision(collision, useSel8Trigger, maxPvPosZ, useTimeFrameBorderCut)) { + continue; + } + auto trackPi = rowTrackIndexDstar.template prong0_as(); auto prongD0 = rowTrackIndexDstar.template prongD0_as(); auto trackD0Prong0 = prongD0.template prong0_as(); @@ -326,7 +337,7 @@ struct HfCandidateCreatorDstar { /////////////////////////////////// /// @brief process function w/ PV refit and w/o centrality selections - void processPvRefit(aod::Collisions const& collisions, + void processPvRefit(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexD0, aod::HfDstarsWithPvRefitInfo const& rowsTrackIndexDstar, aod::TracksWCov const& tracks, @@ -337,7 +348,7 @@ struct HfCandidateCreatorDstar { PROCESS_SWITCH(HfCandidateCreatorDstar, processPvRefit, " Run candidate creator with PV refit and w/o centrality selections", false); /// @brief process function w/o PV refit and w/o centrality selections - void processNoPvRefit(aod::Collisions const& collisions, + void processNoPvRefit(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexD0, aod::HfDstars const& rowsTrackIndexDstar, aod::TracksWCov const& tracks, @@ -354,7 +365,7 @@ struct HfCandidateCreatorDstar { ///////////////////////////////////////////// /// @brief process function w/ PV refit and w/ centrality selection on FT0C - void processPvRefitCentFT0C(soa::Join const& collisions, + void processPvRefitCentFT0C(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexD0, aod::HfDstarsWithPvRefitInfo const& rowsTrackIndexDstar, aod::TracksWCov const& tracks, @@ -365,7 +376,7 @@ struct HfCandidateCreatorDstar { PROCESS_SWITCH(HfCandidateCreatorDstar, processPvRefitCentFT0C, " Run candidate creator with PV refit nad w/ centrality selection on FT0C", false); /// @brief process function w/o PV refit and w/ centrality selection on FT0C - void processNoPvRefitCentFT0C(soa::Join const& collisions, + void processNoPvRefitCentFT0C(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexD0, aod::HfDstars const& rowsTrackIndexDstar, aod::TracksWCov const& tracks, @@ -382,7 +393,7 @@ struct HfCandidateCreatorDstar { ///////////////////////////////////////////// /// @brief process function w/ PV refit and w/ centrality selection on FT0M - void processPvRefitCentFT0M(soa::Join const& collisions, + void processPvRefitCentFT0M(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexD0, aod::HfDstarsWithPvRefitInfo const& rowsTrackIndexDstar, aod::TracksWCov const& tracks, @@ -393,7 +404,7 @@ struct HfCandidateCreatorDstar { PROCESS_SWITCH(HfCandidateCreatorDstar, processPvRefitCentFT0M, " Run candidate creator with PV refit nad w/ centrality selection on FT0M", false); /// @brief process function w/o PV refit and w/ centrality selection on FT0M - void processNoPvRefitCentFT0M(soa::Join const& collisions, + void processNoPvRefitCentFT0M(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexD0, aod::HfDstars const& rowsTrackIndexDstar, aod::TracksWCov const& tracks, From 69a9b56005be618b0f6b751056cb6417614b0492 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Fri, 8 Mar 2024 02:09:52 +0100 Subject: [PATCH 4/7] Add ev. sel. to candidateCreatorCascade. --- PWGHF/TableProducer/candidateCreatorCascade.cxx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreatorCascade.cxx b/PWGHF/TableProducer/candidateCreatorCascade.cxx index 96735fa9838..35ba0627eb5 100644 --- a/PWGHF/TableProducer/candidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorCascade.cxx @@ -28,6 +28,7 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" +#include "PWGHF/Utils/utilsEvSelHf.h" using namespace o2; using namespace o2::analysis; @@ -42,6 +43,10 @@ struct HfCandidateCreatorCascade { // centrality Configurable centralityMin{"centralityMin", 0., "Minimum centrality"}; Configurable centralityMax{"centralityMax", 100., "Maximum centrality"}; + // event selection + Configurable useSel8Trigger{"useSel8Trigger", true, "apply the sel8 event selection"}; + Configurable maxPvPosZ{"maxPvPosZ", 10.f, "max. PV posZ (cm)"}; + Configurable useTimeFrameBorderCut{"useTimeFrameBorderCut", true, "apply TF border cut"}; // vertexing // Configurable bz{"bz", 5., "magnetic field"}; Configurable propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"}; @@ -133,6 +138,11 @@ struct HfCandidateCreatorCascade { } } + /// event selection: sel8, PV posZ, TF border cut + if (!applyEventSelectionHfCollision(collision, useSel8Trigger, maxPvPosZ, useTimeFrameBorderCut)) { + continue; + } + const auto& bach = casc.prong0_as(); LOGF(debug, "V0 %d in HF cascade %d.", casc.v0Id(), casc.globalIndex()); if (!casc.has_v0()) { @@ -297,7 +307,7 @@ struct HfCandidateCreatorCascade { } /// @brief process function w/o centrality selections - void processNoCent(aod::Collisions const& collisions, + void processNoCent(soa::Join const& collisions, aod::HfCascades const& rowsTrackIndexCasc, aod::V0sLinked const& v0sLinked, aod::V0Datas const& v0Data, @@ -310,7 +320,7 @@ struct HfCandidateCreatorCascade { PROCESS_SWITCH(HfCandidateCreatorCascade, processNoCent, " Run candidate creator w/o centrality selections", true); /// @brief process function w/ centrality selection on FT0C - void processCentFT0C(soa::Join const& collisions, + void processCentFT0C(soa::Join const& collisions, aod::HfCascades const& rowsTrackIndexCasc, aod::V0sLinked const& v0sLinked, aod::V0Datas const& v0Data, @@ -323,7 +333,7 @@ struct HfCandidateCreatorCascade { PROCESS_SWITCH(HfCandidateCreatorCascade, processCentFT0C, " Run candidate creator w/ centrality selection on FT0C", false); /// @brief process function w/ centrality selection on FT0M - void processCentFT0M(soa::Join const& collisions, + void processCentFT0M(soa::Join const& collisions, aod::HfCascades const& rowsTrackIndexCasc, aod::V0sLinked const& v0sLinked, aod::V0Datas const& v0Data, From 46d34e73772bbeb20ce8acd8ca8a6649da83565c Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Fri, 8 Mar 2024 02:18:59 +0100 Subject: [PATCH 5/7] Fix MegaLinter. --- PWGHF/Utils/utilsEvSelHf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 1e32adba893..c07feac1903 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -43,4 +43,4 @@ bool applyEventSelectionHfCollision(const Coll& collision, const bool& useSel8Tr /// all conditions satisfied return true; } -#endif // PWGHF_UTILS_UTILSEVSELHF_H_ \ No newline at end of file +#endif // PWGHF_UTILS_UTILSEVSELHF_H_ From 3f311693d6bbea97ca869939a75a00fc4e016433 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Fri, 8 Mar 2024 15:35:32 +0100 Subject: [PATCH 6/7] Implement comments by Vit. --- PWGHF/TableProducer/candidateCreator2Prong.cxx | 2 +- PWGHF/TableProducer/candidateCreator3Prong.cxx | 2 +- PWGHF/TableProducer/candidateCreatorCascade.cxx | 2 +- PWGHF/TableProducer/candidateCreatorDstar.cxx | 2 +- PWGHF/Utils/utilsEvSelHf.h | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index bc92c7e89b8..bd4e292e513 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -167,7 +167,7 @@ struct HfCandidateCreator2Prong { } /// event selection: sel8, PV posZ, TF border cut - if (!applyEventSelectionHfCollision(collision, useSel8Trigger, maxPvPosZ, useTimeFrameBorderCut)) { + if (!isHfCollisionSelected(collision, useSel8Trigger, maxPvPosZ, useTimeFrameBorderCut)) { continue; } diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 6a23f20a658..ccfa9451593 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -160,7 +160,7 @@ struct HfCandidateCreator3Prong { } /// event selection: sel8, PV posZ, TF border cut - if (!applyEventSelectionHfCollision(collision, useSel8Trigger, maxPvPosZ, useTimeFrameBorderCut)) { + if (!isHfCollisionSelected(collision, useSel8Trigger, maxPvPosZ, useTimeFrameBorderCut)) { continue; } diff --git a/PWGHF/TableProducer/candidateCreatorCascade.cxx b/PWGHF/TableProducer/candidateCreatorCascade.cxx index 35ba0627eb5..9c08adb124d 100644 --- a/PWGHF/TableProducer/candidateCreatorCascade.cxx +++ b/PWGHF/TableProducer/candidateCreatorCascade.cxx @@ -139,7 +139,7 @@ struct HfCandidateCreatorCascade { } /// event selection: sel8, PV posZ, TF border cut - if (!applyEventSelectionHfCollision(collision, useSel8Trigger, maxPvPosZ, useTimeFrameBorderCut)) { + if (!isHfCollisionSelected(collision, useSel8Trigger, maxPvPosZ, useTimeFrameBorderCut)) { continue; } diff --git a/PWGHF/TableProducer/candidateCreatorDstar.cxx b/PWGHF/TableProducer/candidateCreatorDstar.cxx index 06d01b878ce..c7322121e98 100644 --- a/PWGHF/TableProducer/candidateCreatorDstar.cxx +++ b/PWGHF/TableProducer/candidateCreatorDstar.cxx @@ -174,7 +174,7 @@ struct HfCandidateCreatorDstar { } /// event selection: sel8, PV posZ, TF border cut - if (!applyEventSelectionHfCollision(collision, useSel8Trigger, maxPvPosZ, useTimeFrameBorderCut)) { + if (!isHfCollisionSelected(collision, useSel8Trigger, maxPvPosZ, useTimeFrameBorderCut)) { continue; } diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index c07feac1903..fbea192b352 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file eventselectionHf.h +/// \file utilsEvSelHf.h /// \brief Utility set the event selections for HF analyses /// \author Mattia Faggin , CERN @@ -22,7 +22,7 @@ /// \param maxPvPosZ maximum primary-vertex Z allowed /// \param useTimeFrameBorderCutbool to activate the TF border cut template -bool applyEventSelectionHfCollision(const Coll& collision, const bool& useSel8Trigger, const float& maxPvPosZ, const bool& useTimeFrameBorderCut) +bool isHfCollisionSelected(const Coll& collision, bool useSel8Trigger, float maxPvPosZ, bool useTimeFrameBorderCut) { /// sel8() condition @@ -35,7 +35,7 @@ bool applyEventSelectionHfCollision(const Coll& collision, const bool& useSel8Tr return false; } - /// TF border cut + /// time frame border cut if (useTimeFrameBorderCut && !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { return false; } From e09d2ed623b6f209ccd0c6a8ef2f213ffabd9d59 Mon Sep 17 00:00:00 2001 From: Mattia Faggin Date: Fri, 8 Mar 2024 16:00:41 +0100 Subject: [PATCH 7/7] Adjust isHfCollisionSelected documentation. --- PWGHF/Utils/utilsEvSelHf.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index fbea192b352..0b87373377c 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -16,11 +16,12 @@ #ifndef PWGHF_UTILS_UTILSEVSELHF_H_ #define PWGHF_UTILS_UTILSEVSELHF_H_ -/// @brief Function to apply the event selections for HF analyses -/// \param collision the current collision that has to satisfy the selection criteria -/// \param useSel8Trigger bool to activate the sel8() event selection -/// \param maxPvPosZ maximum primary-vertex Z allowed -/// \param useTimeFrameBorderCutbool to activate the TF border cut +/// \brief Function to apply event selections in HF analyses +/// \param collision collision that has to satisfy the selection criteria +/// \param useSel8Trigger switch to activate the sel8() event selection +/// \param zPvPosMax maximum primary-vertex z +/// \param useTimeFrameBorderCut switch to activate the time frame border cut +/// \return true if collision satisfies all criteria, false otherwise template bool isHfCollisionSelected(const Coll& collision, bool useSel8Trigger, float maxPvPosZ, bool useTimeFrameBorderCut) {