Skip to content

Commit 0755ca3

Browse files
committed
TPC: Make TPC calibration objects constructible from standalone benchmark
1 parent 0f1a97f commit 0755ca3

File tree

28 files changed

+160
-176
lines changed

28 files changed

+160
-176
lines changed

Common/MathUtils/include/MathUtils/detail/Bracket.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define ALICEO2_BRACKET_H
1818

1919
#include <GPUCommonRtypes.h>
20-
#ifndef GPUCA_ALIGPUCODE
20+
#ifndef GPUCA_GPUCODE_DEVICE
2121
#include <string>
2222
#include <sstream>
2323
#endif
@@ -76,7 +76,7 @@ class Bracket
7676
Relation isOutside(T t, T tErr) const;
7777
Relation isOutside(T t) const;
7878

79-
#ifndef GPUCA_ALIGPUCODE
79+
#ifndef GPUCA_GPUCODE_DEVICE
8080
std::string asString() const;
8181
#endif
8282

@@ -247,7 +247,7 @@ inline typename Bracket<T>::Relation Bracket<T>::isOutside(T t) const
247247
return t < mMin ? Below : (t > mMax ? Above : Inside);
248248
}
249249

250-
#ifndef GPUCA_ALIGPUCODE
250+
#ifndef GPUCA_GPUCODE_DEVICE
251251
template <typename T>
252252
std::string Bracket<T>::asString() const
253253
{

DataFormats/Detectors/TPC/include/DataFormatsTPC/CalibdEdxCorrection.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,12 @@ class CalibdEdxCorrection
4242
static constexpr int FitSize = 288; ///< Number of fitted corrections
4343
static constexpr int ParamSize = 8; ///< Number of params per fit
4444

45-
#if !defined(GPUCA_ALIGPUCODE)
45+
#if !defined(GPUCA_GPUCODE)
4646
CalibdEdxCorrection()
4747
{
4848
clear();
4949
}
5050
CalibdEdxCorrection(std::string_view fileName) { loadFromFile(fileName); }
51-
#else
52-
CalibdEdxCorrection() = default;
5351
#endif
5452
~CalibdEdxCorrection() = default;
5553

DataFormats/Detectors/TPC/src/CalibdEdxCorrection.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
#include <algorithm>
1515
#include <string_view>
1616

17+
#ifndef GPUCA_STANDALONE
1718
// o2 includes
1819
#include "Framework/Logger.h"
1920
#include "DataFormatsTPC/Defs.h"
2021
#include "CommonUtils/TreeStreamRedirector.h"
2122

2223
// root includes
2324
#include "TFile.h"
25+
#endif
2426

2527
using namespace o2::tpc;
2628

@@ -37,6 +39,8 @@ void CalibdEdxCorrection::clear()
3739
mDims = -1;
3840
}
3941

42+
#ifndef GPUCA_STANDALONE
43+
4044
void CalibdEdxCorrection::writeToFile(std::string_view fileName, std::string_view objName) const
4145
{
4246
std::unique_ptr<TFile> file(TFile::Open(fileName.data(), "recreate"));
@@ -181,3 +185,5 @@ void CalibdEdxCorrection::setUnity()
181185
}
182186
mDims = 0;
183187
}
188+
189+
#endif // GPUCA_STANDALONE

DataFormats/Reconstruction/include/ReconstructionDataFormats/PrimaryVertex.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class PrimaryVertex : public Vertex<TimeStampWithError<float, float>>
4242
float getZMAD() const { return mZMAD; }
4343
void setZMAD(float v) { mZMAD = v; }
4444

45-
#ifndef GPUCA_ALIGPUCODE
45+
#ifndef GPUCA_GPUCODE_DEVICE
4646
void print() const;
4747
std::string asString() const;
4848
#endif
@@ -56,7 +56,7 @@ class PrimaryVertex : public Vertex<TimeStampWithError<float, float>>
5656
ClassDefNV(PrimaryVertex, 2);
5757
};
5858

59-
#ifndef GPUCA_ALIGPUCODE
59+
#ifndef GPUCA_GPUCODE_DEVICE
6060
std::ostream& operator<<(std::ostream& os, const o2::dataformats::PrimaryVertex& v);
6161
#endif
6262

DataFormats/Reconstruction/include/ReconstructionDataFormats/PrimaryVertexExt.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ struct PrimaryVertexExt : public PrimaryVertex {
3636
int getNSrcA(int i) const { return nSrcA[i]; }
3737
int getNSrcAU(int i) const { return nSrcAU[i]; }
3838

39-
#ifndef GPUCA_ALIGPUCODE
39+
#ifndef GPUCA_GPUCODE_DEVICE
4040
void print() const;
4141
std::string asString() const;
4242
#endif
4343

4444
ClassDefNV(PrimaryVertexExt, 6);
4545
};
4646

47-
#ifndef GPUCA_ALIGPUCODE
47+
#ifndef GPUCA_GPUCODE_DEVICE
4848
std::ostream& operator<<(std::ostream& os, const o2::dataformats::PrimaryVertexExt& v);
4949
#endif
5050

DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackParametrizationWithError.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class TrackParametrizationWithError : public TrackParametrization<value_T>
8383

8484
GPUd() void print() const;
8585
GPUd() void printHexadecimal();
86-
#ifndef GPUCA_ALIGPUCODE
86+
#ifndef GPUCA_GPUCODE_DEVICE
8787
bool toFwdTrackParCov(TrackParCovFwd& t) const;
8888
std::string asString() const;
8989
std::string asStringHexadecimal();

DataFormats/Reconstruction/src/PrimaryVertex.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ namespace o2
1919
namespace dataformats
2020
{
2121

22-
#ifndef GPUCA_ALIGPUCODE
23-
2422
std::string PrimaryVertex::asString() const
2523
{
2624
auto str = o2::utils::Str::concat_string(VertexBase::asString(),
@@ -44,7 +42,5 @@ void PrimaryVertex::print() const
4442
std::cout << *this << std::endl;
4543
}
4644

47-
#endif
48-
4945
} // namespace dataformats
5046
} // namespace o2

DataFormats/Reconstruction/src/PrimaryVertexExt.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ namespace o2
1818
{
1919
namespace dataformats
2020
{
21-
22-
#ifndef GPUCA_ALIGPUCODE
2321
using GTrackID = o2::dataformats::GlobalTrackID;
2422

2523
std::string PrimaryVertexExt::asString() const
@@ -45,7 +43,5 @@ void PrimaryVertexExt::print() const
4543
std::cout << *this << std::endl;
4644
}
4745

48-
#endif
49-
5046
} // namespace dataformats
5147
} // namespace o2

DataFormats/common/include/CommonDataFormat/InteractionRecord.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#define ALICEO2_INTERACTIONRECORD_H
1616

1717
#include "GPUCommonRtypes.h"
18-
#ifndef GPUCA_ALIGPUCODE
18+
#ifndef GPUCA_GPUCODE_DEVICE
1919
#include <iosfwd>
2020
#include <cstdint>
2121
#endif

DataFormats/common/src/InteractionRecord.cxx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
namespace o2
1616
{
1717

18-
#ifndef GPUCA_ALIGPUCODE
19-
2018
std::string InteractionRecord::asString() const
2119
{
2220
return isDummy() ? std::string{"NotSet"} : fmt::format("BCid: {:4d} Orbit: {:6d}", bc, orbit);
@@ -49,6 +47,4 @@ void InteractionTimeRecord::print() const
4947
std::cout << (*this) << std::endl;
5048
}
5149

52-
#endif
53-
5450
} // namespace o2

0 commit comments

Comments
 (0)