@@ -87,25 +87,28 @@ struct sigmaHadCorrTask {
8787 // Configurable for event selection
8888 Configurable<float > cutzvertex{" cutZVertex" , 10 .0f , " Accepted z-vertex range (cm)" };
8989
90+ Configurable<bool > doSigmaPion{" doSigmaPion" , false , " If true, pair Sigma with pions instead of protons" };
91+ Configurable<bool > doSigmaMinus{" doSigmaMinus" , true , " If true, pair Sigma- candidates, else Sigma+" };
92+ Configurable<float > cutMaxKStar{" cutMaxKStar" , 1.5 , " Maximum k* for Sigma-hadron pairs (GeV/c)" };
93+
9094 Configurable<float > minPtSigma{" minPtSigma" , 1 .f , " Minimum pT for Sigma candidates (GeV/c)" };
91- Configurable<float > cutEtaDaught{ " cutEtaDaughter " , 0 . 8f , " Eta cut for daughter tracks " };
95+ Configurable<bool > useRecalculatedSigmaMomentum{ " useRecalculatedSigmaMomentum " , true , " If true, compute k* using Sigma momentum recalculated from daughter kinematics " };
9296 Configurable<float > cutDCAtoPVSigma{" cutDCAtoPVSigma" , 0 .1f , " Max DCA to primary vertex for Sigma candidates (cm)" };
93- Configurable<bool > doSigmaMinus{" doSigmaMinus" , true , " If true, pair Sigma- candidates, else Sigma+" };
9497 Configurable<float > cutSigmaRadius{" cutSigmaRadius" , 20 .f , " Minimum radius for Sigma candidates (cm)" };
9598 Configurable<float > cutSigmaMass{" cutSigmaMass" , 0.3 , " Sigma mass window (GeV/c^2)" };
9699 Configurable<float > alphaAPCut{" alphaAPCut" , 0 ., " Alpha AP cut for Sigma candidates" };
97100 Configurable<float > qtAPCutLow{" qtAPCutLow" , 0.15 , " Lower qT AP cut for Sigma candidates (GeV/c)" };
98101 Configurable<float > qtAPCutHigh{" qtAPCutHigh" , 0.2 , " Upper qT AP cut for Sigma candidates (GeV/c)" };
102+ Configurable<float > cutEtaDaught{" cutEtaDaughter" , 0 .8f , " Eta cut for daughter tracks" };
103+ Configurable<float > ptMinTOFKinkDau{" ptMinTOFKinkDau" , 0 .75f , " Minimum pT to require TOF for kink daughter PID (GeV/c)" };
104+ Configurable<bool > applyTOFPIDKinkDaughter{" applyTOFPIDKinkDaughter" , false , " If true, apply TOF PID cut to the kink daughter track" };
99105
100- Configurable<float > cutNITSClusPr{" cutNITSClusPr" , 5 , " Minimum number of ITS clusters for hadron track" };
101- Configurable<float > cutNTPCClusPr{" cutNTPCClusPr" , 90 , " Minimum number of TPC clusters for hadron track" };
106+ Configurable<float > cutNITSClusHad{" cutNITSClusHad" , 5 , " Minimum number of ITS clusters for hadron track" };
107+ Configurable<float > cutNTPCClusHad{" cutNTPCClusHad" , 90 , " Minimum number of TPC clusters for hadron track" };
108+ Configurable<float > ptMinHad{" ptMinHad" , 0 .2f , " Minimum pT for hadron track (GeV/c)" };
109+ Configurable<float > ptMinTOFHad{" ptMinTOFHad" , 0 .75f , " Minimum pT to require TOF for hadron PID (GeV/c)" };
102110 Configurable<float > cutNSigmaTPC{" cutNSigmaTPC" , 3 , " TPC nSigma cut for hadron track" };
103111 Configurable<float > cutNSigmaTOF{" cutNSigmaTOF" , 3 , " TOF nSigma cut for hadron track" };
104- Configurable<bool > applyTOFPIDKinkDaughter{" applyTOFPIDKinkDaughter" , false , " If true, apply TOF PID cut to the kink daughter track" };
105- Configurable<bool > doSigmaPion{" doSigmaPion" , false , " If true, pair Sigma with pions instead of protons" };
106-
107- Configurable<float > cutMaxKStar{" cutMaxKStar" , 1.5 , " Maximum k* for Sigma-hadron pairs (GeV/c)" };
108- Configurable<bool > useRecalculatedSigmaMomentum{" useRecalculatedSigmaMomentum" , true , " If true, compute k* using Sigma momentum recalculated from daughter kinematics" };
109112
110113 Configurable<bool > fillOutputTree{" fillOutputTree" , true , " If true, fill the output tree with Sigma-hadron candidates" };
111114 Configurable<bool > fillSparseInvMassKstar{" fillSparseInvMassKstar" , false , " If true, fill THn with invmass, k*, sigma charge, proton charge, sigma decay radius, cosPA, sigma pt" };
@@ -126,9 +129,9 @@ struct sigmaHadCorrTask {
126129 const AxisSpec nSigmaHadAxis{100 , -5 , 5 , " n#sigma_{had}" };
127130 const AxisSpec sigmaMassAxis{50 , 1.1 , 1.3 , " m (GeV/#it{c}^{2})" };
128131 const AxisSpec kStarAxis {200 , 0.0 , 2 ., " k* (GeV/#it{c})" };
129- const AxisSpec ptHadAxis{100 , 0.0 , 10 .0 , " #it{p}_{T,had} (GeV/#it{c})" };
130- const AxisSpec sigmaPtAxis{100 , 0.0 , 10 .0 , " #it{p}_{T,#Sigma} (GeV/#it{c})" };
131- const AxisSpec sigmaPtAxisCoarse{20 , 0.0 , 10 .0 , " #it{p}_{T,#Sigma} (GeV/#it{c})" };
132+ const AxisSpec ptHadAxis{100 , 0.0 , 6 .0 , " #it{p}_{T,had} (GeV/#it{c})" };
133+ const AxisSpec sigmaPtAxis{100 , 0.0 , 6 .0 , " #it{p}_{T,#Sigma} (GeV/#it{c})" };
134+ const AxisSpec sigmaPtAxisCoarse{30 , 0.0 , 6 .0 , " #it{p}_{T,#Sigma} (GeV/#it{c})" };
132135 const AxisSpec sigmaChargeAxis{2 , -1.5 , 1.5 , " #Sigma charge" };
133136 const AxisSpec hadronChargeAxis{2 , -1.5 , 1.5 , " Hadron charge" };
134137 const AxisSpec sigmaDecRadiusAxis{25 , 14.5 , 40.5 , " #Sigma decay radius (cm)" };
@@ -191,25 +194,27 @@ struct sigmaHadCorrTask {
191194 return dotProduct / (momMotherMag * decayVecMag);
192195 }
193196
194- float getRecalculatedSigmaMomentum (const sigmaHadCand& candidate )
197+ float getRecalculatedSigmaMomentum (float sigmaPx, float sigmaPy, float sigmaPz, float sigmaDauPx, float sigmaDauPy, float sigmaDauPz )
195198 {
196- constexpr float massPion = o2::constants::physics::MassPionCharged;
197- constexpr float massNeutron = o2::constants::physics::MassNeutron;
199+ // Sigma- -> n + pi- (charged daughter = pion, neutral daughter = neutron)
200+ // Sigma+ -> p + pi0 (charged daughter = proton, neutral daughter = pi0)
201+ float massChargedDau = doSigmaMinus ? o2::constants::physics::MassPionCharged : o2::constants::physics::MassProton;
202+ float massNeutralDau = doSigmaMinus ? o2::constants::physics::MassNeutron : o2::constants::physics::MassPionNeutral;
198203 float massSigma = doSigmaMinus ? o2::constants::physics::MassSigmaMinus : o2::constants::physics::MassSigmaPlus;
199204
200- float pMother = std::sqrt (candidate. sigmaPx * candidate. sigmaPx + candidate. sigmaPy * candidate. sigmaPy + candidate. sigmaPz * candidate. sigmaPz );
205+ float pMother = std::sqrt (sigmaPx * sigmaPx + sigmaPy * sigmaPy + sigmaPz * sigmaPz);
201206 if (pMother < 1e-6f ) {
202207 return -999 .f ;
203208 }
204- float versorX = candidate. sigmaPx / pMother;
205- float versorY = candidate. sigmaPy / pMother;
206- float versorZ = candidate. sigmaPz / pMother;
207- float ePi = std::sqrt (massPion * massPion + candidate. sigmaDauPx * candidate. sigmaDauPx + candidate. sigmaDauPy * candidate. sigmaDauPy + candidate. sigmaDauPz * candidate. sigmaDauPz );
208- float a = versorX * candidate. sigmaDauPx + versorY * candidate. sigmaDauPy + versorZ * candidate. sigmaDauPz ;
209- float K = massSigma * massSigma + massPion * massPion - massNeutron * massNeutron ;
210- float A = 4 .f * (ePi * ePi - a * a);
209+ float versorX = sigmaPx / pMother;
210+ float versorY = sigmaPy / pMother;
211+ float versorZ = sigmaPz / pMother;
212+ float eChDau = std::sqrt (massChargedDau * massChargedDau + sigmaDauPx * sigmaDauPx + sigmaDauPy * sigmaDauPy + sigmaDauPz * sigmaDauPz);
213+ float a = versorX * sigmaDauPx + versorY * sigmaDauPy + versorZ * sigmaDauPz;
214+ float K = massSigma * massSigma + massChargedDau * massChargedDau - massNeutralDau * massNeutralDau ;
215+ float A = 4 .f * (eChDau * eChDau - a * a);
211216 float B = -4 .f * a * K;
212- float C = 4 .f * ePi * ePi * massSigma * massSigma - K * K;
217+ float C = 4 .f * eChDau * eChDau * massSigma * massSigma - K * K;
213218 if (std::abs (A) < 1e-6f ) {
214219 return -999 .f ;
215220 }
@@ -231,19 +236,19 @@ struct sigmaHadCorrTask {
231236 return (p1Diff < p2Diff) ? P1 : P2;
232237 }
233238
234- std::array<float , 3 > getSigmaMomentumForKstar (const sigmaHadCand& candidate )
239+ std::array<float , 3 > getSigmaMomentumForKstar (float sigmaPx, float sigmaPy, float sigmaPz, float sigmaDauPx, float sigmaDauPy, float sigmaDauPz )
235240 {
236- std::array<float , 3 > sigmaMomentum = {candidate. sigmaPx , candidate. sigmaPy , candidate. sigmaPz };
241+ std::array<float , 3 > sigmaMomentum = {sigmaPx, sigmaPy, sigmaPz};
237242 if (!useRecalculatedSigmaMomentum) {
238243 return sigmaMomentum;
239244 }
240245
241- float pNew = getRecalculatedSigmaMomentum (candidate );
246+ float pNew = getRecalculatedSigmaMomentum (sigmaPx, sigmaPy, sigmaPz, sigmaDauPx, sigmaDauPy, sigmaDauPz );
242247 if (pNew <= 0 .f ) {
243248 return sigmaMomentum;
244249 }
245250
246- float pOld = std::sqrt (candidate. sigmaPx * candidate. sigmaPx + candidate. sigmaPy * candidate. sigmaPy + candidate. sigmaPz * candidate. sigmaPz );
251+ float pOld = std::sqrt (sigmaPx * sigmaPx + sigmaPy * sigmaPy + sigmaPz * sigmaPz);
247252 if (pOld <= 0 .f ) {
248253 return sigmaMomentum;
249254 }
@@ -278,26 +283,6 @@ struct sigmaHadCorrTask {
278283 }
279284
280285 TLorentzVector trackSum, PartOneCMS, PartTwoCMS, trackRelK;
281- float getKStar (const sigmaHadCand& candidate)
282- {
283- TLorentzVector part1; // Sigma
284- TLorentzVector part2; // Hadron track (proton/pion)
285- part1.SetXYZM (candidate.sigmaPx , candidate.sigmaPy , candidate.sigmaPz , getSigmaMassForKstar ());
286- part2.SetXYZM (candidate.pxHad , candidate.pyHad , candidate.pzHad , getHadTrackMass ());
287- trackSum = part1 + part2;
288- const float beta = trackSum.Beta ();
289- const float betax = beta * std::cos (trackSum.Phi ()) * std::sin (trackSum.Theta ());
290- const float betay = beta * std::sin (trackSum.Phi ()) * std::sin (trackSum.Theta ());
291- const float betaz = beta * std::cos (trackSum.Theta ());
292- PartOneCMS.SetXYZM (part1.Px (), part1.Py (), part1.Pz (), part1.M ());
293- PartTwoCMS.SetXYZM (part2.Px (), part2.Py (), part2.Pz (), part2.M ());
294- const ROOT::Math::Boost boostPRF = ROOT::Math::Boost (-betax, -betay, -betaz);
295- PartOneCMS = boostPRF (PartOneCMS);
296- PartTwoCMS = boostPRF (PartTwoCMS);
297- trackRelK = PartOneCMS - PartTwoCMS;
298- return 0.5 * trackRelK.P ();
299- }
300-
301286 float getKStar (float sigmaPx, float sigmaPy, float sigmaPz, float pxHad, float pyHad, float pzHad)
302287 {
303288 TLorentzVector part1; // Sigma
@@ -321,17 +306,15 @@ struct sigmaHadCorrTask {
321306 template <typename Ttrack>
322307 bool selectHadTrack (const Ttrack& candidate)
323308 {
324- if (std::abs ( getTPCNSigmaHad ( candidate)) > cutNSigmaTPC || candidate. tpcNClsFound () < cutNTPCClusPr || std::abs (candidate. eta ()) > cutEtaDaught ) {
309+ if (candidate. pt () < ptMinHad ) {
325310 return false ;
326311 }
327-
328- if (candidate.itsNCls () < cutNITSClusPr) {
312+ if (std::abs (getTPCNSigmaHad (candidate)) > cutNSigmaTPC || candidate.tpcNClsFound () < cutNTPCClusHad || std::abs (candidate.eta ()) > cutEtaDaught) {
329313 return false ;
330314 }
331315
332- float ptMinTOF = 0 .75f ; // Minimum pT to use TOF for hadron-track PID
333- if (candidate.pt () < ptMinTOF) {
334- return true ; // No TOF cut for low pT
316+ if (candidate.itsNCls () < cutNITSClusHad) {
317+ return false ;
335318 }
336319
337320 if (!candidate.hasTOF ()) {
@@ -377,8 +360,7 @@ struct sigmaHadCorrTask {
377360 }
378361
379362 if (applyTOFPIDKinkDaughter) {
380- constexpr float ptMinTOF = 0 .75f ;
381- if (kinkDauTrack.pt () >= ptMinTOF) {
363+ if (kinkDauTrack.pt () >= ptMinTOFKinkDau) {
382364 if (!kinkDauTrack.hasTOF ()) {
383365 return false ;
384366 }
@@ -410,14 +392,8 @@ struct sigmaHadCorrTask {
410392 float qtAP = getQtAP (momMothAll, momDaugAll);
411393 rSigmaHad.fill (HIST (" QA/h2QtAPvsAlphaAP" ), alphaAP, qtAP);
412394
413- sigmaHadCand sigmaForPt;
414- sigmaForPt.sigmaPx = sigmaCand.pxMoth ();
415- sigmaForPt.sigmaPy = sigmaCand.pyMoth ();
416- sigmaForPt.sigmaPz = sigmaCand.pzMoth ();
417- sigmaForPt.sigmaDauPx = sigmaCand.pxDaug ();
418- sigmaForPt.sigmaDauPy = sigmaCand.pyDaug ();
419- sigmaForPt.sigmaDauPz = sigmaCand.pzDaug ();
420- auto sigmaPRecal = getSigmaMomentumForKstar (sigmaForPt);
395+ auto sigmaPRecal = getSigmaMomentumForKstar (sigmaCand.pxMoth (), sigmaCand.pyMoth (), sigmaCand.pzMoth (),
396+ sigmaCand.pxDaug (), sigmaCand.pyDaug (), sigmaCand.pzDaug ());
421397 float sigmaPtRecal = std::hypot (sigmaPRecal[0 ], sigmaPRecal[1 ]);
422398 float sigmaMassForQa = doSigmaMinus ? sigmaCand.mSigmaMinus () : sigmaCand.mSigmaPlus ();
423399
@@ -608,7 +584,8 @@ struct sigmaHadCorrTask {
608584 float kStarGen = getKStar (mcPartSigma.px (), mcPartSigma.py (), mcPartSigma.pz (), mcPartHad.px (), mcPartHad.py (), mcPartHad.pz ());
609585
610586 if (fillSparseInvMassKstar) {
611- auto sigmaMomForKstar = getSigmaMomentumForKstar (candidate);
587+ auto sigmaMomForKstar = getSigmaMomentumForKstar (candidate.sigmaPx , candidate.sigmaPy , candidate.sigmaPz ,
588+ candidate.sigmaDauPx , candidate.sigmaDauPy , candidate.sigmaDauPz );
612589 float kStarRec = getKStar (sigmaMomForKstar[0 ], sigmaMomForKstar[1 ], sigmaMomForKstar[2 ], candidate.pxHad , candidate.pyHad , candidate.pzHad );
613590 float sigmaPtUsed = std::hypot (sigmaMomForKstar[0 ], sigmaMomForKstar[1 ]);
614591 rSigmaHad.fill (HIST (" hSparseSigmaHadMC" ),
@@ -689,7 +666,8 @@ struct sigmaHadCorrTask {
689666 float kStarGen = getKStar (mcPartSigma.px (), mcPartSigma.py (), mcPartSigma.pz (), mcPartHad.px (), mcPartHad.py (), mcPartHad.pz ());
690667
691668 if (fillSparseInvMassKstar) {
692- auto sigmaMomForKstar = getSigmaMomentumForKstar (candidate);
669+ auto sigmaMomForKstar = getSigmaMomentumForKstar (candidate.sigmaPx , candidate.sigmaPy , candidate.sigmaPz ,
670+ candidate.sigmaDauPx , candidate.sigmaDauPy , candidate.sigmaDauPz );
693671 float kStarRec = getKStar (sigmaMomForKstar[0 ], sigmaMomForKstar[1 ], sigmaMomForKstar[2 ], candidate.pxHad , candidate.pyHad , candidate.pzHad );
694672 float sigmaPtUsed = std::hypot (sigmaMomForKstar[0 ], sigmaMomForKstar[1 ]);
695673 rSigmaHad.fill (HIST (" hSparseSigmaHadMC" ),
0 commit comments