@@ -1543,9 +1543,16 @@ struct LambdaSpinPolarization {
15431543 Configurable<int > cNPhiBins{" cNPhiBins" , 36 , " N Phi Bins" };
15441544 Configurable<int > cNBinsCosTS{" cNBinsCosTS" , 10 , " N CosTS Bins" };
15451545 Configurable<bool > cInvBoostFlag{" cInvBoostFlag" , true , " Inverse Boost Flag" };
1546+ Configurable<int > mixingParameter{" mixingParameter" , 5 , " How many events are mixed" };
15461547
15471548 // Centrality Axis
15481549 ConfigurableAxis cMultBins{" cMultBins" , {VARIABLE_WIDTH, 0 .0f , 10 .0f , 30 .0f , 50 .f , 80 .0f , 100 .f }, " Variable Mult-Bins" };
1550+ ConfigurableAxis axisCentME{" axisCentME" , {VARIABLE_WIDTH, 0 , 10 , 30 , 50 , 100 }, " Mixing bins - centrality (%)" };
1551+ ConfigurableAxis axisVtxZME{" axisVtxZME" , {VARIABLE_WIDTH, -7 , -3 , 0 , 3 , 7 }, " Mixing bins - z-vertex" };
1552+
1553+ Configurable<float > cMaxDeltaPt{" cMaxDeltaPt" , 0 .1f , " Max delta pT for kinematic matching (GeV/c)" };
1554+ Configurable<float > cMaxDeltaPhi{" cMaxDeltaPhi" , 0 .1f , " Max delta phi for kinematic matching (rad)" };
1555+ Configurable<float > cMaxDeltaRap{" cMaxDeltaRap" , 0 .1f , " Max delta rapidity for kinematic matching" };
15491556
15501557 // Histogram Registry.
15511558 HistogramRegistry histos{" histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
@@ -1570,8 +1577,14 @@ struct LambdaSpinPolarization {
15701577 const AxisSpec axisCosTS (cNBinsCosTS, -1 , 1 , " cos(#theta*)" );
15711578 const AxisSpec axisDR (10 , 0 , 2 , " #DeltaR" );
15721579
1573- // Single and Two Particle Densities
1574- // 1D Histograms
1580+ // Pool occupancy
1581+ histos.add (" QA/ME/hPoolCentVz" , " ME pool occupancy;centrality (%);V_{z} (cm)" , kTH2F , {axisCentME, axisVtxZME});
1582+
1583+ // Lambda multiplicity vs centrality
1584+ histos.add (" QA/ME/hLambdaMultVsCent" , " ME #Lambda multiplicity;centrality (%);N_{#Lambda}" , kTH2F , {axisCentME, {50 , 0 , 50 }});
1585+ histos.add (" QA/ME/hAntiLambdaMultVsCent" , " ME #bar{#Lambda} multiplicity;centrality (%);N_{#bar{#Lambda}}" , kTH2F , {axisCentME, {50 , 0 , 50 }});
1586+
1587+ // inv mass vs pt for Lambda and AntiLambda
15751588 histos.add (" Reco/h2f_n2_mass_LaPLaM" , " m_{inv}^{#Lambda} vs m_{inv}^{#bar{#Lambda}}" , kTHnSparseF , {axisMass, axisMass, axisPt, axisPt});
15761589 histos.add (" Reco/h2f_n2_mass_LaPLaP" , " m_{inv}^{#Lambda} vs m_{inv}^{#Lambda}" , kTHnSparseF , {axisMass, axisMass, axisPt, axisPt});
15771590 histos.add (" Reco/h2f_n2_mass_LaMLaM" , " m_{inv}^{#bar{#Lambda}} vs m_{inv}^{#bar{#Lambda}}" , kTHnSparseF , {axisMass, axisMass, axisPt, axisPt});
@@ -1583,9 +1596,6 @@ struct LambdaSpinPolarization {
15831596 histos.add (" RecoCorr/h2f_n2_ctheta_LaPLaM" , " #rho_{2}^{#Lambda#bar{#Lambda}}" , kTHnSparseF , {axisCent, axisDRap, axisDPhi, axisCosTS});
15841597 histos.add (" RecoCorr/h2f_n2_ctheta_LaPLaP" , " #rho_{2}^{#Lambda#Lambda}" , kTHnSparseF , {axisCent, axisDRap, axisDPhi, axisCosTS});
15851598 histos.add (" RecoCorr/h2f_n2_ctheta_LaMLaM" , " #rho_{2}^{#bar{#Lambda}#bar{#Lambda}}" , kTHnSparseF , {axisCent, axisDRap, axisDPhi, axisCosTS});
1586- // histos.add("RecoCorr/h2f_n2_dphi_LaPLaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDPhi});
1587- // histos.add("RecoCorr/h2f_n2_dphi_LaPLaP", "#rho_{2}^{#Lambda#Lambda}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDPhi});
1588- // histos.add("RecoCorr/h2f_n2_dphi_LaMLaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTHnSparseF, {axisCent, axisDRap, axisDPhi, axisDPhi});
15891599 }
15901600
15911601 void getBoostVector (std::array<float , 4 > const & p, std::array<float , 3 >& v, bool inverseBoostFlag = true )
@@ -1619,7 +1629,7 @@ struct LambdaSpinPolarization {
16191629 static constexpr std::string_view SubDirHist[] = {" LaPLaM" , " LaPLaP" , " LaMLaM" };
16201630
16211631 // Fill lambda pair mass
1622- histos.fill (HIST (" Reco/h2f_n2_mass_" ) + HIST (SubDirHist[part_pair]), p1.mass (), p2.mass (), p1.pt (), p2.pt ());
1632+ // histos.fill(HIST("Reco/h2f_n2_mass_") + HIST(SubDirHist[part_pair]), p1.mass(), p2.mass(), p1.pt(), p2.pt());
16231633 float drap = p1.rap () - p2.rap ();
16241634 float dphi = RecoDecay::constrainAngle (p1.phi () - p2.phi (), -PI);
16251635 float dR = std::sqrt (drap * drap + dphi * dphi);
@@ -1638,11 +1648,7 @@ struct LambdaSpinPolarization {
16381648 std::array<float , 3 > pr1tv = {pr1[0 ], pr1[1 ], pr1[2 ]};
16391649 std::array<float , 3 > pr2tv = {pr2[0 ], pr2[1 ], pr2[2 ]};
16401650 float ctheta = RecoDecay::dotProd (pr1tv, pr2tv) / (RecoDecay::sqrtSumOfSquares (pr1tv[0 ], pr1tv[1 ], pr1tv[2 ]) * RecoDecay::sqrtSumOfSquares (pr2tv[0 ], pr2tv[1 ], pr2tv[2 ]));
1641- // float prdphi = RecoDecay::constrainAngle(RecoDecay::phi(pr1) - RecoDecay::phi(pr2), -PI);
1642- // float prdrap = RecoDecay::eta(pr1tv) - RecoDecay::eta(pr2tv);
16431651
1644- // Fill pair density
1645- // histos.fill(HIST("RecoCorr/h2f_n2_dphi_") + HIST(SubDirHist[part_pair]), cent, drap, dphi, prdphi);
16461652 histos.fill (HIST (" RecoCorr/h2f_n2_ctheta_" ) + HIST (SubDirHist[part_pair]), cent, drap, dphi, ctheta);
16471653 histos.fill (HIST (" RecoCorr/h2f_n2_dltaR_" ) + HIST (SubDirHist[part_pair]), cent, dR, ctheta);
16481654 }
@@ -1661,10 +1667,33 @@ struct LambdaSpinPolarization {
16611667 }
16621668 }
16631669
1670+ template <ParticlePairType part_pair, bool samelambda, typename T>
1671+ void analyzePairsWithKinematicMatching (T const & trks_1, T const & trks_2)
1672+ {
1673+ for (auto const & trk_1 : trks_1) {
1674+ for (auto const & trk_2 : trks_2) {
1675+ if (samelambda && ((trk_1.index () == trk_2.index ()))) {
1676+ continue ;
1677+ }
1678+
1679+ // Kinematic matching with named constants
1680+ float deltaPt = std::abs (trk_1.pt () - trk_2.pt ());
1681+ float deltaPhi = std::abs (RecoDecay::constrainAngle (trk_1.phi () - trk_2.phi (), -PI));
1682+ float deltaRap = std::abs (trk_1.rap () - trk_2.rap ());
1683+
1684+ if (deltaPt < cMaxDeltaPt && deltaPhi < cMaxDeltaPhi && deltaRap < cMaxDeltaRap) {
1685+ fillPairHistos<part_pair>(trk_1, trk_2);
1686+ }
1687+ }
1688+ }
1689+ }
1690+
16641691 // Initialize tables
16651692 using LambdaCollisions = aod::LambdaCollisions;
16661693 using LambdaTracks = soa::Join<aod::LambdaTracks, aod::LambdaTracksExt>;
16671694
1695+ Preslice<LambdaTracks> perCollisionLambda = aod::lambdatrack::lambdaCollisionId;
1696+
16681697 SliceCache cache;
16691698 Partition<LambdaTracks> partLambdaTracks = (aod::lambdatrack::v0Type == (int8_t )kLambda ) && (aod::lambdatrackext::trueLambdaFlag == true ) && (aod::lambdatrack::v0PrmScd == (int8_t )kPrimary );
16701699 Partition<LambdaTracks> partAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t )kAntiLambda ) && (aod::lambdatrackext::trueLambdaFlag == true ) && (aod::lambdatrack::v0PrmScd == (int8_t )kPrimary );
@@ -1689,7 +1718,55 @@ struct LambdaSpinPolarization {
16891718 analyzePairs<kAntiLambdaAntiLambda , true >(antiLambdaTracks, antiLambdaTracks);
16901719 }
16911720
1692- PROCESS_SWITCH (LambdaSpinPolarization, processDataReco, " Process for Data and MCReco" , true );
1721+ PROCESS_SWITCH (LambdaSpinPolarization, processDataReco, " Process for Data and MCReco" , false );
1722+
1723+ struct GetMultiplicity {
1724+ float operator ()(auto const & col) const
1725+ {
1726+ return col.cent ();
1727+ }
1728+ };
1729+
1730+ using MixedBinning = FlexibleBinningPolicy<std::tuple<GetMultiplicity>, o2::aod::collision::PosZ, GetMultiplicity>;
1731+ MixedBinning binningOnVtxAndMult{
1732+ {GetMultiplicity{}},
1733+ {axisVtxZME, axisCentME},
1734+ true };
1735+
1736+ void processDataRecoMixed (LambdaCollisions const & col, LambdaTracks const &)
1737+ {
1738+ for (auto const & [col1, col2] : soa::selfCombinations (binningOnVtxAndMult, mixingParameter, -1 , col, col)) {
1739+
1740+ if (col1.globalIndex () == col2.globalIndex ()) {
1741+ continue ;
1742+ }
1743+
1744+ cent = col1.cent ();
1745+
1746+ // QA: pool occupancy
1747+ histos.fill (HIST (" QA/ME/hPoolCentVz" ), col1.cent (), col1.posZ ());
1748+
1749+ // Lambda slices
1750+ auto lambdaTracks_col1 = partLambdaTracks->sliceByCached (aod::lambdatrack::lambdaCollisionId, col1.globalIndex (), cache);
1751+ auto lambdaTracks_col2 = partLambdaTracks->sliceByCached (aod::lambdatrack::lambdaCollisionId, col2.globalIndex (), cache);
1752+
1753+ // Anti-lambda slices
1754+ auto antiLambdaTracks_col1 = partAntiLambdaTracks->sliceByCached (aod::lambdatrack::lambdaCollisionId, col1.globalIndex (), cache);
1755+ auto antiLambdaTracks_col2 = partAntiLambdaTracks->sliceByCached (aod::lambdatrack::lambdaCollisionId, col2.globalIndex (), cache);
1756+
1757+ // QA: multiplicities
1758+ histos.fill (HIST (" QA/ME/hLambdaMultVsCent" ), col1.cent (), lambdaTracks_col1.size ());
1759+ histos.fill (HIST (" QA/ME/hAntiLambdaMultVsCent" ), col1.cent (), antiLambdaTracks_col1.size ());
1760+
1761+ // Mixed-event pairs
1762+ analyzePairsWithKinematicMatching<kLambdaAntiLambda , false >(lambdaTracks_col1, antiLambdaTracks_col2);
1763+ analyzePairsWithKinematicMatching<kLambdaAntiLambda , false >(antiLambdaTracks_col1, lambdaTracks_col2);
1764+ analyzePairsWithKinematicMatching<kLambdaLambda , true >(lambdaTracks_col1, lambdaTracks_col2);
1765+ analyzePairsWithKinematicMatching<kAntiLambdaAntiLambda , true >(antiLambdaTracks_col1, antiLambdaTracks_col2);
1766+ }
1767+ }
1768+
1769+ PROCESS_SWITCH (LambdaSpinPolarization, processDataRecoMixed, " Process for Data and MCReco for Mixed events" , true );
16931770
16941771 void processDataRecoMixEvent (LambdaCollisions::iterator const & collision, LambdaTracks const & tracks)
16951772 {
@@ -1707,7 +1784,7 @@ struct LambdaSpinPolarization {
17071784 }
17081785 }
17091786
1710- PROCESS_SWITCH (LambdaSpinPolarization, processDataRecoMixEvent, " Process for Data and MCReco Mix Event" , true );
1787+ PROCESS_SWITCH (LambdaSpinPolarization, processDataRecoMixEvent, " Process for Data and MCReco Mix Event" , false );
17111788};
17121789
17131790WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments