Skip to content

Commit 07364d7

Browse files
committed
GPU: Fix installation of GPUDataTypeHeaders headers
1 parent b1438a9 commit 07364d7

File tree

5 files changed

+206
-163
lines changed

5 files changed

+206
-163
lines changed

GPU/GPUTracking/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ string(REPLACE ".cxx" ".h" HDRS_TMP "${SRCS_NO_CINT}")
295295
set(HDRS_INSTALL ${HDRS_INSTALL} ${HDRS_TMP})
296296
string(REPLACE ".cxx" ".h" HDRS_TMP "${SRCS_DATATYPES}")
297297
set(HDRS_CINT_DATATYPES ${HDRS_CINT_DATATYPES} ${HDRS_TMP})
298+
string(REPLACE ".cxx" ".h" HDRS_TMP "${SRCS_DATATYPE_HEADERS}")
299+
set(HDRS_INSTALL ${HDRS_INSTALL} ${HDRS_TMP})
298300
unset(HDRS_TMP)
299301

300302
# Main CMake part for O2

GPU/GPUTracking/DataTypes/GPUTRDTrack.cxx

Lines changed: 2 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -13,171 +13,12 @@
1313
/// \author Ole Schmidt, Sergey Gorbunov
1414

1515
#include "GPUTRDTrack.h"
16-
#if !defined(GPU_TRD_TRACK_O2)
1716
#include "GPUTRDInterfaces.h"
18-
#endif
1917

2018
using namespace GPUCA_NAMESPACE::gpu;
19+
#include "GPUTRDTrack.inc"
2120

