Skip to content

Commit f84b440

Browse files
authored
Add mult estimators to matching debug output (#13064)
1 parent 09f01ba commit f84b440

File tree

5 files changed

+50
-2
lines changed

5 files changed

+50
-2
lines changed

Detectors/GlobalTracking/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ o2_add_library(GlobalTracking
3636
O2::FT0Reconstruction
3737
O2::TPCFastTransformation
3838
O2::GPUO2Interface
39+
O2::GPUTracking
3940
O2::TPCBase
4041
O2::TPCReconstruction
4142
O2::TPCCalibration

Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ class MatchTPCITS
372372
///< set Bunch filling and init helpers for validation by BCs
373373
void setBunchFilling(const o2::BunchFilling& bf);
374374

375+
void setNHBPerTF(int n) { mNHBPerTF = n; }
376+
375377
///< ITS readout mode
376378
void setITSTriggered(bool v) { mITSTriggered = v; }
377379
bool isITSTriggered() const { return mITSTriggered; }
@@ -563,6 +565,9 @@ class MatchTPCITS
563565
float mBz = 0; ///< nominal Bz
564566
int mTFCount = 0; ///< internal TF counter for debugger
565567
int mNThreads = 1; ///< number of OMP threads
568+
int mNHBPerTF = 0;
569+
int mNTPCOccBinLength = 0; ///< TPC occ. histo bin length in TBs
570+
float mNTPCOccBinLengthInv;
566571
o2::InteractionRecord mStartIR{0, 0}; ///< IR corresponding to the start of the TF
567572

568573
///========== Parameters to be set externally, e.g. from CCDB ====================
@@ -668,7 +673,7 @@ class MatchTPCITS
668673
std::vector<o2::MCCompLabel> mTPCLblWork; ///< TPC track labels
669674
std::vector<o2::MCCompLabel> mITSLblWork; ///< ITS track labels
670675
std::vector<float> mWinnerChi2Refit; ///< vector of refitChi2 for winners
671-
676+
std::vector<float> mTBinClOcc; ///< TPC occupancy histo: i-th entry is the integrated occupancy for ~1 orbit starting from the TB = i*mNTPCOccBinLength
672677
// ------------------------------
673678
std::vector<TPCABSeed> mTPCABSeeds; ///< pool of primary TPC seeds for AB
674679
///< indices of selected track entries in mTPCWork (for tracks selected by AfterBurner)

Detectors/GlobalTracking/src/MatchTPCITS.cxx

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
#include "ITStracking/IOUtils.h"
4646

4747
#include "GPUO2Interface.h" // Needed for propper settings in GPUParam.h
48+
#include "GPUParam.h"
49+
#include "GPUParam.inc"
4850
#ifdef WITH_OPENMP
4951
#include <omp.h>
5052
#endif
@@ -575,6 +577,28 @@ bool MatchTPCITS::prepareTPCData()
575577
}
576578
*/
577579
mTPCRefitter = std::make_unique<o2::gpu::GPUO2InterfaceRefit>(mTPCClusterIdxStruct, mTPCCorrMapsHelper, mBz, mTPCTrackClusIdx.data(), 0, mTPCRefitterShMap.data(), mTPCRefitterOccMap.data(), mTPCRefitterOccMap.size(), nullptr, o2::base::Propagator::Instance());
580+
mNTPCOccBinLength = mTPCRefitter->getParam()->rec.tpc.occupancyMapTimeBins;
581+
mTBinClOcc.clear();
582+
if (mNTPCOccBinLength > 1 && mTPCRefitterOccMap.size()) {
583+
mNTPCOccBinLengthInv = 1. / mNTPCOccBinLength;
584+
int nTPCBins = mNHBPerTF * o2::constants::lhc::LHCMaxBunches / 8, ninteg = 0;
585+
int nTPCOccBins = nTPCBins * mNTPCOccBinLengthInv, sumBins = std::max(1, int(o2::constants::lhc::LHCMaxBunches / 8 * mNTPCOccBinLengthInv));
586+
mTBinClOcc.resize(nTPCOccBins);
587+
float sm = 0., tb = (nTPCOccBins - 0.5) * mNTPCOccBinLength, mltPrev = 0.;
588+
for (int i = nTPCOccBins; i--;) {
589+
float mlt = mTPCRefitter->getParam()->GetUnscaledMult(tb);
590+
sm += mlt;
591+
mTBinClOcc.push_back(sm);
592+
if (ninteg++ > mNTPCOccBinLength) {
593+
sm -= mltPrev;
594+
}
595+
// LOGP(info, "BIN {} of {} -> {} with inst val {} (prev = {}) BL={} nInt={} tb={}", i, nTPCOccBins, sm, mlt, mltPrev, mNTPCOccBinLength, ninteg, tb);
596+
mltPrev = mlt;
597+
tb -= mNTPCOccBinLength;
598+
}
599+
} else {
600+
mTBinClOcc.resize(1);
601+
}
578602
mInteractionMUSLUT.clear();
579603
mInteractionMUSLUT.resize(maxTime + 3 * o2::constants::lhc::LHCOrbitMUS, -1);
580604
mTimer[SWPrepTPC].Stop();
@@ -1478,6 +1502,8 @@ void MatchTPCITS::fillCalibDebug(int ifit, int iTPC, const o2::dataformats::Trac
14781502
itsRefAltPID.setX(-10);
14791503
}
14801504
}
1505+
int tb = mTPCTracksArray[tTPC.sourceID].getTime0() * mNTPCOccBinLengthInv;
1506+
float mltTPC = tb < 0 ? mTBinClOcc[0] : (tb >= mTBinClOcc.size() ? mTBinClOcc.back() : mTBinClOcc[tb]);
14811507
(*mDBGOut) << "refit"
14821508
<< "tpcOrig=" << mTPCTracksArray[tTPC.sourceID] << "itsOrig=" << mITSTracksArray[tITS.sourceID] << "itsRef=" << tITS << "tpcRef=" << tTPC << "matchRefit=" << match
14831509
<< "timeCorr=" << timeC << "dTimeFT0=" << minDiffFT0 << "dTimes=" << dtimes
@@ -1487,6 +1513,9 @@ void MatchTPCITS::fillCalibDebug(int ifit, int iTPC, const o2::dataformats::Trac
14871513
<< "itsLbl=" << mITSLblWork[iITS] << "tpcLbl=" << mTPCLblWork[iTPC];
14881514
}
14891515
(*mDBGOut) << "refit"
1516+
<< "multTPC=" << mltTPC
1517+
<< "multITSTr=" << mITSTrackROFRec[tITS.roFrame]
1518+
<< "multITSCl=" << mITSClusterROFRec[tITS.roFrame]
14901519
<< "tf=" << mTFCount << "\n";
14911520
}
14921521
#endif
@@ -2803,8 +2832,14 @@ void MatchTPCITS::fillTPCITSmatchTree(int itsID, int tpcID, int rejFlag, float c
28032832
(*mDBGOut) << "match"
28042833
<< "itsLbl=" << mITSLblWork[itsID] << "tpcLbl=" << mTPCLblWork[tpcID];
28052834
}
2835+
int tb = mTPCTracksArray[trackTPC.sourceID].getTime0() * mNTPCOccBinLengthInv;
2836+
float mltTPC = tb < 0 ? mTBinClOcc[0] : (tb >= mTBinClOcc.size() ? mTBinClOcc.back() : mTBinClOcc[tb]);
28062837
(*mDBGOut) << "match"
2807-
<< "rejFlag=" << rejFlag << "\n";
2838+
<< "rejFlag=" << rejFlag
2839+
<< "multTPC=" << tb
2840+
<< "multITSTr=" << mITSTrackROFRec[trackITS.roFrame]
2841+
<< "multITSCl=" << mITSClusterROFRec[trackITS.roFrame]
2842+
<< "\n";
28082843

