TEveCaloData::SliceInfo Setup

Hello all,

I’ve got a small question concerning the method Setup(const char* name, Float_t threshold, Color_t col) in this class. I wonder what the meaning of ‘threshold’ is. Does it mean only values above the given threshold are drawn (in order to supress noise etc)?

Thanks for your answer,

Hi Oliver,

The SliceInfo_t holds information about how to draw given longitudinal slice of the calorimeter.
void Setup(const char* name, Float_t threshold, Color_t col)
// name - name of the slice, eg. ECAL, HCAL
// threshold - only display towers with higher energy
// color - color used to draw the given longitudinal slice

Threshold and color can be changed at run-time via the GED editor. See for example “Data” tab of any calorimeter object in tutorial cms_calo.C.
As all views share the CaloData object color and threshold get automatically propagated to all views (3d, lego and 2d projections).


Hi Matevz,

many thanks. In fact, I use the well written cms_calo.C as a template for my code. Since I’m not working for CMS I have to use slightly (larger) values for the cal radius and length. Because of this the default view - in particular the 2D one - is a bit too small. The towers do not fit completely in the shown area and are clipped. Of course, I can see the full picture by zooming out a bit. It would be nice if the default view has the correct scaling. How can I achieve this? Also, the lego plot is very tiny at the beginning and I have to zoom in a lot to see it properly.

On my notebook I have some trouble with the X server. It crashes whenever I quit Eve. I suspect my graphics driver. I get lot of gl errors when running Eve:

Error in <TGLViewer::PostDraw>: GL Error invalid enumerant Error in <TGLViewerBase::RenderNonSelected - pre exit check>: GL Error invalid enumerant
Did you experience something like this?

I’m still running with v5.22.00.

Many thanks for your suggestions,

Hi Oliver,

In principle GL camera is set so as to show entire scene with some border on both sides. After you add new elements into a scene, camera will not be automatically resized, unless you ask for it:
a) for all viewers that contain changed scenes:
gEve->Redraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
b) for all viewers:
gEve->FullRedraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE
c) for specific viewer:
TEveViewer* ev;
TGLViewer* gv = ev->GetGLViewer();
gv->RequestDraw(); // To redraw from system event-loop
gv->DoRedraw(); // To redraw NOW (finished when func returns)

You can in priciple zoom programatically by calling functions on current camera:
TGLCamera& cam = gv->CurrentCamera();
but note that some functions are mostly intended to be called from GUI handlers. New functions can be added - let me know.

About the X-server — what you describe mostly happens with intel driver shipped with MesaGL. They finally fixed them somewhere in March. If this is the case, try upgrading them. Otherwise, can you give me some more details, like output of xdpyinfo and glxinfo.


Hi Matevz,

many thanks for the fast reply. gEve->FullRedraw3D(kTRUE) did the trick. I forgot to call it when drawing the very first event. This is necessary since when starting the viewer the calo data histograms are still empty and the view does not know about any towers yet. Thus a FullyRedraw3D stretches the histograms to the image borders. Now it works nicely. When switching to any later event I use DataChanged().

Please find attached the output of xdpyinfo and glxinfo.

glxinfo.txt (6.42 KB)
xdpyinfo.txt (2.8 KB)

Hi Oliver,

I see you indeed have the Intel-mesa drivers :slight_smile:
Can you try updating those, the package should be something like xserver-xorg-video-intel (debians) or xorg-x11-drv-i810 (redhats).

Also, I see in glxinfo:
direct rendering: No (LIBGL_ALWAYS_INDIRECT set)
Do you have desktop effects enabled? This often causes GL available to the applications to be significantly affected as the good part of GL gets used for the effects. If yes, try disabling them (unless you really like them).

Another thing, as you still use 5.22, we found a problem with display-lists and TEveJetCone class - there is a bug in some mesa implementations. So this got disabled sometime in May:
root.cern.ch/viewcvs/trunk/graf3 … x?view=log
If you are using this class and all else fails, try applying the changes from rev 28506 (trivial, just one line to be un-commented).

Good luck!