Project
Loading...
Searching...
No Matches
GPUTRDTrackletWord.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#include "GPUTRDTrackletWord.h"
16using namespace o2::gpu;
17
18#ifndef GPUCA_TPC_GEOMETRY_O2
19
20GPUd() GPUTRDTrackletWord::GPUTRDTrackletWord(uint32_t trackletWord) : mHCId(-1), mTrackletWord(trackletWord)
21{
22}
23GPUd() GPUTRDTrackletWord::GPUTRDTrackletWord(uint32_t trackletWord, int32_t hcid) : mHCId(hcid), mTrackletWord(trackletWord) {}
24
25GPUd() int32_t GPUTRDTrackletWord::GetYbin() const
26{
27 // returns (signed) value of Y
28 if (mTrackletWord & 0x1000) {
29 return -((~(mTrackletWord - 1)) & 0x1fff);
30 } else {
31 return (mTrackletWord & 0x1fff);
32 }
33}
34
35GPUd() int32_t GPUTRDTrackletWord::GetdYbin() const
36{
37 // returns (signed) value of the deflection length
38 if (mTrackletWord & (1 << 19)) {
39 return -((~((mTrackletWord >> 13) - 1)) & 0x7f);
40 } else {
41 return ((mTrackletWord >> 13) & 0x7f);
42 }
43}
44
45#endif // !GPUCA_TPC_GEOMETRY_O2
GPUd() GPUTRDTrackletWord
TRD Tracklet word for GPU tracker - 32bit tracklet info + half chamber ID + index.