@@ -618,10 +618,38 @@ struct decay3bodyBuilder {
618618
619619 // ------------------------------------------------------------------
620620 // 3body candidate builder with KFParticle
621- template <class TTrackTo , typename TCollision>
621+ template <class TTrackTo , class TCollisionTo , typename TCollision>
622622 void buildVtx3BodyDataTableKFParticle (TCollision const & collision, aod::Decay3Bodys const & decay3bodys, int bachelorcharge = 1 )
623623 {
624624 LOG (debug) << " buildVtx3BodyDataTableKFParticle called." ;
625+
626+ // initialise KF primary vertex
627+ KFPVertex kfpVertex = createKFPVertexFromCollision (collision);
628+ KFParticle kfpv (kfpVertex);
629+ LOG (debug) << " Created KF PV." ;
630+
631+ // fill event QA histograms
632+ if (kfparticleConfigurations.doVertexQA ) {
633+ registry.fill (HIST (" QA/Event/hVtxXKF" ), kfpv.GetX ());
634+ registry.fill (HIST (" QA/Event/hVtxYKF" ), kfpv.GetY ());
635+ registry.fill (HIST (" QA/Event/hVtxZKF" ), kfpv.GetZ ());
636+ registry.fill (HIST (" QA/Event/hVtxCovXXKF" ), kfpv.GetCovariance (0 ));
637+ registry.fill (HIST (" QA/Event/hVtxCovYYKF" ), kfpv.GetCovariance (2 ));
638+ registry.fill (HIST (" QA/Event/hVtxCovZZKF" ), kfpv.GetCovariance (5 ));
639+ registry.fill (HIST (" QA/Event/hVtxCovXYKF" ), kfpv.GetCovariance (1 ));
640+ registry.fill (HIST (" QA/Event/hVtxCovXZKF" ), kfpv.GetCovariance (3 ));
641+ registry.fill (HIST (" QA/Event/hVtxCovYZKF" ), kfpv.GetCovariance (4 ));
642+ registry.fill (HIST (" QA/Event/hVtxX" ), collision.posX ());
643+ registry.fill (HIST (" QA/Event/hVtxY" ), collision.posY ());
644+ registry.fill (HIST (" QA/Event/hVtxZ" ), collision.posZ ());
645+ registry.fill (HIST (" QA/Event/hVtxCovXX" ), collision.covXX ());
646+ registry.fill (HIST (" QA/Event/hVtxCovYY" ), collision.covYY ());
647+ registry.fill (HIST (" QA/Event/hVtxCovZZ" ), collision.covZZ ());
648+ registry.fill (HIST (" QA/Event/hVtxCovXY" ), collision.covXY ());
649+ registry.fill (HIST (" QA/Event/hVtxCovXZ" ), collision.covXZ ());
650+ registry.fill (HIST (" QA/Event/hVtxCovYZ" ), collision.covYZ ());
651+ }
652+
625653 for (auto & vtx3body : decay3bodys) {
626654 LOG (debug) << " Entered decay3bodys loop." ;
627655
@@ -635,13 +663,9 @@ struct decay3bodyBuilder {
635663 auto trackParCovBach = getTrackParCov (trackBach);
636664 LOG (debug) << " Got all daughter tracks." ;
637665
638- KFPVertex kfpVertex = createKFPVertexFromCollision (collision);
639- KFParticle kfpv (kfpVertex);
640- LOG (debug) << " Created KF PV." ;
641-
642666 bool isMatter = trackBach.sign () > 0 ? true : false ;
643667
644- // ---------- fill trackQA and vertexQA histograms
668+ // ---------- fill track QA histograms ----------
645669 if (kfparticleConfigurations.doTrackQA ) {
646670 registry.fill (HIST (" QA/Tracks/hTrackPosTPCNcls" ), trackPos.tpcNClsFound ());
647671 registry.fill (HIST (" QA/Tracks/hTrackNegTPCNcls" ), trackNeg.tpcNClsFound ());
@@ -665,27 +689,6 @@ struct decay3bodyBuilder {
665689 registry.fill (HIST (" QA/Tracks/hTrackBachPt" ), trackBach.pt ());
666690 }
667691
668- if (kfparticleConfigurations.doVertexQA ) {
669- registry.fill (HIST (" QA/Event/hVtxXKF" ), kfpv.GetX ());
670- registry.fill (HIST (" QA/Event/hVtxYKF" ), kfpv.GetY ());
671- registry.fill (HIST (" QA/Event/hVtxZKF" ), kfpv.GetZ ());
672- registry.fill (HIST (" QA/Event/hVtxCovXXKF" ), kfpv.GetCovariance (0 ));
673- registry.fill (HIST (" QA/Event/hVtxCovYYKF" ), kfpv.GetCovariance (2 ));
674- registry.fill (HIST (" QA/Event/hVtxCovZZKF" ), kfpv.GetCovariance (5 ));
675- registry.fill (HIST (" QA/Event/hVtxCovXYKF" ), kfpv.GetCovariance (1 ));
676- registry.fill (HIST (" QA/Event/hVtxCovXZKF" ), kfpv.GetCovariance (3 ));
677- registry.fill (HIST (" QA/Event/hVtxCovYZKF" ), kfpv.GetCovariance (4 ));
678- registry.fill (HIST (" QA/Event/hVtxX" ), collision.posX ());
679- registry.fill (HIST (" QA/Event/hVtxY" ), collision.posY ());
680- registry.fill (HIST (" QA/Event/hVtxZ" ), collision.posZ ());
681- registry.fill (HIST (" QA/Event/hVtxCovXX" ), collision.covXX ());
682- registry.fill (HIST (" QA/Event/hVtxCovYY" ), collision.covYY ());
683- registry.fill (HIST (" QA/Event/hVtxCovZZ" ), collision.covZZ ());
684- registry.fill (HIST (" QA/Event/hVtxCovXY" ), collision.covXY ());
685- registry.fill (HIST (" QA/Event/hVtxCovXZ" ), collision.covXZ ());
686- registry.fill (HIST (" QA/Event/hVtxCovYZ" ), collision.covYZ ());
687- }
688-
689692 // -------- STEP 1: track selection --------
690693 // collision ID --> not correct? tracks can have different collisions, but belong to one 3prong vertex!
691694 // if (trackPos.collisionId() != trackNeg.collisionId() || trackPos.collisionId() != trackBach.collisionId() || trackNeg.collisionId() != trackBach.collisionId()) {
@@ -731,23 +734,37 @@ struct decay3bodyBuilder {
731734 // TPC PID
732735 float tpcNsigmaProton;
733736 float tpcNsigmaPion;
737+ float dEdxProton;
738+ float dEdxPion;
734739 float tpcNsigmaDeuteron = trackBach.tpcNSigmaDe ();
740+ float dEdxDeuteron = trackBach.tpcSignal ();
735741 if (isMatter) { // hypertriton (proton, pi-, deuteron)
736742 tpcNsigmaProton = trackPos.tpcNSigmaPr ();
737743 tpcNsigmaPion = trackNeg.tpcNSigmaPi ();
744+ dEdxProton = trackPos.tpcSignal ();
745+ dEdxPion = trackNeg.tpcSignal ();
738746 if (!selectTPCPID (trackPos, trackNeg, trackBach)) {
739747 continue ;
740748 }
741749 } else if (!isMatter) { // anti-hypertriton (anti-proton, pi+, deuteron)
742750 tpcNsigmaProton = trackNeg.tpcNSigmaPr ();
743751 tpcNsigmaPion = trackPos.tpcNSigmaPi ();
752+ dEdxProton = trackNeg.tpcSignal ();
753+ dEdxPion = trackPos.tpcSignal ();
744754 if (!selectTPCPID (trackNeg, trackPos, trackBach)) {
745755 continue ;
746756 }
747757 }
748758 registry.fill (HIST (" hVtx3BodyCounterKFParticle" ), kKfVtxTPCPID );
749759 LOG (debug) << " Basic track selections done." ;
750760
761+ // TOF PID of deuteron (set motherhyp correctly)
762+ double tofNSigmaDeuteron = -999 ;
763+ if (trackBach.has_collision () && trackBach.hasTOF ()) {
764+ auto originalcol = trackBach.template collision_as <TCollisionTo>();
765+ tofNSigmaDeuteron = bachelorTOFPID.GetTOFNSigma (trackBach, originalcol, collision);
766+ }
767+
751768 // track DCAxy and DCAz to PV associated with decay3body
752769 o2::dataformats::VertexBase mPV ;
753770 o2::dataformats::DCA mDcaInfoCovPos ;
@@ -1000,7 +1017,11 @@ struct decay3bodyBuilder {
10001017 // daughter PID
10011018 tpcNsigmaProton,
10021019 tpcNsigmaPion,
1003- tpcNsigmaDeuteron);
1020+ tpcNsigmaDeuteron,
1021+ dEdxProton,
1022+ dEdxPion,
1023+ dEdxDeuteron,
1024+ tofNSigmaDeuteron);
10041025
10051026 if (kfparticleConfigurations.fillCandidateLiteTable ) {
10061027 kfvtx3bodydatalite (
@@ -1050,7 +1071,11 @@ struct decay3bodyBuilder {
10501071 // daughter PID
10511072 tpcNsigmaProton,
10521073 tpcNsigmaPion,
1053- tpcNsigmaDeuteron);
1074+ tpcNsigmaDeuteron,
1075+ dEdxProton,
1076+ dEdxPion,
1077+ dEdxDeuteron,
1078+ tofNSigmaDeuteron);
10541079 }
10551080 LOG (debug) << " Table filled." ;
10561081
@@ -1074,7 +1099,7 @@ struct decay3bodyBuilder {
10741099 }
10751100 PROCESS_SWITCH (decay3bodyBuilder, processRun3, " Produce DCA fitter decay3body tables" , true );
10761101
1077- void processRun3withKFParticle (MyCollisions const & collisions, FullTracksExtPIDIU const &, aod::Decay3Bodys const & decay3bodys, aod::BCsWithTimestamps const &)
1102+ void processRun3withKFParticle (ColwithEvTimes const & collisions, TrackExtPIDIUwithEvTimes const &, aod::Decay3Bodys const & decay3bodys, aod::BCsWithTimestamps const &)
10781103 {
10791104 for (const auto & collision : collisions) {
10801105 // event selection
@@ -1097,7 +1122,7 @@ struct decay3bodyBuilder {
10971122 // LOG(debug) << "Collision index: " << collIdx;
10981123 auto Decay3BodyTable_thisCollision = decay3bodys.sliceBy (perCollision, collIdx);
10991124 // LOG(debug) << "Decay3Body tables sliced per collision. Calling buildVtx3BodyDataTableKFParticle function...";
1100- buildVtx3BodyDataTableKFParticle<FullTracksExtPIDIU >(collision, Decay3BodyTable_thisCollision, bachelorcharge);
1125+ buildVtx3BodyDataTableKFParticle<TrackExtPIDIUwithEvTimes, ColwithEvTimes >(collision, Decay3BodyTable_thisCollision, bachelorcharge);
11011126 LOG (debug) << " End of processKFParticle." ;
11021127 }
11031128 }
0 commit comments