-
Notifications
You must be signed in to change notification settings - Fork 613
[PWGHF] Add proper lifetime into THnSparse at taskLc #12902
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
Conversation
|
O2 linter results: ❌ 0 errors, |
|
many thanks @lubynets for the development. I have two requests:
Many thanks |
This reverts commit cc0075b.
I fully agree with Mattia's point, and this is also what I want to say, Thanks! |
|
Hi @mfaggin, @zhangbiao-phy cc
|
|
P.S. In principle I can do the same (make occupancy and lifetime optional) without doing rest of fields optional. |
|
Thanks @lubynets . I'd personally avoid having 1 bool per axis, i.e. I'd just add a |
Great idea! I like it. If |
mfaggin
left a comment
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.
a few comments more (I leave them as comments and not as "request changes" so that other reviewers can move on approving it if I go offline in the meantime)
PWGHF/D2H/Tasks/taskLc.cxx
Outdated
| if (storeProperLifetime) { | ||
| for (const auto& axes : std::array<std::vector<AxisSpec>*, 2>{&axesGen, &axesWithBdt}) { | ||
| if (!axes->empty()) { | ||
| axes->push_back(thnAxisProperLifetime); | ||
| } | ||
| } |
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.
I'd put this always after the occupancy axis, to maintain backward compatibility with the current version of the code (please, fix the order of the axis and values filling everywhere)
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.
Done
PWGHF/D2H/Tasks/taskLc.cxx
Outdated
| outputFD = candidate.mlProbLcToPKPi()[MlClassNonPrompt]; /// non-prompt score | ||
| } | ||
| /// Fill the ML outputScores and variables of candidate | ||
| std::vector<Double_t> valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<Double_t>(numPvContributors), ptRecB, static_cast<Double_t>(originType)}; |
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.
| std::vector<Double_t> valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<Double_t>(numPvContributors), ptRecB, static_cast<Double_t>(originType)}; | |
| std::vector<double> valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<double>(numPvContributors), ptRecB, static_cast<double>(originType)}; |
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.
Done
PWGHF/D2H/Tasks/taskLc.cxx
Outdated
| outputFD = candidate.mlProbLcToPiKP()[MlClassNonPrompt]; /// non-prompt score | ||
| } | ||
| /// Fill the ML outputScores and variables of candidate (todo: add multiplicity) | ||
| std::vector<Double_t> valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<Double_t>(numPvContributors), ptRecB, static_cast<Double_t>(originType)}; |
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.
| std::vector<Double_t> valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<Double_t>(numPvContributors), ptRecB, static_cast<Double_t>(originType)}; | |
| std::vector<double> valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<double>(numPvContributors), ptRecB, static_cast<double>(originType)}; |
PWGHF/D2H/Tasks/taskLc.cxx
Outdated
|
|
||
| if (particle.originMcGen() == RecoDecay::OriginType::Prompt) { | ||
| if (fillTHn) { | ||
| std::vector<Double_t> valuesToFill{ptGen, cent, yGen, static_cast<Double_t>(numPvContributors), ptGenB, static_cast<Double_t>(originType)}; |
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.
| std::vector<Double_t> valuesToFill{ptGen, cent, yGen, static_cast<Double_t>(numPvContributors), ptGenB, static_cast<Double_t>(originType)}; | |
| std::vector<double> valuesToFill{ptGen, cent, yGen, static_cast<double>(numPvContributors), ptGenB, static_cast<double>(originType)}; |
PWGHF/D2H/Tasks/taskLc.cxx
Outdated
| if (particle.originMcGen() == RecoDecay::OriginType::NonPrompt) { | ||
| ptGenB = mcParticles.rawIteratorAt(particle.idxBhadMotherPart()).pt(); | ||
| if (fillTHn) { | ||
| std::vector<Double_t> valuesToFill{ptGen, cent, yGen, static_cast<Double_t>(numPvContributors), ptGenB, static_cast<Double_t>(originType)}; |
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.
| std::vector<Double_t> valuesToFill{ptGen, cent, yGen, static_cast<Double_t>(numPvContributors), ptGenB, static_cast<Double_t>(originType)}; | |
| std::vector<double> valuesToFill{ptGen, cent, yGen, static_cast<double>(numPvContributors), ptGenB, static_cast<double>(originType)}; |
PWGHF/D2H/Tasks/taskLc.cxx
Outdated
| outputFD = candidate.mlProbLcToPKPi()[MlClassNonPrompt]; /// non-prompt score | ||
| } | ||
| /// Fill the ML outputScores and variables of candidate | ||
| std::vector<Double_t> valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<Double_t>(numPvContributors)}; |
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.
| std::vector<Double_t> valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<Double_t>(numPvContributors)}; | |
| std::vector<double> valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<double>(numPvContributors)}; |
PWGHF/D2H/Tasks/taskLc.cxx
Outdated
| } | ||
| registry.get<THnSparse>(HIST("hnLcVarsWithBdt"))->Fill(valuesToFill.data()); | ||
| } else { | ||
| std::vector<Double_t> valuesToFill{massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast<Double_t>(numPvContributors)}; |
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.
| std::vector<Double_t> valuesToFill{massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast<Double_t>(numPvContributors)}; | |
| std::vector<double> valuesToFill{massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast<double>(numPvContributors)}; |
PWGHF/D2H/Tasks/taskLc.cxx
Outdated
| outputFD = candidate.mlProbLcToPiKP()[MlClassNonPrompt]; /// non-prompt score | ||
| } | ||
| /// Fill the ML outputScores and variables of candidate | ||
| std::vector<Double_t> valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<Double_t>(numPvContributors)}; |
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.
| std::vector<Double_t> valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<Double_t>(numPvContributors)}; | |
| std::vector<double> valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<double>(numPvContributors)}; |
PWGHF/D2H/Tasks/taskLc.cxx
Outdated
| } | ||
| registry.get<THnSparse>(HIST("hnLcVarsWithBdt"))->Fill(valuesToFill.data()); | ||
| } else { | ||
| std::vector<Double_t> valuesToFill{massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast<Double_t>(numPvContributors)}; |
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.
| std::vector<Double_t> valuesToFill{massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast<Double_t>(numPvContributors)}; | |
| std::vector<double> valuesToFill{massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast<double>(numPvContributors)}; |
PWGHF/D2H/Tasks/taskLc.cxx
Outdated
| registry.get<THnSparse>(HIST("hnLcVarsWithBdt"))->Fill(valuesToFill.data()); | ||
| } else { | ||
|
|
||
| std::vector<Double_t> valuesToFill{massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast<Double_t>(numPvContributors), ptRecB, static_cast<Double_t>(originType)}; |
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.
| std::vector<Double_t> valuesToFill{massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast<Double_t>(numPvContributors), ptRecB, static_cast<Double_t>(originType)}; | |
| std::vector<double> valuesToFill{massLc, pt, cent, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast<double>(numPvContributors), ptRecB, static_cast<double>(originType)}; |
mfaggin
left a comment
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.
thanks @lubynets it seems ok to me. Just to be sure before merging: I see that you do not add the ct axis to the axesStd and therefore to the hnLcVars object. Is it what you want or did you simply forget?
Thanks for pointing to it! I did it by purpose because I supposed to run analysis always with calculation of Bdt scores. |
|
Error while checking build/O2Physics/o2 for b6ded05 at 2025-09-08 17:53: Full log here. |
mfaggin
left a comment
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.
thanks @lubynets
|
@lubynets Why is there so much code duplication? It seems like the same blocks appear 4 times. |
That was not introduced by my PR, I just inserted proper lifetime everywhere. I also noticed significant code duplication and planned to refactor it. But I think it can be better done in a separate PR (?) |
Of course I was not referring to the PR changes but to the pre-existing code structure. Thanks if you plan to refactor! |
|
Dear @mfaggin (all code owners cc), |
taskLcworkflow.2. Bugfix: in the$pK\pi$ and $K\pi$ in treeCreatorLcToPKPiworkflow the invariant mass ofLiteandFulltables was written either from dynamic column of the DCAFitter or KFParticle depending on the mode in which reconstruction was run. However the KF-related variables have a dedicated table, therefore there is no need to write them intoLiteandFull. This PR fixes this issue and enables writing of mentioned invariant masses from only from dynamic column associated with DCAFitter.moved to a separate PR12906