1515// / \author Your Name (your.email@cern.ch)
1616// / \since April 2025
1717
18+ #include " PWGCF/FemtoWorld/Core/FemtoWorldMath.h"
1819#include " PWGLF/DataModel/EPCalibrationTables.h"
1920#include " PWGLF/DataModel/LFhe3HadronTables.h"
2021#include " PWGLF/Utils/nucleiUtils.h"
@@ -93,6 +94,29 @@ constexpr int ProtonPDG = PDG_t::kProton;
9394constexpr int He3PDG = o2::constants::physics::Pdg::kHelium3 ;
9495constexpr float CommonInite = 0 .0f ;
9596
97+ float getkstar (const float pt1, const float eta1, const float phi1, const float mass1, const float z1,
98+ const float pt2, const float eta2, const float phi2, const float mass2, const float z2)
99+ {
100+ const ROOT::Math::PtEtaPhiMVector vecpart1 (pt1 * z1, eta1, phi1, mass1);
101+ const ROOT::Math::PtEtaPhiMVector vecpart2 (pt2 * z2, eta2, phi2, mass2);
102+ const ROOT::Math::PtEtaPhiMVector trackSum = vecpart1 + vecpart2;
103+
104+ const float beta = trackSum.Beta ();
105+ const float betax = beta * std::cos (trackSum.Phi ()) * std::sin (trackSum.Theta ());
106+ const float betay = beta * std::sin (trackSum.Phi ()) * std::sin (trackSum.Theta ());
107+ const float betaz = beta * std::cos (trackSum.Theta ());
108+
109+ ROOT::Math::PxPyPzMVector PartOneCMS (vecpart1);
110+ ROOT::Math::PxPyPzMVector PartTwoCMS (vecpart2);
111+
112+ const ROOT::Math::Boost boostPRF = ROOT::Math::Boost (-betax, -betay, -betaz);
113+ PartOneCMS = boostPRF (PartOneCMS);
114+ PartTwoCMS = boostPRF (PartTwoCMS);
115+
116+ const ROOT::Math::PxPyPzMVector trackRelK = PartOneCMS - PartTwoCMS;
117+ return 0.5 * trackRelK.P ();
118+ }
119+
96120enum Selections {
97121 kNoCuts = 0 ,
98122 kTrackCuts ,
@@ -307,6 +331,7 @@ struct he3HadronFemto {
307331 {" hTrackSel" , " Accepted tracks" , {HistType::kTH1F , {{Selections::kAll , -0.5 , static_cast <double >(Selections::kAll ) - 0.5 }}}},
308332 {" hEmptyPool" , " svPoolCreator did not find track pairs false/true" , {HistType::kTH1F , {{2 , -0.5 , 1.5 }}}},
309333 {" hhe3HadtInvMass" , " ; M(^{3}He + p) (GeV/#it{c}^{2})" , {HistType::kTH1F , {{300 , 3 .74f , 4 .34f }}}},
334+ {" hKstarRecVsKstarGen" , " ; #it{k}*_{gen} (GeV/#it{c}); #it{k}*_{rec} (GeV/#it{c})" , {HistType::kTH2F , {{400 , 0 .f , 0 .8f }, {400 , 0 .f , 0 .8f }}}},
310335
311336 {" He3/hDCAxyHe3" , " ^{3}He;DCA_{xy} (cm)" , {HistType::kTH1F , {{200 , -0 .5f , 0 .5f }}}},
312337 {" He3/hDCAzHe3" , " ^{3}He;DCA_{z} (cm)" , {HistType::kTH1F , {{200 , -1 .0f , 1 .0f }}}},
@@ -480,12 +505,20 @@ struct he3HadronFemto {
480505 template <typename Ttrack>
481506 float correctPtHe3TrackedAsTriton (const Ttrack& candidate)
482507 {
483- if (candidate.pt () < 2.5 && candidate.pidForTracking () == o2::track::PID::Triton)
508+ if (candidate.pt () * 2 . < 2.5 && candidate.pidForTracking () == o2::track::PID::Triton)
484509 return candidate.pt () * 2 . * (1 . - kHePidTrkParams [0 ] - kHePidTrkParams [1 ] * candidate.pt () * 2 .);
485510
486511 return candidate.pt () * 2 .;
487512 }
488513
514+ float correctPtHe3TrackedAsTriton (const float pt, const uint32_t pidForTracking)
515+ {
516+ if (pt < 2.5 && pidForTracking == o2::track::PID::Triton)
517+ return pt * 2 . * (1 . - kHePidTrkParams [0 ] - kHePidTrkParams [1 ] * pt * 2 .);
518+
519+ return pt * 2 .;
520+ }
521+
489522 float computeNsigmaDCA (const float pt, const float dca, const int iSpecies, const char * dcaType = " xy" )
490523 {
491524
@@ -920,7 +953,7 @@ struct he3HadronFemto {
920953 }
921954 }
922955
923- void fillHistograms (const He3HadCandidate& he3Hadcand)
956+ void fillHistograms (const He3HadCandidate& he3Hadcand, bool isMc = false )
924957 {
925958 mQaRegistry .fill (HIST (" He3/hHe3Pt" ), he3Hadcand.recoPtHe3 ());
926959 mQaRegistry .fill (HIST (" Had/hHadronPt" ), he3Hadcand.recoPtHad ());
@@ -931,6 +964,15 @@ struct he3HadronFemto {
931964 mQaRegistry .fill (HIST (" Had/hNClsHadITS" ), he3Hadcand.nclsITSHad );
932965 mQaRegistry .fill (HIST (" He3/hChi2NClHe3ITS" ), he3Hadcand.chi2nclITSHe3 );
933966 mQaRegistry .fill (HIST (" Had/hChi2NClHadITS" ), he3Hadcand.chi2nclITSHad );
967+
968+ if (isMc) {
969+ const float correctedPtHe3 = correctPtHe3TrackedAsTriton (he3Hadcand.recoPtHe3 (), he3Hadcand.pidtrkHe3 );
970+ const float kstarGen = getkstar (he3Hadcand.momHe3MC , he3Hadcand.etaHe3MC , he3Hadcand.phiHe3MC , o2::constants::physics::MassHelium3, 1 .,
971+ he3Hadcand.momHadMC , he3Hadcand.etaHadMC , he3Hadcand.phiHadMC , settingHadPDGCode == PDG_t::kPiPlus ? o2::constants::physics::MassPiPlus : o2::constants::physics::MassProton, 1 .);
972+ const float kstarRec = getkstar (correctedPtHe3, he3Hadcand.recoEtaHe3 (), he3Hadcand.recoPhiHe3 (), o2::constants::physics::MassHelium3, 1 .,
973+ he3Hadcand.recoPtHad (), he3Hadcand.recoEtaHad (), he3Hadcand.recoPhiHad (), settingHadPDGCode == PDG_t::kPiPlus ? o2::constants::physics::MassPiPlus : o2::constants::physics::MassProton, 1 .);
974+ mQaRegistry .fill (HIST (" hKstarRecVsKstarGen" ), kstarGen, kstarRec);
975+ }
934976 }
935977
936978 // ==================================================================================================================
@@ -1186,7 +1228,7 @@ struct he3HadronFemto {
11861228 filledMothers.push_back (motherParticle.globalIndex ());
11871229 }
11881230
1189- fillHistograms (he3Hadcand);
1231+ fillHistograms (he3Hadcand, /* isMc */ true );
11901232 auto collision = collisions.rawIteratorAt (he3Hadcand.collisionID );
11911233 fillTable (he3Hadcand, collision, /* isMC*/ true );
11921234 }
0 commit comments