2424#include " GPUTPCClusterData.h"
2525#include " GPUO2DataTypes.h"
2626#include " GPUDataTypes.h"
27+ #include " GPUTPCGeometry.h"
2728#include " AliHLTTPCRawCluster.h"
2829#include " GPUParam.h"
2930#include " GPULogging.h"
@@ -275,10 +276,10 @@ struct zsEncoderRow : public zsEncoder {
275276
276277inline bool zsEncoderRow::sort (const o2::tpc::Digit a, const o2::tpc::Digit b)
277278{
278- int32_t endpointa = param-> tpcGeometry . GetRegion (a.getRow ());
279- int32_t endpointb = param-> tpcGeometry . GetRegion (b.getRow ());
280- endpointa = 2 * endpointa + (a.getRow () >= param-> tpcGeometry . GetRegionStart (endpointa) + param-> tpcGeometry . GetRegionRows (endpointa) / 2 );
281- endpointb = 2 * endpointb + (b.getRow () >= param-> tpcGeometry . GetRegionStart (endpointb) + param-> tpcGeometry . GetRegionRows (endpointb) / 2 );
279+ int32_t endpointa = GPUTPCGeometry:: GetRegion (a.getRow ());
280+ int32_t endpointb = GPUTPCGeometry:: GetRegion (b.getRow ());
281+ endpointa = 2 * endpointa + (a.getRow () >= GPUTPCGeometry:: GetRegionStart (endpointa) + GPUTPCGeometry:: GetRegionRows (endpointa) / 2 );
282+ endpointb = 2 * endpointb + (b.getRow () >= GPUTPCGeometry:: GetRegionStart (endpointb) + GPUTPCGeometry:: GetRegionRows (endpointb) / 2 );
282283 if (endpointa != endpointb) {
283284 return endpointa <= endpointb;
284285 }
@@ -295,11 +296,11 @@ bool zsEncoderRow::checkInput(std::vector<o2::tpc::Digit>& tmpBuffer, uint32_t k
295296{
296297 seqLen = 1 ;
297298 if (lastRow != tmpBuffer[k].getRow ()) {
298- endpointStart = param-> tpcGeometry . GetRegionStart (curRegion);
299+ endpointStart = GPUTPCGeometry:: GetRegionStart (curRegion);
299300 endpoint = curRegion * 2 ;
300- if (tmpBuffer[k].getRow () >= endpointStart + param-> tpcGeometry . GetRegionRows (curRegion) / 2 ) {
301+ if (tmpBuffer[k].getRow () >= endpointStart + GPUTPCGeometry:: GetRegionRows (curRegion) / 2 ) {
301302 endpoint++;
302- endpointStart += param-> tpcGeometry . GetRegionRows (curRegion) / 2 ;
303+ endpointStart += GPUTPCGeometry:: GetRegionRows (curRegion) / 2 ;
303304 }
304305 }
305306 for (uint32_t l = k + 1 ; l < tmpBuffer.size (); l++) {
@@ -408,7 +409,7 @@ void zsEncoderRow::decodePage(std::vector<o2::tpc::Digit>& outputBuffer, const z
408409 if ((uint32_t )region != decEndpoint / 2 ) {
409410 throw std::runtime_error (" CRU ID / endpoint mismatch" );
410411 }
411- int32_t nRowsRegion = param-> tpcGeometry . GetRegionRows (region);
412+ int32_t nRowsRegion = GPUTPCGeometry:: GetRegionRows (region);
412413
413414 int32_t timeBin = (decHDR->timeOffset + (uint64_t )(o2::raw::RDHUtils::getHeartBeatOrbit (*rdh) - firstOrbit) * o2::constants::lhc::LHCMaxBunches) / LHCBCPERTIMEBIN;
414415 for (int32_t l = 0 ; l < decHDR->nTimeBinSpan ; l++) {
@@ -420,7 +421,7 @@ void zsEncoderRow::decodePage(std::vector<o2::tpc::Digit>& outputBuffer, const z
420421 if (tbHdr->rowMask != 0 && ((upperRows) ^ ((decEndpoint & 1 ) != 0 ))) {
421422 throw std::runtime_error (" invalid endpoint" );
422423 }
423- const int32_t rowOffset = param-> tpcGeometry . GetRegionStart (region) + (upperRows ? (nRowsRegion / 2 ) : 0 );
424+ const int32_t rowOffset = GPUTPCGeometry:: GetRegionStart (region) + (upperRows ? (nRowsRegion / 2 ) : 0 );
424425 const int32_t nRows = upperRows ? (nRowsRegion - nRowsRegion / 2 ) : (nRowsRegion / 2 );
425426 const int32_t nRowsUsed = __builtin_popcount ((uint32_t )(tbHdr->rowMask & 0x7FFF ));
426427 decPagePtr += nRowsUsed ? (2 * nRowsUsed) : 2 ;
@@ -513,7 +514,7 @@ void zsEncoderLinkBased::createBitmask(std::vector<o2::tpc::Digit>& tmpBuffer, u
513514 uint32_t l;
514515 for (l = k; l < tmpBuffer.size (); l++) {
515516 const auto & a = tmpBuffer[l];
516- int32_t cruinsector = param-> tpcGeometry . GetRegion (a.getRow ());
517+ int32_t cruinsector = GPUTPCGeometry:: GetRegion (a.getRow ());
517518 o2::tpc::GlobalPadNumber pad = mapper.globalPadNumber (o2::tpc::PadPos (a.getRow (), a.getPad ()));
518519 o2::tpc::FECInfo fec = mapper.fecInfo (pad);
519520 o2::tpc::CRU cru = cruinsector;
@@ -535,8 +536,8 @@ void zsEncoderLinkBased::createBitmask(std::vector<o2::tpc::Digit>& tmpBuffer, u
535536bool zsEncoderLinkBased::sort (const o2::tpc::Digit a, const o2::tpc::Digit b)
536537{
537538 // Fixme: this is blasphemy... one shoult precompute all values and sort an index array
538- int32_t cruinsectora = param-> tpcGeometry . GetRegion (a.getRow ());
539- int32_t cruinsectorb = param-> tpcGeometry . GetRegion (b.getRow ());
539+ int32_t cruinsectora = GPUTPCGeometry:: GetRegion (a.getRow ());
540+ int32_t cruinsectorb = GPUTPCGeometry:: GetRegion (b.getRow ());
540541 if (cruinsectora != cruinsectorb) {
541542 return cruinsectora < cruinsectorb;
542543 }
@@ -1124,7 +1125,7 @@ inline uint32_t zsEncoderRun<T>::run(std::vector<zsPage>* buffer, std::vector<o2
11241125 }
11251126 }
11261127 if (lastRow != tmpBuffer[k].getRow ()) {
1127- curRegion = param-> tpcGeometry . GetRegion (tmpBuffer[k].getRow ());
1128+ curRegion = GPUTPCGeometry:: GetRegion (tmpBuffer[k].getRow ());
11281129 }
11291130 mustWriteSubPage = checkInput (tmpBuffer, k);
11301131 } else {
0 commit comments