Skip to content

Conversation

@zhangbiao-phy
Copy link
Collaborator

@zhangbiao-phy zhangbiao-phy commented Jan 31, 2026

@fgrosa, the BB parametrization is validated with two diffrent analysis of LF

@github-actions github-actions bot added the pwghf PWG-HF label Jan 31, 2026
@github-actions github-actions bot changed the title Implement TPC pid for light nuclei based on Bethe-Bloch parametrization [PWGHF] Implement TPC pid for light nuclei based on Bethe-Bloch parametrization Jan 31, 2026
@zhangbiao-phy zhangbiao-phy changed the title [PWGHF] Implement TPC pid for light nuclei based on Bethe-Bloch parametrization Implement TPC pid for light nuclei based on Bethe-Bloch parametrization in HF track skimming task Jan 31, 2026
@github-actions github-actions bot changed the title Implement TPC pid for light nuclei based on Bethe-Bloch parametrization in HF track skimming task [PWGHF] Implement TPC pid for light nuclei based on Bethe-Bloch parametrization in HF track skimming task Jan 31, 2026
{-4, 3, 5., 0., 100, 100, 0.83, 160., 1.},
{-4, 3, 5., 0., 100, 100, 0.83, 160., 1.}};
static const std::vector<std::string> labelsCutsTrack = {"nSigmaMinIts", "minItsClusterSizes", "minItsCluster", "minItsIbCluster", "minTpcCluster", "minTpcRow", "minTpcCrossedOverFound", "maxTpcShared", "maxTpcFracShared"};
constexpr float CutsTrackQuality[3][10] = {{-4, 3, 5., 0., 100, 100, 0.83, 160., 1., 5},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already commented on this many times before. Do not hard-code array dimensions.

{-4, 3, 5., 0., 100, 100, 0.83, 160., 1.},
{-4, 3, 5., 0., 100, 100, 0.83, 160., 1.}};
static const std::vector<std::string> labelsCutsTrack = {"nSigmaMinIts", "minItsClusterSizes", "minItsCluster", "minItsIbCluster", "minTpcCluster", "minTpcRow", "minTpcCrossedOverFound", "maxTpcShared", "maxTpcFracShared"};
constexpr float CutsTrackQuality[3][10] = {{-4, 3, 5., 0., 100, 100, 0.83, 160., 1., 5},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are initialising float elements with a mixture of int and double values.

static const std::vector<std::string> labelsCutsTrack = {"nSigmaMinIts", "minItsClusterSizes", "minItsCluster", "minItsIbCluster", "minTpcCluster", "minTpcRow", "minTpcCrossedOverFound", "maxTpcShared", "maxTpcFracShared", "maxTPCnSigmaBB"};
static const std::vector<std::string> labelsRowsNucleiType = {"Deutron", "Triton", "Helium3"};

constexpr float BetheBlochParams[3][6] = {{5.39302, 7.859534, 0.004048, 2.323197, 1.609307, 0.09},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not hard-code array dimensions.

#include "Common/DataModel/TrackSelectionTables.h"
#include "Tools/ML/MlResponse.h"

#include "MathUtils/BetheBlochAleph.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a correct format.


// CharmNuclei track selection
Configurable<LabeledArray<float>> selectionsLightNuclei{"selectionsLightNuclei", {hf_presel_lightnuclei::CutsTrackQuality[0], 3, 9, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsCutsTrack}, "nuclei track selections for deuteron / triton / helium applied if proper process function enabled"};
Configurable<LabeledArray<float>> selectionsLightNuclei{"selectionsLightNuclei", {hf_presel_lightnuclei::CutsTrackQuality[0], 3, 10, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsCutsTrack}, "nuclei track selections for deuteron / triton / helium applied if proper process function enabled"};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not hard-code array dimensions.

// CharmNuclei track selection
Configurable<LabeledArray<float>> selectionsLightNuclei{"selectionsLightNuclei", {hf_presel_lightnuclei::CutsTrackQuality[0], 3, 9, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsCutsTrack}, "nuclei track selections for deuteron / triton / helium applied if proper process function enabled"};
Configurable<LabeledArray<float>> selectionsLightNuclei{"selectionsLightNuclei", {hf_presel_lightnuclei::CutsTrackQuality[0], 3, 10, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsCutsTrack}, "nuclei track selections for deuteron / triton / helium applied if proper process function enabled"};
Configurable<LabeledArray<float>> tpcPidBBParamsLightNuclei{"tpcPidBBParamsLightNuclei", {hf_presel_lightnuclei::BetheBlochParams[0], 3, 6, hf_presel_lightnuclei::labelsRowsNucleiType, hf_presel_lightnuclei::labelsBetheBlochParams},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not hard-code array dimensions.

Comment on lines 1691 to 1692
default:
return false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a valid scenario or an error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error, I add an LOG(fatal) there now

const float maxTpcFracShared = config.selectionsLightNuclei->get(row, 8u);

// Optional: BB-based TPC nσ selection (only if enabled)
const float maxTPCnSigmaBB = config.selectionsLightNuclei->get(row, 9u);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max is not a quantity. Follow naming conventions.

Comment on lines 1781 to 1784
// Mass/charge hypothesis for the selected nucleus.
const double mass =
(lightnuclei == ChannelsNucleiQA::Deuteron) ? MassDeuteron : (lightnuclei == ChannelsNucleiQA::Triton) ? MassTriton
: MassHelium3;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not nest ternary operators. A switch statement or a function would be much better.

Comment on lines 1856 to 1857
ChannelsNucleiQA nucleiType =
(iDecay3P == hf_cand_3prong::DecayType::CdToDeKPi) ? ChannelsNucleiQA::Deuteron : (iDecay3P == hf_cand_3prong::DecayType::CtToTrKPi) ? ChannelsNucleiQA::Triton
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not nest ternary operators. A switch statement or a function would be much better.

@zhangbiao-phy
Copy link
Collaborator Author

thanks @vkucera! I fixed your comments now, please take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pwghf PWG-HF

Development

Successfully merging this pull request may close these issues.

2 participants