Skip to content

[PWGJE] Updating jetD0AngSubstructure.cxx#15914

Draft
pdhankhe wants to merge 17 commits intoAliceO2Group:masterfrom
pdhankhe:master
Draft

[PWGJE] Updating jetD0AngSubstructure.cxx#15914
pdhankhe wants to merge 17 commits intoAliceO2Group:masterfrom
pdhankhe:master

Conversation

@pdhankhe
Copy link
Copy Markdown
Contributor

  • Fixed the formatting issues of columns
  • Added task to match detector level and particle level Monte Carlo particles.
  • Added an additional task to calculate the Monte Carlo efficiency.
  • Using templated analyse functions to easily define process functions for other particles than D0 if desired.

Preeti Dhankher and others added 17 commits March 9, 2026 13:26
Please consider the following formatting changes to AliceO2Group#15311
Please consider the following formatting changes to AliceO2Group#15311
- Added task to analyse D0 candidates from experimental data. Histograms for different observables such as angularity etc. are made for quick checking purposes.
- Added task to match detector level and particle level Monte Carlo particles.
- Added an additional task to calculate the Monte Carlo efficiency.
- Using templated analyse functions to easily define processfunctions for other particles than D0 if desired.
[PWGJE] Updated jetD0AngSubstructure.cxx
Pushing the updates from dev branch to master
Updated code to obey style guidelines.
@github-actions
Copy link
Copy Markdown

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

@github-actions github-actions Bot changed the title Updating jetD0AngSubstructure.cxx [PWGJE] Updating jetD0AngSubstructure.cxx Apr 22, 2026

//
#include <PWGHF/Core/DecayChannels.h>
//
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

please rebase to the latest master to avoid changing includes if not needed

/*
// Experimental Data (analyseDataChargedSubstructure)
*/
HNAME(ex_col); // Collision Counter
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why do you define these here? What is the operational benefit?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There are two main reasons I prefer to define the histogram name this way:

  • using HNAME allows me to only insert the name of a histogram once. If I were to make a change it will be consistent and change both the variable name and string definition.
  • the code is more readable to me and it is easy to add a new definition.

Copy link
Copy Markdown
Collaborator

@vkucera vkucera Apr 23, 2026

Choose a reason for hiding this comment

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

Your macro just defines strings with the same name as the content. If you want to rename a histogram, you have to change all occurrences of that string anyway. It just creates another level of indirection, making the references actually longer than their content. How does that make anything easier or more readable?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It is a preference, it prevents me making typos in the histogram names. I added this, because before I had string and found myself making mistakes when writing the names as a string. The intellisense I use recognises variable names, but not bare strings. This makes it a lot easier for me to change names and prevent typos.

So indeed, if I would change the variable name, I have to do that elsewhere in the code (ctrl+f makes this easy in combination with the namespace), but that is not the point I intended to make. You do not seem to tell me that it is not allowed, so I rather keep it this way since it fits my style of working.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Well, I just gave you several reasons why I think it makes the code worse in both aspects that you seem to care about.
Can you please explain how this setup allows you to rename a histogram without changing all the string occurrences?
The point of preventing typos seems irrelevant to me because you are supposed to test your changes and an attempt to fill a non-existent histogram should throw a run time error.

CandidatesMCP const& /*mcpCandidates*/,
aod::JetTracks const& tracks,
aod::JetParticles const& particles,
HistogramRegistry& registry)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the registry should be a member of your struct and accesible everywhere

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The registry is a member of the struct. I have process methods at the bottom where I pass it as an argument to the templated analyse methods.

  • Currently I use only one registry, but I might want to add one later in my planned analysis.
  • I prefer to make the methods independent of which particle I analyse (e.g. the tables and registry).

I am not aware of all requirements so if this is something that is not recommended or impractical according to your experience. I am happy to change it. Otherwise I rather leave it this way.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What would you try to achieve by having multiple registries?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

When I intend to add a process method for other particle species. However, I realise that this would require a different pipeline of tasks anyway and therefore seperate outputs. Therefore I can just as well use one registry since it will never happen that in the same pipelen the task is used for both particle species.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Even if you did have processing of multiple species in different process functions of the same task, I don't see how multiple registries would help you do anything that cannot be done with one.

@vkucera vkucera marked this pull request as draft April 22, 2026 22:28
Copy link
Copy Markdown
Collaborator

@vkucera vkucera left a comment

Choose a reason for hiding this comment

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

Don't break the includes.

@pdhankhe pdhankhe requested a review from vkucera April 23, 2026 09:51
@pdhankhe pdhankhe marked this pull request as ready for review April 23, 2026 09:51
@pdhankhe pdhankhe marked this pull request as draft April 23, 2026 09:52
@Lolle2001
Copy link
Copy Markdown

Don't break the includes.

I do not see how the includes are broken. Could you perhaps elaborate on this or send a link to the relevant part in the documentation?

@vkucera
Copy link
Copy Markdown
Collaborator

vkucera commented Apr 23, 2026

Don't break the includes.

I do not see how the includes are broken. Could you perhaps elaborate on this or send a link to the relevant part in the documentation?

https://aliceo2group.github.io/analysis-framework/docs/tools/#cleaning-include-statements-and-using-statements

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.

5 participants