22-
template <typename T>
23-
GPUd() GPUTRDTrack_t<T>::GPUTRDTrack_t()
24-
{
25-
// default constructor
26-
initialize();
27-
}
28-
29-
template <typename T>
30-
GPUd() void GPUTRDTrack_t<T>::initialize()
31-
{
32-
// set all members to their default values (needed since in-class initialization not possible with AliRoot)
33-
mChi2 = 0.f;
34-
mSignal = -1.f;
35-
mRefGlobalTrackId = 0;
36-
mCollisionId = -1;
37-
mFlags = 0;
38-
mIsCrossingNeighbor = 0;
39-
for (int i = 0; i < kNLayers; ++i) {
40-
mAttachedTracklets[i] = -1;
41-
}
42-
}
43-
44-
#ifdef GPUCA_ALIROOT_LIB
45-
#include "AliHLTExternalTrackParam.h"
46-
#include "GPUTRDTrackData.h"
47-
48-
template <typename T>
49-
GPUd() GPUTRDTrack_t<T>::GPUTRDTrack_t(const AliHLTExternalTrackParam& t) : T(t)
50-
{
51-
initialize();
52-
}
53-
54-
template <typename T>
55-
GPUd() void GPUTRDTrack_t<T>::ConvertTo(GPUTRDTrackDataRecord& t) const
56-
{
57-
//------------------------------------------------------------------
58-
// convert to GPU structure
59-
//------------------------------------------------------------------
60-
t.mAlpha = T::getAlpha();
61-
t.fX = T::getX();
62-
t.fY = T::getY();
63-
t.fZ = T::getZ();
64-
t.fq1Pt = T::getQ2Pt();
65-
t.mSinPhi = T::getSnp();
66-
t.fTgl = T::getTgl();
67-
for (int i = 0; i < 15; i++) {
68-
t.fC[i] = T::getCov()[i];
69-
}
70-
t.fTPCTrackID = getRefGlobalTrackIdRaw();
71-
for (int i = 0; i < kNLayers; i++) {
72-
t.fAttachedTracklets[i] = getTrackletIndex(i);
73-
}
74-
}
75-
76-
template <typename T>
77-
GPUd() void GPUTRDTrack_t<T>::ConvertFrom(const GPUTRDTrackDataRecord& t)
78-
{
79-
//------------------------------------------------------------------
80-
// convert from GPU structure
81-
//------------------------------------------------------------------
82-
T::set(t.fX, t.mAlpha, &(t.fY), t.fC);
83-
setRefGlobalTrackIdRaw(t.fTPCTrackID);
84-
mChi2 = 0.f;
85-
mSignal = -1.f;
86-
mFlags = 0;
87-
mIsCrossingNeighbor = 0;
88-
mCollisionId = -1;
89-
for (int iLayer = 0; iLayer < kNLayers; iLayer++) {
90-
mAttachedTracklets[iLayer] = t.fAttachedTracklets[iLayer];
91-
}
92-
}
93-
94-
#endif
95-
96-
#if defined(GPUCA_HAVE_O2HEADERS)
97-
#include "ReconstructionDataFormats/TrackTPCITS.h"
98-
#include "DataFormatsTPC/TrackTPC.h"
99-
100-
template <typename T>
101-
GPUd() GPUTRDTrack_t<T>::GPUTRDTrack_t(const o2::dataformats::TrackTPCITS& t) : T(t)
102-
{
103-
initialize();
104-
}
105-
106-
template <typename T>
107-
GPUd() GPUTRDTrack_t<T>::GPUTRDTrack_t(const o2::tpc::TrackTPC& t) : T(t)
108-
{
109-
initialize();
110-
}
111-
112-
#endif
113-
114-
template <typename T>
115-
GPUd() GPUTRDTrack_t<T>::GPUTRDTrack_t(const GPUTRDTrack_t<T>& t)
116-
: T(t), mChi2(t.mChi2), mSignal(t.mSignal), mRefGlobalTrackId(t.mRefGlobalTrackId), mCollisionId(t.mCollisionId), mFlags(t.mFlags), mIsCrossingNeighbor(t.mIsCrossingNeighbor)
117-
{
118-
// copy constructor
119-
for (int i = 0; i < kNLayers; ++i) {
120-
mAttachedTracklets[i] = t.mAttachedTracklets[i];
121-
}
122-
}
123-
124-
template <typename T>
125-
GPUd() GPUTRDTrack_t<T>::GPUTRDTrack_t(const T& t) : T(t)
126-
{
127-
// copy constructor from anything
128-
initialize();
129-
}
130-
131-
template <typename T>
132-
GPUd() GPUTRDTrack_t<T>& GPUTRDTrack_t<T>::operator=(const GPUTRDTrack_t<T>& t)
133-
{
134-
// assignment operator
135-
if (&t == this) {
136-
return *this;
137-
}
138-
*(T*)this = t;
139-
mChi2 = t.mChi2;
140-
mSignal = t.mSignal;
141-
mRefGlobalTrackId = t.mRefGlobalTrackId;
142-
mCollisionId = t.mCollisionId;
143-
mFlags = t.mFlags;
144-
mIsCrossingNeighbor = t.mIsCrossingNeighbor;
145-
for (int i = 0; i < kNLayers; ++i) {
146-
mAttachedTracklets[i] = t.mAttachedTracklets[i];
147-
}
148-
return *this;
149-
}
150-
151-
template <typename T>
152-
GPUd() int GPUTRDTrack_t<T>::getNlayersFindable() const
153-
{
154-
// returns number of layers in which the track is in active area of TRD
155-
int retVal = 0;
156-
for (int iLy = 0; iLy < kNLayers; iLy++) {
157-
if ((mFlags >> iLy) & 0x1) {
158-
++retVal;
159-
}
160-
}
161-
return retVal;
162-
}
163-
164-
template <typename T>
165-
GPUd() int GPUTRDTrack_t<T>::getNmissingConsecLayers(int iLayer) const
166-
{
167-
// returns number of consecutive layers in which the track was
168-
// inside the deadzone up to (and including) the given layer
169-
int retVal = 0;
170-
while (!getIsFindable(iLayer)) {
171-
++retVal;
172-
--iLayer;
173-
if (iLayer < 0) {
174-
break;
175-
}
176-
}
177-
return retVal;
178-
}
179-
180-
#if !defined(GPUCA_GPUCODE) && !defined(GPU_TRD_TRACK_O2)
21+
#if !defined(GPUCA_GPUCODE)
18122
namespace GPUCA_NAMESPACE
18223
{
18324
namespace gpu
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
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+
12+
/// \file GPUTRDTrack.inc
13+
/// \author Ole Schmidt, Sergey Gorbunov
14+
15+
#ifndef GPUTRDTRACK_INC_H
16+
#define GPUTRDTRACK_INC_H
17+
18+
#include "GPUTRDTrack.h"
19+
20+
template <typename T>
21+
GPUd() GPUTRDTrack_t<T>::GPUTRDTrack_t()
22+
{
23+
// default constructor
24+
initialize();
25+
}
26+
27+
template <typename T>
28+
GPUd() void GPUTRDTrack_t<T>::initialize()
29+
{
30+
// set all members to their default values (needed since in-class initialization not possible with AliRoot)
31+
mChi2 = 0.f;
32+
mSignal = -1.f;
33+
mRefGlobalTrackId = 0;
34+
mCollisionId = -1;
35+
mFlags = 0;
36+
mIsCrossingNeighbor = 0;
37+
for (int i = 0; i < kNLayers; ++i) {
38+
mAttachedTracklets[i] = -1;
39+
}
40+
}
41+
42+
#ifdef GPUCA_ALIROOT_LIB
43+
#include "AliHLTExternalTrackParam.h"
44+
#include "GPUTRDTrackData.h"
45+
46+
template <typename T>
47+
GPUd() GPUTRDTrack_t<T>::GPUTRDTrack_t(const AliHLTExternalTrackParam& t) : T(t)
48+
{
49+
initialize();
50+
}
51+
52+
template <typename T>
53+
GPUd() void GPUTRDTrack_t<T>::ConvertTo(GPUTRDTrackDataRecord& t) const
54+
{
55+
//------------------------------------------------------------------
56+
// convert to GPU structure
57+
//------------------------------------------------------------------
58+
t.mAlpha = T::getAlpha();
59+
t.fX = T::getX();
60+
t.fY = T::getY();
61+
t.fZ = T::getZ();
62+
t.fq1Pt = T::getQ2Pt();
63+
t.mSinPhi = T::getSnp();
64+
t.fTgl = T::getTgl();
65+
for (int i = 0; i < 15; i++) {
66+
t.fC[i] = T::getCov()[i];
67+
}
68+
t.fTPCTrackID = getRefGlobalTrackIdRaw();
69+
for (int i = 0; i < kNLayers; i++) {
70+
t.fAttachedTracklets[i] = getTrackletIndex(i);
71+
}
72+
}
73+
74+
template <typename T>
75+
GPUd() void GPUTRDTrack_t<T>::ConvertFrom(const GPUTRDTrackDataRecord& t)
76+
{
77+
//------------------------------------------------------------------
78+
// convert from GPU structure
79+
//------------------------------------------------------------------
80+
T::set(t.fX, t.mAlpha, &(t.fY), t.fC);
81+
setRefGlobalTrackIdRaw(t.fTPCTrackID);
82+
mChi2 = 0.f;
83+
mSignal = -1.f;
84+
mFlags = 0;
85+
mIsCrossingNeighbor = 0;
86+
mCollisionId = -1;
87+
for (int iLayer = 0; iLayer < kNLayers; iLayer++) {
88+
mAttachedTracklets[iLayer] = t.fAttachedTracklets[iLayer];
89+
}
90+
}
91+
92+
#endif
93+
94+
#if defined(GPUCA_HAVE_O2HEADERS)
95+
#include "ReconstructionDataFormats/TrackTPCITS.h"
96+
#include "DataFormatsTPC/TrackTPC.h"
97+
98+
template <typename T>
99+
GPUd() GPUTRDTrack_t<T>::GPUTRDTrack_t(const o2::dataformats::TrackTPCITS& t) : T(t)
100+
{
101+
initialize();
102+
}
103+
104+
template <typename T>
105+
GPUd() GPUTRDTrack_t<T>::GPUTRDTrack_t(const o2::tpc::TrackTPC& t) : T(t)
106+
{
107+
initialize();
108+
}
109+
110+
#endif
111+
112+
template <typename T>
113+
GPUd() GPUTRDTrack_t<T>::GPUTRDTrack_t(const GPUTRDTrack_t<T>& t)
114+
: T(t), mChi2(t.mChi2), mSignal(t.mSignal), mRefGlobalTrackId(t.mRefGlobalTrackId), mCollisionId(t.mCollisionId), mFlags(t.mFlags), mIsCrossingNeighbor(t.mIsCrossingNeighbor)
115+
{
116+
// copy constructor
117+
for (int i = 0; i < kNLayers; ++i) {
118+
mAttachedTracklets[i] = t.mAttachedTracklets[i];
119+
}
120+
}
121+
122+
template <typename T>
123+
GPUd() GPUTRDTrack_t<T>::GPUTRDTrack_t(const T& t) : T(t)
124+
{
125+
// copy constructor from anything
126+
initialize();
127+
}
128+
129+
template <typename T>
130+
GPUd() GPUTRDTrack_t<T>& GPUTRDTrack_t<T>::operator=(const GPUTRDTrack_t<T>& t)
131+
{
132+
// assignment operator
133+
if (&t == this) {
134+
return *this;
135+
}
136+
*(T*)this = t;
137+
mChi2 = t.mChi2;
138+
mSignal = t.mSignal;
139+
mRefGlobalTrackId = t.mRefGlobalTrackId;
140+
mCollisionId = t.mCollisionId;
141+
mFlags = t.mFlags;
142+
mIsCrossingNeighbor = t.mIsCrossingNeighbor;
143+
for (int i = 0; i < kNLayers; ++i) {
144+
mAttachedTracklets[i] = t.mAttachedTracklets[i];
145+
}
146+
return *this;
147+
}
148+
149+
template <typename T>
150+
GPUd() int GPUTRDTrack_t<T>::getNlayersFindable() const
151+
{
152+
// returns number of layers in which the track is in active area of TRD
153+
int retVal = 0;
154+
for (int iLy = 0; iLy < kNLayers; iLy++) {
155+
if ((mFlags >> iLy) & 0x1) {
156+
++retVal;
157+
}
158+
}
159+
return retVal;
160+
}
161+
162+
template <typename T>
163+
GPUd() int GPUTRDTrack_t<T>::getNmissingConsecLayers(int iLayer) const
164+
{
165+
// returns number of consecutive layers in which the track was
166+
// inside the deadzone up to (and including) the given layer
167+
int retVal = 0;
168+
while (!getIsFindable(iLayer)) {
169+
++retVal;
170+
--iLayer;
171+
if (iLayer < 0) {
172+
break;
173+
}
174+
}
175+
return retVal;
176+
}
177+
178+
#endif // GPUTRDTRACK_INC_H

GPU/GPUTracking/DataTypes/GPUTRDTrackO2.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
/// \file GPUTRDTrackO2.cxx
1313
/// \author David Rohr
1414

15-
#define GPU_TRD_TRACK_O2
16-
#include "GPUTRDTrack.cxx"
15+
#include "GPUTRDTrackO2.h"
16+
using namespace GPUCA_NAMESPACE::gpu;
17+
18+
#include "GPUTRDTrack.inc"
1719
#include "ReconstructionDataFormats/GlobalTrackID.h"
1820
#include "ReconstructionDataFormats/Track.h"
1921

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
12+
/// \file GPUTRDTrackO2.h
13+
/// \author David Rohr
14+
15+
#ifndef GPUTRDTRACKO2_H
16+
#define GPUTRDTRACKO2_H
17+
18+
#include "GPUTRDTrack.h"
19+
20+
#endif // GPUTRDTRACKO2_H

0 commit comments

Comments
 (0)