-
Notifications
You must be signed in to change notification settings - Fork 615
[PWGHF] Add Lb reduced workflow into the framework #10978
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 all commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
939a202
Add files via upload
zhangbiao-phy c24685c
Update HfHelper.h
zhangbiao-phy 40f2ad9
Update ReducedDataModel.h
zhangbiao-phy 06a3044
Update CandidateSelectionTables.h
zhangbiao-phy 79ae5cd
Update CandidateReconstructionTables.h
zhangbiao-phy 35d9e71
Update CMakeLists.txt
zhangbiao-phy 7ba146e
Update CMakeLists.txt
zhangbiao-phy 80c9c9f
Add files via upload
zhangbiao-phy 8ac973e
Add files via upload
zhangbiao-phy 44eccd3
Update candidateCreatorLbReduced.cxx
zhangbiao-phy 6cf18de
Update taskLbReduced.cxx
zhangbiao-phy 2f0b63f
Update candidateCreatorLbReduced.cxx
zhangbiao-phy 04fbe34
Update candidateCreatorLbReduced.cxx
zhangbiao-phy 5beba24
Update candidateSelectorLbToLcPiReduced.cxx
zhangbiao-phy 9565916
Update taskLbReduced.cxx
zhangbiao-phy dc63ad6
Update dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy af29198
Please consider the following formatting changes
alibuild 5108a3f
Merge pull request #24 from alibuild/alibot-cleanup-10978
zhangbiao-phy 29dc5e9
Update HfMlResponseLbToLcPi.h
zhangbiao-phy e16aa2a
Update CMakeLists.txt
zhangbiao-phy 4372de1
Update PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx
zhangbiao-phy 5f4d82c
Update PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx
zhangbiao-phy 24851f1
Update PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx
zhangbiao-phy f2867b4
Update PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx
zhangbiao-phy 6434ab1
Update PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy 9e418a2
Update PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy f58f9f0
Update PWGHF/D2H/Tasks/taskLbReduced.cxx
zhangbiao-phy 5bb7b33
Update PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx
zhangbiao-phy 5782536
Update PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy d225303
Update dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy 8af882f
Update PWGHF/D2H/TableProducer/candidateCreatorLbReduced.cxx
zhangbiao-phy 8032c02
Update PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy 90de737
Update PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy deb11a2
Update PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy ca09fa2
Update candidateCreatorLbReduced.cxx
zhangbiao-phy 0d52e4e
Update candidateSelectorLbToLcPiReduced.cxx
zhangbiao-phy 75cdded
Update taskLbReduced.cxx
zhangbiao-phy e2f2f14
Please consider the following formatting changes
alibuild f703375
Merge pull request #25 from alibuild/alibot-cleanup-10978
zhangbiao-phy ca0d218
Update ReducedDataModel.h
zhangbiao-phy 298088f
Update CMakeLists.txt
zhangbiao-phy b762e44
Create converterReducedHadronDausPid.cxx
zhangbiao-phy c83d1fe
Please consider the following formatting changes
alibuild 947ff6f
Merge pull request #26 from alibuild/alibot-cleanup-10978
zhangbiao-phy 5addcbb
Merge branch 'master' into lb_reduced
zhangbiao-phy 05d8bc1
Update candidateCreatorLbReduced.cxx
zhangbiao-phy ea1387c
Update HfMlResponseLbToLcPi.h
zhangbiao-phy de0e35d
Update CMakeLists.txt
zhangbiao-phy 9cbd8ab
Update dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy 27a4c6b
Update PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx
zhangbiao-phy 4e5e1a1
Update converterReducedHadronDausPid.cxx
zhangbiao-phy 97117af
Update candidateSelectorLbToLcPiReduced.cxx
zhangbiao-phy 40c0607
Please consider the following formatting changes
alibuild a3df623
Update candidateCreatorLbReduced.cxx
zhangbiao-phy b89eec8
Merge pull request #27 from alibuild/alibot-cleanup-10978
zhangbiao-phy ef315b0
Update CMakeLists.txt
zhangbiao-phy 7555776
Update candidateCreatorLbReduced.cxx
zhangbiao-phy 15d4e8f
fix Megalinter
zhangbiao-phy 88cf939
Merge branch 'master' into lb_reduced
zhangbiao-phy e163347
Update dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy 76452b4
Update dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy 39bdbdc
Update converterReducedHadronDausPid.cxx
zhangbiao-phy 8709fed
Update dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy 340af3e
Update candidateSelectorLbToLcPiReduced.cxx
zhangbiao-phy 99cdf02
Update dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy a59eabd
re-trigger the alibuild complie
zhangbiao-phy 84e34b6
Update HfMlResponseLbToLcPi.h
zhangbiao-phy 6cd4ecc
Update candidateCreatorLbReduced.cxx
zhangbiao-phy 5cbd0a4
Update dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy 54f4335
Update dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy 3ff0bc2
Please consider the following formatting changes
alibuild 323f3bf
Merge pull request #29 from alibuild/alibot-cleanup-10978
zhangbiao-phy 4eee2c2
Update dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy e7c8429
Update candidateCreatorLbReduced.cxx
zhangbiao-phy 2151e73
Please consider the following formatting changes
alibuild 651f673
Merge pull request #30 from alibuild/alibot-cleanup-10978
zhangbiao-phy f35afc0
Update candidateCreatorLbReduced.cxx
zhangbiao-phy 6099103
fix linter warning
zhangbiao-phy c789ba0
fix linter warning
zhangbiao-phy 7aa380a
Update dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy d3d6fa0
Please consider the following formatting changes
alibuild a6f2ffa
Merge pull request #31 from alibuild/alibot-cleanup-10978
zhangbiao-phy e2e62ce
Update dataCreatorCharmHadPiReduced.cxx
zhangbiao-phy 317391d
fix the PidMethod configuration
zhangbiao-phy ffe7318
Update candidateCreatorLbReduced.cxx
zhangbiao-phy a59227f
fix linter warning
zhangbiao-phy 8c68ba2
fix a typo
zhangbiao-phy 51cee7b
fix a typo
zhangbiao-phy 519a410
Update HfHelper.h based on vit's comment
zhangbiao-phy 178ee31
remove unnecessary lines
zhangbiao-phy 80185a5
Update converterReducedHadronDausPid.cxx
zhangbiao-phy 4a97f56
Update converterReducedHadronDausPid.cxx
zhangbiao-phy 6dcf700
Update converterReducedHadronDausPid.cxx
zhangbiao-phy aa38d27
Update PWGHF/D2H/TableProducer/converterReducedHadronDausPid.cxx
zhangbiao-phy 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
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,197 @@ | ||
| // 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 HfMlResponseLbToLcPi.h | ||
| /// \brief Class to compute the ML response for Lb → Lc∓ π± analysis selections | ||
| /// \author Biao Zhang <biao.zhang@cern.ch>, Heidelberg University | ||
|
|
||
| #ifndef PWGHF_CORE_HFMLRESPONSELBTOLCPI_H_ | ||
| #define PWGHF_CORE_HFMLRESPONSELBTOLCPI_H_ | ||
|
|
||
| #include <map> | ||
| #include <string> | ||
| #include <vector> | ||
|
|
||
| #include "PWGHF/Core/HfMlResponse.h" | ||
| #include "PWGHF/D2H/Utils/utilsRedDataFormat.h" | ||
|
|
||
| // 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_LB(FEATURE) \ | ||
| { \ | ||
| #FEATURE, static_cast<uint8_t>(InputFeaturesLbToLcPi::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_LB_FULL(OBJECT, FEATURE, GETTER) \ | ||
| case static_cast<uint8_t>(InputFeaturesLbToLcPi::FEATURE): { \ | ||
| inputFeatures.emplace_back(OBJECT.GETTER()); \ | ||
| break; \ | ||
| } | ||
|
|
||
| // 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 GETTER function taking OBJECT in argument | ||
| #define CHECK_AND_FILL_VEC_LB_FUNC(OBJECT, FEATURE, GETTER) \ | ||
| case static_cast<uint8_t>(InputFeaturesLbToLcPi::FEATURE): { \ | ||
| inputFeatures.emplace_back(GETTER(OBJECT)); \ | ||
| break; \ | ||
| } | ||
|
|
||
| // Specific case of (OBJECT, FEATURE, GETTER) | ||
| // where OBJECT is named candidate and FEATURE = GETTER | ||
| #define CHECK_AND_FILL_VEC_LB(GETTER) \ | ||
| case static_cast<uint8_t>(InputFeaturesLbToLcPi::GETTER): { \ | ||
| inputFeatures.emplace_back(candidate.GETTER()); \ | ||
| break; \ | ||
| } | ||
|
|
||
| namespace o2::analysis | ||
| { | ||
|
|
||
| enum class InputFeaturesLbToLcPi : uint8_t { | ||
| ptProng0 = 0, | ||
| ptProng1, | ||
| impactParameter0, | ||
| impactParameter1, | ||
| impactParameterProduct, | ||
| chi2PCA, | ||
| decayLength, | ||
| decayLengthXY, | ||
| decayLengthNormalised, | ||
| decayLengthXYNormalised, | ||
| cpa, | ||
| cpaXY, | ||
| maxNormalisedDeltaIP, | ||
| prong0MlScoreBkg, | ||
| prong0MlScorePrompt, | ||
| prong0MlScoreNonprompt, | ||
| tpcNSigmaPi1, | ||
| tofNSigmaPi1, | ||
| tpcTofNSigmaPi1 | ||
| }; | ||
|
|
||
| template <typename TypeOutputScore = float> | ||
| class HfMlResponseLbToLcPi : public HfMlResponse<TypeOutputScore> | ||
| { | ||
| public: | ||
| /// Default constructor | ||
| HfMlResponseLbToLcPi() = default; | ||
| /// Default destructor | ||
| virtual ~HfMlResponseLbToLcPi() = default; | ||
|
|
||
| /// Method to get the input features vector needed for ML inference | ||
| /// \param candidate is the Lb candidate | ||
| /// \param prong1 is the candidate's prong1 | ||
| /// \return inputFeatures vector | ||
| template <bool withDmesMl, typename T1, typename T2> | ||
| std::vector<float> getInputFeatures(T1 const& candidate, | ||
| T2 const& prong1) | ||
| { | ||
| std::vector<float> inputFeatures; | ||
|
|
||
| for (const auto& idx : MlResponse<TypeOutputScore>::mCachedIndices) { | ||
| if constexpr (withDmesMl) { | ||
| switch (idx) { | ||
| CHECK_AND_FILL_VEC_LB(ptProng0); | ||
| CHECK_AND_FILL_VEC_LB(ptProng1); | ||
| CHECK_AND_FILL_VEC_LB(impactParameter0); | ||
| CHECK_AND_FILL_VEC_LB(impactParameter1); | ||
| CHECK_AND_FILL_VEC_LB(impactParameterProduct); | ||
| CHECK_AND_FILL_VEC_LB(chi2PCA); | ||
| CHECK_AND_FILL_VEC_LB(decayLength); | ||
| CHECK_AND_FILL_VEC_LB(decayLengthXY); | ||
| CHECK_AND_FILL_VEC_LB(decayLengthNormalised); | ||
| CHECK_AND_FILL_VEC_LB(decayLengthXYNormalised); | ||
| CHECK_AND_FILL_VEC_LB(cpa); | ||
| CHECK_AND_FILL_VEC_LB(cpaXY); | ||
| CHECK_AND_FILL_VEC_LB(maxNormalisedDeltaIP); | ||
| CHECK_AND_FILL_VEC_LB(prong0MlScoreBkg); | ||
| CHECK_AND_FILL_VEC_LB(prong0MlScorePrompt); | ||
| CHECK_AND_FILL_VEC_LB(prong0MlScoreNonprompt); | ||
| // TPC PID variable | ||
| CHECK_AND_FILL_VEC_LB_FULL(prong1, tpcNSigmaPi1, tpcNSigmaPi); | ||
| // TOF PID variable | ||
| CHECK_AND_FILL_VEC_LB_FULL(prong1, tofNSigmaPi1, tofNSigmaPi); | ||
| // Combined PID variables | ||
| CHECK_AND_FILL_VEC_LB_FUNC(prong1, tpcTofNSigmaPi1, o2::pid_tpc_tof_utils::getTpcTofNSigmaPi1); | ||
| } | ||
| } else { | ||
| switch (idx) { | ||
| CHECK_AND_FILL_VEC_LB(ptProng0); | ||
| CHECK_AND_FILL_VEC_LB(ptProng1); | ||
| CHECK_AND_FILL_VEC_LB(impactParameter0); | ||
| CHECK_AND_FILL_VEC_LB(impactParameter1); | ||
| CHECK_AND_FILL_VEC_LB(impactParameterProduct); | ||
| CHECK_AND_FILL_VEC_LB(chi2PCA); | ||
| CHECK_AND_FILL_VEC_LB(decayLength); | ||
| CHECK_AND_FILL_VEC_LB(decayLengthXY); | ||
| CHECK_AND_FILL_VEC_LB(decayLengthNormalised); | ||
| CHECK_AND_FILL_VEC_LB(decayLengthXYNormalised); | ||
| CHECK_AND_FILL_VEC_LB(cpa); | ||
| CHECK_AND_FILL_VEC_LB(cpaXY); | ||
| CHECK_AND_FILL_VEC_LB(maxNormalisedDeltaIP); | ||
| // TPC PID variable | ||
| CHECK_AND_FILL_VEC_LB_FULL(prong1, tpcNSigmaPi1, tpcNSigmaPi); | ||
| // TOF PID variable | ||
| CHECK_AND_FILL_VEC_LB_FULL(prong1, tofNSigmaPi1, tofNSigmaPi); | ||
| // Combined PID variables | ||
| CHECK_AND_FILL_VEC_LB_FUNC(prong1, tpcTofNSigmaPi1, o2::pid_tpc_tof_utils::getTpcTofNSigmaPi1); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return inputFeatures; | ||
| } | ||
|
|
||
| protected: | ||
| /// Method to fill the map of available input features | ||
| void setAvailableInputFeatures() | ||
| { | ||
| MlResponse<TypeOutputScore>::mAvailableInputFeatures = { | ||
| FILL_MAP_LB(ptProng0), | ||
| FILL_MAP_LB(ptProng1), | ||
| FILL_MAP_LB(impactParameter0), | ||
| FILL_MAP_LB(impactParameter1), | ||
| FILL_MAP_LB(impactParameterProduct), | ||
| FILL_MAP_LB(chi2PCA), | ||
| FILL_MAP_LB(decayLength), | ||
| FILL_MAP_LB(decayLengthXY), | ||
| FILL_MAP_LB(decayLengthNormalised), | ||
| FILL_MAP_LB(decayLengthXYNormalised), | ||
| FILL_MAP_LB(cpa), | ||
| FILL_MAP_LB(cpaXY), | ||
| FILL_MAP_LB(maxNormalisedDeltaIP), | ||
| FILL_MAP_LB(prong0MlScoreBkg), | ||
| FILL_MAP_LB(prong0MlScorePrompt), | ||
| FILL_MAP_LB(prong0MlScoreNonprompt), | ||
| // TPC PID variable | ||
| FILL_MAP_LB(tpcNSigmaPi1), | ||
| // TOF PID variable | ||
| FILL_MAP_LB(tofNSigmaPi1), | ||
| // Combined PID variable | ||
| FILL_MAP_LB(tpcTofNSigmaPi1)}; | ||
| } | ||
| }; | ||
|
|
||
| } // namespace o2::analysis | ||
|
|
||
| #undef FILL_MAP_LB | ||
| #undef CHECK_AND_FILL_VEC_LB_FULL | ||
| #undef CHECK_AND_FILL_VEC_LB_FUNC | ||
| #undef CHECK_AND_FILL_VEC_LB | ||
|
|
||
| #endif // PWGHF_CORE_HFMLRESPONSELBTOLCPI_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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function is used only once. Where else do you plan to use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be in principle used in the non-reduced version of the Lb selector (https://github.com/AliceO2Group/O2Physics/blob/master/PWGHF/TableProducer/candidateSelectorLbToLcPi.cxx), as it is for the other B hadrons in order to have a common code for the selection. I would anyway suggest to implement it in the
candidateSelectorLbToLcPi.cxxin a second PR since this one is already very longThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please sync the reduced and the standard workflows in the next PR soon.