@@ -119,15 +119,17 @@ struct lambdalambda {
119119
120120 Configurable<bool > cfgV0V0Sel{" cfgV0V0Sel" , false , " application of V0V0 selections" };
121121
122- Configurable<float > cfgV0V0RadiusMin{" cfgV0V0RadiusMin" , 1.0 , " maximum radius of v0v0" };
122+ Configurable<float > cfgV0V0RadiusMin{" cfgV0V0RadiusMin" , 1.0 , " minimum radius of v0v0" };
123123 Configurable<float > cfgV0V0CPAMin{" cfgV0V0CPAMin" , 0.6 , " minimum CPA of v0v0" };
124124 Configurable<float > cfgV0V0DistanceMin{" cfgV0V0DistanceMin" , 1 , " minimum distance of v0v0" };
125- Configurable<float > cfgV0V0DCAMin{" cfgV0V0DCAMin" , 1.0 , " maximum DCA of v0v0 R" };
125+ Configurable<float > cfgV0V0DCAMin{" cfgV0V0DCAMin" , 1.0 , " minimum DCA of v0v0 R" };
126+ Configurable<float > cfgV0V0PVPAMin{" cfgV0V0PVPAMin" , 0.9 , " minimum PV PA of v0v0" };
126127
127128 Configurable<float > cfgV0V0RadiusMax{" cfgV0V0RadiusMax" , 1.0 , " maximum radius of v0v0" };
128129 Configurable<float > cfgV0V0CPAMax{" cfgV0V0CPAMax" , 0.6 , " maximum CPA of v0v0" };
129130 Configurable<float > cfgV0V0DistanceMax{" cfgV0V0DistanceMax" , 1 , " maximum distance of v0v0" };
130131 Configurable<float > cfgV0V0DCAMax{" cfgV0V0DCAMax" , 1.0 , " maximum DCA of v0v0 R" };
132+ Configurable<float > cfgV0V0PVPAMax{" cfgV0V0PVPAMax" , 1.0 , " maximum PV PA of v0v0" };
131133
132134 Configurable<bool > cfgEffCor{" cfgEffCor" , false , " flag to apply efficiency correction" };
133135 Configurable<std::string> cfgEffCorPath{" cfgEffCorPath" , " " , " path for pseudo efficiency correction" };
@@ -184,11 +186,13 @@ struct lambdalambda {
184186 histos.add (" CPA_V0V0_full" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, CPAAxis, combAxis}});
185187 histos.add (" Distance_V0V0_full" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, DistanceAxis, combAxis}});
186188 histos.add (" DCA_V0V0_full" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, DCAAxis, combAxis}});
189+ histos.add (" PVPA_V0V0_full" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, CPAAxis, combAxis}});
187190
188191 histos.add (" Radius_V0V0_sel" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, RadiusAxis, combAxis}});
189192 histos.add (" CPA_V0V0_sel" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, CPAAxis, combAxis}});
190193 histos.add (" Distance_V0V0_sel" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, DistanceAxis, combAxis}});
191194 histos.add (" DCA_V0V0_sel" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, DCAAxis, combAxis}});
195+ histos.add (" PVPA_V0V0_sel" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, CPAAxis, combAxis}});
192196
193197 histos.add (" h_InvMass_same" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, centAxis, combAxis}});
194198 histos.add (" h_InvMass_mixed" , " " , {HistType::kTHnSparseF , {massAxis, ptAxis, centAxis, combAxis}});
@@ -303,8 +307,8 @@ struct lambdalambda {
303307 return true ;
304308 }
305309
306- template <typename V01, typename V02>
307- bool isSelectedV0V0 (V01 const & v01, V02 const & v02)
310+ template <typename V01, typename V02, typename Coll >
311+ bool isSelectedV0V0 (V01 const & v01, V02 const & v02, Coll const & coll )
308312 {
309313 if (getDCAofV0V0 (v01, v02) > cfgV0V0DCAMax)
310314 return false ;
@@ -318,9 +322,13 @@ struct lambdalambda {
318322 return false ;
319323 if (getDistance (v01, v02) < cfgV0V0DistanceMin)
320324 return false ;
321- if (getRadius (v01, v02) > cfgV0V0RadiusMax)
325+ if (getRadius (v01, v02, coll) > cfgV0V0RadiusMax)
326+ return false ;
327+ if (getRadius (v01, v02, coll) < cfgV0V0RadiusMin)
328+ return false ;
329+ if (getPVPA (v01, v02, coll) > cfgV0V0PVPAMax)
322330 return false ;
323- if (getRadius (v01, v02) < cfgV0V0RadiusMin )
331+ if (getPVPA (v01, v02, coll ) < cfgV0V0PVPAMin )
324332 return false ;
325333
326334 return true ;
@@ -360,8 +368,8 @@ struct lambdalambda {
360368 return std::sqrt (posdiff.Mag2 ());
361369 }
362370
363- template <typename V01, typename V02>
364- float getRadius (V01 const & v01, V02 const & v02)
371+ template <typename V01, typename V02, typename Coll >
372+ float getRadius (V01 const & v01, V02 const & v02, Coll const & coll )
365373 {
366374 ROOT::Math::XYZVector v01pos, v02pos, v01mom, v02mom;
367375 v01pos.SetXYZ (v01.x (), v01.y (), v01.z ());
@@ -377,7 +385,37 @@ struct lambdalambda {
377385 float s = -posdiff.Dot (v02mom - v01mom.Dot (v02mom) * v01mom) / d;
378386 ROOT::Math::XYZVector dca = v01pos + v02pos + t * v01mom + s * v02mom;
379387 dca /= 2 .;
380- return std::sqrt (dca.Mag2 ());
388+ ROOT::Math::XYZVector pv;
389+ pv.SetXYZ (coll.posX (), coll.posY (), coll.posZ ());
390+ ROOT::Math::XYZVector reldca = dca - pv;
391+ return std::sqrt (reldca.Mag2 ());
392+ }
393+
394+ template <typename V01, typename V02, typename Coll>
395+ float getPVPA (V01 const & v01, V02 const & v02, Coll const & coll)
396+ {
397+ ROOT::Math::XYZVector v0v0mom;
398+ v0v0mom.SetXYZ (v01.px () + v02.px (), v01.py () + v02.py (), v01.pz () + v02.pz ());
399+
400+ ROOT::Math::XYZVector v01pos, v02pos, v01mom, v02mom;
401+ v01pos.SetXYZ (v01.x (), v01.y (), v01.z ());
402+ v02pos.SetXYZ (v02.x (), v02.y (), v02.z ());
403+ v01mom.SetXYZ (v01.px () / v01.p (), v01.py () / v01.p (), v01.pz () / v01.p ());
404+ v02mom.SetXYZ (v02.px () / v02.p (), v02.py () / v02.p (), v02.pz () / v02.p ());
405+ ROOT::Math::XYZVector posdiff = v02pos - v01pos;
406+
407+ float d = 1 . - TMath::Power (v01mom.Dot (v02mom), 2 );
408+ if (d < 1e-5 )
409+ return -2 ;
410+ float t = posdiff.Dot (v01mom - v01mom.Dot (v02mom) * v02mom) / d;
411+ float s = -posdiff.Dot (v02mom - v01mom.Dot (v02mom) * v01mom) / d;
412+ ROOT::Math::XYZVector dca = v01pos + v02pos + t * v01mom + s * v02mom;
413+ dca /= 2 .;
414+ ROOT::Math::XYZVector pv;
415+ pv.SetXYZ (coll.posX (), coll.posY (), coll.posZ ());
416+ ROOT::Math::XYZVector reldca = dca - pv;
417+
418+ return v0v0mom.Dot (reldca) / sqrt (v0v0mom.Mag2 () * reldca.Mag2 ());
381419 }
382420
383421 template <typename C1, typename C2, typename V01, typename V02>
@@ -465,22 +503,23 @@ struct lambdalambda {
465503 continue ;
466504 IsTriggered = true ;
467505
468- histos.fill (HIST (" Radius_V0V0_full" ), RecoV0V0.M (), RecoV0V0.Pt (), getRadius (v01, v02), V01Tag + V02Tag);
506+ histos.fill (HIST (" Radius_V0V0_full" ), RecoV0V0.M (), RecoV0V0.Pt (), getRadius (v01, v02, c1 ), V01Tag + V02Tag);
469507 histos.fill (HIST (" CPA_V0V0_full" ), RecoV0V0.M (), RecoV0V0.Pt (), getCPA (v01, v02), V01Tag + V02Tag);
470508 histos.fill (HIST (" Distance_V0V0_full" ), RecoV0V0.M (), RecoV0V0.Pt (), getDistance (v01, v02), V01Tag + V02Tag);
471509 histos.fill (HIST (" DCA_V0V0_full" ), RecoV0V0.M (), RecoV0V0.Pt (), getDCAofV0V0 (v01, v02), V01Tag + V02Tag);
472-
473- if (isSelectedV0V0 (v01, v02)) {
474- histos.fill (HIST (" Radius_V0V0_sel" ), RecoV0V0.M (), RecoV0V0.Pt (), getRadius (v01, v02), V01Tag + V02Tag);
510+ histos. fill ( HIST ( " PVPA_V0V0_full " ), RecoV0V0. M (), RecoV0V0. Pt (), getPVPA (v01, v02, c1), V01Tag + V02Tag);
511+ if (isSelectedV0V0 (v01, v02, c1 )) {
512+ histos.fill (HIST (" Radius_V0V0_sel" ), RecoV0V0.M (), RecoV0V0.Pt (), getRadius (v01, v02, c1 ), V01Tag + V02Tag);
475513 histos.fill (HIST (" CPA_V0V0_sel" ), RecoV0V0.M (), RecoV0V0.Pt (), getCPA (v01, v02), V01Tag + V02Tag);
476514 histos.fill (HIST (" Distance_V0V0_sel" ), RecoV0V0.M (), RecoV0V0.Pt (), getDistance (v01, v02), V01Tag + V02Tag);
477515 histos.fill (HIST (" DCA_V0V0_sel" ), RecoV0V0.M (), RecoV0V0.Pt (), getDCAofV0V0 (v01, v02), V01Tag + V02Tag);
516+ histos.fill (HIST (" PVPA_V0V0_sel" ), RecoV0V0.M (), RecoV0V0.Pt (), getPVPA (v01, v02, c1), V01Tag + V02Tag);
478517 IsSelected = true ;
479518 }
480519
481520 if (doprocessDataSame) {
482521 histos.fill (HIST (" h_InvMass_same" ), RecoV0V0.M (), RecoV0V0.Pt (), centrality, V01Tag + V02Tag);
483- if (cfgV0V0Sel && isSelectedV0V0 (v01, v02)) {
522+ if (cfgV0V0Sel && isSelectedV0V0 (v01, v02, c1 )) {
484523 histos.fill (HIST (" h_InvMass_same_sel" ), RecoV0V0.M (), RecoV0V0.Pt (), centrality, V01Tag + V02Tag);
485524 if (cfgRotBkg) {
486525 for (int nr = 0 ; nr < cfgNRotBkg; nr++) {
@@ -495,7 +534,7 @@ struct lambdalambda {
495534 }
496535 if (doprocessDataMixed) {
497536 histos.fill (HIST (" h_InvMass_mixed" ), RecoV0V0.M (), RecoV0V0.Pt (), centrality, V01Tag + V02Tag);
498- if (cfgV0V0Sel && isSelectedV0V0 (v01, v02)) {
537+ if (cfgV0V0Sel && isSelectedV0V0 (v01, v02, c1 )) {
499538 histos.fill (HIST (" h_InvMass_mixed_sel" ), RecoV0V0.M (), RecoV0V0.Pt (), centrality, V01Tag + V02Tag);
500539 }
501540 }
0 commit comments