TH3F from ASCII file

Ok, I get your plot nevertheless…

In the macro, I wrote

if(infile==NULL)
	{
    	printf("Error opening file");
    	exit(1);
	}

and you get the error Error opening file% (i.e. you get printf("Error opening file"); ) so it looks like that you can’t open the file…did you try to open it by an editor? I saved the file by windows…maybe, if you use Linux or Mac there are problems regarding of the format?
Anyway, the previous file was saved in UTF… can you try this one in ANSI
boxMesh_1.txt (1.8 MB)

Your macro was a bit complexe. I made it a bit more clear.scorelemma.cpp (3.8 KB)
I get now:

thank you @couet I tried your macro but

  1. currently we are just taking in account z,phi,R, relen… not also the entries
  2. I tried to add the stat box, but it looks like not working with th box2 Z type…is it normal?

I just put the box2 option : https://root.cern/doc/master/classTHistPainter.html#HP25
Which use the palette for TH3 (colz doe not exert. See Help)

Hi @couet I mean that if I add

 TPaveStats *statshscoring = (TPaveStats*)hscoring->GetListOfFunctions()->FindObject("stats");
   statshscoring->SetTextColor(kBlue);
   statshscoring->SetX1NDC(0.80); statshscoring->SetX2NDC(0.98);
   statshscoring->SetY1NDC(0.77); statshscoring->SetY2NDC(0.92);
   gPad->Update();

I don’t get the plot (instead I could use the TPaveStats using the COLZ option). Is it normal?

Yes it looks like the stats are not available with this option.

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