-
Notifications
You must be signed in to change notification settings - Fork 496
TRD add additional helper functions #11644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,35 @@ GPUd() int Tracklet64::getPadCol() const | |
| return CAMath::Nint(6.f + mcmCol * ((float)NCOLMCM) + padLocal); | ||
| } | ||
|
|
||
| GPUd() float Tracklet64::PadPositionMCM() const | ||
| { | ||
| return 12.0 - (getPositionBinSigned() * GRANULARITYTRKLPOS); | ||
| } | ||
|
|
||
| GPUd() float Tracklet64::PadPosition() const | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't this a duplicate of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
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. |
||
| { | ||
| // int padLocalBin = tracklet.getPosition() ^ 0x80; | ||
| float padMCM = PadPositionMCM(); | ||
| int mcmCol = HelperMethods::getMCMCol(getROB(), getMCM()); | ||
| return float((mcmCol + 1) * NCOLMCM) + 2.0 - padMCM; | ||
| } | ||
|
|
||
| GPUd() float Tracklet64::UncalibratedPad() const | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't this a duplicate of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but the uncalibrated pad number should really be given by
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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). |
||
| { | ||
| float y = getUncalibratedY(); | ||
| int mcmCol = (getMCM() % NMCMROBINCOL) + NMCMROBINCOL * (getROB() % 2); | ||
| // one pad column has 144 pads, the offset of -63 is the center of the first MCM in that column | ||
| // which is connected to the pads -63 - 9 = -72 to -63 + 9 = -54 | ||
| // float offset = -63.f + ((float)NCOLMCM) * mcmCol; | ||
| float padWidth = 0.635f + 0.03f * (getDetector() % NLAYER); | ||
| return y / padWidth + 71.0; | ||
| } | ||
|
|
||
| GPUd() float Tracklet64::Slope() const | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could for this not
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we take into account the pad width, then we can use
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The slope is given in units of pad/timebin, while dy is a distance in cm. |
||
| { | ||
| return getSlopeBinSigned() * GRANULARITYTRKLSLOPE / ADDBITSHIFTSLOPE; | ||
| } | ||
|
|
||
| #ifndef GPUCA_GPUCODE_DEVICE | ||
| void Tracklet64::printStream(std::ostream& stream) const | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getPositionBinSigned() * GRANULARITYTRKLPOSshould 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 neededThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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