Skip to content

Conversation

@Tao-Fang
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the pwghf PWG-HF label Mar 31, 2025
@github-actions github-actions bot changed the title Fix unbund index issue at Xic0VsMult [PWGHF] Fix unbund index issue at Xic0VsMult Mar 31, 2025
@Tao-Fang Tao-Fang marked this pull request as ready for review March 31, 2025 11:34
@vkucera
Copy link
Collaborator

vkucera commented Mar 31, 2025

Hi @Tao-Fang , please stop creating and closing PRs on the same subject. Keep one PR opened and update it if needed.

@Tao-Fang
Copy link
Contributor Author

Hi @Tao-Fang , please stop creating and closing PRs on the same subject. Keep one PR opened and update it if needed.
Hello Vit
Sorry for creating so many pull requests, now I want to delete the closed ones and couldn't find the 'Delete pull request' button below the comment box.

@fcatalan92 fcatalan92 changed the title [PWGHF] Fix unbund index issue at Xic0VsMult [PWGHF] Fix unbound index issue in XiC0 tree creator Mar 31, 2025
@fcatalan92
Copy link
Collaborator

Hi @Tao-Fang,
You cannot delete a PR after it has been opened, the only thing you can do is to close it.

Concerning the content, I see you are trying to workaround the unbound index issue (which prevents from running on the GRID if I remember correctly) by replicating the indexing with a different approach. I'm not sure this will work, since the indexing will be the same for multiple jobs on the GRID, so if your plan is to merge the output the index will not be unique.
Can you explain the idea behind your proposed changes?

@Tao-Fang
Copy link
Contributor Author

Tao-Fang commented Apr 1, 2025

Hi @Tao-Fang, You cannot delete a PR after it has been opened, the only thing you can do is to close it.

Concerning the content, I see you are trying to workaround the unbound index issue (which prevents from running on the GRID if I remember correctly) by replicating the indexing with a different approach. I'm not sure this will work, since the indexing will be the same for multiple jobs on the GRID, so if your plan is to merge the output the index will not be unique. Can you explain the idea behind your proposed changes?

Hello Fabio

Thanks for you reply, you are right the indexing will be the same for multiple jobs, and when I do the merge the index will overlap then It can't continue conect event table to collision table. Now I have change the define of HfToXiPiEvBase to INDEX_COLUMN_CUSTOM just like Lc died in DerivedTables.h L166-173, but somehow It will stell overlap when I local test

Cheers
Tao

@fcatalan92
Copy link
Collaborator

Hi @Tao-Fang, AFAIK using INDEX_COLUMN_CUSTOM is just another way to define an index column so you get exactly the same unbound index issue as before. The easiest solution is to store the event information that you need in the candidate table, so duplicating it for each candidate. It is not optimal in terms of space but it should work.

I think the approach behind the Lc derived tables is different and they are not meant to be merged. @vkucera can tell you more on this.

@Tao-Fang
Copy link
Contributor Author

Tao-Fang commented Apr 2, 2025

Hi @Tao-Fang, AFAIK using INDEX_COLUMN_CUSTOM is just another way to define an index column so you get exactly the same unbound index issue as before. The easiest solution is to store the event information that you need in the candidate table, so duplicating it for each candidate. It is not optimal in terms of space but it should work.

I think the approach behind the Lc derived tables is different and they are not meant to be merged. @vkucera can tell you more on this.

Thank you for your reply. The easiest solution is indeed to store the needed information, and I have tested it locally—it works.
I was confused about the strategy. For example:

Lc adds multiplicity information in DerivedTables.h.
Ds+ adds it in treeCreatorDsToKKPi.cxx.
D+ was recently updated to include it in DerivedTables.h.

Should I add Xic to DerivedTables.h as well? I am not sure because Lc and D+ are three-prong decays.

@fcatalan92
Copy link
Collaborator

