Skip to content

[PWGLF] Update KF cascade building in strangenessBuilderHelper#17003

Open
creetz16 wants to merge 1 commit into
AliceO2Group:masterfrom
creetz16:cascKF
Open

[PWGLF] Update KF cascade building in strangenessBuilderHelper#17003
creetz16 wants to merge 1 commit into
AliceO2Group:masterfrom
creetz16:cascKF

Conversation

@creetz16

Copy link
Copy Markdown
Contributor

Update LF strangenessbuilderHelper KF cascade building:

  • store unconstrained V0 and cascade masses in StoredKFCascCores table in all cases

Hi @ddobrigk and @romainschotter :)
I noticed that in the KF cascade building I had implemented the computation of the V0 and cascade masses in a way that the constrained masses (PDG masses) are stored in the StoredKFCascCores table in case the mass constraints are enabled. On the one hand this makes sense from the point of view of storing consistently the constrained particle parameters (mom, E, mass) and covariance matrix. But on the other hand it is essential to store the unconstrained invariant mass to for example apply selections on it. In our case of the Xic to Xipipi analysis of triggered data with the KF we indeed need the unconstrained V0 and cascade masses while using the constrained parameters.
I therefore updated the strangenessBuilderHelper accordingly in this PR. I would be happy to have your thoughts on this, maybe there is a better way to do it. :)
I am not aware of any other analysis using the KF cascade building. Do you know of anyone whom we should include in this discussion/update?

@github-actions github-actions Bot added the pwglf label Jul 10, 2026
@github-actions github-actions Bot changed the title Update KF cascade building in strangenessBuilderHelper [PWGLF] Update KF cascade building in strangenessBuilderHelper Jul 10, 2026
@github-actions

Copy link
Copy Markdown

O2 linter results: ❌ 12 errors, ⚠️ 31 warnings, 🔕 0 disabled

@alibuild

alibuild commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for c97df79 at 2026-07-11 08:24:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 39 errors and 2 warnings.'
Found 39 errors and 2 warnings.
++ [[ 39 -gt 0 ]]
++ cat /sw/BUILD/79898a31ecd4c305502d38c51e58e6127856a21f/O2Physics-code-check/errors.txt
PWGLF/Utils/strangenessBuilderHelper.h:19:1: error: included header RecoDecay.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:26:1: error: included header Propagator.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:42:1: error: included header vector is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:44:1: error: nested namespaces can be concatenated [modernize-concat-nested-namespaces,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:148:8: error: constructor does not initialize these fields: massGamma, massK0Short, massLambda, massAntiLambda, positionCovariance, momentumCovariance [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:180:3: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:181:3: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:186:8: error: constructor does not initialize these fields: kfTrackCovarianceV0, kfTrackCovariancePos, kfTrackCovarianceNeg, covariance [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:230:3: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:231:3: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:232:3: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:235:3: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:243:3: error: constructor does not initialize these fields: v0selections, cascadeselections [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:266:5: error: 'lut' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:420:12: error: variable 'cosPA' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:472:17: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:558:21: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:582:5: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:612:11: error: variable 'cosPA' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:775:15: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:822:12: error: variable 'cosPA' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:878:5: error: if with identical then and else branches [bugprone-branch-clone,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:890:7: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:903:17: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:1011:11: error: variable 'massPosTrack' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:1011:25: error: variable 'massNegTrack' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:1049:21: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:1063:11: error: variable 'MLambda' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:1063:20: error: variable 'SigmaLambda' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:1104:21: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:1105:21: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:1128:11: error: variable 'MXi' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:1128:16: error: variable 'SigmaXi' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:1128:25: error: variable 'MOmega' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:1128:33: error: variable 'SigmaOmega' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:1156:5: error: if with identical then and else branches [bugprone-branch-clone,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:1203:5: error: if with identical then and else branches [bugprone-branch-clone,-warnings-as-errors]
PWGLF/Utils/strangenessBuilderHelper.h:1224:12: error: variable 'cosPA' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
Tools/KFparticle/KFUtilities.h:35:10: error: 'KFPTrack.h' file not found [clang-diagnostic-error]
++ [[ 2 -gt 0 ]]
++ cat /sw/BUILD/79898a31ecd4c305502d38c51e58e6127856a21f/O2Physics-code-check/warnings.txt
PWGLF/Utils/strangenessBuilderHelper.h:1313:20: warning: statement should be inside braces [readability-braces-around-statements]
[0 more errors; see full log]

Full log here.

@romainschotter

Copy link
Copy Markdown
Collaborator

Hi @creetz16 !
I had a look at which tasks are using the KFCascCores or the KFCascDatas, and here is what I found:

  • PWGLF/Tasks/QC/kfStrangenessStudy.cxx,
  • PWGLF/Tasks/QC/kfPerformanceStudy.cxx,
  • PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx
  • PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx.

I think there are two possible strategies:

  1. store the unconstrained masses in the MXi, MOmega, MLambda` columns and obtain the constrained masses either by calculating them manually or through dynamic columns using the constrained momentum information. The downside is that the tasks listed above would need to be updated accordingly.
  2. use the KFToCascRefs table (which an interlink table KFCascCores --> CascCores) to de-reference the KFCascCore into a CascCore and access the unconstrained information directly. A similar approach could also be implemented using KFCascDataLink and CascDataLink, although it would only work on original data and would require a few extra steps than the simple de-referencing.

Both approaches work but I personally find the second one more practical, since it keeps the constrained and unconstrained information clearly separated while still making both easily accessible. However, it requires a tiny development (and some testing) on our side regarding this process function (

void populateCascadeInterlinks()
) if one wants to use the KFToCascRefs.

Maybe @ddobrigk or you have a different opinion, so please let me know what you think ! :-)

In the meantime, I'll start implementing the second approach. It will most likely be next week, though, as I won't have enough time to implement and test it over the weekend 😢 )

Thank you very much!

@creetz16

Copy link
Copy Markdown
Contributor Author

Hi @romainschotter

Many thanks for having a look!! This is not urgent, so please don't worry! :)
Getting the constrained mass is not difficult at all since we are constraining to the PDG mass and therefore it will simply be a delta function at the PDG mass value.
But I agree that keeping the constrained and unconstrained information separate is for sure the "safest" way. I chose here the easy way in a sense. ;)
PWGLF/Tasks/QC/kfStrangenessStudy.cxx and PWGLF/Tasks/QC/kfPerformanceStudy.cxx are QA tasks that David and I wrote some time ago to compare cascades built with the DCA fitter and with the KF. PWGHF/TableProducer/candidateCreatorXicToXiPiPi.cxx is our HF analysis code for the Xic to Xipipi reconstruction where I am one of the analyser (at least for the KF part of the code). Indeed, I forgot about the Xic0 task PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx. I am not sure if anyone is using it for analysis at the moment but it is implemented in a way that it is supposed to be run without any mass constraints in the strangenessbuilder. The mass constraints are only set in the candidateCreatorXic0Omegac0 itself.
I will also look into your second suggestion.

Thanks again for having a look. I would be happy to discuss next week at some point. :)

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

Labels

Development

Successfully merging this pull request may close these issues.

3 participants