28092844
mTimer[SWDBG].Stop();
28102845
}
@@ -2833,7 +2868,12 @@ void MatchTPCITS::dumpWinnerMatches()
28332868
(*mDBGOut) << "matchWin"
28342869
<< "itsLbl=" << mITSLblWork[iits] << "tpcLbl=" << mTPCLblWork[itpc];
28352870
}
2871+
int tb = mTPCTracksArray[tTPC.sourceID].getTime0() * mNTPCOccBinLengthInv;
2872+
float mltTPC = tb < 0 ? mTBinClOcc[0] : (tb >= mTBinClOcc.size() ? mTBinClOcc.back() : mTBinClOcc[tb]);
28362873
(*mDBGOut) << "matchWin"
2874+
<< "multTPC=" << mTPCRefitter->getParam()->GetUnscaledMult(mTPCTracksArray[tTPC.sourceID].getTime0())
2875+
<< "multITSTr=" << mITSTrackROFRec[tITS.roFrame]
2876+
<< "multITSCl=" << mITSClusterROFRec[tITS.roFrame]
28372877
<< "\n";
28382878
}
28392879
mTimer[SWDBG].Stop();

Detectors/GlobalTrackingWorkflow/src/TPCITSMatchingSpec.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ void TPCITSMatchingDPL::updateTimeDependentParams(ProcessingContext& pc)
184184
mMatching.setITSTimeBiasInBC(alpParams.roFrameBiasInBC);
185185
mMatching.setSkipTPCOnly(mSkipTPCOnly);
186186
mMatching.setITSTriggered(!o2::base::GRPGeomHelper::instance().getGRPECS()->isDetContinuousReadOut(o2::detectors::DetID::ITS));
187+
mMatching.setNHBPerTF(o2::base::GRPGeomHelper::instance().getGRPECS()->getNHBFPerTF());
187188
mMatching.setMCTruthOn(mUseMC);
188189
mMatching.setUseFT0(mUseFT0);
189190
mMatching.setVDriftCalib(mCalibMode);

GPU/GPUTracking/Interface/GPUO2InterfaceRefit.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class GPUO2InterfaceRefit
8080
void setTrackReferenceX(float v);
8181
void setIgnoreErrorsAtTrackEnds(bool v);
8282
void updateCalib(const o2::gpu::CorrectionMapsHelper* trans, float bzNominalGPU);
83+
auto getParam() const { return mParam.get(); }
8384

8485
// To create shared cluster maps and occupancy maps.
8586
// param is an optional parameter to override the param object, by default a default object from --configKeyValues is used.

0 commit comments

Comments
 (0)