@@ -248,26 +248,30 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
248248 auto vdrit = mTPCVDriftHelper .getVDriftObject ().getVDrift ();
249249 bool tpcTrackOK = recoData.isTrackSourceLoaded (GTrackID::TPC);
250250
251- auto getTPCClInfo = [&recoData](const o2::tpc::TrackTPC& trc) {
251+ auto fillTPCClInfo = [&recoData, this ](const o2::tpc::TrackTPC& trc, o2::dataformats::TrackInfoExt& trExt, float timestampTB = - 1e9 ) {
252252 const auto clRefs = recoData.getTPCTracksClusterRefs ();
253- std::array<int , 3 > clinfo = {};
254253 if (recoData.inputsTPCclusters ) {
255254 uint8_t clSect = 0 , clRow = 0 , clRowP = -1 ;
256255 uint32_t clIdx = 0 ;
257256 for (int ic = 0 ; ic < trc.getNClusterReferences (); ic++) {
258257 trc.getClusterReference (clRefs, ic, clSect, clRow, clIdx);
259258 if (clRow != clRowP) {
260- clinfo[ 2 ] ++;
259+ trExt. rowCountTPC ++;
261260 clRowP = clRow;
262261 }
263262 }
264- const auto clRefs = recoData.getTPCTracksClusterRefs ();
265263 trc.getClusterReference (clRefs, trc.getNClusterReferences () - 1 , clSect, clRow, clIdx);
266- clinfo[0 ] = clRow;
264+ trExt.rowMinTPC = clRow;
265+ const auto & clus = recoData.inputsTPCclusters ->clusterIndex .clusters [clSect][clRow][clIdx];
266+ this ->mTPCCorrMapsLoader .Transform (clSect, clRow, clus.getPad (), clus.getTime (), trExt.innerTPCPos0 [0 ], trExt.innerTPCPos0 [1 ], trExt.innerTPCPos0 [2 ], trc.getTime0 ()); // nominal time of the track
267+ if (timestampTB > -1e8 ) {
268+ this ->mTPCCorrMapsLoader .Transform (clSect, clRow, clus.getPad (), clus.getTime (), trExt.innerTPCPos [0 ], trExt.innerTPCPos [1 ], trExt.innerTPCPos [2 ], timestampTB); // time assigned from the global track track
269+ } else {
270+ trExt.innerTPCPos = trExt.innerTPCPos0 ;
271+ }
267272 trc.getClusterReference (clRefs, 0 , clSect, clRow, clIdx);
268- clinfo[ 1 ] = clRow;
273+ trExt. rowMaxTPC = clRow;
269274 }
270- return clinfo;
271275 };
272276
273277 for (int iv = 0 ; iv < nv; iv++) {
@@ -276,7 +280,6 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
276280 if (iv != nv - 1 ) {
277281 auto & pve = pveVec[iv];
278282 static_cast <o2::dataformats::PrimaryVertex&>(pve) = pvvec[iv];
279-
280283 // find best matching FT0 signal
281284 float bestTimeDiff = 1000 , bestTime = -999 ;
282285 int bestFTID = -1 ;
@@ -319,15 +322,13 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
319322 GTrackID tpcTrID;
320323 const o2::tpc::TrackTPC* tpcTr = nullptr ;
321324 int nclTPC = 0 ;
322- std::array<int , 3 > tpcClInfo{};
323325 if (dm[DetID::TPC] && tpcTrackOK) {
324326 tpcTrID = recoData.getTPCContributorGID (vid);
325327 tpcTr = &recoData.getTPCTrack (tpcTrID);
326328 nclTPC = tpcTr->getNClusters ();
327329 if (nclTPC < mMinTPCClusters ) {
328330 continue ;
329331 }
330- tpcClInfo = getTPCClInfo (*tpcTr);
331332 }
332333 bool ambig = vid.isAmbiguous ();
333334 auto trc = recoData.getTrackParam (vid);
@@ -364,11 +365,19 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
364365 continue ;
365366 }
366367 {
367- o2::dataformats::DCA dcaTPC;
368- dcaTPC.set (-999 .f , -999 .f );
368+ auto & trcExt = trcExtVec.emplace_back ();
369+ recoData.getTrackTime (vid, trcExt.ttime , trcExt.ttimeE );
370+ trcExt.track = trc;
371+ trcExt.dca = dca;
372+ trcExt.gid = vid;
373+ trcExt.xmin = xmin;
374+ trcExt.dcaTPC .set (-999 .f , -999 .f );
375+
369376 if (tpcTr) {
377+ float tsuse = trcExt.ttime / (8 * o2::constants::lhc::LHCBunchSpacingMUS);
370378 if (is == GTrackID::TPC) {
371- dcaTPC = dca;
379+ trcExt.dcaTPC = dca;
380+ tsuse = -1e9 ;
372381 } else {
373382 o2::track::TrackParCov tmpTPC (*tpcTr);
374383 if (iv < nv - 1 && is == GTrackID::TPC && tpcTr && !tpcTr->hasBothSidesClusters ()) { // for unconstrained TPC tracks correct track Z
@@ -378,18 +387,12 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
378387 }
379388 tmpTPC.setZ (tmpTPC.getZ () + corz);
380389 }
381- if (!prop->propagateToDCA (iv == nv - 1 ? vtxDummy : pvvec[iv], tmpTPC, prop->getNominalBz (), 2 ., o2::base::PropagatorF::MatCorrType::USEMatCorrLUT, &dcaTPC)) {
382- dcaTPC.set (-999 .f , -999 .f );
390+ if (!prop->propagateToDCA (iv == nv - 1 ? vtxDummy : pvvec[iv], tmpTPC, prop->getNominalBz (), 2 ., o2::base::PropagatorF::MatCorrType::USEMatCorrLUT, &trcExt. dcaTPC )) {
391+ trcExt. dcaTPC .set (-999 .f , -999 .f );
383392 }
384393 }
394+ fillTPCClInfo (*tpcTr, trcExt, tsuse);
385395 }
386- auto & trcExt = trcExtVec.emplace_back ();
387- recoData.getTrackTime (vid, trcExt.ttime , trcExt.ttimeE );
388- trcExt.track = trc;
389- trcExt.dca = dca;
390- trcExt.dcaTPC = dcaTPC;
391- trcExt.gid = vid;
392- trcExt.xmin = xmin;
393396 auto gidRefs = recoData.getSingleDetectorRefs (vid);
394397 if (gidRefs[GTrackID::ITS].isIndexSet ()) {
395398 const auto & itsTr = recoData.getITSTrack (gidRefs[GTrackID::ITS]);
@@ -412,9 +415,6 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData)
412415 if (gidRefs[GTrackID::TPC].isIndexSet ()) {
413416 trcExt.q2ptTPC = recoData.getTrackParam (gidRefs[GTrackID::TPC]).getQ2Pt ();
414417 trcExt.nClTPC = nclTPC;
415- trcExt.rowMinTPC = tpcClInfo[0 ];
416- trcExt.rowMaxTPC = tpcClInfo[1 ];
417- trcExt.rowCountTPC = tpcClInfo[2 ];
418418 }
419419 if (gidRefs[GTrackID::ITSTPC].isIndexSet ()) {
420420 const auto & trTPCITS = recoData.getTPCITSTrack (gidRefs[GTrackID::ITSTPC]);
0 commit comments