|
17 | 17 | #include "PWGLF/DataModel/LFPhiFlowTables.h" |
18 | 18 |
|
19 | 19 | #include <CommonConstants/PhysicsConstants.h> |
| 20 | +#include <Framework/ASoAHelpers.h> |
20 | 21 | #include <Framework/AnalysisTask.h> |
| 22 | +#include <Framework/BinningPolicy.h> |
21 | 23 | #include <Framework/Configurable.h> |
22 | 24 | #include <Framework/HistogramRegistry.h> |
23 | 25 | #include <Framework/HistogramSpec.h> |
|
27 | 29 |
|
28 | 30 | #include <Math/Vector4D.h> |
29 | 31 |
|
| 32 | +#include <cmath> |
30 | 33 | #include <cstdint> |
31 | 34 | #include <map> |
32 | 35 | #include <string> |
| 36 | +#include <tuple> |
33 | 37 |
|
34 | 38 | using namespace o2; |
35 | 39 | using namespace o2::framework; |
@@ -63,6 +67,7 @@ struct phiflowder { |
63 | 67 | /*Configurable<float> ptMix{"ptMix", 0.2f, "ME: pT bin width"}; |
64 | 68 | Configurable<float> etaMix{"etaMix", 0.2f, "ME: eta bin width"}; |
65 | 69 | Configurable<float> phiMix{"phiMix", 0.3f, "ME: phi bin width"};*/ |
| 70 | + ConfigurableAxis cfgSPAngleBins{"cfgSPAngleBins", {12, 0.0, 2.0 * TMath::Pi()}, "Mixing bins - odd spectator-plane angle"}; |
66 | 71 |
|
67 | 72 | HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; |
68 | 73 |
|
@@ -476,6 +481,127 @@ struct phiflowder { |
476 | 481 | } |
477 | 482 |
|
478 | 483 | PROCESS_SWITCH(phiflowder, processMixedData, "Process mixed-event K+K- pairs", true); |
| 484 | + |
| 485 | + // Processing Event Mixing |
| 486 | + void processMixedData2(EventCandidates const& collisions, |
| 487 | + aod::KaonTracks const& /*kaontracks*/) |
| 488 | + { |
| 489 | + // Calculate the odd spectator-plane angle directly |
| 490 | + // from the Q vectors already stored in KaonEvents. |
| 491 | + auto getSPAngle = |
| 492 | + [](EventCandidates::iterator const& collision) -> float { |
| 493 | + const float qxOdd = |
| 494 | + collision.qxA() - collision.qxC(); |
| 495 | + |
| 496 | + const float qyOdd = |
| 497 | + collision.qyA() - collision.qyC(); |
| 498 | + |
| 499 | + float psiSP = |
| 500 | + std::atan2(qyOdd, qxOdd); |
| 501 | + |
| 502 | + // Put first-harmonic angle in [0, 2pi). |
| 503 | + if (psiSP < 0.f) { |
| 504 | + psiSP += 2.f * TMath::Pi(); |
| 505 | + } |
| 506 | + |
| 507 | + return psiSP; |
| 508 | + }; |
| 509 | + |
| 510 | + using BinningTypeSP = |
| 511 | + FlexibleBinningPolicy< |
| 512 | + std::tuple<decltype(getSPAngle)>, |
| 513 | + aod::kaonevent::Posz, |
| 514 | + aod::kaonevent::Cent, |
| 515 | + decltype(getSPAngle)>; |
| 516 | + |
| 517 | + BinningTypeSP binningOnSPAngle{ |
| 518 | + {getSPAngle}, |
| 519 | + {cfgVtxBins, |
| 520 | + cfgCentBins, |
| 521 | + cfgSPAngleBins}, |
| 522 | + true}; |
| 523 | + |
| 524 | + for (const auto& [collision1, collision2] : |
| 525 | + selfCombinations(binningOnSPAngle, |
| 526 | + nEvtMixing.value, |
| 527 | + -1, |
| 528 | + collisions, |
| 529 | + collisions)) { |
| 530 | + |
| 531 | + if (collision1.globalIndex() == |
| 532 | + collision2.globalIndex()) { |
| 533 | + continue; |
| 534 | + } |
| 535 | + |
| 536 | + const float centrality = |
| 537 | + collision1.cent(); |
| 538 | + |
| 539 | + const float qxZDCA = |
| 540 | + collision1.qxA(); |
| 541 | + |
| 542 | + const float qyZDCA = |
| 543 | + collision1.qyA(); |
| 544 | + |
| 545 | + const float qxZDCC = |
| 546 | + collision1.qxC(); |
| 547 | + |
| 548 | + const float qyZDCC = |
| 549 | + collision1.qyC(); |
| 550 | + |
| 551 | + // K+ from event 1 and K- from event 2. |
| 552 | + auto posGroup1 = |
| 553 | + posKaons->sliceByCached( |
| 554 | + aod::kaonpair::kaoneventId, |
| 555 | + collision1.globalIndex(), |
| 556 | + cache); |
| 557 | + |
| 558 | + auto negGroup2 = |
| 559 | + negKaons->sliceByCached( |
| 560 | + aod::kaonpair::kaoneventId, |
| 561 | + collision2.globalIndex(), |
| 562 | + cache); |
| 563 | + |
| 564 | + // K+ from event 2 and K- from event 1. |
| 565 | + auto posGroup2 = |
| 566 | + posKaons->sliceByCached( |
| 567 | + aod::kaonpair::kaoneventId, |
| 568 | + collision2.globalIndex(), |
| 569 | + cache); |
| 570 | + |
| 571 | + auto negGroup1 = |
| 572 | + negKaons->sliceByCached( |
| 573 | + aod::kaonpair::kaoneventId, |
| 574 | + collision1.globalIndex(), |
| 575 | + cache); |
| 576 | + |
| 577 | + int nMixedPairs = 0; |
| 578 | + |
| 579 | + // Both combinations use centrality and Q vectors |
| 580 | + // from collision1. |
| 581 | + nMixedPairs += |
| 582 | + fillMixedPairs(posGroup1, |
| 583 | + negGroup2, |
| 584 | + centrality, |
| 585 | + qxZDCA, |
| 586 | + qxZDCC, |
| 587 | + qyZDCA, |
| 588 | + qyZDCC); |
| 589 | + |
| 590 | + nMixedPairs += |
| 591 | + fillMixedPairs(posGroup2, |
| 592 | + negGroup1, |
| 593 | + centrality, |
| 594 | + qxZDCA, |
| 595 | + qxZDCC, |
| 596 | + qyZDCA, |
| 597 | + qyZDCC); |
| 598 | + |
| 599 | + histos.fill(HIST("hMixpairs"), |
| 600 | + nMixedPairs); |
| 601 | + } |
| 602 | + } |
| 603 | + |
| 604 | + PROCESS_SWITCH(phiflowder, processMixedData2, "Process mixed-event K+K- pairs in SP-angle bins", true); |
479 | 605 | }; |
480 | 606 |
|
481 | 607 | WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
|
0 commit comments