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 ();
0 commit comments