I want to visualize photons’ paths in detector as 3D lines. I know I can use TPolyLine3D
. But it is some kind of inconvenience and redundant I think. So what is the best way to draw a 3D line in ROOT?
Note: I need to draw several different 3D lines starting from the same origin.
Why do you think so ?
Because as I understand TPolyLine3D
is for drawing sequence of lines: the origin of the next line is the end of the previous one. But I use it only for drawing a single line. It is about redundancy. More over, I set points to draw in a loop. For example, I use TPolyMarker3D
in order to represent photons’ conversion points and I create a single TPolyMarker3D
via default constructor and then “fill” it in a loop:
...
for ( Int_t i = 0; i < nPhotons; i++ )
{
//m is polymarker3d instance
m.SetNextPoint( xConv, yConv, zConv );
}
...
To use TPolyLine3D
I have to create several instances and put them in something that supports iteration in order to fill it inside a loop, do I?
It is not a tragedy to use TPolyLine3D
but I wanted to know if there is an alternative to draw a 3D line in ROOT.
It is perfectly fine to draw a Polyline with 2 points only.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.