diff --git a/PWGCF/Tasks/dptdptcorrelations.cxx b/PWGCF/Tasks/dptdptcorrelations.cxx index cd481c0a877..8a0fba9a8e5 100644 --- a/PWGCF/Tasks/dptdptcorrelations.cxx +++ b/PWGCF/Tasks/dptdptcorrelations.cxx @@ -67,6 +67,8 @@ bool ptorder = false; PairCuts fPairCuts; // pair suppression engine bool fUseConversionCuts = false; // suppress resonances and conversions bool fUseTwoTrackCut = false; // suppress too close tracks + +std::vector tname = {"O", "T"}; ///< the track names } // namespace correlationstask // Task for building correlations @@ -108,17 +110,6 @@ struct DptDptCorrelationsTask { std::vector> fhSum2PtPtnw_vsC{nch, {nch, nullptr}}; //!> fhSum2DptDptnw_vsC{nch, {nch, nullptr}}; //!) ({p_T}_2 - <{p_T}_2>) \f$ distribution vs \f$\Delta\eta,\;\Delta\phi\f$ distribution vs event centrality/multiplicity 1-1,1-2,2-1,2-2, combinations - /// \enum TrackPairs - /// \brief The track combinations hadled by the class - typedef enum { - kOO = 0, ///< one-one pairs - kOT, ///< one-two pairs - kTO, ///< two-one pairs - kTT, ///< two-two pairs - nTrackPairs ///< the number of track pairs - } trackpairs; - - std::vector tname = {"O", "T"}; ///< the external track names, one and two, for histogram creation std::vector> trackPairsNames = {{"OO", "OT"}, {"TO", "TT"}}; bool ccdbstored = false; @@ -916,40 +907,38 @@ struct DptDptCorrelationsTask { if (!(ixDCE < 0)) { if (ccdblst != nullptr && !(dataCEME[ixDCE]->isCCDBstored())) { if constexpr (gen) { - dataCEME[ixDCE]->storePtAverages( - std::vector{reinterpret_cast(ccdblst->FindObject( - TString::Format("trueptavgetaphi_%02d-%02d_p", - static_cast(fCentMultMin[ixDCE]), - static_cast(fCentMultMax[ixDCE])) - .Data())), - reinterpret_cast(ccdblst->FindObject( - TString::Format("trueptavgetaphi_%02d-%02d_m", - static_cast(fCentMultMin[ixDCE]), - static_cast(fCentMultMax[ixDCE])) - .Data()))}); + std::vector ptavgs{tname.size(), nullptr}; + for (auto sp : tname) { + ptavgs.push_back(reinterpret_cast(ccdblst->FindObject( + TString::Format("trueptavgetaphi_%02d-%02d_%s", + static_cast(fCentMultMin[ixDCE]), + static_cast(fCentMultMax[ixDCE]), + sp.c_str()) + .Data()))); + } + dataCEME[ixDCE]->storePtAverages(ptavgs); } else { - dataCEME[ixDCE]->storeTrackCorrections( - std::vector{reinterpret_cast(ccdblst->FindObject( - TString::Format("correction_%02d-%02d_p1", - static_cast(fCentMultMin[ixDCE]), - static_cast(fCentMultMax[ixDCE])) - .Data())), - reinterpret_cast(ccdblst->FindObject( - TString::Format("correction_%02d-%02d_m1", - static_cast(fCentMultMin[ixDCE]), - static_cast(fCentMultMax[ixDCE])) - .Data()))}); - dataCEME[ixDCE]->storePtAverages( - std::vector{reinterpret_cast(ccdblst->FindObject( - TString::Format("ptavgetaphi_%02d-%02d_p", - static_cast(fCentMultMin[ixDCE]), - static_cast(fCentMultMax[ixDCE])) - .Data())), - reinterpret_cast(ccdblst->FindObject( - TString::Format("ptavgetaphi_%02d-%02d_m", - static_cast(fCentMultMin[ixDCE]), - static_cast(fCentMultMax[ixDCE])) - .Data()))}); + std::vector corrs{tname.size(), nullptr}; + for (auto sp : tname) { + corrs.push_back(reinterpret_cast(ccdblst->FindObject( + TString::Format("correction_%02d-%02d_%s", + static_cast(fCentMultMin[ixDCE]), + static_cast(fCentMultMax[ixDCE]), + sp.c_str()) + .Data()))); + } + dataCEME[ixDCE]->storeTrackCorrections(corrs); + + std::vector ptavgs{tname.size(), nullptr}; + for (auto sp : tname) { + ptavgs.push_back(reinterpret_cast(ccdblst->FindObject( + TString::Format("ptavgetaphi_%02d-%02d_%s", + static_cast(fCentMultMin[ixDCE]), + static_cast(fCentMultMax[ixDCE]), + sp.c_str()) + .Data()))); + } + dataCEME[ixDCE]->storePtAverages(ptavgs); } }