16#ifndef O2_TRD_TRACKLET64_H
17#define O2_TRD_TRACKLET64_H
30#ifndef GPUCA_GPUCODE_DEVICE
67 ((
hcid << hcidbs) & hcidmask) |
68 ((
padrow << padrowbs) & padrowmask) |
69 ((
col << colbs) & colmask) |
71 ((
slope << slopebs) & slopemask) |
72 ((
Q2 << Q2bs) & Q2mask) |
73 ((
Q1 << Q1bs) & Q1mask) |
74 ((
Q0 << Q0bs) & Q0mask);
78 uint64_t
slope, uint64_t pid)
81 ((
hcid << hcidbs) & hcidmask) |
82 ((
padrow << padrowbs) & padrowmask) |
83 ((
col << colbs) & colmask) |
85 ((
slope << slopebs) & slopemask) |
102 GPUd()
int getDetector()
const {
return getHCID() / 2; }
117 GPUd()
float getPositionFloat()
const {
return getPositionBinSigned() * constants::GRANULARITYTRKLPOS; }
126 GPUd()
float getSlopeFloat()
const {
return getSlopeBinSigned() * constants::GRANULARITYTRKLSLOPE / constants::ADDBITSHIFTSLOPE; }
129 GPUd()
int getMCM()
const {
return constants::NMCMROBINROW * (getPadRow() % constants::NMCMROBINCOL) +
getColumn(); }
132 GPUd()
int getROB()
const {
return (getHCID() % 2) ? (getPadRow() / constants::NMCMROBINROW) * 2 + 1 : (getPadRow() / constants::NMCMROBINROW) * 2; }
135 GPUd()
int getMCMCol()
const {
return (getMCM() % constants::NMCMROBINCOL) + constants::NMCMROBINCOL * (getROB() % 2); }
138 GPUd() float getPadWidth()
const {
return 0.635f + 0.03f * (getDetector() % constants::NLAYER); }
144 GPUd() float getPadColFloat(
bool applyShift)
const {
return getPositionFloat() + getMCMCol() * constants::NCOLMCM + 8.f + (applyShift ? 1.f : 0.f); }
147 GPUd()
int getPadCol(
bool applyShift = false)
const {
return o2::gpu::CAMath::Float2IntRn(getPadColFloat(applyShift)); }
150 GPUd() float getUncalibratedY(
bool applyShift = false)
const {
return (getPadColFloat(applyShift) - (constants::NCOLUMN / 2.f)) * getPadWidth(); }
153 GPUd() float getUncalibratedDy(
float nTbDrift = 19.4
f)
const {
return getSlopeFloat() * getPadWidth() * nTbDrift; }
160 int shift = (
charge >> 6) & 0x3;
171 if ((getFormat() & 0x1) == 0) {
179 if ((getFormat() & 0x1) == 0) {
187 if ((getFormat() & 0x1) == 0) {
204#ifndef GPUCA_GPUCODE_DEVICE
239 int padLocalBin = getPosition();
241 if (padLocalBin & (1 << (constants::NBITSTRKLPOS - 1))) {
242 padLocal = -((~(padLocalBin - 1)) & ((1 << constants::NBITSTRKLPOS) - 1));
244 padLocal = padLocalBin & ((1 << constants::NBITSTRKLPOS) - 1);
251 int slopeBin = getSlope();
253 if (slopeBin & (1 << (constants::NBITSTRKLSLOPE - 1))) {
254 slope = -((~(slopeBin - 1)) & ((1 << constants::NBITSTRKLSLOPE) - 1));
256 slope = slopeBin & ((1 << constants::NBITSTRKLSLOPE) - 1);
261#ifndef GPUCA_GPUCODE_DEVICE
o2::mid::ColumnData & getColumn(std::vector< o2::mid::ColumnData > &patterns, uint8_t icolumn, uint8_t deId)
GPUd() int getROB() const
GPUd() int getPositionBinSigned() const
GPUd() float getPadWidth() const
GPUd() void setTrackletWord(uint64_t trackletword)
GPUd() void print() const
GPUd() void setQ0(int charge)
GPUdDefault() Tracklet64 &operator
GPUd() void setPID(int pid)
GPUd() int getMCM() const
uint64_t uint64_t uint64_t uint64_t uint64_t slope
GPUd() void setQ1(int charge)
GPUd() int getPadCol(bool applyShift
uint64_t uint64_t uint64_t uint64_t uint64_t uint64_t uint64_t uint64_t Q2
GPUd() int getSlope() const
uint64_t uint64_t uint64_t uint64_t uint64_t uint64_t Q0
GPUd() void setSlope(int slope)
GPUd() int getMCMCol() const
Tracklet64(uint64_t format, uint64_t hcid, uint64_t padrow, uint64_t col, uint64_t position, uint64_t slope, uint64_t pid)
void printStream(std::ostream &stream) const
GPUd() void setQ2(int charge)
GPUd() int getSlopeBinSigned() const
GPUdDefault() Tracklet64()=default
uint64_t uint64_t uint64_t col
GPUd() void setPosition(int position)
GPUd() int getDetector() const
uint64_t uint64_t uint64_t uint64_t uint64_t uint64_t uint64_t Q1
GPUd() int getPID() const
GPUdDefault() Tracklet64(const Tracklet64 &)=default
GPUdDefault() ~Tracklet64()=default
uint64_t uint64_t uint64_t uint64_t position
GPUd() int getPosition() const
GPUd() int getColumn() const
static GPUglobalconstexpr() uint64_t formatmask=0xf000000000000000
GPUd() int getDynamicCharge(unsigned int charge) const
GPUd() Tracklet64(uint64_t trackletword)
GPUd() float getPadColFloat(bool applyShift) const
GPUd() int getPadRow() const
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLint GLint GLsizei GLint GLenum format
std::ostream & operator<<(std::ostream &stream, const Digit &d)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...