Could you explain what you are trying to do?
-THStack draws several histograms. The one obtained via GetHistogram
is an empty histogram used to draw the frame.
-You should use new THStack otherwise your THStack object will be deleted at the end of the script and all associated histograms deleted too.
As you know, the object of THStack is not a histogram, what I am trying to do is to get a histogram corresponding to this THStach, which means I want to convert THStack to a histogram. Yes, I agree I can use another way such as histogram->Merge(), histogram->Add(otherHistos); to get this kind of histogram, however, since I have THStack already, so I would like to convert it to a histogram.
Cheers,
Zhiyi.
[quote=“brun”]Could you explain what you are trying to do?
-THStack draws several histograms. The one obtained via GetHistogram
is an empty histogram used to draw the frame.
-You should use new THStack otherwise your THStack object will be deleted at the end of the script and all associated histograms deleted too.