Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3cb7d47
Add files via upload
Tao-Fang Aug 27, 2025
6fd6bb1
Add files via upload
Tao-Fang Aug 27, 2025
9629f7a
Add files via upload
Tao-Fang Aug 27, 2025
a5a9bd4
Update taskXic0ToXiPi.cxx
Tao-Fang Aug 27, 2025
1fee4a5
Please consider the following formatting changes
alibuild Aug 27, 2025
eff8922
Merge pull request #12 from alibuild/alibot-cleanup-12758
Tao-Fang Aug 27, 2025
dbc579b
Add files via upload
Tao-Fang Aug 27, 2025
f478f54
Please consider the following formatting changes
alibuild Aug 27, 2025
f76f0e3
Merge pull request #13 from alibuild/alibot-cleanup-12758
Tao-Fang Aug 27, 2025
ee5f69b
Update CandidateSelectionTables.h
Tao-Fang Sep 2, 2025
ecb66b4
Update HfMlResponseXic0ToXiPi.h
Tao-Fang Oct 6, 2025
e7cc03c
Update taskXic0ToXiPi.cxx
Tao-Fang Oct 6, 2025
40c08f1
Please consider the following formatting changes
alibuild Oct 6, 2025
76f8414
Merge pull request #14 from alibuild/alibot-cleanup-12758
Tao-Fang Oct 6, 2025
75dfc7e
Update taskXic0ToXiPi.cxx
Tao-Fang Oct 7, 2025
935f4e5
Please consider the following formatting changes
alibuild Oct 7, 2025
2aed772
Merge pull request #15 from alibuild/alibot-cleanup-12758
Tao-Fang Oct 7, 2025
9f477c2
Merge branch 'master' into 20250827_1
Tao-Fang Oct 7, 2025
3cc644c
Update taskXic0ToXiPi.cxx
Tao-Fang Oct 7, 2025
2939ea2
Merge branch 'AliceO2Group:master' into 20250827_1
Tao-Fang Oct 8, 2025
748728f
Update taskXic0ToXiPi.cxx
Tao-Fang Oct 8, 2025
45950c7
Update candidateSelectorToXiPi.cxx
Tao-Fang Oct 8, 2025
06997f1
Update treeCreatorToXiPi.cxx
Tao-Fang Oct 8, 2025
64b4e4f
Update taskXic0ToXiPi.cxx
Tao-Fang Oct 8, 2025
25b9b1b
Please consider the following formatting changes
alibuild Oct 8, 2025
2f87cf4
Merge pull request #16 from alibuild/alibot-cleanup-12758
Tao-Fang Oct 8, 2025
a2abf4a
Merge branch 'AliceO2Group:master' into 20250827_1
Tao-Fang Oct 11, 2025
4e9dd4c
Update taskFlowCharmHadrons.cxx
Tao-Fang Oct 11, 2025
5727dff
Update taskXic0ToXiPi.cxx
Tao-Fang Oct 11, 2025
23e866b
Update CandidateReconstructionTables.h
Tao-Fang Oct 11, 2025
138362e
Update CandidateSelectionTables.h
Tao-Fang Oct 11, 2025
50228aa
Update candidateSelectorXic0ToXiPiKf.cxx
Tao-Fang Oct 11, 2025
611ed6c
Please consider the following formatting changes
alibuild Oct 11, 2025
4f25cfa
Merge pull request #17 from alibuild/alibot-cleanup-12758
Tao-Fang Oct 11, 2025
12b2049
Update CandidateReconstructionTables.h
Tao-Fang Oct 11, 2025
04daca8
Update candidateSelectorToXiPi.cxx
Tao-Fang Oct 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions PWGHF/Core/HfMlResponseXic0ToXiPi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
// 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 HfMlResponseXic0ToXiPi.h
/// \brief Class to compute the ML response for Ξc^0 → Ξ∓ π± analysis selections
/// \author Tao Fang <tao.fang@cern.ch>, Central China Normal University

#ifndef PWGHF_CORE_HFMLRESPONSEXIC0TOXIPI_H_
#define PWGHF_CORE_HFMLRESPONSEXIC0TOXIPI_H_

#include "PWGHF/Core/HfMlResponse.h"

#include "Tools/ML/MlResponse.h"

#include <cstdint>
#include <vector>

// Fill the map of available input features
// the key is the feature's name (std::string)
// the value is the corresponding value in EnumInputFeatures
#define FILL_MAP_XIC0TOXIPI(FEATURE) \
{ \
#FEATURE, static_cast<uint8_t>(InputFeaturesXic0ToXiPi::FEATURE) \
}

// Check if the index of mCachedIndices (index associated to a FEATURE)
// matches the entry in EnumInputFeatures associated to this FEATURE
// if so, the inputFeatures vector is filled with the FEATURE's value
// by calling the corresponding GETTER from OBJECT
#define CHECK_AND_FILL_VEC_XIC0TOXIPI_FULL(OBJECT, FEATURE, GETTER) \
case static_cast<uint8_t>(InputFeaturesXic0ToXiPi::FEATURE): { \
inputFeatures.emplace_back(OBJECT.GETTER()); \
break; \
}

// where OBJECT is named candidate and FEATURE = GETTER
#define CHECK_AND_FILL_VEC_XIC0TOXIPI(GETTER) \
case static_cast<uint8_t>(InputFeaturesXic0ToXiPi::GETTER): { \
inputFeatures.emplace_back(candidate.GETTER()); \
break; \
}

