Skip to content

Conversation

@rahulverma012
Copy link
Contributor

added efficiency correction via CCDB stored histograms, particle reconstruction to remove background and TListHandler to add, manage, fill and get histograms from a TList in similar way as done in HistogramRegistry class

rahulverma012 and others added 19 commits February 28, 2025 18:47
Added Generator level and truth level analysis in the code
Kaon Isospin workflow was removed  from this file during some other commit. Functionality added again
Added new momentum dependent particle identification cuts
Added new K0s Cuts for and pure simulation analysis function for MC results
TListHandler class to efficiently add, fill and get histogram from a root TList in O2 framework. It enables user to manage histograms in same way the Histogram registry does it.
Efficiency correction added, many particle reconstruction to remove background and increase purity
@victor-gonzalez
Copy link
Collaborator

Please, keep it as draft for the time being

I repeat here my question

Have you been asked to incorporate the ListHandler functionality to the O2Physics framework?
If you consider the functionality is need it, you should present your case in the combined WP4+WP14 meeting every other Monday (https://indico.cern.ch/event/1513758/)

@rahulverma012
Copy link
Contributor Author

Have you been asked to incorporate the ListHandler functionality to the O2Physics framework? If you consider the functionality is need it, you should present your case in the combined WP4+WP14 meeting every other Monday (https://indico.cern.ch/event/1513758/)

Hi Victor,
Finally I have removed all the formatting errors.
I was trying to add many QA histgorams and I hit the limit of max no of objects in task while declaring histogram registry. To overcome this, I was told to use TList to add as many histograms as needed.

I wasn't told to add this TListHandler functionality to the Framework.

To reuse same methods of HistogramRegistry and efficient getting and filling of histograms in TList. I created a class TListHandler, it stores pointer to the List and then add, retrive and fill histograms in same way as HistogramRegistry.

I have asked @ddobrigk if the TListHanlder can be added to Framework.
If needed I will present my case in the combined WP4+WP14 meeting.

Thank you for your suggestion
Best Regards,
Rahul

@victor-gonzalez
Copy link
Collaborator

Have you been asked to incorporate the ListHandler functionality to the O2Physics framework? If you consider the functionality is need it, you should present your case in the combined WP4+WP14 meeting every other Monday (https://indico.cern.ch/event/1513758/)

Hi Victor, Finally I have removed all the formatting errors. I was trying to add many QA histgorams and I hit the limit of max no of objects in task while declaring histogram registry. To overcome this, I was told to use TList to add as many histograms as needed.

I wasn't told to add this TListHandler functionality to the Framework.

To reuse same methods of HistogramRegistry and efficient getting and filling of histograms in TList. I created a class TListHandler, it stores pointer to the List and then add, retrive and fill histograms in same way as HistogramRegistry.

I have asked @ddobrigk if the TListHanlder can be added to Framework. If needed I will present my case in the combined WP4+WP14 meeting.

Thank you for your suggestion Best Regards, Rahul

Thanks for the clarification @rahulverma012

My view is that one does not need to reinvent the wheel unless it is not invented

Each histogram registry has about 500 histograms for storage capability
Additionally, a struct with histogram registries will only occupy one single object in your task and the number of histogram registries will be, in principle, unlimited

@rahulverma012
Copy link
Contributor Author

rahulverma012 commented Sep 29, 2025

Hi @victor-gonzalez ,
I had asked this, but there are currently no struct group for HistogramRegistries like a configurable group. Further I also tried to create and array of registries e.g. ( std::array<HistogramRegistry, 10> myRegList), this also acted as one object. But at the end of the processing, the workflow didn't wrote any of the registries in array to the output file. Only output objects gets written. So I created a output TList. TListHandler only manages the TList, it is not an output object. so manage the List using TListHandler, but only output object TList gets written at the end.
Thanks

@rahulverma012 rahulverma012 marked this pull request as ready for review September 29, 2025 08:25
@rahulverma012 rahulverma012 marked this pull request as draft September 29, 2025 08:25
@victor-gonzalez
Copy link
Collaborator

Hi Victor, I had asked this, but there are currently no struct group for HistogramRegistries like a configurable group. Further I also tried to create and array of registries e.g. ( std::array<HistogramRegistry, 10> myRegList), this also acted as one object. But at the end of the processing, the workflow didn't wrote any of the registries in array to the output file. Only output objects gets written. So I created a output TList. TListHandler only manages the TList, it is not an output object. so manage the List using TListHandler, but only output object TList gets written at the end. Thanks

I was not expecting that the struct group will exist. To me it should not be needed
What I meant is to create a struct with histogram registries. Have you tried that?

Regarding the array of histogram registries, in my view that should work.
Are you sure you have constructed your histogram registries before introducing them in the array?

@rahulverma012
Copy link
Contributor Author

rahulverma012 commented Sep 29, 2025

Hi @victor-gonzalez , This is how I checked it,
HistogramRegistry myReg1{"myReg1", {}, OutputObjHandlingPolicy::AnalysisObject, true}; (1)
HistogramRegistry myReg2{"myReg2", {}, OutputObjHandlingPolicy::AnalysisObject, true}; (2)

std::array<HistogramRegistry, 10> myRegList; (3)

The declarations like (1) and (2) each is counted as separate object and I will hit the limit. They are taken as output object, and are written in output file.
In declaration like (3), the object created is an array, HistogramRegistries in it can be used, histograms can be added in them, can be filled. But registries won't get written to the output AnalysisResults.root file. I think this is happening because now the Registries are part of array and not objects of the workflow.

I have not checked if a separate struct of HistogramRegistry will work or not. I am checking it now. I will let you know if it works or not.
If you know any task that is already using a struct of HistogramRegisty. Can you please point me to it.

Thanks

@victor-gonzalez
Copy link
Collaborator

Hi Victor, I had asked this, but there are currently no struct group for HistogramRegistries like a configurable group. Further I also tried to create and array of registries e.g. ( std::array<HistogramRegistry, 10> myRegList), this also acted as one object. But at the end of the processing, the workflow didn't wrote any of the registries in array to the output file. Only output objects gets written. So I created a output TList. TListHandler only manages the TList, it is not an output object. so manage the List using TListHandler, but only output object TList gets written at the end. Thanks

I was not expecting that the struct group will exist. To me it should not be needed What I meant is to create a struct with histogram registries. Have you tried that?

Regarding the array of histogram registries, in my view that should work. Are you sure you have constructed your histogram registries before introducing them in the array?

Anyway, as I said, if you found limitations in the analysis scenario and have a proposal for improvement you should present your case in the WP4+WP14 meeting. There the experts on the O2 framework are present and perhaps they could suggest other potential ways to address such limitations, that probably I am not aware of, or recommend to implement your proposal

@victor-gonzalez
Copy link
Collaborator

Hi @victor-gonzalez , This is how I checked it, HistogramRegistry myReg1{"myReg1", {}, OutputObjHandlingPolicy::AnalysisObject, true}; (1) HistogramRegistry myReg2{"myReg2", {}, OutputObjHandlingPolicy::AnalysisObject, true}; (2)

std::array<HistogramRegistry, 10> myRegList; (3)

The declarations like (1) and (2) each is counted as separate object and I will hit the limit. They are taken as output object, and are written in output file. In declaration like (3), the object created is an array, HistogramRegistries in it can be used, histograms can be added in them, can be filled. But registries won't get written to the output AnalysisResults.root file. I think this is happening because now the Registries are part of array and not objects of the workflow.

I have not checked if a separate struct of HistogramRegistry will work or not. I am checking it now. I will let you know if it works or not. If you know any task that is already using a struct of HistogramRegisty. Can you please point me to it.

Thanks

(3) Creates the histogram registries with the default constructor and that's why probably it doesn't work

@rahulverma012
Copy link
Contributor Author

Hi @victor-gonzalez,
sorry i wrote that to keep the message size small, The following is what I tried.
std::array<HistogramRegistry, 6> histRegArr = {
HistogramRegistry{"recoAnalysisPi", {}, OutputObjHandlingPolicy::AnalysisObject},
HistogramRegistry{"recoAnalysisKa", {}, OutputObjHandlingPolicy::AnalysisObject},
HistogramRegistry{"recoAnalysisPr", {}, OutputObjHandlingPolicy::AnalysisObject},
HistogramRegistry{"recoAnalysisEl", {}, OutputObjHandlingPolicy::AnalysisObject},
HistogramRegistry{"recoAnalysisMu", {}, OutputObjHandlingPolicy::AnalysisObject},
HistogramRegistry{"recoAnalysisDe", {}, OutputObjHandlingPolicy::AnalysisObject}
};
and it didn't work.
Best Regards,
Rahul

@victor-gonzalez
Copy link
Collaborator

Hi @victor-gonzalez, sorry i wrote that to keep the message size small, The following is what I tried. std::array<HistogramRegistry, 6> histRegArr = { HistogramRegistry{"recoAnalysisPi", {}, OutputObjHandlingPolicy::AnalysisObject}, HistogramRegistry{"recoAnalysisKa", {}, OutputObjHandlingPolicy::AnalysisObject}, HistogramRegistry{"recoAnalysisPr", {}, OutputObjHandlingPolicy::AnalysisObject}, HistogramRegistry{"recoAnalysisEl", {}, OutputObjHandlingPolicy::AnalysisObject}, HistogramRegistry{"recoAnalysisMu", {}, OutputObjHandlingPolicy::AnalysisObject}, HistogramRegistry{"recoAnalysisDe", {}, OutputObjHandlingPolicy::AnalysisObject} }; and it didn't work. Best Regards, Rahul

To me this should work because is basically the same as creating six different histogram registries which for sure works
If one way works the other way should also work
If it does not work it needs to be fixed

@github-actions
Copy link

This PR has not been updated in the last 30 days. Is it still needed? Unless further action is taken, it will be closed in 5 days.

@github-actions github-actions bot added the stale label Oct 30, 2025
@github-actions github-actions bot closed this Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants