3131#include " Framework/StepTHn.h"
3232
3333#include " Common/DataModel/EventSelection.h"
34- #include " Common/Core/TrackSelection.h"
3534#include " Common/DataModel/TrackSelectionTables.h"
3635#include " Common/DataModel/Centrality.h"
3736#include " Common/DataModel/PIDResponse.h"
38- #include " Common/Core/trackUtilities.h"
39- #include " Common/Core/RecoDecay.h"
4037#include " Common/DataModel/Multiplicity.h"
41- #include " PWGLF/DataModel/EPCalibrationTables.h"
38+ #include " Common/Core/TrackSelection.h"
39+ #include " Common/Core/trackUtilities.h"
4240#include " CommonConstants/PhysicsConstants.h"
41+
42+ #include " PWGLF/DataModel/EPCalibrationTables.h"
4343#include " PWGLF/DataModel/LFStrangenessTables.h"
4444
45+ #include " PWGCF/GenericFramework/Core/GFWPowerArray.h"
46+ #include " PWGCF/GenericFramework/Core/GFW.h"
47+ #include " PWGCF/GenericFramework/Core/GFWCumulant.h"
48+ #include " PWGCF/GenericFramework/Core/FlowContainer.h"
49+ #include " PWGCF/GenericFramework/Core/GFWWeights.h"
50+ #include " PWGCF/GenericFramework/Core/GFWWeightsList.h"
51+
4552#include " ReconstructionDataFormats/Track.h"
4653#include " ReconstructionDataFormats/PID.h"
4754
@@ -116,9 +123,9 @@ struct ResonancesGfwFlow {
116123 ConfigurableAxis axisNsigmaTPC{" axisNsigmaTPC" , {80 , -5 , 5 }, " nsigmaTPC axis" };
117124 ConfigurableAxis axisNsigmaTOF{" axisNsigmaTOF" , {80 , -5 , 5 }, " nsigmaTOF axis" };
118125 ConfigurableAxis axisParticles{" axisParticles" , {3 , 0 , 3 }, " axis for different hadrons" };
119- ConfigurableAxis axisPhiMass{" axisPhiMass" , {50000 , 0 , 5 }, " axis for invariant mass distibution for Phi" };
120- ConfigurableAxis axisK0Mass{" axisK0Mass" , {50000 , 0 , 5 }, " axis for invariant mass distibution for K0" };
121- ConfigurableAxis axisLambdaMass{" axisLambdaMass" , {50000 , 0 , 5 }, " axis for invariant mass distibution for Lambda" };
126+ ConfigurableAxis axisPhiMass{" axisPhiMass" , {70 , 0.99 , 1.06 }, " axis for invariant mass distibution for Phi" };
127+ ConfigurableAxis axisK0Mass{" axisK0Mass" , {120 , 0.44 , 0.56 }, " axis for invariant mass distibution for K0" };
128+ ConfigurableAxis axisLambdaMass{" axisLambdaMass" , {70 , 1.08 , 1.15 }, " axis for invariant mass distibution for Lambda" };
122129 ConfigurableAxis axisTPCsignal{" axisTPCsignal" , {10000 , 0 , 1000 }, " axis for TPC signal" };
123130 ConfigurableAxis axisTOFsignal{" axisTOFsignal" , {10000 , 0 , 1000 }, " axis for TOF signal" };
124131
@@ -135,6 +142,14 @@ struct ResonancesGfwFlow {
135142
136143 HistogramRegistry histos{" histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
137144
145+ GFW* fGFW = new GFW();
146+ std::vector<GFW::CorrConfig> corrconfigs;
147+ TAxis* fPtAxis ;
148+ TAxis* fPhiMassAxis ;
149+ TAxis* fK0MassAxis ;
150+ TAxis* fLambdaMassAxis ;
151+ TRandom3* fRndm = new TRandom3(0 );
152+
138153 void init (InitContext const &)
139154 {
140155 ccdb->setURL (ccdbUrl.value );
@@ -179,6 +194,79 @@ struct ResonancesGfwFlow {
179194 histos.add (" hK0Eta" , " " , {HistType::kTH1D , {axisEta}});
180195 histos.add (" hK0Mass_sparse" , " " , {HistType::kTHnSparseF , {{axisK0Mass, axisPt, axisMultiplicity}}});
181196 histos.add (" hK0Count" , " " , {HistType::kTH1D , {singleCount}});
197+
198+ histos.add (" Phic22" , " " , {HistType::kTProfile , {axisMultiplicity}});
199+ histos.add (" Phic24" , " " , {HistType::kTProfile , {axisMultiplicity}});
200+ histos.add (" Phiv22pt" , " " , {HistType::kTProfile3D , {axisPt, axisPhiMass, axisMultiplicity}});
201+ histos.add (" Phiv24pt" , " " , {HistType::kTProfile3D , {axisPt, axisPhiMass, axisMultiplicity}});
202+
203+ o2::framework::AxisSpec axis = axisPt;
204+ int nPtBins = axis.binEdges .size () - 1 ;
205+ double * ptBins = &(axis.binEdges )[0 ];
206+ fPtAxis = new TAxis (nPtBins, ptBins);
207+
208+ o2::framework::AxisSpec axisPhisMass = axisPhiMass;
209+ int nPhiMassBins = axisPhisMass.binEdges .size () - 1 ;
210+ double * phiMassBins = &(axisPhisMass.binEdges )[0 ];
211+ fPhiMassAxis = new TAxis (nPhiMassBins, phiMassBins);
212+ int nPhisPtMassBins = nPtBins * nPhiMassBins;
213+
214+ o2::framework::AxisSpec axisK0sMass = axisK0Mass;
215+ int nK0MassBins = axisK0sMass.binEdges .size () - 1 ;
216+ double * k0MassBins = &(axisK0sMass.binEdges )[0 ];
217+ fK0MassAxis = new TAxis (nK0MassBins, k0MassBins);
218+
219+ o2::framework::AxisSpec axisLambdasMass = axisLambdaMass;
220+ int nLambdaMassBins = axisLambdasMass.binEdges .size () - 1 ;
221+ double * lambdaMassBins = &(axisLambdasMass.binEdges )[0 ];
222+ fLambdaMassAxis = new TAxis (nLambdaMassBins, lambdaMassBins);
223+
224+ // ********** Defining the regions **********
225+ // reference particles
226+ fGFW ->AddRegion (" refN08" , -0.8 , -0.4 , 1 , 1 );
227+ fGFW ->AddRegion (" refP08" , 0.4 , 0.8 , 1 , 1 );
228+
229+ // phi
230+ fGFW ->AddRegion (" poiNphi" , -0.8 , -0.4 , 1 + nPhisPtMassBins, 2 );
231+ fGFW ->AddRegion (" olNphi" , -0.8 , -0.4 , 1 + nPhisPtMassBins, 32 );
232+
233+ // ********** Defining the correlations **********
234+ // reference particles
235+ corrconfigs.push_back (fGFW ->GetCorrelatorConfig (" refN08 {2} refP08 {-2}" , " Phi08Gap22" , kFALSE ));
236+ corrconfigs.push_back (fGFW ->GetCorrelatorConfig (" refN08 {2 2} refP08 {-2 -2}" , " Phi08Gap24" , kFALSE ));
237+
238+ // pt differential pois
239+ corrconfigs.push_back (fGFW ->GetCorrelatorConfig (" poiNphi refN08 | olNphi {2} refP08 {-2}" , " Phi08Gap22" , kTRUE ));
240+ corrconfigs.push_back (fGFW ->GetCorrelatorConfig (" poiNphi refN08 | olNphi {2 2} refP08 {-2 -2}" , " Phi08Gap24" , kTRUE ));
241+
242+ fGFW ->CreateRegions ();
243+ }
244+
245+ // This function is specific for Phi flow: will be made more generic in further iterations
246+ template <char ... chars>
247+ void fillResoProfile (const GFW::CorrConfig& corrconf, const ConstStr<chars...>& tarName, const double & cent)
248+ {
249+ double dnx, val;
250+ if (!corrconf.pTDif ) {
251+ dnx = fGFW ->Calculate (corrconf, 0 , kTRUE ).real ();
252+ if (dnx == 0 )
253+ return ;
254+ val = fGFW ->Calculate (corrconf, 0 , kFALSE ).real () / dnx;
255+ if (std::fabs (val) < 1 )
256+ histos.fill (tarName, cent, val, dnx);
257+ return ;
258+ }
259+ for (int i = 1 ; i <= fPtAxis ->GetNbins (); i++) {
260+ for (int j = 1 ; j <= fPhiMassAxis ->GetNbins (); j++) {
261+ dnx = fGFW ->Calculate (corrconf, ((i - 1 ) * fPhiMassAxis ->GetNbins ()) + (j - 1 ), kTRUE ).real ();
262+ if (dnx == 0 )
263+ continue ;
264+ val = fGFW ->Calculate (corrconf, ((i - 1 ) * fPhiMassAxis ->GetNbins ()) + (j - 1 ), kFALSE ).real () / dnx;
265+ if (std::fabs (val) < 1 )
266+ histos.fill (tarName, fPtAxis ->GetBinCenter (i), fPhiMassAxis ->GetBinCenter (j), cent, val, dnx);
267+ }
268+ }
269+ return ;
182270 }
183271
184272 // Cosine pointing angle cut
@@ -248,7 +336,7 @@ struct ResonancesGfwFlow {
248336 }
249337
250338 template <typename TTrack, typename vector, char ... chars>
251- void resurrectKaon (TTrack trackplus, TTrack trackminus, vector plusdaug, vector minusdaug, vector mom, double plusmass, const ConstStr<chars...>& hist, const double cent)
339+ void resurrectPhi (TTrack trackplus, TTrack trackminus, vector plusdaug, vector minusdaug, vector mom, double plusmass, const ConstStr<chars...>& hist, const double cent, float weff, float wacc )
252340 {
253341 for (auto const & [partplus, partminus] : o2::soa::combinations (o2::soa::CombinationsFullIndexPolicy (trackplus, trackminus))) {
254342 if (getNsigmaPID (partplus) != 2 )
@@ -271,10 +359,20 @@ struct ResonancesGfwFlow {
271359 minusdaug = ROOT::Math::PxPyPzMVector (partminus.px (), partminus.py (), partminus.pz (), plusmass);
272360 mom = plusdaug + minusdaug;
273361
362+ double pt = mom.Pt ();
363+ double invMass = mom.M ();
364+ bool withinPtPOI = (cfgCutPtPOIMin < pt) && (pt < cfgCutPtPOIMax); // within POI pT range
365+ bool withinPtRef = (cfgCutPtMin < pt) && (pt < cfgCutPtMax);
366+
274367 if (std::abs (mom.Rapidity ()) < cfgRapidityCut) {
275- histos.fill (hist, mom.M (), mom.Pt (), cent);
276- histos.fill (HIST (" hPhiPhi" ), phiMom.Phi ());
277- histos.fill (HIST (" hPhiEta" ), phiMom.Eta ());
368+ histos.fill (hist, invMass, pt, cent);
369+ histos.fill (HIST (" hPhiPhi" ), mom.Phi ());
370+ histos.fill (HIST (" hPhiEta" ), mom.Eta ());
371+
372+ if (withinPtPOI)
373+ fGFW ->Fill (mom.Eta (), ((fPtAxis ->FindBin (pt) - 1 ) * fPhiMassAxis ->GetNbins ()) + (fPhiMassAxis ->FindBin (invMass) - 1 ), mom.Phi (), wacc * weff, 2 );
374+ if (withinPtPOI && withinPtRef)
375+ fGFW ->Fill (mom.Eta (), ((fPtAxis ->FindBin (pt) - 1 ) * fPhiMassAxis ->GetNbins ()) + (fPhiMassAxis ->FindBin (invMass) - 1 ), mom.Phi (), wacc * weff, 32 );
278376 }
279377 }
280378 return ;
@@ -462,11 +560,22 @@ struct ResonancesGfwFlow {
462560 histos.fill (HIST (" hVtxZ" ), vtxz);
463561 histos.fill (HIST (" hMult" ), nTot);
464562 histos.fill (HIST (" hCent" ), cent);
563+ fGFW ->Clear ();
564+
565+ float weff = 1 , wacc = 1 ;
566+
567+ for (auto const & track : tracks) {
568+ double pt = track.pt ();
569+ bool withinPtRef = (cfgCutPtMin < pt) && (pt < cfgCutPtMax);
570+
571+ if (withinPtRef)
572+ fGFW ->Fill (track.eta (), fPtAxis ->FindBin (pt) - 1 , track.phi (), wacc * weff, 1 );
573+ }
465574
466575 auto posSlicedTracks = posTracks->sliceByCached (aod::track::collisionId, collision.globalIndex (), cache);
467576 auto negSlicedTracks = negTracks->sliceByCached (aod::track::collisionId, collision.globalIndex (), cache);
468577
469- resurrectKaon (posSlicedTracks, negSlicedTracks, kaonPlus, kaonMinus, phiMom, massKaPlus, HIST (" hPhiMass_sparse" ), cent);
578+ resurrectPhi (posSlicedTracks, negSlicedTracks, kaonPlus, kaonMinus, phiMom, massKaPlus, HIST (" hPhiMass_sparse" ), cent, weff, wacc );
470579
471580 for (auto const & v0s : V0s) {
472581 if (selectionLambda (collision, v0s) == true )
@@ -476,6 +585,10 @@ struct ResonancesGfwFlow {
476585
477586 } // End of v0 loop
478587
588+ fillResoProfile (corrconfigs.at (0 ), HIST (" Phic22" ), cent);
589+ fillResoProfile (corrconfigs.at (1 ), HIST (" Phic24" ), cent);
590+ fillResoProfile (corrconfigs.at (2 ), HIST (" Phiv22pt" ), cent);
591+ fillResoProfile (corrconfigs.at (3 ), HIST (" Phiv24pt" ), cent);
479592 } // end of process
480593};
481594
0 commit comments