Skip to content

Commit

Permalink
Add to matching debug info TPC inermost cl. row/pad
Browse files Browse the repository at this point in the history
  • Loading branch information
shahor02 committed Jan 28, 2025
1 parent 1640a62 commit 0a74715
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down
32 changes: 24 additions & 8 deletions Detectors/GlobalTracking/src/MatchTPCITS.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <omp.h>
#endif

#include <TTree.h>
#include <cassert>
#include <algorithm>
Expand Down Expand Up @@ -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 <omp.h>
#endif

using namespace o2::globaltracking;

using MatrixDSym4 = ROOT::Math::SMatrix<double, 4, 4, ROOT::Math::MatRepSym<double, 4>>;
Expand All @@ -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;

Expand Down Expand Up @@ -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) {
Expand All @@ -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();
Expand Down Expand Up @@ -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<bool, 152> shMap{};
Expand All @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit 0a74715

Please sign in to comment.