@@ -249,8 +249,8 @@ struct HfTaskCd {
249249 };
250250
251251 // / Fill histograms for real data
252- template <typename CollType, typename CandType, typename TrackType, typename BcType>
253- void fillHistosData (CollType const & collision, CandType const & candidates, TrackType const & /* tracks*/ , BcType const & /* bcs*/ )
252+ template <typename CollType, typename CandType, typename TrackType, typename TrackWithItsType, typename BcType>
253+ void fillHistosData (CollType const & collision, CandType const & candidates, TrackType const & /* tracks*/ , TrackWithItsType const & tracksWithItsPid, BcType const & /* bcs*/ )
254254 {
255255 auto thisCollId = collision.globalIndex ();
256256 auto groupedCdCandidates = candidates.sliceBy (candCdPerCollision, thisCollId);
@@ -363,6 +363,9 @@ struct HfTaskCd {
363363 auto prong1 = candidate.template prong1_as <TrackType>();
364364 auto prong2 = candidate.template prong2_as <TrackType>();
365365
366+ auto prong0Its = tracksWithItsPid.iteratorAt (candidate.prong0Id () - tracksWithItsPid.offset ());
367+ auto prong2Its = tracksWithItsPid.iteratorAt (candidate.prong2Id () - tracksWithItsPid.offset ());
368+
366369 if (selDeKPi) {
367370 candFlag = 1 ;
368371 pSignedDe = prong0.p () * prong0.sign ();
@@ -371,7 +374,7 @@ struct HfTaskCd {
371374 nSigmaTofDe = candidate.nSigTofDe0 ();
372375 nSigmaTpcPi = candidate.nSigTpcPi2 ();
373376 nSigmaTofPi = candidate.nSigTofPi2 ();
374- nSigmaItsDe = prong0 .itsNSigmaDe ();
377+ nSigmaItsDe = prong0Its .itsNSigmaDe ();
375378 itsNClusterDe = prong0.itsNCls ();
376379 itsNClusterSizeDe = prong0.itsClusterSizes ();
377380 tpcNClusterDe = prong0.tpcNClsCrossedRows ();
@@ -385,7 +388,7 @@ struct HfTaskCd {
385388 nSigmaTofDe = candidate.nSigTofDe2 ();
386389 nSigmaTpcPi = candidate.nSigTpcPi0 ();
387390 nSigmaTofPi = candidate.nSigTofPi0 ();
388- nSigmaItsDe = prong2 .itsNSigmaDe ();
391+ nSigmaItsDe = prong2Its .itsNSigmaDe ();
389392 itsNClusterDe = prong2.itsNCls ();
390393 itsNClusterSizeDe = prong2.itsClusterSizes ();
391394 tpcNClusterDe = prong2.tpcNClsCrossedRows ();
@@ -431,15 +434,16 @@ struct HfTaskCd {
431434 }
432435 }
433436 // / Run the analysis on real data
434- template <typename CollType, typename CandType, typename TrackType, typename BcType>
437+ template <typename CollType, typename CandType, typename TrackType, typename TrackWithItsType, typename BcType>
435438 void runAnalysisPerCollisionData (CollType const & collisions,
436439 CandType const & candidates,
437440 TrackType const & tracks,
441+ TrackWithItsType const & tracksWithItsPid,
438442 BcType const & bcs)
439443 {
440444
441445 for (const auto & collision : collisions) {
442- fillHistosData (collision, candidates, tracks, bcs);
446+ fillHistosData (collision, candidates, tracks, tracksWithItsPid, bcs);
443447 }
444448 }
445449
@@ -450,7 +454,7 @@ struct HfTaskCd {
450454 {
451455 // inlcude ITS PID information
452456 auto tracksWithItsPid = soa::Attach<HFTracks, aod::pidits::ITSNSigmaPi, aod::pidits::ITSNSigmaPr, aod::pidits::ITSNSigmaDe>(tracks);
453- runAnalysisPerCollisionData (collisions, selectedCdCandidates, tracksWithItsPid, bcWithTimeStamps);
457+ runAnalysisPerCollisionData (collisions, selectedCdCandidates, tracks, tracksWithItsPid, bcWithTimeStamps);
454458 }
455459 PROCESS_SWITCH (HfTaskCd, processDataStd, " Process Data with the standard method" , true );
456460
@@ -461,7 +465,7 @@ struct HfTaskCd {
461465 {
462466 // inlcude ITS PID information
463467 auto tracksWithItsPid = soa::Attach<HFTracks, aod::pidits::ITSNSigmaPi, aod::pidits::ITSNSigmaPr, aod::pidits::ITSNSigmaDe>(tracks);
464- runAnalysisPerCollisionData (collisions, selectedCdCandidates, tracksWithItsPid, bcWithTimeStamps);
468+ runAnalysisPerCollisionData (collisions, selectedCdCandidates, tracks, tracksWithItsPid, bcWithTimeStamps);
465469 }
466470 PROCESS_SWITCH (HfTaskCd, processDataStdWithFT0C, " Process real data with the standard method and with FT0C centrality" , false );
467471
@@ -472,7 +476,7 @@ struct HfTaskCd {
472476 {
473477 // inlcude ITS PID information
474478 auto tracksWithItsPid = soa::Attach<HFTracks, aod::pidits::ITSNSigmaPi, aod::pidits::ITSNSigmaPr, aod::pidits::ITSNSigmaDe>(tracks);
475- runAnalysisPerCollisionData (collisions, selectedCdCandidates, tracksWithItsPid, bcWithTimeStamps);
479+ runAnalysisPerCollisionData (collisions, selectedCdCandidates, tracks, tracksWithItsPid, bcWithTimeStamps);
476480 }
477481 PROCESS_SWITCH (HfTaskCd, processDataStdWithFT0M, " Process real data with the standard method and with FT0M centrality" , false );
478482};
0 commit comments