diff --git a/Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h b/Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h index 8a8dbcb8fa9ae..00f2fc157a5ec 100644 --- a/Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h +++ b/Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h @@ -50,6 +50,7 @@ #include "ITSReconstruction/RecoGeomHelper.h" #include "TPCFastTransform.h" #include "GPUO2InterfaceRefit.h" +#include "GPUTPCGeometry.h" #include "GlobalTracking/MatchTPCITSParams.h" #include "DataFormatsITSMFT/TopologyDictionary.h" #include "DataFormatsITSMFT/TrkClusRef.h" @@ -132,6 +133,8 @@ struct TrackLocTPC : public o2::track::TrackParCov { int sourceID = 0; ///< TPC track origin in o2::dataformats::GlobalTrackID gid{}; // global track source ID (TPC track may be part of it) int matchID = MinusOne; ///< entry (non if MinusOne) of its matchTPC struct in the mMatchesTPC + uint8_t lowestRow = -1; + uint8_t padFromEdge = -1; Constraint_t constraint{Constrained}; float getCorrectedTime(float dt) const // return time0 corrected for extra drift (to match certain Z) @@ -143,7 +146,7 @@ struct TrackLocTPC : public o2::track::TrackParCov { return constraint == Constrained ? 0.f : (constraint == ASide ? dt : -dt); } - ClassDefNV(TrackLocTPC, 2); + ClassDefNV(TrackLocTPC, 3); }; ///< ITS track outward parameters propagated to reference X, with time bracket and index of @@ -738,6 +741,7 @@ class MatchTPCITS static constexpr float MaxSnp = 0.9; // max snp of ITS or TPC track at xRef to be matched static constexpr float MaxTgp = 2.064; // max tg corresponting to MaxSnp = MaxSnp/std::sqrt(1.-MaxSnp^2) static constexpr float MinTBToCleanCache = 600.; // keep in AB ITS cluster refs cache at most this number of TPC bins + static const o2::gpu::GPUTPCGeometry TPCGeometry; enum TimerIDs { SWTot, SWPrepITS, diff --git a/Detectors/GlobalTracking/src/MatchTPCITS.cxx b/Detectors/GlobalTracking/src/MatchTPCITS.cxx index eb2a2212edb30..436a12df51352 100644 --- a/Detectors/GlobalTracking/src/MatchTPCITS.cxx +++ b/Detectors/GlobalTracking/src/MatchTPCITS.cxx @@ -9,6 +9,13 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include "GPUO2Interface.h" // Needed for propper settings in GPUParam.h +#include "GPUParam.h" +#include "GPUParam.inc" +#ifdef WITH_OPENMP +#include +#endif + #include #include #include @@ -50,13 +57,6 @@ #include "ITS3Reconstruction/IOUtils.h" #endif -#include "GPUO2Interface.h" // Needed for propper settings in GPUParam.h -#include "GPUParam.h" -#include "GPUParam.inc" -#ifdef WITH_OPENMP -#include -#endif - using namespace o2::globaltracking; using MatrixDSym4 = ROOT::Math::SMatrix>; @@ -68,6 +68,8 @@ constexpr float MatchTPCITS::Tan70, MatchTPCITS::Cos70I2, MatchTPCITS::MaxSnp, M LinksPoolMT* TPCABSeed::gLinksPool = nullptr; +const o2::gpu::GPUTPCGeometry MatchTPCITS::TPCGeometry{}; + //______________________________________________ MatchTPCITS::MatchTPCITS() = default; @@ -428,6 +430,12 @@ int MatchTPCITS::addTPCSeed(const o2::track::TrackParCov& _tr, float t0, float t if (clRow > mParams->askMinTPCRow[clSect]) { return -9; } + const auto& clus = mTPCClusterIdxStruct->clusters[clSect][clRow][clIdx]; + uint8_t padFromEdge = uint8_t(clus.getPad()); + if (padFromEdge > TPCGeometry.NPads(clRow) / 2) { + padFromEdge = TPCGeometry.NPads(clRow) - 1 - padFromEdge; + } + // create working copy of track param bool extConstrained = srcGID.getSource() != GTrackID::TPC; if (extConstrained) { @@ -442,6 +450,8 @@ int MatchTPCITS::addTPCSeed(const o2::track::TrackParCov& _tr, float t0, float t tpcID, srcGID, MinusOne, + clRow, + padFromEdge, (extConstrained || tpcOrig.hasBothSidesClusters()) ? TrackLocTPC::Constrained : (tpcOrig.hasASideClustersOnly() ? TrackLocTPC::ASide : TrackLocTPC::CSide)}); // propagate to matching Xref const auto& trackTune = TrackTuneParams::Instance(); @@ -2872,7 +2882,7 @@ void MatchTPCITS::dumpTPCOrig(bool acc, int tpcIndex) ///< fill debug tree for TPC original tracks (passing pT cut) mTimer[SWDBG].Start(false); const auto& tpcOrig = mTPCTracksArray[tpcIndex]; - uint8_t clSect = 0, clRow = 0, prevRow = 0xff; + uint8_t clSect = 0, clRow = 0, prevRow = 0xff, padFromEdge = -1; uint32_t clIdx = 0; int nshared = 0; std::array shMap{}; @@ -2888,6 +2898,11 @@ void MatchTPCITS::dumpTPCOrig(bool acc, int tpcIndex) prevRawShared = true; } } + const auto& clus = mTPCClusterIdxStruct->clusters[clSect][clRow][clIdx]; + padFromEdge = uint8_t(clus.getPad()); + if (padFromEdge > TPCGeometry.NPads(clRow) / 2) { + padFromEdge = TPCGeometry.NPads(clRow) - 1 - padFromEdge; + } int tb = tpcOrig.getTime0() * mNTPCOccBinLengthInv; float mltTPC = tb < 0 ? mTBinClOcc[0] : (tb >= mTBinClOcc.size() ? mTBinClOcc.back() : mTBinClOcc[tb]); (*mDBGOut) << "tpcOrig" @@ -2900,6 +2915,7 @@ void MatchTPCITS::dumpTPCOrig(bool acc, int tpcIndex) << "time0=" << tpcOrig.getTime0() << "trc=" << ((o2::track::TrackParCov&)tpcOrig) << "minRow=" << clRow + << "padFromEdge=" << padFromEdge << "multTPC=" << mltTPC; if (mMCTruthON) { (*mDBGOut) << "tpcOrig"