TRD Coordinate Transformations#5553
Conversation
tdietel
left a comment
There was a problem hiding this comment.
I am not sure to which degree I trust my code... The overall coordinate transformations should be ok, but datails like correct handling of tilted pads or Lorentz angle might not be correct.
I think we can merge it if there is benefit, but it would probably be useful to add some tests and check this code before it gets forgotten. @jbarrella, maybe you can contact @bazinski about the technicalities - CMake seems to have nice support for unit tests.
I think at the very least we should check for consistency, i.e. that we get the same (or conistent results) if we apply spatial->pad and pad->spatial coordinates after each other.
martenole
left a comment
There was a problem hiding this comment.
Not really sure what we use these functions for? And if we ask for row/pad/timebin shouldn't we return integer values? What coordinate system are the o2::trd::Hit objects given in actually?
I did not go through the actual calculation in detail..
There was a problem hiding this comment.
mGeo->getPadPlane(chamberID) would be easier to read
There was a problem hiding this comment.
I was actually able to remove this line entirely and instead use the mPadPlane member variable that is updated with TrackletTransformer::loadPadPlane(int hcid).
7f34cea to
bc01709
Compare
|
@tdietel Finally had a chance to look at this again. Was doing more testing and discovered that padrows 0 and 15 (for HCID = 776) return padrow positions of 0.6528 and 15.3472 respectively after converting to spatial and then back to rct coords with the new function. I don't really understand this. It looks like the positions are being reported at the center of the padrow in units of inner padrow lengths? But then the center of padrow 1 is not 1.5, but something like 1.35. Also, if this were the case, I would have expected the center of padrow 0 to be at ~ 0.35 like padrow 15 with its center at ~ 15.35. Not sure if I'm missing something here? Also not certain about this 0.15 difference over half a padrow. Would expect it to be a bit smaller. |
That's a tricky one - we are testing several things at once, and we are not really sure if it's a bug in one of the components, or a misunderstanding of what is happening in between. Maybe we need to test all of the components separately. As a first step, it would be useful to record not only the initial and final row/col/tb coordinates, but also the z position. It should be quite simple to translate from z to the expected result. And just to confirm: HCID=776 corresponds to SM 12, L4S4, i.e. a L4C1 chamber with inner/outer pad length of 90/75 mm. Is that correct? |
|
One thing I do not understand is how and when a new pad plane is loaded. It should be loaded whenever the HCID changes, but there are many functions where the HCID is passed as an argument, but it is not checked if the loaded pad plane matches the requested HCID. |
Good point. In |
That is correct. Okay, I'll look more closely at the spatial coordinates as well. I can look up the dimensions of the pad plane and we can calculate what the correct values should be. Was it your intention to report these values in units of inner padrow lengths though? So you were not expecting to see 0.5 and 15.5 or were you? I guess standardizing the units within each chamber would make sense. |
26f1f6b to
8a3a3ba
Compare
8a3a3ba to
41c8b48
Compare
41c8b48 to
12f590e
Compare
12f590e to
2df13ba
Compare
2df13ba to
53698b5
Compare
|
@martenole @bazinski Hello! Hoping to merge this soon. Two main points:
Let me know what you think. Thanks! |
53698b5 to
1e368fb
Compare
|
After some consideration and a chat with @bazinski, I've gone ahead and changed the calls in @jolopezl please take a look at the changes in |
1e368fb to
9a96936
Compare
There was a problem hiding this comment.
@jolopezl please take a look at the changes in
Digitizer.cxxand make sure they look reasonable. The new function needs an additional argument which is the pad row number. In your code, it looked like this wasrowE.
The change looks reasonable. In the digitizer, rowE is the row position after diffusion so that the change looks good.
I left some comments that you could take care of. This is a good chance to improve what's in PadPlane.
b7f6c71 to
9af595e
Compare
9af595e to
736c321
Compare
|
Hi @davidrohr, can we go ahead and merge this? |
Adding two functions written by @tdietel to perform the inverse transformation from spatial to pad-timebin coordinates.
TrackletTransformer::Local2RowColTime- Takes HCID and 3D space-point and returns a point in pad-timebin coordinates.TrackletTransformer::Hit2RowColTime- Takes ano2::trd:Hitand callsTrackletTransformer::Local2RowColTimeagainst its coordinates.