Make stacked histogram. You may want to combine similar interaction types together

My question is that if i have a ‘mode’ branch file that contains several interactions and I would like to make stacked histogram, but separate events by interaction code. I want to combine similar interaction types together. How can I do that.

Hi @Karim_Hassinin,
welcome on the ROOT forum!

Your situation is not very clear. Can you describe it more in detail? what do you mean by interaction code?

Cheers,
Monica

I have a root file that contains a tree that contains possible interactions of neutrinos and the interactions are included in a branch in that tree with branch name modes. And I want to make a stacked histogram, but separate events by interaction code . You may want to combine similar interaction types together. ) in other words if I have a branch in a tree that contains different interactions of neutrinos and I want to extract these interaction separately and then stack them makng sure to combine similar interaction types together

You could use THStack for producing a stacked histogram, but to my knowledge there is no standard way of separating events by interaction code, I believe you should code it yourself…

Hi @Karim_Hassinin,

without seeing what exactly you want to do it is not very easy to advise you directly, but I would suggest trying to use RDataFrame and creating Filters (or maybe Defines, really depends on your dataset and what you want to do exactly) and creating histograms for different interactions that you have. As an inspiration you could take a look at the following tutorial which doesn’t use multiple interactions but uses multiple datasets and eventually creates a stack histogram: ROOT: tutorials/dataframe/df106_HiggsToFourLeptons.py File Reference

Cheers,
Marta

Thank you

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.