Difference between the vertex position and position in phase-space file

Dear all,

To open a phase space .root file , I am able to open it in TBrowser .But I am confused that what could be the meaning of vertex position in y cm and Position in y cm interprets ?

If anybody can elaborate the doubt. It would be really helpful.

PFA image

Thank You


Please read tips for efficient and successful posting and posting code

ROOT Version: ROOT 6.32.02
Platform: Ubuntu 13.2.0-23ubuntu4 13.2.0
Compiler: c++


Hi Dipanuta,

But I am confused that what could be the meaning of vertex position in y cm and Position in y cm interprets ?

The question of how to interpret your data is best discussed with your colleagues or supervisor.

From your screenshot I can see that the TBrowser opens fine and the histogram is successfully rendered. If you do encounter a ROOT-specific issue, please let us know and we are happy to help.

Best,
Lukas

Thank you @lbreitwi for the suggestion.

I am having a problem in converting a 2D plot to 3D plot.

Please tell how to convert this 2D plot to 3D plot in TBrowser ? What changes are required to obtain the following kind of plots ?

Thank You

How are you getting the 2D plot? A good start is to show the code you are using to get the 2D plot. Anyway, if you already know how to do a 2D plot, the 3D plot is straightforward, just use the appropriate constructor and Fill method (expand the “Public Member Functions inherited from TH3” to see the ways to Fill it):

Then check the Drawing options for 3D histos; start here and search down the page for more about 3D options:

According to the plot you post it looks like you have a 2D histogram. The top image is produced with a command like h→Draw(“COLZ"); . I guess that’s what you call the 2D plot. To get the 3D representation below you’ll need to change the drawing option to SURF1Z

Thank you for the clarification. I mistakenly considered the first image shared in this conversation to be a 2D plot.

I completely don’t know how to get the 2D plot from TH1F , 1D plot.

TH1F *htemp__1 = new TH1F(“htemp__1“, “Position_X_cm_“, 100,- 88, 88) ;

What exactly input should be done to get a 2D and then a 3D graph ?

Thank You

Something like that:

TH2F *htemp__2 = new TH2F(“htemp__2“, ““, 100,- 88, 88, 100, -88, 88); 
1 Like

Thank you,

I tried to change TH1F to TH2F in the code and was able to get a 2D plot .

But I am obtaining a blank XY 2D plot , Why it is not showing the same curve points as in TH1F ?

And is there any way to add .csv file which contains x and y data points in the Editor of root , so that it can plot the 2D graph.

It looks like your TH2F was not filled. Can you show the code you wrote to create and fill the TH2F ? (the screen dump you posted is not clear enough, it would be nice to have a piece of code).

PFA, code file ;

Please tell how to add data points in it ?

Canvas_1.C (5.0 KB)

For a TH2 you need to used this version of SetBinContent

@couet Note that this looks like the automatically generated file (i.e., menu “Save->File->Canvas_1.C”), so maybe you should have used the “proper” method. :wink:

@Dipanuta_Behera it seems all your entries go into the “underflow” bins. In the source code which creates the histogram, try:
TH2F *h = new TH2F("h", "h", 100, 0, 0, 100, 0, 0); // automatic binning

When I save a TH2 (hpxpy from hsimple.root) in a .C file the histogram content is not set by individual calls to SetBinContent but via a loop on a vector containing the bins’ contents. That’s why I am suspecting the macro was edited after being created.

@couet

In ROOT 6.34 and older. :wink:

In ROOT 6.36 and newer. :wink: