Skip to content

Commit cebee0d

Browse files
prottayCMTProttay Das
andauthored
[PWGLF] Updated mixing (#17258)
Co-authored-by: Prottay Das <prottay@alipap1.cern.ch>
1 parent 6b23fc4 commit cebee0d

1 file changed

Lines changed: 126 additions & 0 deletions

File tree

PWGLF/Tasks/Resonances/phiflowder.cxx

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
#include "PWGLF/DataModel/LFPhiFlowTables.h"
1818

1919
#include <CommonConstants/PhysicsConstants.h>
20+
#include <Framework/ASoAHelpers.h>
2021
#include <Framework/AnalysisTask.h>
22+
#include <Framework/BinningPolicy.h>
2123
#include <Framework/Configurable.h>
2224
#include <Framework/HistogramRegistry.h>
2325
#include <Framework/HistogramSpec.h>
@@ -27,9 +29,11 @@
2729

2830
#include <Math/Vector4D.h>
2931

32+
#include <cmath>
3033
#include <cstdint>
3134
#include <map>
3235
#include <string>
36+
#include <tuple>
3337

3438
using namespace o2;
3539
using namespace o2::framework;
@@ -63,6 +67,7 @@ struct phiflowder {
6367
/*Configurable<float> ptMix{"ptMix", 0.2f, "ME: pT bin width"};
6468
Configurable<float> etaMix{"etaMix", 0.2f, "ME: eta bin width"};
6569
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"};
6671

6772
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
6873

@@ -476,6 +481,127 @@ struct phiflowder {
476481
}
477482

478483
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);
479605
};
480606

481607
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)