EVE cones and transparency

Dear all,

I’d like to have transparent (elliptical) cones inside the EVE event display (v5.22). I started from the tutorial “cone_test.C” and used TEveBoxSet::DigitColor(Color_t ci, UChar_t transparency) for setting the colour of the cones. This works, however I wasn’t able to make them transparent. I guess I have to give some number in the range 0 to 255 (which one?) to the UChar_t transparency. Digging through the code lead me to TEveUtil::ColorFromIdx(Color_t ci, UChar_t col[4], UChar_t transparency) which says:

[quote] Fill col with RGBA values corresponding to index ci and transparency.
ROOT’s indexed color palette does not support transparency.[/quote]
Does that mean transparency is not supported at all in this case?

Many thanks for your suggestions.

Dear Oliver,

As you use DigitColor(), I assume you are using the “value-is-color” mode (2nd argument to Reset()).

In this case, as you are specifying special transparency to each cone, you should also set TEveBoxSet’s transparency to non-zero value, so that the GL turns on the blending functionality when rendering the object:


should be ok (this is also mentioned in the TEveDigitSet class-docs).

Otherwise, ROOT’s standard for transparency is:
0 - opaque; 100 - fully transparent.

About the TEveUtil::ColorFromIdx(Color_t ci, UChar_t col[4], UChar_t transparency) - this takes color-index (Short_t, can be translated to RGB) and transparency and converts them to RGBA representation (A ~ alpha value as accepted by GL: 0 - fully transparent, 255 - fully opaque).


It works. Looks fantastic. Many thanks,

Very good, I’m glad.

After 5.22 a new class TEveJetCone was added … this one shows a single cone and provides a method to cut it at given cylindrical boundary (R,Z).
See jetcone_test.C


Hello Matevz,

sounds good. I’ll definitely try this out.
Are these jet cones circular or elliptical? I’ve been thinking about using elliptical cones for jets, since the cones are usually defined in the eta-phi plane. This means that the jet cones are squeezed (in the polar direction) for small theta angles.


Hi Oliver,

In fact it specified by apex point and arbitrary points given on the circumference at the base.

The following function is provided for convenience:
Int_t AddCone(const Float_t& eta, const Float_t& phi, const Float_t& coneRadius, const Float_t& height = -1.);

Let me know if you need a different interface.