How to add two TBox class variables?

Please read tips for efficient and successful posting and posting code

ROOT Version: Latest
Platform: ubuntu 20.04
Compiler: ROOT

Hello everyone,
I need to construct an L shape geometry.
So, if I have two TBox class variables say box1 and box2. Then, I can have an L shape by concatenating these two structures.
LShape = concatenate of (Box1, Box2)
Ps. I need one single variable for making the L-shaped structure.
It will be very helpful if anyone would resolve this problem.

Hi @dsubhro,

I am not able to understand your issue only with the details that you have provided. Could you please elaborate a bit more?
Using the information in your last post, I can only suggest defining a struct as follows:

struct LShape {
    TBox first;
    TBox second;


Hello @jalopezg ,

Sorry for the inconvenience.
In simple terms, I want to make a variable having L shaped geometry. Like,
L = L shaped geometrical structure
I had an idea to make it with two TBox class variables by concatenating these two boxes. That will be very helpful if you could tell me how to do it or any other methods to form this type of geometrical structure.
Thank you for your reply.

I am not aware of the existence of any stock shape that satisfies your requirements. As mentioned before, I can only suggest using a struct. @couet maybe can provide any other ideas.


1 Like

Ah you using the TGeo shapes ? in that case combine two TGeo shapes. @agheata may help.

1 Like

Hi @couet sir,
I am using TBox. There will not be any issues of using TGeo instead. But it will be very helpful if I could get some guidance about this type of problem.
Thank you, sir.

You talked about “geometry” that’s why I suspected you wanted to build a detector geometry. In that case @agheata is the person who can help you. But may be that not what you want to do ? Can you clarify what you mean by “geometry” and what you want to do with this L shape ?

1 Like

If you want to create/display a letter-shaped geometry you can have a look in this tutorial example

1 Like

Yes @agheata sir, I got it. It took a little more time to learn about this library.
Thank you all for your consistent support and sorry for late reply.