@Tao-Fang What is done in DerivedTables.h is an alternative approach to the tree creators, with the idea of storing more information and performing a more complex analysis chain locally (here I'm not an expert). My suggestion is that you stick to use the tree creator.

@Tao-Fang
Copy link
Contributor Author

Tao-Fang commented Apr 3, 2025

Thank you for your patient answer, I just think to add cenrtl directly at the candidate level is easier, now I have update the new code. They tested well locally.

Please consider the following formatting changes to AliceO2Group#10710
@alibuild
Copy link
Collaborator

alibuild commented Apr 3, 2025

Error while checking build/O2Physics/o2 for 86be21a at 2025-04-03 13:15:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/10710-slc9_x86-64/0/PWGHF/TableProducer/treeCreatorToXiPi.cxx:369:41: error: 'getCentralityPercentile' is not a member of 'o2::hf_centrality'; did you mean 'getCentralityGenColl'?
ninja: build stopped: subcommand failed.

Full log here.

Copy link
Collaborator

@fcatalan92 fcatalan92 left a comment

Choose a reason for hiding this comment

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

Hi @Tao-Fang, please do not change 'HfToXiPiEvs' and all the tree creator code. You should just add the information you need to HfToXiPiFulls (for consistency) and HfToXiPiLites.

DECLARE_SOA_COLUMN(CentFV0A, centFV0A, float);
DECLARE_SOA_COLUMN(CentFDDM, centFDDM, float);
DECLARE_SOA_COLUMN(MultZeqNTracksPV, multZeqNTracksPV, float);
DECLARE_SOA_COLUMN(Centrality, centrality, float);
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you just want a specific centrality estimator, please specify this info in the name of the column.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you just want a specific centrality estimator, please specify this info in the name of the column.

For different centrality change different processes to achieve, and a common centrality variable is needed, otherwise, some tables that require centrality are not declared, Like I processes the FT0M the FT0A column will not declared at the table I used

@vkucera
Copy link
Collaborator

vkucera commented Apr 4, 2025

Hi @Tao-Fang , I don't see how these extensive changes address the unbound index issue mentioned in the PR title. Can you please clarify your intentions?

@vkucera vkucera marked this pull request as draft April 4, 2025 08:02
@Tao-Fang
Copy link
Contributor Author

Tao-Fang commented Apr 4, 2025

My initial idea was to adopt an approach similar to the Lc vs multiplicity analysis, where I added FT0M, Ntrack, and other information into the collision table. Then, I try to use the SliceBy method to linke the collision-level and candidate-leve by rowEv.lastIndex(). However, I encount an issue where merging results caused rowEv.lastIndex() to overlap along the y-axis for different parent datasets (since rowEv.lastIndex() is not unique across parent data). This broken link between the collision and candidate layers. I try to repid what seen in utilsDerivedData.h (line 196) and DerivedTables.h (line 177), which define this connection for the Lc vs multiplicity study (treeCreatorLcToPKPi.cxx), but the core linkage issue remains unresolved. (On January 23, I submitted code that introduced FT0M and Ntracks into the collision table which why these variables are now present there)

Faced with this challenge, I just change the way, similar to the Ds analysis (treeCreatorDsToKKPi.cxx), where centrality-related information is added directly at the candidate level. If implemented this way, the previous structure such as storing FT0M in the collision table and relying on sliceBy would become useless. Therefore, I go to remove the collision-level FT0M/Ntracks and related sliceBy wich the January code I submissed.

@vkucera
Copy link
Collaborator

vkucera commented Apr 4, 2025

Hi @Tao-Fang , thanks for the clarification.
If I understood correctly, the problem you are trying to solve is to link the collision multiplicity/centrality information to the candidate.

  • The simplest solution I see is to add that column in the candidate table produced by the tree creator, which is the approach in treeCreatorDsToKKPi, as you pointed out.
  • Another solution would be to implement a derived-data creator using the derived-data model in DerivedTables.h, as @fcatalan92 mentioned.

If just adding the multiplicity/centrality column is fine for you, I would suggest to go with the first solution.
In any case, please do not remove any existing functionality.

@Tao-Fang
Copy link
Contributor Author

Tao-Fang commented Apr 4, 2025

Thank you for your understanding. I am currently using the first solution. Regarding the output functions, on one hand, I added them previously, and I believe that deleting this part will not affect others. On the other hand, I need to clean up this part of the results because if I don’t remove the SOA_COLUMN declarations at the collision level, running a specific centrality process will break due to undefined variables. Moreover, the parts I am deleting were intended for the second structure you mentioned, making them clear.

@Tao-Fang Tao-Fang marked this pull request as ready for review April 9, 2025 07:42
@Tao-Fang Tao-Fang requested a review from fcatalan92 April 9, 2025 08:01
@fcatalan92 fcatalan92 merged commit 82c3b4c into AliceO2Group:master Apr 9, 2025
13 of 14 checks passed
Comment on lines -166 to -178
full::McCollisionId,
collision::NumContrib,
collision::PosX,
collision::PosY,
collision::PosZ,
full::IsEventReject,
full::RunNumber,
full::CentFT0A,
full::CentFT0C,
full::CentFT0M,
full::CentFV0A,
full::CentFDDM,
full::MultZeqNTracksPV);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why were all these columns removed from the table?!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the part of the structure that I added earlier and wanted to bund central to the collision lever. Of course, it's nice to keep central's information at the collision level. But the problem is that when I choose to run the program in a specific central and want get central info at candidate level (e.g. FT0M it won't find the like FT0A's FT0C Table at collision level), so I just deleted this part

njacazio pushed a commit that referenced this pull request Apr 11, 2025
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
ariedel-cern pushed a commit to ariedel-cern/O2Physics that referenced this pull request May 23, 2025
)

Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
smaff92 pushed a commit to smaff92/O2Physics that referenced this pull request Jun 17, 2025
)

Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
alibuild added a commit to alibuild/O2Physics that referenced this pull request Aug 11, 2025
)

Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
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.

4 participants