-
Notifications
You must be signed in to change notification settings - Fork 650
[PWGHF] Add ML to Xic0ToXiPi DCA Filter analysis #12758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 10 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
3cb7d47
Add files via upload
Tao-Fang 6fd6bb1
Add files via upload
Tao-Fang 9629f7a
Add files via upload
Tao-Fang a5a9bd4
Update taskXic0ToXiPi.cxx
Tao-Fang 1fee4a5
Please consider the following formatting changes
alibuild eff8922
Merge pull request #12 from alibuild/alibot-cleanup-12758
Tao-Fang dbc579b
Add files via upload
Tao-Fang f478f54
Please consider the following formatting changes
alibuild f76f0e3
Merge pull request #13 from alibuild/alibot-cleanup-12758
Tao-Fang ee5f69b
Update CandidateSelectionTables.h
Tao-Fang ecb66b4
Update HfMlResponseXic0ToXiPi.h
Tao-Fang e7cc03c
Update taskXic0ToXiPi.cxx
Tao-Fang 40c08f1
Please consider the following formatting changes
alibuild 76f8414
Merge pull request #14 from alibuild/alibot-cleanup-12758
Tao-Fang 75dfc7e
Update taskXic0ToXiPi.cxx
Tao-Fang 935f4e5
Please consider the following formatting changes
alibuild 2aed772
Merge pull request #15 from alibuild/alibot-cleanup-12758
Tao-Fang 9f477c2
Merge branch 'master' into 20250827_1
Tao-Fang 3cc644c
Update taskXic0ToXiPi.cxx
Tao-Fang 2939ea2
Merge branch 'AliceO2Group:master' into 20250827_1
Tao-Fang 748728f
Update taskXic0ToXiPi.cxx
Tao-Fang 45950c7
Update candidateSelectorToXiPi.cxx
Tao-Fang 06997f1
Update treeCreatorToXiPi.cxx
Tao-Fang 64b4e4f
Update taskXic0ToXiPi.cxx
Tao-Fang 25b9b1b
Please consider the following formatting changes
alibuild 2f87cf4
Merge pull request #16 from alibuild/alibot-cleanup-12758
Tao-Fang a2abf4a
Merge branch 'AliceO2Group:master' into 20250827_1
Tao-Fang 4e9dd4c
Update taskFlowCharmHadrons.cxx
Tao-Fang 5727dff
Update taskXic0ToXiPi.cxx
Tao-Fang 23e866b
Update CandidateReconstructionTables.h
Tao-Fang 138362e
Update CandidateSelectionTables.h
Tao-Fang 50228aa
Update candidateSelectorXic0ToXiPiKf.cxx
Tao-Fang 611ed6c
Please consider the following formatting changes
alibuild 4f25cfa
Merge pull request #17 from alibuild/alibot-cleanup-12758
Tao-Fang 12b2049
Update CandidateReconstructionTables.h
Tao-Fang 04daca8
Update candidateSelectorToXiPi.cxx
Tao-Fang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| // 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, | ||
| 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(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(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_ | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.