namespace o2::analysis
{

enum class InputFeaturesXic0ToXiPi : uint8_t {
tpcNSigmaPiFromLambda,
tpcNSigmaPiFromCasc,
tpcNSigmaPiFromCharmBaryon,
dcaCascDau,
dcaCharmBaryonDau,
cosPACharmBaryon,
cosPACasc,
cosPAV0,
impactParBachFromCharmBaryonXY,
impactParCascXY
};

template <typename TypeOutputScore = float>
class HfMlResponseXic0ToXiPi : public HfMlResponse<TypeOutputScore>
{
public:
/// Default constructor
HfMlResponseXic0ToXiPi() = default;
/// Default destructor
virtual ~HfMlResponseXic0ToXiPi() = default;

/// Method to get the input features vector needed for ML inference
/// \param candidate is the Xic0 candidate
/// \return inputFeatures vector
template <typename T1, typename T2, typename T3>
// std::vector<float> getInputFeatures(T1 const& candidate)
std::vector<float> getInputFeatures(T1 const& candidate, T2 const& lamProngPi, T2 const& cascProngPi, T3 const& charmBaryonProngPi)
{
std::vector<float> inputFeatures;

for (const auto& idx : MlResponse<TypeOutputScore>::mCachedIndices) {
switch (idx) {
// PID variables
CHECK_AND_FILL_VEC_XIC0TOXIPI_FULL(lamProngPi, tpcNSigmaPiFromLambda, tpcNSigmaPi);
CHECK_AND_FILL_VEC_XIC0TOXIPI_FULL(cascProngPi, tpcNSigmaPiFromCasc, tpcNSigmaPi);
CHECK_AND_FILL_VEC_XIC0TOXIPI_FULL(charmBaryonProngPi, tpcNSigmaPiFromCharmBaryon, tpcNSigmaPi);
// DCA
CHECK_AND_FILL_VEC_XIC0TOXIPI(dcaCascDau);
CHECK_AND_FILL_VEC_XIC0TOXIPI(dcaCharmBaryonDau);
// CosPA
CHECK_AND_FILL_VEC_XIC0TOXIPI(cosPACharmBaryon);
CHECK_AND_FILL_VEC_XIC0TOXIPI(cosPACasc);
CHECK_AND_FILL_VEC_XIC0TOXIPI(cosPAV0);
// ImpactPar
CHECK_AND_FILL_VEC_XIC0TOXIPI(impactParBachFromCharmBaryonXY);
CHECK_AND_FILL_VEC_XIC0TOXIPI(impactParCascXY);
}
}

return inputFeatures;
}

protected:
/// Method to fill the map of available input features
void setAvailableInputFeatures()
{
MlResponse<TypeOutputScore>::mAvailableInputFeatures = {
FILL_MAP_XIC0TOXIPI(tpcNSigmaPiFromLambda),
FILL_MAP_XIC0TOXIPI(tpcNSigmaPiFromCasc),
FILL_MAP_XIC0TOXIPI(tpcNSigmaPiFromCharmBaryon),
FILL_MAP_XIC0TOXIPI(dcaCascDau),
FILL_MAP_XIC0TOXIPI(dcaCharmBaryonDau),
FILL_MAP_XIC0TOXIPI(cosPACharmBaryon),
FILL_MAP_XIC0TOXIPI(cosPACasc),
FILL_MAP_XIC0TOXIPI(cosPAV0),
FILL_MAP_XIC0TOXIPI(impactParBachFromCharmBaryonXY),
FILL_MAP_XIC0TOXIPI(impactParCascXY)};
}
};

} // namespace o2::analysis

#undef FILL_MAP_XIC0TOXIPI
#undef CHECK_AND_FILL_VEC_XIC0TOXIPI_FULL
#undef CHECK_AND_FILL_VEC_XIC0TOXIPI

#endif // PWGHF_CORE_HFMLRESPONSEXIC0TOXIPI_H_
2 changes: 1 addition & 1 deletion PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ struct HfTaskFlowCharmHadrons {
using CandXicData = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelXicToPKPi>>;
using CandXicDataWMl = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelXicToPKPi, aod::HfMlXicToPKPi>>;
using CandXic0Data = soa::Filtered<soa::Join<aod::HfCandToXiPiKf, aod::HfSelToXiPiKf>>;
using CandXic0DataWMl = soa::Filtered<soa::Join<aod::HfCandToXiPiKf, aod::HfSelToXiPiKf, aod::HfMlToXiPiKf>>;
using CandXic0DataWMl = soa::Filtered<soa::Join<aod::HfCandToXiPiKf, aod::HfSelToXiPiKf, aod::HfMlToXiPi>>;
using CandD0DataWMl = soa::Filtered<soa::Join<aod::HfCand2Prong, aod::HfSelD0, aod::HfMlD0>>;
using CandD0Data = soa::Filtered<soa::Join<aod::HfCand2Prong, aod::HfSelD0>>;
using CollsWithQvecs = soa::Join<aod::Collisions, aod::EvSels, aod::QvectorFT0Cs, aod::QvectorFT0As, aod::QvectorFT0Ms, aod::QvectorFV0As, aod::QvectorBPoss, aod::QvectorBNegs, aod::QvectorBTots, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs>;
Expand Down
Loading
Loading