@@ -1454,9 +1454,8 @@ struct LambdaR2Correlation {
14541454
14551455 // Lambda Kaon two-track cuts
14561456 Configurable<bool > cApplyTwoTrackCut{" cApplyTwoTrackCut" , false , " Flag for two track cut" };
1457- Configurable<float > cTpcRadii{" cTpcRadii" , 0.80 , " TPC Radius for DPhiStar" };
1458- Configurable<float > cDEtaCut{" cDEtaCut" , 0.01 , " DEta cut" };
1459- Configurable<float > cDPhiStarCut{" cDPhiStarCut" , 0.01 , " DPhiStar cut" };
1457+ Configurable<float > cDEtaCut{" cDEtaCut" , 0.02 , " DEta cut" };
1458+ Configurable<float > cDPhiStarCut{" cDPhiStarCut" , 0.02 , " DPhiStar cut" };
14601459
14611460 // Centrality Axis
14621461 ConfigurableAxis cCentBins{" cCentBins" , {VARIABLE_WIDTH , 0 .0f , 10 .0f , 20 .0f , 30 .0f , 40 .0f , 50 .f , 60 .0f , 70 .0f , 80 .0f , 90 .0f , 100 .f }, " Variable Mult-Bins" };
@@ -1476,6 +1475,7 @@ struct LambdaR2Correlation {
14761475 float q = 0 ., e = 0 ., qinv = 0 .;
14771476 float cent = 0 .;
14781477 float magField = 0 .;
1478+ std::array<float , 9 > tpcRadii = {0.8 , 1.0 , 1.2 , 1.4 , 1.6 , 1.8 , 2.0 , 2.2 , 2.4 };
14791479
14801480 void init (InitContext const &)
14811481 {
@@ -1562,18 +1562,27 @@ struct LambdaR2Correlation {
15621562 }
15631563
15641564 template <typename A>
1565- bool checkClosePair (A const & v1, A const & v2, int const & charge1, int const & charge2)
1565+ bool checkClosePair (A const & v1, A const & v2, int charge1, int charge2)
15661566 {
1567- // DPhiStar
1568- float dphistar = 0 .;
1569- float arg1 = 0.15 * magField * charge1 * cTpcRadii / v1[0 ];
1570- float arg2 = 0.15 * magField * charge2 * cTpcRadii / v2[0 ];
1571- if (std::abs (arg1) < 1.0 && std::abs (arg2) < 1.0 ) {
1572- dphistar = v1[2 ] - v2[2 ] - std::asin (arg1) + std::asin (arg2);
1573- } else {
1574- dphistar = 99 .;
1567+ // DPhiStar average over different TPC radius
1568+ float dphistar = 0 ., n = 0 .;
1569+ for (auto radius : tpcRadii) {
1570+ float arg1 = 0.15 * magField * radius / v1[0 ];
1571+ float arg2 = 0.15 * magField * radius / v2[0 ];
1572+ if (std::abs (arg1) < 1.0 && std::abs (arg2) < 1.0 ) {
1573+ dphistar += v1[2 ] - v2[2 ] - (charge1 * std::abs (std::asin (arg1))) + (charge2 * std::abs (std::asin (arg2)));
1574+ ++n;
1575+ }
15751576 }
15761577
1578+ // Inf check
1579+ if (n == 0 ) {
1580+ return false ;
1581+ }
1582+
1583+ // DPhiStar
1584+ dphistar = RecoDecay::constrainAngle (dphistar / n, -PIHalf);
1585+
15771586 // DEta
15781587 float deta = v1[1 ] - v2[1 ];
15791588
@@ -1584,6 +1593,9 @@ struct LambdaR2Correlation {
15841593 template <typename T, typename V>
15851594 bool isClosePair (V const & lambda, T const & track)
15861595 {
1596+ // Before
1597+ histos.fill (HIST (" QA/TwoTrackCut/Before/h2d_n2_detadphi" ), track.eta () - lambda.eta (), RecoDecay::constrainAngle (track.phi () - lambda.phi (), -PIHalf));
1598+
15871599 // Close pair flag
15881600 bool retFlag = false ;
15891601
@@ -1599,27 +1611,33 @@ struct LambdaR2Correlation {
15991611 }
16001612
16011613 // Fill QA
1602- if (retFlag) {
1603- histos.fill (HIST (" QA/TwoTrackCut/h2d_n2_detadphi" ), track.eta () - lambda.eta (), RecoDecay::constrainAngle (track.phi () - lambda.phi (), -PIHalf));
1614+ if (! retFlag) { // Pair accept
1615+ histos.fill (HIST (" QA/TwoTrackCut/After/ h2d_n2_detadphi" ), track.eta () - lambda.eta (), RecoDecay::constrainAngle (track.phi () - lambda.phi (), -PIHalf));
16041616 }
16051617
1618+ // Pair reject
16061619 return retFlag;
16071620 }
16081621
16091622 template <typename T, typename V>
16101623 bool isCloseQinv (V const & p1, T const & p2)
16111624 {
1625+ // Before
1626+ histos.fill (HIST (" QA/FemtoCut/Before/h2d_n2_detadphi" ), p1.eta () - p2.eta (), RecoDecay::constrainAngle (p1.phi () - p2.phi (), -PIHalf));
1627+
16121628 // Calculate qinv
16131629 q = RecoDecay::p ((p1.px () - p2.px ()), (p1.py () - p2.py ()), (p1.pz () - p2.pz ()));
16141630 e = RecoDecay::e (p1.px (), p1.py (), p1.pz (), MassLambda0) - RecoDecay::e (p2.px (), p2.py (), p2.pz (), MassKaonCharged);
16151631 qinv = std::sqrt (-RecoDecay::m2 (q, e));
16161632
1617- if (qinv < cFemtoCut) {
1618- histos.fill (HIST (" QA/FemtoCut/h2d_n2_detadphi" ), p1.eta () - p2.eta (), RecoDecay::constrainAngle (p1.phi () - p2.phi (), -PIHalf));
1619- return true ;
1633+ // Pair accept
1634+ if (qinv > cFemtoCut) {
1635+ histos.fill (HIST (" QA/FemtoCut/After/h2d_n2_detadphi" ), p1.eta () - p2.eta (), RecoDecay::constrainAngle (p1.phi () - p2.phi (), -PIHalf));
1636+ return false ;
16201637 }
16211638
1622- return false ;
1639+ // Pair reject
1640+ return true ;
16231641 }
16241642
16251643 template <ParticlePairType part_pair, RecGenType rec_gen, typename T1 , typename T2 >
@@ -1634,12 +1652,12 @@ struct LambdaR2Correlation {
16341652 const auto phibin1 = static_cast <int >(p1.phi () / phibinwidth);
16351653 const auto phibin2 = static_cast <int >(p2.phi () / phibinwidth);
16361654
1637- float corfac = p1.corrFact () * p2.corrFact ();
1655+ const float corfac = p1.corrFact () * p2.corrFact ();
16381656
16391657 if (rapbin1 >= 0 && rapbin2 >= 0 && phibin1 >= 0 && phibin2 >= 0 && rapbin1 < nrapbins && rapbin2 < nrapbins && phibin1 < nphibins && phibin2 < nphibins) {
16401658
1641- int rapphix = rapbin1 * nphibins + phibin1;
1642- int rapphiy = rapbin2 * nphibins + phibin2;
1659+ const int rapphix = rapbin1 * nphibins + phibin1;
1660+ const int rapphiy = rapbin2 * nphibins + phibin2;
16431661
16441662 histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_n2_rapphi_" ) + HIST (SubDirHist[part_pair]), cent, rapphix + 0.5 , rapphiy + 0.5 , corfac);
16451663 }
0 commit comments