1212// / \file GPUReconstructionConvert.cxx
1313// / \author David Rohr
1414
15- #ifdef GPUCA_O2_LIB
15+ #ifndef GPUCA_STANDALONE
1616#include " DetectorsRaw/RawFileWriter.h"
1717#include " TPCBase/Sector.h"
1818#include " DataFormatsTPC/Digit.h"
@@ -54,13 +54,13 @@ void GPUReconstructionConvert::ConvertNativeToClusterData(o2::tpc::ClusterNative
5454 uint32_t offset = 0 ;
5555 for (uint32_t i = 0 ; i < NSECTORS; i++) {
5656 uint32_t nClSector = 0 ;
57- for (int32_t j = 0 ; j < GPUCA_ROW_COUNT ; j++) {
57+ for (int32_t j = 0 ; j < GPUCA_NROWS ; j++) {
5858 nClSector += native->nClusters [i][j];
5959 }
6060 nClusters[i] = nClSector;
6161 clusters[i].reset (new GPUTPCClusterData[nClSector]);
6262 nClSector = 0 ;
63- for (int32_t j = 0 ; j < GPUCA_ROW_COUNT ; j++) {
63+ for (int32_t j = 0 ; j < GPUCA_NROWS ; j++) {
6464 for (uint32_t k = 0 ; k < native->nClusters [i][j]; k++) {
6565 const auto & clin = native->clusters [i][j][k];
6666 float x = 0 , y = 0 , z = 0 ;
@@ -98,7 +98,7 @@ void GPUReconstructionConvert::ConvertRun2RawToNative(o2::tpc::ClusterNativeAcce
9898 native.clustersLinear = nativeBuffer.get ();
9999 native.setOffsetPtrs ();
100100 for (uint32_t i = 0 ; i < NSECTORS; i++) {
101- for (uint32_t j = 0 ; j < GPUCA_ROW_COUNT ; j++) {
101+ for (uint32_t j = 0 ; j < GPUCA_NROWS ; j++) {
102102 native.nClusters [i][j] = 0 ;
103103 }
104104 for (uint32_t j = 0 ; j < nRawClusters[i]; j++) {
@@ -119,7 +119,7 @@ int32_t GPUReconstructionConvert::GetMaxTimeBin(const ClusterNativeAccess& nativ
119119{
120120 float retVal = 0 ;
121121 for (uint32_t i = 0 ; i < NSECTORS; i++) {
122- for (uint32_t j = 0 ; j < GPUCA_ROW_COUNT ; j++) {
122+ for (uint32_t j = 0 ; j < GPUCA_NROWS ; j++) {
123123 for (uint32_t k = 0 ; k < native.nClusters [i][j]; k++) {
124124 if (native.clusters [i][j][k].getTime () > retVal) {
125125 retVal = native.clusters [i][j][k].getTime ();
@@ -174,7 +174,7 @@ int32_t GPUReconstructionConvert::GetMaxTimeBin(const GPUTrackingInOutZS& zspage
174174
175175// ------------------------------------------------- TPC ZS -------------------------------------------------
176176
177- #ifdef GPUCA_TPC_GEOMETRY_O2
177+ #ifndef GPUCA_RUN2
178178namespace o2 ::gpu
179179{
180180namespace // anonymous
@@ -193,7 +193,7 @@ struct zsEncoder {
193193 const o2::InteractionRecord* ir = nullptr ;
194194 const GPUParam* param = nullptr ;
195195 bool padding = false ;
196- int32_t lastEndpoint = -2 , lastTime = -1 , lastRow = GPUCA_ROW_COUNT ;
196+ int32_t lastEndpoint = -2 , lastTime = -1 , lastRow = GPUCA_NROWS ;
197197 int32_t endpoint = 0 , outputEndpoint = 0 ;
198198 int64_t hbf = -1 , nexthbf = 0 ;
199199 zsPage* page = nullptr ;
@@ -244,11 +244,11 @@ inline void zsEncoder::ZSstreamOut(uint16_t* bufIn, uint32_t& lenIn, uint8_t* bu
244244
245245static inline auto ZSEncoderGetDigits (const GPUTrackingInOutDigits& in, int32_t i) { return in.tpcDigits [i]; }
246246static inline auto ZSEncoderGetNDigits (const GPUTrackingInOutDigits& in, int32_t i) { return in.nTPCDigits [i]; }
247- #ifdef GPUCA_O2_LIB
247+ #ifndef GPUCA_STANDALONE
248248using DigitArray = std::array<gsl::span<const o2::tpc::Digit>, o2::tpc::Sector::MAXSECTOR>;
249249static inline auto ZSEncoderGetDigits (const DigitArray& in, int32_t i) { return in[i].data (); }
250250static inline auto ZSEncoderGetNDigits (const DigitArray& in, int32_t i) { return in[i].size (); }
251- #endif // GPUCA_O2_LIB
251+ #endif
252252
253253// ------------------------------------------------- TPC ZS Original Row-based ZS -------------------------------------------------
254254
@@ -364,7 +364,7 @@ uint32_t zsEncoderRow::encodeSequence(std::vector<o2::tpc::Digit>& tmpBuffer, ui
364364 curTBHdr = reinterpret_cast <TPCZSTBHDR*>(pagePtr);
365365 curTBHdr->rowMask |= (endpoint & 1 ) << 15 ;
366366 nRowsInTB = 0 ;
367- lastRow = GPUCA_ROW_COUNT ;
367+ lastRow = GPUCA_NROWS ;
368368 }
369369 if (tmpBuffer[k].getRow () != lastRow) {
370370 curTBHdr->rowMask |= 1 << (tmpBuffer[k].getRow () - endpointStart);
@@ -460,7 +460,7 @@ void zsEncoderRow::decodePage(std::vector<o2::tpc::Digit>& outputBuffer, const z
460460
461461// ------------------------------------------------- TPC ZS Link Based ZS -------------------------------------------------
462462
463- #ifdef GPUCA_O2_LIB
463+ #ifndef GPUCA_STANDALONE
464464struct zsEncoderLinkBased : public zsEncoder {
465465 TPCZSHDRV2* hdr = nullptr ;
466466 TPCZSHDRV2 hdrBuffer;
@@ -1045,7 +1045,7 @@ void zsEncoderDenseLinkBased::amendPageErrorMessage(std::ostringstream& oss, con
10451045 oss << " Meta header of page: " << dumpBuffer << " \n " ;
10461046}
10471047
1048- #endif // GPUCA_O2_LIB
1048+ #endif // !GPUCA_STANDALONE
10491049
10501050// ------------------------------------------------- TPC ZS Main Encoder -------------------------------------------------
10511051
@@ -1095,7 +1095,7 @@ inline uint32_t zsEncoderRun<T>::run(std::vector<zsPage>* buffer, std::vector<o2
10951095{
10961096 uint32_t totalPages = 0 ;
10971097 zsPage singleBuffer;
1098- #ifdef GPUCA_O2_LIB
1098+ #ifndef GPUCA_STANDALONE
10991099 int32_t maxhbf = 0 ;
11001100 int32_t minhbf = o2::constants::lhc::LHCMaxBunches;
11011101#endif
@@ -1178,7 +1178,7 @@ inline uint32_t zsEncoderRun<T>::run(std::vector<zsPage>* buffer, std::vector<o2
11781178 }
11791179 size_t size = !std::is_same_v<T, struct zsEncoderDenseLinkBased > && (padding || lastEndpoint == -1 || hbf == nexthbf) ? TPCZSHDR::TPC_ZS_PAGE_SIZE : (pagePtr - (uint8_t *)page);
11801180 size = CAMath::nextMultipleOf<o2::raw::RDHUtils::GBTWord128>(size);
1181- #ifdef GPUCA_O2_LIB
1181+ #ifndef GPUCA_STANDALONE
11821182 if (raw) {
11831183 raw->addData (rawfeeid, rawcru, 0 , rawendpoint, *ir + hbf * o2::constants::lhc::LHCMaxBunches, gsl::span<char >((char *)page + sizeof (o2::header::RAWDataHeader), (char *)page + size), true , 0 , 2 );
11841184 maxhbf = std::max<int32_t >(maxhbf, hbf);
@@ -1257,7 +1257,7 @@ inline uint32_t zsEncoderRun<T>::run(std::vector<zsPage>* buffer, std::vector<o2
12571257 k += nEncoded;
12581258 }
12591259 if (raw) {
1260- #ifdef GPUCA_O2_LIB
1260+ #ifndef GPUCA_STANDALONE
12611261 if (iSector == 0 ) {
12621262 for (int32_t i = minhbf; i <= maxhbf; i++) {
12631263 raw->addData (46208 , 360 , rdh_utils::SACLinkID, 0 , *ir + i * o2::constants::lhc::LHCMaxBunches, gsl::span<char >((char *)&singleBuffer, (char *)&singleBuffer), true , 0 , 4 );
@@ -1310,7 +1310,7 @@ size_t zsEncoderRun<T>::compare(std::vector<zsPage>* buffer, std::vector<o2::tpc
13101310
13111311} // anonymous namespace
13121312} // namespace o2::gpu
1313- #endif // GPUCA_TPC_GEOMETRY_O2
1313+ #endif // !GPUCA_RUN2
13141314
13151315template <class S >
13161316void GPUReconstructionConvert::RunZSEncoder (const S& in, std::unique_ptr<uint64_t []>* outBuffer, uint32_t * outSizes, o2::raw::RawFileWriter* raw, const o2::InteractionRecord* ir, const GPUParam& param, int32_t version, bool verify, float threshold, bool padding, std::function<void (std::vector<o2::tpc::Digit>&)> digitsFilter)
@@ -1320,7 +1320,7 @@ void GPUReconstructionConvert::RunZSEncoder(const S& in, std::unique_ptr<uint64_
13201320 if (((outBuffer == nullptr ) ^ (outSizes == nullptr )) || ((raw != nullptr ) && (ir == nullptr )) || !((outBuffer == nullptr ) ^ (raw == nullptr )) || (raw && verify)) {
13211321 throw std::runtime_error (" Invalid parameters" );
13221322 }
1323- #ifdef GPUCA_TPC_GEOMETRY_O2
1323+ #ifndef GPUCA_RUN2
13241324 std::vector<zsPage> buffer[NSECTORS][GPUTrackingInOutZS::NENDPOINTS];
13251325 struct tmpReductionResult {
13261326 uint32_t totalPages = 0 ;
@@ -1365,7 +1365,7 @@ void GPUReconstructionConvert::RunZSEncoder(const S& in, std::unique_ptr<uint64_
13651365 zsEncoderRun<zsEncoderRow> enc{{{.iSector = i, .raw = raw, .ir = ir, .param = ¶m, .padding = padding}}};
13661366 runZS (enc);
13671367 } else if (version >= ZSVersion::ZSVersionLinkBasedWithMeta && version <= ZSVersion::ZSVersionDenseLinkBasedV2) {
1368- #ifdef GPUCA_O2_LIB
1368+ #ifndef GPUCA_STANDALONE
13691369 if (version == ZSVersion::ZSVersionLinkBasedWithMeta) {
13701370 zsEncoderRun<zsEncoderImprovedLinkBased> enc{{{{.iSector = i, .raw = raw, .ir = ir, .param = ¶m, .padding = padding}}}};
13711371 runZS (enc);
@@ -1410,7 +1410,7 @@ void GPUReconstructionConvert::RunZSEncoder(const S& in, std::unique_ptr<uint64_
14101410}
14111411
14121412template void GPUReconstructionConvert::RunZSEncoder<GPUTrackingInOutDigits>(const GPUTrackingInOutDigits&, std::unique_ptr<uint64_t []>*, uint32_t *, o2::raw::RawFileWriter*, const o2::InteractionRecord*, const GPUParam&, int32_t , bool , float , bool , std::function<void (std::vector<o2::tpc::Digit>&)> digitsFilter);
1413- #ifdef GPUCA_O2_LIB
1413+ #ifndef GPUCA_STANDALONE
14141414template void GPUReconstructionConvert::RunZSEncoder<DigitArray>(const DigitArray&, std::unique_ptr<uint64_t []>*, uint32_t *, o2::raw::RawFileWriter*, const o2::InteractionRecord*, const GPUParam&, int32_t , bool , float , bool , std::function<void (std::vector<o2::tpc::Digit>&)> digitsFilter);
14151415#endif
14161416
@@ -1454,7 +1454,7 @@ void GPUReconstructionConvert::RunZSFilter(std::unique_ptr<o2::tpc::Digit[]>* bu
14541454 }
14551455}
14561456
1457- #ifdef GPUCA_O2_LIB
1457+ #ifndef GPUCA_STANDALONE
14581458namespace o2 ::gpu::internal
14591459{
14601460template <class T >
0 commit comments