TEve track projection


I have some TEve 3D plotted tracks and I am trying to get the TEveProjection to work in 2D.

The tracks are plotted fine in 3D. They are helices which are precessing around the z axis (z=horizontal in these plots).

I am projecting the 2D using:

tracker2Dproj->fRZMgr = new TEveProjectionManager(TEveProjection::kPT_RhoZ);

So projecting on the RZ axes. The attached plot is what I’m seeing.

I think there is something wrong with the 2D plot, if you compare it to the 3D track is supposed to represent you will see what I mean.

I tried changing the axes to be XZ but I see this error:

 error: 'kPT_XZ' is not a member of 'TEveProjection'

Screen Shot 2021-05-31 at 4.02.46 PM
Screen Shot 2021-05-31 at 4.02.35 PM

Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

@linev could you please take a look here? (or maybe to invite somebody with relevant experience)? Thank you!


Without code example we cannot reproduce the problem.
TEveProjection::kPT_XZ is valid constant for projection types.
Probably @matevz could help more once you provide code which is not working.


Indeed, it’s hard to tell what is going on.

TEveProjection::kPT_XZ has only been added in 6.24.

RhoZ projection is a real cylindrical projection, it is not a side-view:


Ah Ok, so it could be that we are projecting into some strange plane. I was more thinking it could be some sort of plotting feature which might be easy to recognise, like some sort of leak (although this is the first events so unlikely). The helix is made of a series to TEveLines. Points on the lines are derived from a Kalman Fit. Prining out the x,y,z coordinates and plotting those in a simple XZ (Z=horiztonal) plane in a plotting macro shows a “sine wave” like structure which is what I was expecting to see. I cant really visualize if this type of feature is a result then of this being projected into some strange plane or if its a plotting feature. The reason I was favouring this being in some plotting feature is that the distortion seems to vary. Some tracks look almost correct in shape but others have jagged lines such as in this example.

As an update I made a XZ plot but intead of using X I used SQRT(X^2+Y^2)*SIGN(Y) as per the wiki you sent…the track looks like my event display so I expect that this is just the issue…I will wait until we upgrade to v6.24…

It depends where your y=0 plane is. If the helix is at y<0 or y>0 all the time, you won’t see a “jump” … it happens when y=0 plane is crossed and x is non-zero.

Yes, the center of the tracker is 0,0,0 so it is crossing that plane. I can try to do some transformation and see if that helps. It could be that the tracks which look OK are all to one side of y=0…that would make sense

Yes, shifting the track to be above or below y seems to work. The only issue is I need to shift the detector too. The detector is a TEveGeoShape…presumably I can do a basic translation with such an object?

This is how those yellow lines are constructed:

      TubsParams envelope(trkr->g4Tracker()->getInnerTrackerEnvelopeParams());

      Double_t dz{(envelope.zHalfLength())};
      Double_t rmin{(envelope.innerRadius())};
      Double_t rmax{(envelope.outerRadius())};
      TEveGeoShape *tr = new TEveGeoShape();
      tr->SetShape(new TGeoTube(rmin, rmax, dz));

So I guess any translation would have to be done using TEveGeoShape or TGeoTube…I dont see any translation functions in either class?

Update: Solved by switching to use TGeoBBoxes for the two rectangles and translatnig the whole system so eveyrthing is always y>0

Hmmh … it seems you are really after side-view, not RhoZ view. We could add other projection types like TEveProjection::kPT_XZ to cover other coordinate combinations … probably YZ for side-view along x-axis.

Unless your detector really has cylindrical geometry.

There is also a flag to prevent from jumping y-plane, let me fish it up …

See also the top of
for enum EProjTrackBreaking_e { kPTB_Break, kPTB_UseFirstPointPos, kPTB_UseLastPointPos } that controls what happens when projected tracks cross sub-space of a projection.

Yes, we really just want a side view of the detector, we dont use cylinderical coordinates to represent anything.

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