Replicating Geometry in 2D

Hello everyone,
I am trying to view my detector geometry in 2D using the TPolyline Class as follows:

Double_t x1[7]={86.244e-4,96.244e-4,86.244e-4,35.0e-4,25.0e-4,35.0e-4,86.244e-4};
Double_t y1[7]={0.0,0025.0e-4,0050.0e-4,0050.0e-4,0025.0e-4,0.0,0.0};
TPolyLine* geom=new TPolyLine(7,x1,y1);

Is there someway I can replicate this polygon geometry multiple times along the X axis, translating it each time by some distance (let’s say 100.0e-4)?
I have the X,Y and Z coordinates of my particle tracks from an event stored in a tree and I wish to visualise the tracks along with the geometry in 2D.


_ROOT Version:v6.16/00-
_Platform: Ubuntu 14.04
_Compiler: GCC v4.8


There is no predefined function allowing to apply a translation on an existing TPolyline. But that’s simple to implement in a small C++ macro.

1 Like

Hello,
Thank you for clarifying. I guess I will have to use a macro.
Sincerely, Aritra

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.