@@ -120,6 +120,7 @@ struct ChargeBalanceFunction {
120120 // Efficiency Correction
121121 Configurable<bool > cGetCorrectionFlag{" cGetCorrectionFlag" , false , " Apply correction flag" };
122122 Configurable<bool > cGetNuaCorrectionFlag{" cGetNuaCorrectionFlag" , false , " Apply NUA correction flag" };
123+ Configurable<bool > cDoEffNuaCorrection{" cDoEffNuaCorrection" , false , " Do NUE x NUA correction" };
123124
124125 // CCDB
125126 Configurable<std::string> cUrlCCDB{" cUrlCCDB" , " http://alice-ccdb.cern.ch" , " ALICE CCDB URL" };
@@ -248,6 +249,10 @@ struct ChargeBalanceFunction {
248249 histos.add (" Reco/h3f_n1_rapphi_P" , " #rho_{1}^{#plus}" , kTH3F , {axisCent, axisTrackEta, axisTrackPhi});
249250 histos.add (" Reco/h3f_n1_rapphi_M" , " #rho_{1}^{#minus}" , kTH3F , {axisCent, axisTrackEta, axisTrackPhi});
250251
252+ // Rho1 for P2 pT
253+ histos.add (" Reco/h2f_n1_pt_P" , " #rho_{1}^{#plus}" , kTH2F , {axisCent, axisTrackPt});
254+ histos.add (" Reco/h2f_n1_pt_M" , " #rho_{1}^{#minus}" , kTH2F , {axisCent, axisTrackPt});
255+
251256 // Rho1 for P2 RapPhi
252257 histos.add (" Reco/h3f_pt_rapphi_P" , " #rho_{1}^{#plus}" , kTH3F , {axisCent, axisTrackEta, axisTrackPhi});
253258 histos.add (" Reco/h3f_pt_rapphi_M" , " #rho_{1}^{#minus}" , kTH3F , {axisCent, axisTrackEta, axisTrackPhi});
@@ -394,7 +399,7 @@ struct ChargeBalanceFunction {
394399 }
395400
396401 template <RecGenType rec_gen, typename T, typename S>
397- float getCorrectionFactor (T const & track, S const & sign)
402+ float getEffCorrectionFactor (T const & track, S const & sign)
398403 {
399404 if (!cGetCorrectionFlag) {
400405 return 1 .;
@@ -530,29 +535,35 @@ struct ChargeBalanceFunction {
530535 const auto phibin1 = static_cast <int >(trk_1.phi () / phibinwidth);
531536 const auto phibin2 = static_cast <int >(trk_2.phi () / phibinwidth);
532537
533- float corfac = getCorrectionFactor<rec_gen>(trk_1, sign_1) * getCorrectionFactor<rec_gen>(trk_2, sign_2);
538+ float effcorr = getEffCorrectionFactor<rec_gen>(trk_1, sign_1) * getEffCorrectionFactor<rec_gen>(trk_2, sign_2);
539+ float nuacorr = getNuaCorrectionFactor<rec_gen>(trk_1, sign_1) * getNuaCorrectionFactor<rec_gen>(trk_2, sign_2);
540+ float corrfact = effcorr;
541+
542+ if (cDoEffNuaCorrection) {
543+ corrfact *= nuacorr;
544+ }
534545
535546 if (rapbin1 >= 0 && rapbin2 >= 0 && phibin1 >= 0 && phibin2 >= 0 && rapbin1 < nrapbins && rapbin2 < nrapbins && phibin1 < nphibins && phibin2 < nphibins) {
536547
537548 int rapphix = rapbin1 * nphibins + phibin1;
538549 int rapphiy = rapbin2 * nphibins + phibin2;
539550
540551 if ((sign_1 > 0 && sign_2 < 0 ) || (sign_1 < 0 && sign_2 > 0 )) {
541- histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_n2_rapphi_PM" ), cent, rapphix + 0.5 , rapphiy + 0.5 , corfac );
542- histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_ptpt_rapphi_PM" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_1.pt () * trk_2.pt () * corfac );
543- histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_npt_rapphi_PM" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_1.pt () * corfac );
544- histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_ptn_rapphi_PM" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_2.pt () * corfac );
552+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_n2_rapphi_PM" ), cent, rapphix + 0.5 , rapphiy + 0.5 , corrfact );
553+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_ptpt_rapphi_PM" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_1.pt () * trk_2.pt () * corrfact );
554+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_npt_rapphi_PM" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_1.pt () * corrfact );
555+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_ptn_rapphi_PM" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_2.pt () * corrfact );
545556 } else {
546557 if (sign_1 > 0 && sign_2 > 0 ) {
547- histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_n2_rapphi_PP" ), cent, rapphix + 0.5 , rapphiy + 0.5 , corfac );
548- histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_ptpt_rapphi_PP" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_1.pt () * trk_2.pt () * corfac );
549- histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_npt_rapphi_PP" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_1.pt () * corfac );
550- histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_ptn_rapphi_PP" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_2.pt () * corfac );
558+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_n2_rapphi_PP" ), cent, rapphix + 0.5 , rapphiy + 0.5 , corrfact );
559+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_ptpt_rapphi_PP" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_1.pt () * trk_2.pt () * corrfact );
560+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_npt_rapphi_PP" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_1.pt () * corrfact );
561+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_ptn_rapphi_PP" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_2.pt () * corrfact );
551562 } else if (sign_1 < 0 && sign_2 < 0 ) {
552- histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_n2_rapphi_MM" ), cent, rapphix + 0.5 , rapphiy + 0.5 , corfac );
553- histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_ptpt_rapphi_MM" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_1.pt () * trk_2.pt () * corfac );
554- histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_npt_rapphi_MM" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_1.pt () * corfac );
555- histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_ptn_rapphi_MM" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_2.pt () * corfac );
563+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_n2_rapphi_MM" ), cent, rapphix + 0.5 , rapphiy + 0.5 , corrfact );
564+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_ptpt_rapphi_MM" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_1.pt () * trk_2.pt () * corrfact );
565+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_npt_rapphi_MM" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_1.pt () * corrfact );
566+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_ptn_rapphi_MM" ), cent, rapphix + 0.5 , rapphiy + 0.5 , trk_2.pt () * corrfact );
556567 }
557568 }
558569 }
@@ -573,8 +584,13 @@ struct ChargeBalanceFunction {
573584 static constexpr auto SubDirRecGen = std::array{" Reco/" , " McGen/" };
574585
575586 // Correction factor
576- float corrFact = getCorrectionFactor <rec_gen>(track, sign);
587+ float effCorr = getEffCorrectionFactor <rec_gen>(track, sign);
577588 float nuaCorr = getNuaCorrectionFactor<rec_gen>(track, sign);
589+ float corrFact = effCorr;
590+
591+ if (cDoEffNuaCorrection) {
592+ corrFact *= nuaCorr;
593+ }
578594
579595 // Histograms
580596 if (sign > 0 ) {
@@ -584,14 +600,15 @@ struct ChargeBalanceFunction {
584600 histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" NUA/h3f_n1_vzrapphi_P" ), posz, track.eta (), track.phi ());
585601
586602 // Checks
587- histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h1f_n1_pt_P" ), track.pt (), corrFact );
588- histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h1f_n1_rap_P" ), track.eta (), corrFact );
603+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h1f_n1_pt_P" ), track.pt (), effCorr );
604+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h1f_n1_rap_P" ), track.eta (), effCorr );
589605 histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h1f_n1_phi_P" ), track.phi (), nuaCorr);
590606
591607 // R2 Rho1 (Eta,Phi)
592608 histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_n1_rapphi_P" ), cent, track.eta (), track.phi (), corrFact);
593609
594610 // P2 Rho1 (Eta,Phi)
611+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h2f_n1_pt_P" ), cent, track.pt (), corrFact);
595612 histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_pt_rapphi_P" ), cent, track.eta (), track.phi (), track.pt () * corrFact);
596613 } else if (sign < 0 ) {
597614 // Corrections
@@ -608,6 +625,7 @@ struct ChargeBalanceFunction {
608625 histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_n1_rapphi_M" ), cent, track.eta (), track.phi (), corrFact);
609626
610627 // P2 Rho1 (Eta,Phi)
628+ histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h2f_n1_pt_M" ), cent, track.pt (), corrFact);
611629 histos.fill (HIST (SubDirRecGen[rec_gen]) + HIST (" h3f_pt_rapphi_M" ), cent, track.eta (), track.phi (), track.pt () * corrFact);
612630 }
613631 }
0 commit comments