Histogram calculation

Hello, if I have a histogram h1 whose x axis is px and histogram h2 whose x axis is py.Both of the y axises is event number.how can I calculate px+py.

try ROOT: TH1 Class Reference

Thank you for your attention.
Would you mind giving me more detailed instruction?
For example, I generated two histograms:mh1 for invariant mass of Higgs Boson h1 and mh2 for h2,now I 'd like to generate d histogram for mHH,how can I do it.

If you simply want to add both 1-dimensional histograms, then use, e.g.: mh1->Add(mh2);

However, if you want a 2-dimensional histogram, then you need to create and fill it (you cannot use two 1-dimensional histograms to get a 2-dimensional histogram).

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