How to implement TEveCaloLego in python


I want to generate calorimeter lego plots in ROOT to visualize events in eta-phi plane. I have the eta, phi and pt values of the events, but I don’t understand how to make the calorimeter lego plots using TEveCaloLego in python 2.7. Following are the details of my system,

  • ROOT Version: 5.34/09
  • Platform: Scientific Linux
  • Compiler: GCC 4.8.5

Looking forward for your help.


Please note that we don’t support ROOT 5 anymore, would it be an option for you to upgrade to a newer version?

It would have been better if I can do it in ROOT 5.
If you can tell the procedure for the higher version of ROOT, then I can try to incorporate in my version of ROOT.

There do not seem to exist any python “Event display classes” tutorials.

In particular, the TEveCaloLego class is only used in one of them:
${ROOTSYS}/tutorials/eve/calo_detail.C + ${ROOTSYS}/tutorials/eve/calorimeters.C

So, is there any alternative way to construct calorimeter lego plots in ROOT to visualize events in eta-phi plane ?

You can have a look at some “general purpose” drawing capabilities, e.g.:
TGraph2D and / or TGraph2DErrors

Maybe @couet can give more hints.

Calorimeter Lego Plots are special lego plots not drawn by the general purpose painters. They are part of the Events display package. See the eve tutorials.
Or, may be, these special options can help ?

Thank you for the suggestion.
I have managed to draw the plot attached herewith QCD_Event_v2.pdf (256.0 KB)
Is there any way/option to show the jet radius and the jet axis in the plot ?

What is it exactly ? lines ? markers ?
Some 3D line can be added like in this example.

I am talking about how to make this circular patch in eta-phi plane and the vertical lines like this given in the attached picture

Well , try to get ideas from the example I sent. You can use the the option “0” in addition to the LEGO option to not draw the empty bins. I am not sure it works with ROOT 5 …

1 Like