Skip to content

Conversation

@lubynets
Copy link
Contributor

In this PR usage of KF Particle for 3 prong decay (in particular Lc->PKPi) reconstruction was developed as well as some changes needed for Lc lifetime measurement were implemented:

  1. Application of topological and invariant mass constraints implemented.
  2. Enabled application of cuts on Kf-based variables in the candidateSelectorLc task.
  3. Added lifetime-relevant fields to the Mc particles table of the treeCreatorLcToPKPi task.
  4. List of pid-related variables in the treeCreatorLcToPKPi task reduced to what is really needed according to the order of prongs in the candidate - PKPi or PiKP.

@github-actions github-actions bot added the pwghf PWG-HF label Mar 21, 2025
@github-actions github-actions bot changed the title KFParticle based 3 prong decay reconstruction development [PWGHF] KFParticle based 3 prong decay reconstruction development Mar 21, 2025
@lubynets lubynets requested a review from alcaliva as a code owner March 22, 2025 19:06
@lubynets lubynets requested review from fgrosa, mfaggin and vkucera April 3, 2025 12:45
fgrosa
fgrosa previously approved these changes Apr 3, 2025
Copy link
Collaborator

@fgrosa fgrosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for me now, thanks @lubynets for reverting the PID variables!

@fgrosa
Copy link
Collaborator

fgrosa commented Apr 22, 2025

Hi @lubynets, is this PR ready? Should we revert it to Ready for review? Thanks!

@lubynets
Copy link
Contributor Author

Hi @fgrosa,
Yes, it's ready for review. Sorry for the silence from my side.

@vkucera
Copy link
Collaborator

vkucera commented Apr 22, 2025

@lubynets Please fix the issues.

@lubynets
Copy link
Contributor Author

@lubynets Please fix the issues.

@vkucera, I noticed the "magic number" issues, but I could not invent a meaningful name for the variable 2, because I do not understand the physics case - why a 3-prong decay particle has only two daughters. Can you please briefly hint what it means, so I could create a proper alias for 2?

Comment on lines +1165 to +1176
const float x = candidate.xSecondaryVertex();
const float y = candidate.ySecondaryVertex();
const float z = candidate.zSecondaryVertex();
const float errX = candidate.kfXError();
const float errY = candidate.kfYError();
const float errZ = candidate.kfZError();
const float errPVX = candidate.kfXPVError();
const float errPVY = candidate.kfYPVError();
const float errPVZ = candidate.kfZPVError();
const float chi2primKaon = candidate.kfChi2PrimProng1();
const float dcaProtonPion = candidate.kfDcaProng0Prong2();
const float chi2GeoProtonPion = candidate.kfChi2GeoProng0Prong2();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The amount of code duplication is increasing with every addition. Please take a moment for a proper factorisation soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will try to reduce code duplication between MC and data functions.
There is one more place where duplication takes place - the lite and full tables. Won't it be better if they will be replaced with lite and "additional", where lite will remain as is, and "additional" will include only the difference between full and lite?
Or due to compatibility with other tasks the existing division into lite and full tables should remain?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lubynets @vkucera if you agree, I would postpone it to a separated PR, since it would touch only one file while the current one is open since a while and it is implementing modifications to a few files that we would like to modify for a couple of central developments (see for event selection #10949, and another one regards the PID variables). If you confirm that it is ok for you, I would merge this PR. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @fgrosa (@vkucera cc),
From my side it's ok to prepare a separate PR dedicated to code duplication reduction (if Vit does not object).
I would also like to clarify whether my idea expressed above (replace "full" table with "additional / extended / etc") makes sense? Or should I contact those who is marked as code authors - Nicolo' and Luigi?

Copy link
Collaborator

@fgrosa fgrosa Apr 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lubynets thanks!
Regarding the names, while I understand the reasoning, I would keep full simply because it is the same for all channels and it's easier for newcomers to have similar names (or you change it for all the channels), but not a strong opinion ;-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, my idea is not about names change! (the name can be approved later)
The point is that there are two possibilities - to write Lite or Full table on user's request according to the Configurable flag. But the Lite is a subset of Full, so there are a lot of identical code lines, which we want to reduce.
My suggestion is to replace Full with Full* (the name can be a subject of discussion) which will contain the difference between Full and Lite - then there will be no code duplication. Then the Lite will be written always, by default, and Full* - only by user's request of one needs to save more information.
But I am not sure if it will be compatible with other tasks, and if it's OK to have two output tables instead of one.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, sorry for the misunderstanding! In principle it is OK to have 2 tables instead of one, however it is not very user friendly for local processing (since the tree creator is meant to produce a flat tree for analysis). If you use O2 or python (e.g. pandas) is easy to join two "tables", but otherwise not much, so I would still keep the lite and full so that it's easier for less expert users (but honestly speaking I also don't know how many users use the full version..)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not suggesting to do the factorisation in this PR, so I'm fine with the idea of a dedicated PR after the central features are merged.

@vkucera
Copy link
Collaborator

vkucera commented Apr 22, 2025

@lubynets Please fix the issues.

@vkucera, I noticed the "magic number" issues, but I could not invent a meaningful name for the variable 2, because I do not understand the physics case - why a 3-prong decay particle has only two daughters. Can you please briefly hint what it means, so I could create a proper alias for 2?

It's the number of daughters in the resonant decay channel.

constexpr std::size_t NDaughtersResonant{2u};

@lubynets
Copy link
Contributor Author

@lubynets Please fix the issues.

Done

@fgrosa fgrosa marked this pull request as ready for review April 23, 2025 08:53
@alibuild
Copy link
Collaborator

Error while checking build/O2Physics/o2 for 1df1a8e at 2025-04-23 11:55:

## sw/BUILD/O2Physics-latest/log
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
/sw/SOURCES/O2Physics/10610-slc9_x86-64/0/PWGHF/TableProducer/candidateCreator3Prong.cxx:111:3: error: non-static data member 'NDaughtersResonant' declared 'constexpr'
/sw/SOURCES/O2Physics/10610-slc9_x86-64/0/PWGHF/TableProducer/candidateCreator3Prong.cxx:951:39: error: 'NDaughtersResonant' was not declared in this scope
/sw/SOURCES/O2Physics/10610-slc9_x86-64/0/PWGHF/TableProducer/candidateCreator3Prong.cxx:997:39: error: 'NDaughtersResonant' was not declared in this scope
ninja: build stopped: subcommand failed.

Full log here.

@lubynets lubynets requested review from fgrosa and vkucera April 24, 2025 08:17
@fgrosa fgrosa merged commit b0a9d21 into AliceO2Group:master Apr 24, 2025
19 checks passed
@lubynets lubynets deleted the KFdev branch April 24, 2025 14:24
prottayCMT pushed a commit to prottayCMT/O2Physics2024 that referenced this pull request May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pwghf PWG-HF

Development

Successfully merging this pull request may close these issues.

5 participants