@@ -95,6 +95,7 @@ struct FlowQa {
9595 O2_DEFINE_CONFIGURABLE (cfgCutOccupancyHigh, int , 500 , " High cut on TPC occupancy" )
9696 O2_DEFINE_CONFIGURABLE (cfgCutOccupancyLow, int , 0 , " Low cut on TPC occupancy" )
9797 O2_DEFINE_CONFIGURABLE (cfgUseSmallMemory, bool , false , " Use small memory mode" )
98+ O2_DEFINE_CONFIGURABLE (cfgUseEPcorrection, bool , false , " Use event plane efficiency correction" )
9899 Configurable<std::vector<std::string>> cfgUserDefineGFWCorr{" cfgUserDefineGFWCorr" , std::vector<std::string>{" refN02 {2} refP02 {-2}" , " refN12 {2} refP12 {-2}" }, " User defined GFW CorrelatorConfig" };
99100 Configurable<std::vector<std::string>> cfgUserDefineGFWName{" cfgUserDefineGFWName" , std::vector<std::string>{" Ch02Gap22" , " Ch12Gap22" }, " User defined GFW Name" };
100101 Configurable<std::vector<int >> cfgRunRemoveList{" cfgRunRemoveList" , std::vector<int >{-1 }, " excluded run numbers" };
@@ -157,6 +158,12 @@ struct FlowQa {
157158 ctpRateFetcher mRateFetcher ;
158159 TH2* gCurrentHadronicRate ;
159160
161+ std::vector<TF1*> funcEff;
162+ TH1D* hFindPtBin;
163+ TF1* funcV2;
164+ TF1* funcV3;
165+ TF1* funcV4;
166+
160167 using AodCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentFV0As, aod::Mults>>;
161168 using AodTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA>>;
162169
@@ -355,6 +362,31 @@ struct FlowQa {
355362 }
356363 }
357364 fGFW ->CreateRegions ();
365+
366+ if (cfgUseEPcorrection) {
367+ hFindPtBin = new TH1D (" hFindPtBin" , " hFindPtBin" , 7 , 0.2 , 3.0 );
368+ funcEff.resize (7 );
369+ funcEff[0 ] = new TF1 (" funcEff0" , " [0]+[1]*x+[2]*(2*x*x - 1)+[3]*(4*x*x*x - 3*x)+[4]*(8*x*x*x*x - 8*x*x + 1)" , 0 , 3000 );
370+ funcEff[0 ]->SetParameters (0.7366162408 , -2.11923e-05 , 1.5258e-09 , -2.23824e-12 , 4.53824e-16 );
371+ funcEff[1 ] = new TF1 (" funcEff1" , " [0]+[1]*x+[2]*(2*x*x - 1)+[3]*(4*x*x*x - 3*x)+[4]*(8*x*x*x*x - 8*x*x + 1)" , 0 , 3000 );
372+ funcEff[1 ]->SetParameters (0.7742102264 , -2.50337e-05 , -1.12602e-09 , -1.38765e-12 , 3.86733e-16 );
373+ funcEff[2 ] = new TF1 (" funcEff2" , " [0]+[1]*x+[2]*(2*x*x - 1)+[3]*(4*x*x*x - 3*x)+[4]*(8*x*x*x*x - 8*x*x + 1)" , 0 , 3000 );
374+ funcEff[2 ]->SetParameters (0.7933082148 , -2.24092e-05 , -2.55079e-09 , -8.59327e-13 , 3.1966e-16 );
375+ funcEff[3 ] = new TF1 (" funcEff3" , " [0]+[1]*x+[2]*(2*x*x - 1)+[3]*(4*x*x*x - 3*x)+[4]*(8*x*x*x*x - 8*x*x + 1)" , 0 , 3000 );
376+ funcEff[3 ]->SetParameters (0.8084143879 , -1.88185e-05 , -3.26378e-09 , -6.57021e-13 , 2.92597e-16 );
377+ funcEff[4 ] = new TF1 (" funcEff4" , " [0]+[1]*x+[2]*(2*x*x - 1)+[3]*(4*x*x*x - 3*x)+[4]*(8*x*x*x*x - 8*x*x + 1)" , 0 , 3000 );
378+ funcEff[4 ]->SetParameters (0.8160584679 , -4.0401e-06 , -1.5118e-08 , 3.22423e-12 , -1.21729e-16 );
379+ funcEff[5 ] = new TF1 (" funcEff5" , " [0]+[1]*x+[2]*(2*x*x - 1)+[3]*(4*x*x*x - 3*x)+[4]*(8*x*x*x*x - 8*x*x + 1)" , 0 , 3000 );
380+ funcEff[5 ]->SetParameters (0.8245747952 , -1.88827e-05 , 9.88837e-10 , -2.23894e-12 , 4.62594e-16 );
381+ funcEff[6 ] = new TF1 (" funcEff6" , " [0]+[1]*x+[2]*(2*x*x - 1)+[3]*(4*x*x*x - 3*x)+[4]*(8*x*x*x*x - 8*x*x + 1)" , 0 , 3000 );
382+ funcEff[6 ]->SetParameters (0.8277255051 , -1.07687e-05 , -3.9408e-09 , -8.7277e-13 , 3.3104e-16 );
383+ funcV2 = new TF1 (" funcV2" , " [0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x" , 0 , 100 );
384+ funcV2->SetParameters (0.0186111 , 0.00351907 , -4.38264e-05 , 1.35383e-07 , -3.96266e-10 );
385+ funcV3 = new TF1 (" funcV3" , " [0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x" , 0 , 100 );
386+ funcV3->SetParameters (0.0174056 , 0.000703329 , -1.45044e-05 , 1.91991e-07 , -1.62137e-09 );
387+ funcV4 = new TF1 (" funcV4" , " [0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x" , 0 , 100 );
388+ funcV4->SetParameters (0.008845 , 0.000259668 , -3.24435e-06 , 4.54837e-08 , -6.01825e-10 );
389+ }
358390 }
359391
360392 template <char ... chars>
@@ -670,6 +702,32 @@ struct FlowQa {
670702 if (cfgUseNch)
671703 independent = static_cast <float >(tracks.size ());
672704
705+ double psi2Est = 0 , psi3Est = 0 , psi4Est = 0 ;
706+ float wEPeff = 1 ;
707+ double v2 = 0 , v3 = 0 , v4 = 0 ;
708+ if (cfgUseEPcorrection) {
709+ double q2x = 0 , q2y = 0 ;
710+ double q3x = 0 , q3y = 0 ;
711+ double q4x = 0 , q4y = 0 ;
712+ for (const auto & track : tracks) {
713+ bool withinPtRef = (cfgCutPtRefMin < track.pt ()) && (track.pt () < cfgCutPtRefMax); // within RF pT rang
714+ if (withinPtRef) {
715+ q2x += std::cos (2 * track.phi ());
716+ q2y += std::sin (2 * track.phi ());
717+ q3x += std::cos (3 * track.phi ());
718+ q3y += std::sin (3 * track.phi ());
719+ q4x += std::cos (4 * track.phi ());
720+ q4y += std::sin (4 * track.phi ());
721+ }
722+ }
723+ psi2Est = std::atan2 (q2y, q2x) / 2 .;
724+ psi3Est = std::atan2 (q3y, q3x) / 3 .;
725+ psi4Est = std::atan2 (q4y, q4x) / 4 .;
726+ v2 = funcV2->Eval (cent);
727+ v3 = funcV3->Eval (cent);
728+ v4 = funcV4->Eval (cent);
729+ }
730+
673731 for (const auto & track : tracks) {
674732 if (!trackSelected (track))
675733 continue ;
@@ -685,6 +743,15 @@ struct FlowQa {
685743 }
686744 if (!setCurrentParticleWeights (weff, wacc, track.phi (), track.eta (), track.pt (), vtxz))
687745 continue ;
746+ if (cfgUseEPcorrection && withinPtRef) {
747+ double fphi = v2 * std::cos (2 * (track.phi () - psi2Est)) + v3 * std::cos (3 * (track.phi () - psi3Est)) + v4 * std::cos (4 * (track.phi () - psi4Est));
748+ fphi = (1 + 2 * fphi);
749+ int pTBinForEff = hFindPtBin->FindBin (track.pt ());
750+ if (pTBinForEff >= 1 && pTBinForEff <= 7 ) {
751+ wEPeff = funcEff[pTBinForEff - 1 ]->Eval (fphi * tracks.size ());
752+ weff *= wEPeff;
753+ }
754+ }
688755 registry.fill (HIST (" hPt" ), track.pt ());
689756 if (withinPtRef) {
690757 registry.fill (HIST (" hPhi" ), track.phi ());
0 commit comments