Project TH3 on walls as TH2

triggered by the last contribution in this thread:

I made a little exercise to look if this could be useful
proj3d.C (6.9 KB)
This is meant as an exercise or starting point not a proposal.
If you try it dont use too many bins (Its TH3!) the example is with 40x40x40.

Stay healthy

1 Like

Really nice! Would be great to one day see it in the TH3D drawing options.

For now I encountered following issues:

  1. I commented out the TGLViewer at the end, as it does not have axes, thus the projections are drawin in the standard canvas. However, boxes are drawn as wire frame, the walls are not filled, no matter what fill style of the marker I set.
  2. I tired it only for the xy projection - if I decrease the thickness of the box, it seems it is aligned to the top, not to the bottom. Meaning, it does not lie down on the xy plane.

Thanks for the script!

as I pointed out this macro is just a “Starter” the “Main dish” is yet
to be prepared (Axis, titles, background) and acc to my experience
this is the tedious part.
To your 1.
I dont know if this wire frame view can be enhanced, I guess not
TGLViewer has an axis overlay (“Guides”), you might also try with
X3d from the Canvas “View” menu
Alignment of the boxes is done at:

90  // draw the marker boxes just outside the 3d hist volume
152	// draw xy proj at bottom, fixed z
	zc = za3->GetXmin() - zw;


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