@@ -137,11 +137,13 @@ struct FlowGenericFramework {
137137 O2_DEFINE_CONFIGURABLE (cfgUsePID, bool , true , " Enable PID information" )
138138 O2_DEFINE_CONFIGURABLE (cfgUseGapMethod, bool , false , " Use gap method in vn-pt calculations" )
139139 O2_DEFINE_CONFIGURABLE (cfgEfficiency, std::string, " " , " CCDB path to efficiency object" )
140+ O2_DEFINE_CONFIGURABLE (cfgUsePIDEfficiencies, bool , false , " Use species dependent efficiencies" )
140141 O2_DEFINE_CONFIGURABLE (cfgAcceptance, std::string, " " , " CCDB path to acceptance object" )
141142 O2_DEFINE_CONFIGURABLE (cfgPtmin, float , 0.2 , " minimum pt (GeV/c)" );
142143 O2_DEFINE_CONFIGURABLE (cfgPtmax, float , 10 , " maximum pt (GeV/c)" );
143144 O2_DEFINE_CONFIGURABLE (cfgEta, float , 0.8 , " eta cut" );
144145 O2_DEFINE_CONFIGURABLE (cfgEtaPtPt, float , 0.4 , " eta cut for pt-pt correlations" );
146+ O2_DEFINE_CONFIGURABLE (cfgEtaNch, float , 0.4 , " eta cut for nch selection" );
145147 O2_DEFINE_CONFIGURABLE (cfgUsePIDTotal, bool , false , " use fraction of PID total" );
146148 O2_DEFINE_CONFIGURABLE (cfgVtxZ, float , 10 , " vertex cut (cm)" );
147149 struct : ConfigurableGroup {
@@ -223,6 +225,7 @@ struct FlowGenericFramework {
223225
224226 struct Config {
225227 TH1D* mEfficiency = nullptr ;
228+ std::vector<TH1D*> mPIDEfficiencies ;
226229 std::vector<GFWWeights*> mAcceptance ;
227230 bool correctionsLoaded = false ;
228231 } cfg;
@@ -845,11 +848,21 @@ struct FlowGenericFramework {
845848 }
846849 }
847850 if (!cfgEfficiency.value .empty ()) {
848- cfg.mEfficiency = ccdb->getForTimeStamp <TH1D>(cfgEfficiency, timestamp);
849- if (cfg.mEfficiency == nullptr ) {
850- LOGF (fatal, " Could not load efficiency histogram from %s" , cfgEfficiency.value .c_str ());
851+ if (!cfgUsePIDEfficiencies) {
852+ cfg.mEfficiency = ccdb->getForTimeStamp <TH1D>(cfgEfficiency, timestamp);
853+ if (cfg.mEfficiency == nullptr ) {
854+ LOGF (fatal, " Could not load efficiency histogram from %s" , cfgEfficiency.value .c_str ());
855+ }
856+ LOGF (info, " Loaded efficiency histogram from %s (%p)" , cfgEfficiency.value .c_str (), (void *)cfg.mEfficiency );
857+ } else {
858+ std::vector<std::string> species = {" ch" , " pi" , " ka" , " pr" , " k0" , " lambda" };
859+ for (const auto & sp : species) {
860+ cfg.mPIDEfficiencies .push_back (ccdb->getForTimeStamp <TH1D>(cfgEfficiency.value + " /" + sp, timestamp));
861+ if (cfg.mPIDEfficiencies .back () == nullptr )
862+ LOGF (fatal, " Could not load PID efficiency histograms from %s" , cfgEfficiency.value + " /" + sp);
863+ LOGF (info, " Loaded PID efficiency histogram from %s" , cfgEfficiency.value + " /" + sp);
864+ }
851865 }
852- LOGF (info, " Loaded efficiency histogram from %s (%p)" , cfgEfficiency.value .c_str (), (void *)cfg.mEfficiency );
853866 }
854867 cfg.correctionsLoaded = true ;
855868 }
@@ -864,11 +877,15 @@ struct FlowGenericFramework {
864877 }
865878
866879 template <typename TTrack>
867- double getEfficiency (TTrack track)
880+ double getEfficiency (TTrack track, int pidIndex = 0 )
868881 { // -1 ref, 0 ch, 1 pi, 2 ka, 3 pr
869882 double eff = 1 .;
870- if (cfg.mEfficiency )
871- eff = cfg.mEfficiency ->GetBinContent (cfg.mEfficiency ->FindBin (track.pt ()));
883+ if (!cfgUsePIDEfficiencies) {
884+ if (cfg.mEfficiency )
885+ eff = cfg.mEfficiency ->GetBinContent (cfg.mEfficiency ->FindBin (track.pt ()));
886+ } else {
887+ eff = cfg.mPIDEfficiencies [pidIndex]->GetBinContent (cfg.mPIDEfficiencies [pidIndex]->FindBin (track.pt ()));
888+ }
872889 if (eff == 0 )
873890 return -1 .;
874891 else
@@ -1441,8 +1458,10 @@ struct FlowGenericFramework {
14411458 if (!nchSelected (track))
14421459 return ;
14431460
1444- acceptedTracks.total += getEfficiency (track);
1445- ++acceptedTracks.total_uncorr ;
1461+ if (std::abs (track.eta ()) < cfgEtaNch) {
1462+ acceptedTracks.total += getEfficiency (track, 0 );
1463+ ++acceptedTracks.total_uncorr ;
1464+ }
14461465
14471466 if (!trackSelected (track, field))
14481467 return ;
@@ -1457,18 +1476,20 @@ struct FlowGenericFramework {
14571476 pidIndex = 3 ;
14581477 }
14591478
1460- if (pidIndex)
1461- acceptedTracks.pidtotal [pidIndex - 1 ] += getEfficiency (track);
1462- int ptBinIndex = fPtAxis ->FindBin (track.pt ()) - 1 ;
1463-
1464- if (!(ptBinIndex < 0 || ptBinIndex >= static_cast <int >(o2::analysis::gfw::ptbinning.size ()))) {
1465- acceptedTracks.nch [ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency (track) : 1.0 ;
1466- if (pidIndex == 1 )
1467- acceptedTracks.npi [ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency (track) : 1.0 ;
1468- if (pidIndex == 2 )
1469- acceptedTracks.nka [ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency (track) : 1.0 ;
1470- if (pidIndex == 3 )
1471- acceptedTracks.npr [ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency (track) : 1.0 ;
1479+ if (std::abs (track.eta ()) < cfgEtaNch) {
1480+ if (pidIndex)
1481+ acceptedTracks.pidtotal [pidIndex - 1 ] += getEfficiency (track, pidIndex);
1482+
1483+ int ptBinIndex = fPtAxis ->FindBin (track.pt ()) - 1 ;
1484+ if (!(ptBinIndex < 0 || ptBinIndex >= static_cast <int >(o2::analysis::gfw::ptbinning.size ()))) {
1485+ acceptedTracks.nch [ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency (track, 0 ) : 1.0 ;
1486+ if (pidIndex == 1 )
1487+ acceptedTracks.npi [ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency (track, pidIndex) : 1.0 ;
1488+ if (pidIndex == 2 )
1489+ acceptedTracks.nka [ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency (track, pidIndex) : 1.0 ;
1490+ if (pidIndex == 3 )
1491+ acceptedTracks.npr [ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency (track, pidIndex) : 1.0 ;
1492+ }
14721493 }
14731494
14741495 if (cfgFillWeights) {
@@ -1504,21 +1525,24 @@ struct FlowGenericFramework {
15041525 if (std::abs (track.pdgCode ()) == kProton )
15051526 pidIndex = 3 ;
15061527 }
1507- ++acceptedTracks.total ;
1508- ++acceptedTracks.total_uncorr ;
15091528
1510- if (pidIndex)
1511- acceptedTracks.pidtotal [pidIndex - 1 ] += 1 ;
1512- int ptBinIndex = fPtAxis ->FindBin (track.pt ()) - 1 ;
1513-
1514- if (!(ptBinIndex < 0 || ptBinIndex >= static_cast <int >(o2::analysis::gfw::ptbinning.size ()))) {
1515- acceptedTracks.nch [ptBinIndex] += 1.0 ;
1516- if (pidIndex == 1 )
1517- acceptedTracks.npi [ptBinIndex] += 1.0 ;
1518- if (pidIndex == 2 )
1519- acceptedTracks.nka [ptBinIndex] += 1.0 ;
1520- if (pidIndex == 3 )
1521- acceptedTracks.npr [ptBinIndex] += 1.0 ;
1529+ if (std::abs (track.eta ()) < cfgEtaNch) {
1530+ ++acceptedTracks.total ;
1531+ ++acceptedTracks.total_uncorr ;
1532+
1533+ if (pidIndex)
1534+ acceptedTracks.pidtotal [pidIndex - 1 ] += 1 ;
1535+ int ptBinIndex = fPtAxis ->FindBin (track.pt ()) - 1 ;
1536+
1537+ if (!(ptBinIndex < 0 || ptBinIndex >= static_cast <int >(o2::analysis::gfw::ptbinning.size ()))) {
1538+ acceptedTracks.nch [ptBinIndex] += 1.0 ;
1539+ if (pidIndex == 1 )
1540+ acceptedTracks.npi [ptBinIndex] += 1.0 ;
1541+ if (pidIndex == 2 )
1542+ acceptedTracks.nka [ptBinIndex] += 1.0 ;
1543+ if (pidIndex == 3 )
1544+ acceptedTracks.npr [ptBinIndex] += 1.0 ;
1545+ }
15221546 }
15231547
15241548 fillPtSums<kGen >(track, vtxz, pidIndex);
@@ -1532,32 +1556,37 @@ struct FlowGenericFramework {
15321556 // Select tracks with nominal cuts always
15331557 if (!nchSelected (track))
15341558 return ;
1535- acceptedTracks.total += getEfficiency (track);
1536- ++acceptedTracks.total_uncorr ;
1559+
1560+ if (std::abs (track.eta ()) < cfgEtaNch) {
1561+ acceptedTracks.total += getEfficiency (track, 0 );
1562+ ++acceptedTracks.total_uncorr ;
1563+ }
15371564
15381565 if (!trackSelected (track, field))
15391566 return ;
15401567 // int pidIndex = 0;
15411568 // if (cfgUsePID) Need PID for v02
15421569 int pidIndex = getNsigmaPID (track);
15431570
1544- if (pidIndex)
1545- acceptedTracks.pidtotal [pidIndex - 1 ] += getEfficiency (track);
1571+ if (std::abs (track.eta ()) < cfgEtaNch) {
1572+ if (pidIndex)
1573+ acceptedTracks.pidtotal [pidIndex - 1 ] += getEfficiency (track, pidIndex);
15461574
1547- if (pidIndex)
1548- acceptedTracks.pidtotal [pidIndex - 1 ] += getEfficiency (track);
1549- int ptBinIndex = fPtAxis ->FindBin (track.pt ()) - 1 ;
1575+ if (pidIndex)
1576+ acceptedTracks.pidtotal [pidIndex - 1 ] += getEfficiency (track);
1577+ int ptBinIndex = fPtAxis ->FindBin (track.pt ()) - 1 ;
15501578
1551- if (!(ptBinIndex < 0 || ptBinIndex >= static_cast <int >(o2::analysis::gfw::ptbinning.size ()))) {
1552- acceptedTracks.nch [ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency (track) : 1.0 ;
1553- if (pidIndex == 1 ) {
1554- acceptedTracks.npi [ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency (track) : 1.0 ;
1555- }
1556- if (pidIndex == 2 ) {
1557- acceptedTracks.nka [ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency (track) : 1.0 ;
1558- }
1559- if (pidIndex == 3 ) {
1560- acceptedTracks.npr [ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency (track) : 1.0 ;
1579+ if (!(ptBinIndex < 0 || ptBinIndex >= static_cast <int >(o2::analysis::gfw::ptbinning.size ()))) {
1580+ acceptedTracks.nch [ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency (track, 0 ) : 1.0 ;
1581+ if (pidIndex == 1 ) {
1582+ acceptedTracks.npi [ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency (track, pidIndex) : 1.0 ;
1583+ }
1584+ if (pidIndex == 2 ) {
1585+ acceptedTracks.nka [ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency (track, pidIndex) : 1.0 ;
1586+ }
1587+ if (pidIndex == 3 ) {
1588+ acceptedTracks.npr [ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency (track, pidIndex) : 1.0 ;
1589+ }
15611590 }
15621591 }
15631592
@@ -1779,27 +1808,31 @@ struct FlowGenericFramework {
17791808 bool withinPtNch = (track.pt () > ptmins[0 ] && track.pt () < ptmaxs[0 ]);
17801809 if (!withinPtPOI && !withinPtRef)
17811810 return ;
1811+ double weff = (dt == kGen ) ? 1 . : getEfficiency (track, pid_index);
1812+ double weffInclusive = (dt == kGen ) ? 1 . : getEfficiency (track, 0 );
1813+ if (weff < 0 )
1814+ return ;
17821815 double waccRef = (dt == kGen ) ? 1 . : getAcceptance (track, vtxz, 0 );
17831816 double waccPOI = (dt == kGen ) ? 1 . : withinPtPOI ? getAcceptance (track, vtxz, pid_index + 1 )
17841817 : getAcceptance (track, vtxz, 0 ); //
17851818 if (withinPtRef && withinPtPOI && pid_index)
17861819 waccRef = waccPOI; // if particle is both (then it's overlap), override ref with POI
17871820 if (withinPtRef)
1788- fGFW ->Fill (track.eta (), fPtAxis ->FindBin (track.pt ()) - 1 , track.phi (), waccRef, 1 );
1821+ fGFW ->Fill (track.eta (), fPtAxis ->FindBin (track.pt ()) - 1 , track.phi (), waccRef * weffInclusive , 1 );
17891822 if (withinPtPOI && pid_index)
1790- fGFW ->Fill (track.eta (), fPtAxis ->FindBin (track.pt ()) - 1 , track.phi (), waccPOI, (1 << (pid_index + 1 )));
1823+ fGFW ->Fill (track.eta (), fPtAxis ->FindBin (track.pt ()) - 1 , track.phi (), waccPOI * weff , (1 << (pid_index + 1 )));
17911824 if (withinPtNch)
1792- fGFW ->Fill (track.eta (), fPtAxis ->FindBin (track.pt ()) - 1 , track.phi (), waccPOI, 2 );
1825+ fGFW ->Fill (track.eta (), fPtAxis ->FindBin (track.pt ()) - 1 , track.phi (), waccPOI * weff * weffInclusive , 2 );
17931826 if (withinPtPOI && withinPtRef && pid_index)
1794- fGFW ->Fill (track.eta (), fPtAxis ->FindBin (track.pt ()) - 1 , track.phi (), waccPOI, (1 << (pid_index + 5 )));
1827+ fGFW ->Fill (track.eta (), fPtAxis ->FindBin (track.pt ()) - 1 , track.phi (), waccPOI * weff , (1 << (pid_index + 5 )));
17951828 if (withinPtNch && withinPtRef)
1796- fGFW ->Fill (track.eta (), fPtAxis ->FindBin (track.pt ()) - 1 , track.phi (), waccPOI, 32 );
1829+ fGFW ->Fill (track.eta (), fPtAxis ->FindBin (track.pt ()) - 1 , track.phi (), waccPOI * weff * weffInclusive , 32 );
17971830 } else { // Analysing only integrated flow
17981831 bool withinPtRef = (track.pt () > o2::analysis::gfw::ptreflow && track.pt () < o2::analysis::gfw::ptrefup);
17991832 bool withinPtPOI = (track.pt () > o2::analysis::gfw::ptpoilow && track.pt () < o2::analysis::gfw::ptpoiup);
18001833 if (!withinPtPOI && !withinPtRef)
18011834 return ;
1802- double weff = (dt == kGen ) ? 1 . : getEfficiency (track);
1835+ double weff = (dt == kGen ) ? 1 . : getEfficiency (track, 0 );
18031836 if (weff < 0 )
18041837 return ;
18051838 if (cfgUseDensityDependentCorrection && withinPtRef && dt != kGen ) {
0 commit comments