Can I save the data points from the histogram

Usually what we do is make a histogram from a given set of data points.
By adding two histograms i have a final histogram.
Does root offers to allow the saving of data points of the final histogram?

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

ROOT offers several ways to save an histogram. The most common way would be to save it in a ROOT file.

auto f = new TFile("hist.root","RECREATE");

Thanks @couet.
But hist.root does not allowed me to see the final data. Does it?
Actually I need to see the data at each and every point.

The histogram is stored in the file hist.root. You can Draw it etc … like a normal histogram

No I am not asking about drawing the histogram but rather want to see the points.


Thanks it works.

@couet @Wile_E_Coyote.
Still there is an issue that i am unable to understand i.e. when i try to write the data of the background it is showing the values of x from 325 to 12800 but i only want from 128 to 8192.
basic.root (30.0 KB) eu_gu_1.txt (44.1 KB) trio.C (3.4 KB)int.txt (180.5 KB)

At least:
float x=h2->GetBinCenter(h2->FindFixBin(i));

Note also that you are adding histograms with different axis limits ("diff->Add(h2,-1.0);").

Thanks @Wile_E_Coyote.

how can i correct the above warning? because i guess i am adding with same axis limit.
Also, how can i write the data from histogram(diff) in another file?