TRD add additional helper functions#11644
Conversation
martenole
left a comment
There was a problem hiding this comment.
Hi @pestratm thanks, the update to the HelperMethods is fine with me. For the tracklet64 I think the existing functions should be OK. Can you see if they are sufficient for the macros you want to add to the TRD repo?
And please not in general functions in O2 need to start with lower case letter
| return y / padWidth + 71.0; | ||
| } | ||
|
|
||
| GPUd() float Tracklet64::Slope() const |
There was a problem hiding this comment.
could for this not getUncalibratedDy(1) be used? And I think one needs to take into account the pad width for the slope, no?
There was a problem hiding this comment.
If we take into account the pad width, then we can use getUncalibratedDy(1). Tbh, I'm not sure about Tom's reasoning not to take it into account.
There was a problem hiding this comment.
The slope is given in units of pad/timebin, while dy is a distance in cm.
For my raw data display, I wanted everything in pads and timebins, hence the extra function.
I find code with getSlope() more readable than writing the below calculation, but that might be personal preference.
| return float((mcmCol + 1) * NCOLMCM) + 2.0 - padMCM; | ||
| } | ||
|
|
||
| GPUd() float Tracklet64::UncalibratedPad() const |
There was a problem hiding this comment.
isn't this a duplicate of getUncalibratedY()?
There was a problem hiding this comment.
UncalibratedPad() gives the uncalibrated pad number corresponding to the tracklet position, while getUncalibratedY() gives the uncalibrated y-coordinate. That's why for UncalibratedPad(), we divide by the pad width, isn't it?
There was a problem hiding this comment.
but the uncalibrated pad number should really be given by getPadCol(). I just want to avoid any confusion and that we use consistently the functions we have in all the places. Otherwise it get's quite messy. So maybe you could use the functions in your PR to the TRD repo which are already available and drop the ones which are added to Tracklet64? The additional function in HelperMethods is fine of course
There was a problem hiding this comment.
It looks like this essentially does the same thing as PadPosition() discussed above, but in a different way (i.e. calculating the pad from the y coordinate, rather than from MCM and position within the MCM).
I don't remember exactly, but I might have compared the two to make sure I get it right.
| return 12.0 - (getPositionBinSigned() * GRANULARITYTRKLPOS); | ||
| } | ||
|
|
||
| GPUd() float Tracklet64::PadPosition() const |
There was a problem hiding this comment.
isn't this a duplicate of getPadCol()?
There was a problem hiding this comment.
isn't this a duplicate of
getPadCol()?
getPadCol() returns an int, but the position of a tracklet is known better than a pad. Therefore I think it makes sense to provide a function that gives the tracklet position with float precision.
I suspect changing getPadCol() to return a float might break some code, hence I introduced another helper function. I am thinking about calling it getPadColF() (or getPadColFloat, suggestions welcome).
|
|
||
| GPUd() float Tracklet64::PadPositionMCM() const | ||
| { | ||
| return 12.0 - (getPositionBinSigned() * GRANULARITYTRKLPOS); |
There was a problem hiding this comment.
getPositionBinSigned() * GRANULARITYTRKLPOS should give the local pad number relative to the MCM center. Why are you subtracting 12 here? Shouldn't it be 10.5? But in any case I am not sure if these functions are needed
There was a problem hiding this comment.
From my memory, the reason for 12 is that it matches the digits in the raw data display. At the time, I did not try to figure out why this works.
There was a problem hiding this comment.
in UncalibratedPad() there is also a +2 which I don't understand. This effectively turns the 12 into a 10, so closer to the expected 10.5
|
Ok, I'd suggest we add
But we still have to understand the offset. In the @pestratm do you want to give it a try to implement the above 2 functions to Tracklet64 or should I do it? |
You mean keeping |
|
This PR did not have any update in the last 30 days. Is it still needed? Unless further action in will be closed in 5 days. |
Added some additional helper functions for TRD that @tdietel provided in his macros
@martenole @pachmay