@@ -68,6 +68,7 @@ struct heptaquark {
6868
6969 Configurable<float > cfgSoftFraction{" cfgSoftFraction" , 0.01 , " Minimum allowed softest fraction" };
7070 Configurable<float > cfgCollinear{" cfgCollinear" , 0.98 , " Maximum allowed collinear selection" };
71+ Configurable<float > cfgCosPoint{" cfgCosPoint" , 0.95 , " Minimum pointing angle selection" };
7172
7273 ConfigurableAxis massAxis{" massAxis" , {600 , 2.8 , 3.4 }, " Invariant mass axis" };
7374 ConfigurableAxis ptAxis{" ptAxis" , {VARIABLE_WIDTH, 0.2 , 0.5 , 1.0 , 1.5 , 2.0 , 2.5 , 3.0 , 4.0 , 5.0 , 6.5 , 8.0 , 10.0 , 100.0 }, " Transverse momentum bins" };
@@ -97,6 +98,18 @@ struct heptaquark {
9798 histos.add (" hDalitzRot" , " hDalitzRot" , {HistType::kTHnSparseF , {massPPAxis, massPLAxis, massAxis, ptAxis, {2 , -0 .5f , 1 .5f }, centAxis}});
9899 }
99100
101+ template <typename HQRow>
102+ static inline TLorentzVector makeP4FromHQRow (HQRow const & hq)
103+ {
104+ const double px = hq.hqPx ();
105+ const double py = hq.hqPy ();
106+ const double pz = hq.hqPz ();
107+ const double m = hq.hqMass ();
108+ TLorentzVector v;
109+ v.SetXYZM (px, py, pz, m);
110+ return v;
111+ }
112+
100113 double massLambda = o2::constants::physics::MassLambda;
101114 double massPr = o2::constants::physics::MassProton;
102115 double massPi = o2::constants::physics::MassPionCharged;
@@ -185,37 +198,52 @@ struct heptaquark {
185198 return false ;
186199 }
187200
188- template <typename HQ1 , typename HQ2 , typename HQ3 >
189- int selectHQ (HQ1 const & hq1, HQ2 const & hq2, HQ3 const & hq3 )
201+ template <typename HQRow1 , typename HQRow2 , typename HQRow3, typename ColRow >
202+ int selectHQ (HQRow1 const & hq1r, HQRow2 const & hq2r, HQRow3 const & hq3r, ColRow const & col )
190203 {
191204 int selection = 0 ;
192- if (hq1.Pt () < cfgMinPhiPt || hq2.Pt () < cfgMinPhiPt || hq3.Pt () < cfgMinLambdaPt)
205+
206+ auto hq1 = makeP4FromHQRow (hq1r);
207+ auto hq2 = makeP4FromHQRow (hq2r);
208+ auto hq3 = makeP4FromHQRow (hq3r);
209+
210+ if (hq1.Pt () < cfgMinPhiPt || hq2.Pt () < cfgMinPhiPt || hq3.Pt () < cfgMinLambdaPt) {
193211 selection += 1 ;
212+ }
194213
195- double sumE = hq1.E () + hq2.E () + hq3.E ();
196- double emin = std::min ({hq1.E (), hq2.E (), hq3.E ()});
197- double fmin = emin / std::max (1e-9 , sumE);
198- if (fmin < cfgSoftFraction)
214+ const double sumE = hq1.E () + hq2.E () + hq3.E ();
215+ const double emin = std::min ({hq1.E (), hq2.E (), hq3.E ()});
216+ const double fmin = emin / std::max (1e-9 , sumE);
217+ if (fmin < cfgSoftFraction) {
199218 selection += 2 ;
219+ }
200220
201221 auto ex = hq1 + hq2 + hq3;
202222 TVector3 boost = -ex.BoostVector ();
223+
203224 auto hqphipair_boost = hq1 + hq2;
204- auto hqlambda_boost = hq3;
225+ auto hqlambda_boost = hq3;
205226 hqphipair_boost.Boost (boost);
206227 hqlambda_boost.Boost (boost);
207- double cosHel = hqlambda_boost.Vect ().Dot (hqphipair_boost.Vect ()) / (hqlambda_boost.Vect ().Mag () * hqphipair_boost.Vect ().Mag ());
208- if (std::abs (cosHel) > cfgCollinear)
228+
229+ const double denom = (hqlambda_boost.Vect ().Mag () * hqphipair_boost.Vect ().Mag ());
230+ const double cosHel = (denom > 0 .) ? (hqlambda_boost.Vect ().Dot (hqphipair_boost.Vect ()) / denom) : 1.0 ;
231+ if (std::abs (cosHel) > cfgCollinear) {
209232 selection += 4 ;
210- /*
211- ROOT::Math::XYZVector rPV(col.posX(), col.posY(), col.posZ());
212- ROOT::Math::XYZVector rSV(hq3.hqx(), hq3.hqy(), hq3.hqz());
213- ROOT::Math::XYZVector L = rSV - rPV;
214- ROOT::Math::XYZVector exMom(ex.Px(), ex.Py(), ex.Pz());
215- double cosPoint = L.Dot(exMom) / (L.R() * pEx.R() + 1e-9);
216- if (cosPoint < cfgCosPoint)
217- return 8;
218- */
233+ }
234+
235+ ROOT::Math::XYZVector rPV (col.posX (), col.posY (), col.posZ ());
236+ ROOT::Math::XYZVector rSV (hq3r.hqx (), hq3r.hqy (), hq3r.hqz ());
237+
238+ ROOT::Math::XYZVector L = rSV - rPV;
239+ ROOT::Math::XYZVector exMom (ex.Px (), ex.Py (), ex.Pz ());
240+
241+ const double denom2 = (L.R () * exMom.R () + 1e-9 );
242+ const double cosPoint = L.Dot (exMom) / denom2;
243+ if (cosPoint < cfgCosPoint) {
244+ selection += 8 ;
245+ }
246+
219247 return selection;
220248 }
221249
@@ -344,7 +372,7 @@ struct heptaquark {
344372 HQ12 = HQ1 + HQ2;
345373 HQ13 = HQ1 + HQ3;
346374
347- if (cfgSelectHQ && selectHQ (HQ1, HQ2, HQ3 ))
375+ if (cfgSelectHQ && selectHQ (hqtrackd1, hqtrackd2, hqtrackd3, collision ))
348376 continue ;
349377
350378 histos.fill (HIST (" h_InvMass_same" ), exotic.M (), exotic.Pt (), collision.centrality ());
0 commit comments