Skip to content

Commit 4e0f856

Browse files
committed
do not pass tracks into V0 run() and process() functions
1 parent 2aa43a6 commit 4e0f856

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

DPG/Tasks/TPC/tpcSkimsTableCreator.cxx

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ struct TreeWriterTpcV0 {
429429
}
430430

431431
template <bool IsCorrectedDeDx, typename TrksType>
432-
void runStandard(Colls::iterator const& collision, soa::Filtered<TrksType> const& tracks, V0sWithID const& v0s, CascsWithID const& cascs)
432+
void runStandard(Colls::iterator const& collision, V0sWithID const& v0s, CascsWithID const& cascs)
433433
{
434434
/// Check event slection
435435
if (!isEventSelected(collision, applyEvSel)) {
@@ -439,7 +439,7 @@ struct TreeWriterTpcV0 {
439439
const int runnumber = bc.runNumber();
440440
const float hadronicRate = mRateFetcher.fetch(ccdb.service, bc.timestamp(), runnumber, irSource) * 1.e-3;
441441

442-
rowTPCTree.reserve(tracks.size());
442+
rowTPCTree.reserve(2 * v0s.size() + cascs.size());
443443

444444
auto fillDaughterTrack = [&](const auto& mother, const TrksType::iterator& dauTrack, const V0Daughter& daughter) {
445445
const bool passDownsamplig = downsampleTsalisCharged(fRndm, dauTrack.pt(), daughter.downsamplingTsalis, daughter.mass, sqrtSNN, daughter.maxPt4dwnsmplTsalis);
@@ -456,8 +456,8 @@ struct TreeWriterTpcV0 {
456456
if (v0Id == MotherUndef) {
457457
continue;
458458
}
459-
const auto& posTrack = v0.posTrack_as<soa::Filtered<TrksType>>();
460-
const auto& negTrack = v0.negTrack_as<soa::Filtered<TrksType>>();
459+
const auto& posTrack = v0.posTrack_as<TrksType>();
460+
const auto& negTrack = v0.negTrack_as<TrksType>();
461461
if (!(isTrackSelected(posTrack, trackSelection) && isTrackSelected(negTrack, trackSelection))) {
462462
continue;
463463
}
@@ -476,7 +476,7 @@ struct TreeWriterTpcV0 {
476476
if (cascId == MotherUndef) {
477477
continue;
478478
}
479-
const auto& bachTrack = casc.bachelor_as<soa::Filtered<TrksType>>();
479+
const auto& bachTrack = casc.bachelor_as<TrksType>();
480480
if (!isTrackSelected(bachTrack, trackSelection)) {
481481
continue;
482482
}
@@ -487,25 +487,23 @@ struct TreeWriterTpcV0 {
487487
}
488488

489489
/// Apply a track quality selection with a filter!
490-
void processStandard(Colls::iterator const& collision, soa::Filtered<Trks> const& tracks, V0sWithID const& v0s, CascsWithID const& cascs, aod::BCsWithTimestamps const&)
490+
void processStandard(Colls::iterator const& collision, V0sWithID const& v0s, CascsWithID const& cascs, aod::BCsWithTimestamps const&)
491491
{
492-
runStandard<false, Trks>(collision, tracks, v0s, cascs);
492+
runStandard<false, Trks>(collision, v0s, cascs);
493493
} /// process Standard
494494
PROCESS_SWITCH(TreeWriterTpcV0, processStandard, "Standard V0 Samples for PID", true);
495495

496-
void processStandardWithCorrecteddEdx(Colls::iterator const& collision, soa::Filtered<TrksWithDEdxCorrection> const& tracks, V0sWithID const& v0s, CascsWithID const& cascs, aod::BCsWithTimestamps const&)
496+
void processStandardWithCorrecteddEdx(Colls::iterator const& collision, V0sWithID const& v0s, CascsWithID const& cascs, aod::BCsWithTimestamps const&)
497497
{
498-
runStandard<true, TrksWithDEdxCorrection>(collision, tracks, v0s, cascs);
498+
runStandard<true, TrksWithDEdxCorrection>(collision, v0s, cascs);
499499
} /// process StandardWithCorrecteddEdx
500500
PROCESS_SWITCH(TreeWriterTpcV0, processStandardWithCorrecteddEdx, "Standard V0 Samples for PID with corrected dEdx", false);
501501

502-
Preslice<Trks> perCollisionTracks = aod::track::collisionId;
503502
Preslice<V0sWithID> perCollisionV0s = aod::v0data::collisionId;
504503
Preslice<CascsWithID> perCollisionCascs = aod::cascdata::collisionId;
505-
Preslice<TrksWithDEdxCorrection> perCollisionTracksWithNewDEdx = aod::track::collisionId;
506504

507505
template <bool IsCorrectedDeDx, bool IsWithdEdx, typename TrksType, typename BCType>
508-
void runWithTrQAGeneric(Colls const& collisions, TrksType const& myTracks, V0sWithID const& myV0s, CascsWithID const& myCascs, aod::TracksQAVersion const& tracksQA, Preslice<TrksType> const& perCollisionTracksType)
506+
void runWithTrQAGeneric(Colls const& collisions, TrksType const& myTracks, V0sWithID const& myV0s, CascsWithID const& myCascs, aod::TracksQAVersion const& tracksQA)
509507
{
510508
std::vector<int64_t> labelTrack2TrackQA(myTracks.size(), -1);
511509
for (const auto& trackQA : tracksQA) {
@@ -514,7 +512,6 @@ struct TreeWriterTpcV0 {
514512
}
515513
for (const auto& collision : collisions) {
516514
/// Check event slection
517-
const auto& tracks = myTracks.sliceBy(perCollisionTracksType, collision.globalIndex());
518515
if (!isEventSelected(collision, applyEvSel)) {
519516
continue;
520517
}
@@ -533,9 +530,9 @@ struct TreeWriterTpcV0 {
533530
bcBcInTimeFrame = bc.bcInTF();
534531
}
535532
if constexpr (IsWithdEdx) {
536-
rowTPCTreeWithdEdxTrkQA.reserve(tracks.size());
533+
rowTPCTreeWithdEdxTrkQA.reserve(2 * v0s.size() + cascs.size());
537534
} else {
538-
rowTPCTreeWithTrkQA.reserve(tracks.size());
535+
rowTPCTreeWithTrkQA.reserve(2 * v0s.size() + cascs.size());
539536
}
540537

541538
auto fillDaughterTrack = [&](const auto& mother, const TrksType::iterator& dauTrack, const V0Daughter& daughter, const aod::TracksQA& trackQAInstance, const bool existTrkQA) {
@@ -600,25 +597,25 @@ struct TreeWriterTpcV0 {
600597

601598
void processWithdEdxTrQA(Colls const& collisions, Trks const& myTracks, V0sWithID const& myV0s, CascsWithID const& myCascs, aod::BCsWithTimestamps const&, aod::TracksQAVersion const& tracksQA)
602599
{
603-
runWithTrQAGeneric<false, true, Trks, aod::BCsWithTimestamps>(collisions, myTracks, myV0s, myCascs, tracksQA, perCollisionTracks);
600+
runWithTrQAGeneric<false, true, Trks, aod::BCsWithTimestamps>(collisions, myTracks, myV0s, myCascs, tracksQA);
604601
} /// process with dEdx from TrackQA
605602
PROCESS_SWITCH(TreeWriterTpcV0, processWithdEdxTrQA, "Standard V0 Samples with dEdx from Track QA for PID", false);
606603

607604
void processWithdEdxTrQAWithCorrecteddEdx(Colls const& collisions, TrksWithDEdxCorrection const& myTracks, V0sWithID const& myV0s, CascsWithID const& myCascs, aod::BCsWithTimestamps const&, aod::TracksQAVersion const& tracksQA)
608605
{
609-
runWithTrQAGeneric<true, true, TrksWithDEdxCorrection, aod::BCsWithTimestamps>(collisions, myTracks, myV0s, myCascs, tracksQA, perCollisionTracksWithNewDEdx);
606+
runWithTrQAGeneric<true, true, TrksWithDEdxCorrection, aod::BCsWithTimestamps>(collisions, myTracks, myV0s, myCascs, tracksQA);
610607
} /// process with dEdx from TrackQA
611608
PROCESS_SWITCH(TreeWriterTpcV0, processWithdEdxTrQAWithCorrecteddEdx, "Standard V0 Samples with dEdx from Track QA for PID with corrected dEdx", false);
612609

613610
void processWithTrQA(Colls const& collisions, Trks const& myTracks, V0sWithID const& myV0s, CascsWithID const& myCascs, MyBCTable const&, aod::TracksQAVersion const& tracksQA)
614611
{
615-
runWithTrQAGeneric<false, false, Trks, MyBCTable>(collisions, myTracks, myV0s, myCascs, tracksQA, perCollisionTracks);
612+
runWithTrQAGeneric<false, false, Trks, MyBCTable>(collisions, myTracks, myV0s, myCascs, tracksQA);
616613
} /// process with TrackQA
617614
PROCESS_SWITCH(TreeWriterTpcV0, processWithTrQA, "Standard V0 Samples with Track QA for PID", false);
618615

619616
void processWithTrQAWithCorrecteddEdx(Colls const& collisions, TrksWithDEdxCorrection const& myTracks, V0sWithID const& myV0s, CascsWithID const& myCascs, MyBCTable const&, aod::TracksQAVersion const& tracksQA)
620617
{
621-
runWithTrQAGeneric<true, false, TrksWithDEdxCorrection, MyBCTable>(collisions, myTracks, myV0s, myCascs, tracksQA, perCollisionTracksWithNewDEdx);
618+
runWithTrQAGeneric<true, false, TrksWithDEdxCorrection, MyBCTable>(collisions, myTracks, myV0s, myCascs, tracksQA);
622619
} /// process with TrackQA
623620
PROCESS_SWITCH(TreeWriterTpcV0, processWithTrQAWithCorrecteddEdx, "Standard V0 Samples with Track QA for PID with corrected dEdx", false);
624621

0 commit comments

Comments
 (0)