@@ -99,6 +99,9 @@ struct lambdapolsp {
9999 Configurable<bool > doRandomPsi{" doRandomPsi" , true , " randomize psi" };
100100 Configurable<bool > doRandomPsiAC{" doRandomPsiAC" , true , " randomize psiAC" };
101101 Configurable<bool > doRandomPhi{" doRandomPhi" , true , " randomize phi" };
102+ Configurable<double > etaMix{" etaMix" , 0.1 , " eta difference in mixing" };
103+ Configurable<double > ptMix{" ptMix" , 0.1 , " pt difference in mixing" };
104+ Configurable<double > phiMix{" phiMix" , 0.1 , " phi difference in mixing" };
102105 } randGrp;
103106 // events
104107 Configurable<float > cfgCutVertex{" cfgCutVertex" , 10 .0f , " Accepted z-vertex range" };
@@ -1487,6 +1490,159 @@ struct lambdapolsp {
14871490 }
14881491 PROCESS_SWITCH (lambdapolsp, processDerivedDataMixed, " Process mixed event using derived data" , false );
14891492
1493+ void processDerivedDataMixed2 (soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraStamps, aod::StraZDCSP> const & collisions, v0Candidates const & V0s, dauTracks const &)
1494+ {
1495+ TRandom3 randGen (0 );
1496+
1497+ for (auto & [collision1, collision2] : selfCombinations (colBinning, meGrp.nMix , -1 , collisions, collisions)) {
1498+
1499+ if (collision1.index () == collision2.index ()) {
1500+ continue ;
1501+ }
1502+
1503+ if (!collision1.sel8 ()) {
1504+ continue ;
1505+ }
1506+ if (!collision2.sel8 ()) {
1507+ continue ;
1508+ }
1509+
1510+ if (!collision1.triggereventsp ()) { // provided by StraZDCSP
1511+ continue ;
1512+ }
1513+ if (!collision2.triggereventsp ()) { // provided by StraZDCSP
1514+ continue ;
1515+ }
1516+
1517+ if (rctCut.requireRCTFlagChecker && !rctChecker (collision1)) {
1518+ continue ;
1519+ }
1520+ if (rctCut.requireRCTFlagChecker && !rctChecker (collision2)) {
1521+ continue ;
1522+ }
1523+
1524+ if (additionalEvSel && (!collision1.selection_bit (aod::evsel::kNoSameBunchPileup ) || !collision1.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ))) {
1525+ continue ;
1526+ }
1527+ if (additionalEvSel && (!collision2.selection_bit (aod::evsel::kNoSameBunchPileup ) || !collision2.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ))) {
1528+ continue ;
1529+ }
1530+ if (additionalEvSel2 && (collision1.trackOccupancyInTimeRange () > cfgMaxOccupancy || collision1.trackOccupancyInTimeRange () < cfgMinOccupancy)) {
1531+ continue ;
1532+ }
1533+ if (additionalEvSel2 && (collision2.trackOccupancyInTimeRange () > cfgMaxOccupancy || collision2.trackOccupancyInTimeRange () < cfgMinOccupancy)) {
1534+ continue ;
1535+ }
1536+ if (additionalEvSel3 && (!collision1.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !collision1.selection_bit (aod::evsel::kNoITSROFrameBorder ))) {
1537+ continue ;
1538+ }
1539+ if (additionalEvSel3 && (!collision2.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !collision2.selection_bit (aod::evsel::kNoITSROFrameBorder ))) {
1540+ continue ;
1541+ }
1542+ if (additionalEvSel4 && !collision1.selection_bit (o2::aod::evsel::kIsGoodITSLayersAll )) {
1543+ continue ;
1544+ }
1545+ if (additionalEvSel4 && !collision2.selection_bit (o2::aod::evsel::kIsGoodITSLayersAll )) {
1546+ continue ;
1547+ }
1548+
1549+ auto centrality = collision1.centFT0C ();
1550+ auto qxZDCA = collision1.qxZDCA ();
1551+ auto qxZDCC = collision1.qxZDCC ();
1552+ auto qyZDCA = collision1.qyZDCA ();
1553+ auto qyZDCC = collision1.qyZDCC ();
1554+ auto psiZDCC = collision1.psiZDCC ();
1555+ auto psiZDCA = collision1.psiZDCA ();
1556+ double modqxZDCA;
1557+ double modqyZDCA;
1558+ double modqxZDCC;
1559+ double modqyZDCC;
1560+
1561+ modqxZDCA = TMath::Sqrt ((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Cos (psiZDCA);
1562+ modqyZDCA = TMath::Sqrt ((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Sin (psiZDCA);
1563+ modqxZDCC = TMath::Sqrt ((qxZDCC * qxZDCC) + (qyZDCC * qyZDCC)) * TMath::Cos (psiZDCC);
1564+ modqyZDCC = TMath::Sqrt ((qxZDCC * qxZDCC) + (qyZDCC * qyZDCC)) * TMath::Sin (psiZDCC);
1565+
1566+ auto psiZDC = TMath::ATan2 ((modqyZDCC - modqyZDCA), (modqxZDCC - modqxZDCA)); // full event plane from collision 2
1567+
1568+ histos.fill (HIST (" hCentrality" ), centrality);
1569+ histos.fill (HIST (" hpRes" ), centrality, (TMath::Cos (GetPhiInRange (psiZDCA - psiZDCC))));
1570+ histos.fill (HIST (" hpResSin" ), centrality, (TMath::Sin (GetPhiInRange (psiZDCA - psiZDCC))));
1571+
1572+ // V0s from collision1 to match kinematics
1573+ auto v0sCol1 = V0s.sliceBy (tracksPerCollisionV0Mixed, collision1.index ());
1574+ // V0s from collision2 to test
1575+ auto v0sCol2 = V0s.sliceBy (tracksPerCollisionV0Mixed, collision2.index ());
1576+
1577+ for (const auto & v0_2 : v0sCol2) {
1578+
1579+ bool LambdaTag = isCompatible (v0_2, 0 );
1580+ bool aLambdaTag = isCompatible (v0_2, 1 );
1581+ if (!LambdaTag && !aLambdaTag)
1582+ continue ;
1583+ if (!SelectionV0 (collision2, v0_2))
1584+ continue ;
1585+ if (LambdaTag) {
1586+ Proton = ROOT::Math::PxPyPzMVector (v0_2.pxpos (), v0_2.pypos (), v0_2.pzpos (), massPr);
1587+ AntiPion = ROOT::Math::PxPyPzMVector (v0_2.pxneg (), v0_2.pyneg (), v0_2.pzneg (), massPi);
1588+ Lambdadummy = Proton + AntiPion;
1589+ }
1590+ if (aLambdaTag) {
1591+ AntiProton = ROOT::Math::PxPyPzMVector (v0_2.pxneg (), v0_2.pyneg (), v0_2.pzneg (), massPr);
1592+ Pion = ROOT::Math::PxPyPzMVector (v0_2.pxpos (), v0_2.pypos (), v0_2.pzpos (), massPi);
1593+ AntiLambdadummy = AntiProton + Pion;
1594+ }
1595+ if (shouldReject (LambdaTag, aLambdaTag, Lambdadummy, AntiLambdadummy)) {
1596+ continue ;
1597+ }
1598+ if (TMath::Abs (v0_2.eta ()) > 0.8 )
1599+ continue ;
1600+
1601+ // Check if lambda kinematics from collision2 matches with collision1
1602+ bool matched = false ;
1603+ for (const auto & v0_1 : v0sCol1) {
1604+ bool LambdaTag1 = isCompatible (v0_1, 0 );
1605+ bool aLambdaTag1 = isCompatible (v0_1, 1 );
1606+ if (!LambdaTag1 && !aLambdaTag1)
1607+ continue ;
1608+ if (!SelectionV0 (collision1, v0_1))
1609+ continue ;
1610+ if (TMath::Abs (v0_1.eta ()) > 0.8 )
1611+ continue ;
1612+
1613+ double deta = std::abs (v0_1.eta () - v0_2.eta ());
1614+ double dpt = std::abs (v0_1.pt () - v0_2.pt ());
1615+ double dphi = RecoDecay::constrainAngle (v0_1.phi () - v0_2.phi (), 0.0 );
1616+ if (deta < randGrp.etaMix && dpt < randGrp.ptMix && dphi < randGrp.phiMix && ((v0_1.eta () * v0_2.eta ()) > 0.0 )) {
1617+ matched = true ;
1618+ break ;
1619+ }
1620+ }
1621+ if (!matched)
1622+ continue ;
1623+
1624+ int taga = LambdaTag;
1625+ int tagb = aLambdaTag;
1626+
1627+ if (LambdaTag) {
1628+ Lambda = Proton + AntiPion;
1629+ tagb = 0 ;
1630+ double acvalue = 1.0 ;
1631+ fillHistograms (taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0_2.mLambda (), v0_2.pt (), v0_2.eta (), acvalue);
1632+ }
1633+
1634+ tagb = aLambdaTag;
1635+ if (aLambdaTag) {
1636+ AntiLambda = AntiProton + Pion;
1637+ taga = 0 ;
1638+ double acvalue = 1.0 ;
1639+ fillHistograms (taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0_2.mAntiLambda (), v0_2.pt (), v0_2.eta (), acvalue);
1640+ }
1641+ }
1642+ }
1643+ }
1644+ PROCESS_SWITCH (lambdapolsp, processDerivedDataMixed2, " Process mixed event2 using derived data" , false );
1645+
14901646 void processDerivedDataMixedFIFO (soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraStamps, aod::StraZDCSP> const & collisions, v0Candidates const & V0s, dauTracks const &)
14911647 {
14921648
0 commit comments