diff --git a/Common/Core/FFitWeights.cxx b/Common/Core/FFitWeights.cxx index bc2623e7be9..45136149827 100644 --- a/Common/Core/FFitWeights.cxx +++ b/Common/Core/FFitWeights.cxx @@ -16,9 +16,10 @@ #include "FFitWeights.h" +#include "Framework/Logger.h" + #include #include -#include #include #include #include @@ -35,18 +36,26 @@ ClassImp(FFitWeights) FFitWeights::FFitWeights() : TNamed("", ""), fW_data{nullptr}, - CentBin{100}, + ptProfCent{nullptr}, + h2ptCent{nullptr}, + centBin{100}, qAxis{nullptr}, nResolution{3000}, + ptBin{100}, + ptAxis{nullptr}, qnTYPE{0} { } FFitWeights::FFitWeights(const char* name) : TNamed(name, name), fW_data{nullptr}, - CentBin{100}, + ptProfCent{nullptr}, + h2ptCent{nullptr}, + centBin{100}, qAxis{nullptr}, nResolution{3000}, + ptBin{100}, + ptAxis{nullptr}, qnTYPE{0} {} FFitWeights::~FFitWeights() @@ -54,6 +63,8 @@ FFitWeights::~FFitWeights() delete fW_data; if (qAxis) delete qAxis; + if (ptAxis) + delete ptAxis; }; void FFitWeights::init() @@ -65,8 +76,16 @@ void FFitWeights::init() if (!qAxis) this->setBinAxis(500, 0, 25); for (const auto& qn : qnTYPE) { - fW_data->Add(new TH2D(this->getQName(qn.first, qn.second.c_str()), this->getAxisName(qn.first, qn.second.c_str()), CentBin, 0, CentBin, qAxis->GetNbins(), qAxis->GetXmin(), qAxis->GetXmax())); + fW_data->Add(new TH2D(this->getQName(qn.first, qn.second.c_str()), this->getAxisName(qn.first, qn.second.c_str()), centBin, 0, centBin, qAxis->GetNbins(), qAxis->GetXmin(), qAxis->GetXmax())); } + + if (!ptAxis) + this->setPtAxis(3000, -3, 3); + fW_data->Add(new TProfile("pMeanPt", "", centBin, 0, centBin)); + fW_data->Add(new TH2D("hPtWeight", "", centBin, 0, centBin, ptBin, ptAxis->GetXmin(), ptAxis->GetXmax())); + + ptProfCent = reinterpret_cast(fW_data->FindObject("pMeanPt")); + h2ptCent = reinterpret_cast(fW_data->FindObject("hPtWeight")); }; void FFitWeights::fillWeights(float centrality, float qn, int nh, const char* pf) @@ -79,12 +98,28 @@ void FFitWeights::fillWeights(float centrality, float qn, int nh, const char* pf TH2D* th2 = reinterpret_cast(tar->FindObject(this->getQName(nh, pf))); if (!th2) { - tar->Add(new TH2D(this->getQName(nh, pf), this->getAxisName(nh, pf), CentBin, 0, CentBin, qAxis->GetNbins(), qAxis->GetXmin(), qAxis->GetXmax())); + tar->Add(new TH2D(this->getQName(nh, pf), this->getAxisName(nh, pf), centBin, 0, centBin, qAxis->GetNbins(), qAxis->GetXmin(), qAxis->GetXmax())); th2 = reinterpret_cast(tar->At(tar->GetEntries() - 1)); } th2->Fill(centrality, qn); }; +void FFitWeights::fillPt(float centrality, float pt, bool first) +{ + if (first) { + ptProfCent->Fill(centrality, pt); + } else { + h2ptCent->Fill(centrality, pt); + } +}; +float FFitWeights::getPtMult(float centrality) +{ + if (!ptProfCent) { + ptProfCent = reinterpret_cast(fW_data->FindObject("pMeanPt")); + } + return ptProfCent->GetBinContent(ptProfCent->FindBin(centrality)); +}; + Long64_t FFitWeights::Merge(TCollection* collist) { Long64_t nmerged = 0; @@ -93,32 +128,63 @@ Long64_t FFitWeights::Merge(TCollection* collist) fW_data->SetName("FFitWeights_Data"); fW_data->SetOwner(kTRUE); } - FFitWeights* l_w = 0; - TIter all_w(collist); - while ((l_w = (reinterpret_cast(all_w())))) { - addArray(fW_data, l_w->getDataArray()); + FFitWeights* lW = 0; + TIter allW(collist); + while ((lW = (reinterpret_cast(allW())))) { + addArray(fW_data, lW->getDataArray()); nmerged++; } return nmerged; }; void FFitWeights::addArray(TObjArray* targ, TObjArray* sour) { - if (!sour) { - printf("Source array does not exist!\n"); + if (!sour) return; - } + for (int i = 0; i < sour->GetEntries(); i++) { - TH2D* sourh = reinterpret_cast(sour->At(i)); - TH2D* targh = reinterpret_cast(targ->FindObject(sourh->GetName())); - if (!targh) { - targh = reinterpret_cast(sourh->Clone(sourh->GetName())); - targh->SetDirectory(0); - targ->Add(targh); - } else { - targh->Add(sourh); + auto* obj = sour->At(i); + if (!obj) + continue; + + auto* tObj = targ->FindObject(obj->GetName()); + if (!tObj) { + auto* clone = static_cast(obj->Clone(obj->GetName())); + if (auto* h = dynamic_cast(clone)) + h->SetDirectory(0); + targ->Add(clone); + } else if (auto* h1 = dynamic_cast(tObj)) { + if (auto* h2 = dynamic_cast(obj)) + h1->Add(h2); } } -}; +} + +void FFitWeights::mptSel() +{ + TObjArray* tar{nullptr}; + tar = fW_data; + if (!tar) + return; + + TH2D* th2 = reinterpret_cast(tar->FindObject("hPtWeight")); + if (!th2) { + return; + } + + TH1D* tmp{nullptr}; + TGraph* tmpgr{nullptr}; + for (int iSP{0}; iSP < NumberSp; iSP++) { + tmp = th2->ProjectionY(Form("mpt_%i_%i", iSP, iSP + 1), iSP + 1, iSP + 1); + std::vector xq(nResolution); + std::vector yq(nResolution); + for (int i{0}; i < nResolution; i++) + xq[i] = static_cast(i + 1) / static_cast(nResolution); + tmp->GetQuantiles(nResolution, yq.data(), xq.data()); + tmpgr = new TGraph(nResolution, yq.data(), xq.data()); + tmpgr->SetName(Form("sp_mpt_%i", iSP)); + fW_data->Add(tmpgr); + } +} void FFitWeights::qSelection(const std::vector& nhv, const std::vector& stv) /* only execute OFFLINE */ { @@ -132,14 +198,14 @@ void FFitWeights::qSelection(const std::vector& nhv, const std::vector(tar->FindObject(this->getQName(nh, pf.c_str())))}; if (!th2) { - printf("qh not found!\n"); + LOGF(info, "FFitWeights qh not found!"); return; } TH1D* tmp{nullptr}; TGraph* tmpgr{nullptr}; // TSpline3* spline = nullptr; - for (int iSP{0}; iSP < 90; iSP++) { + for (int iSP{0}; iSP < NumberSp; iSP++) { tmp = th2->ProjectionY(Form("q%i_%i_%i", nh, iSP, iSP + 1), iSP + 1, iSP + 1); std::vector xq(nResolution); std::vector yq(nResolution); @@ -148,37 +214,36 @@ void FFitWeights::qSelection(const std::vector& nhv, const std::vectorGetQuantiles(nResolution, yq.data(), xq.data()); tmpgr = new TGraph(nResolution, yq.data(), xq.data()); tmpgr->SetName(Form("sp_q%i%s_%i", nh, pf.c_str(), iSP)); - // spline = new TSpline3(Form("sp_q%i%s_%i", nh, pf.c_str(), iSP), tmpgr); - // spline->SetName(Form("sp_q%i%s_%i", nh, pf.c_str(), iSP)); fW_data->Add(tmpgr); } } } }; - -float FFitWeights::eval(float centr, const float& dqn, const int nh, const char* pf) +float FFitWeights::internalEval(float centr, const float& val, const char* name) { - TObjArray* tar{nullptr}; - - tar = fW_data; - if (!tar) + if (!fW_data) { return -1; - - int isp{static_cast(centr)}; - if (isp < 0 || isp > 90) { + } + int isp = static_cast(centr); + if (isp < 0 || isp > NumberSp) { return -1; } - TGraph* spline{nullptr}; - spline = reinterpret_cast(tar->FindObject(Form("sp_q%i%s_%i", nh, pf, isp))); + auto* spline = dynamic_cast(fW_data->FindObject(Form(name, isp))); if (!spline) { return -1; } - float qn_val{static_cast(100. * spline->Eval(dqn))}; - if (qn_val < 0 || qn_val > 100.05) { - return -1; - } + float perc = 100.f * spline->Eval(val); + return (perc < 0 || perc > MaxTol) ? -1 : perc; +}; - return qn_val; +float FFitWeights::eval(float centr, const float& dqn, int nh, const char* pf) +{ + return internalEval(centr, dqn, Form("sp_q%i%s_%%i", nh, pf)); +}; + +float FFitWeights::evalPt(float centr, const float& mpt) +{ + return internalEval(centr, mpt, "sp_mpt_%i"); }; diff --git a/Common/Core/FFitWeights.h b/Common/Core/FFitWeights.h index 155fd9af97f..992c6af3d4d 100644 --- a/Common/Core/FFitWeights.h +++ b/Common/Core/FFitWeights.h @@ -19,8 +19,10 @@ #include #include +#include #include #include +#include #include #include @@ -39,28 +41,44 @@ class FFitWeights : public TNamed void init(); void fillWeights(float centrality, float qn, int nh, const char* pf = ""); + void fillPt(float centrality, float pt, bool first); + float getPtMult(float centrality); TObjArray* getDataArray() { return fW_data; } - void setCentBin(int bin) { CentBin = bin; } + void setCentBin(int bin) { centBin = bin; } void setBinAxis(int bin, float min, float max) { qAxis = new TAxis(bin, min, max); } TAxis* getqVecAx() { return qAxis; } + void setPtBin(int bin) { ptBin = bin; } + void setPtAxis(int bin, float min, float max) + { + ptAxis = new TAxis(bin, min, max); + } + TAxis* getPtAx() { return ptAxis; } + Long64_t Merge(TCollection* collist); void qSelection(const std::vector& nhv, const std::vector& stv); float eval(float centr, const float& dqn, const int nh, const char* pf = ""); + float evalPt(float centr, const float& mpt); void setResolution(int res) { nResolution = res; } int getResolution() const { return nResolution; } void setQnType(const std::vector>& qninp) { qnTYPE = qninp; } + void mptSel(); + private: TObjArray* fW_data; + TProfile* ptProfCent; //! + TH2D* h2ptCent; //! - int CentBin; + int centBin; TAxis* qAxis; //! int nResolution; + int ptBin; + TAxis* ptAxis; //! std::vector> qnTYPE; @@ -74,6 +92,11 @@ class FFitWeights : public TNamed }; void addArray(TObjArray* targ, TObjArray* sour); + static constexpr int NumberSp = 90; + static constexpr float MaxTol = 100.05; + + float internalEval(float centr, const float& val, const char* name); + ClassDef(FFitWeights, 1); // calibration class }; #endif // COMMON_CORE_FFITWEIGHTS_H_ diff --git a/Common/DataModel/EseTable.h b/Common/DataModel/EseTable.h index 8463848312f..d78c783e12a 100644 --- a/Common/DataModel/EseTable.h +++ b/Common/DataModel/EseTable.h @@ -9,9 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// q vector framework with ESE (20/08/2024) -// -/// \author Joachim Hansen +/// \file EseTable.h +/// \brief ESE Framework (20/08/2024) +/// \author Joachim C. K. B. Hansen, Lund University, joachim.hansen@cern.ch + // #ifndef COMMON_DATAMODEL_ESETABLE_H_ @@ -46,6 +47,16 @@ using QPercentileTPCall = QPercentileTPCalls::iterator; using QPercentileTPCneg = QPercentileTPCnegs::iterator; using QPercentileTPCpos = QPercentileTPCposs::iterator; +namespace meanptshape +{ +DECLARE_SOA_COLUMN(FMEANPT, fMEANPT, std::vector); +DECLARE_SOA_COLUMN(FMEANPTSHAPE, fMEANPTSHAPE, std::vector); +} // namespace meanptshape +DECLARE_SOA_TABLE(MeanPts, "AOD", "MEANPT", meanptshape::FMEANPT); +DECLARE_SOA_TABLE(MeanPtShapes, "AOD", "MEANPTSHAPE", meanptshape::FMEANPTSHAPE); +using MeanPt = MeanPts::iterator; +using MeanPtShape = MeanPtShapes::iterator; + } // namespace o2::aod #endif // COMMON_DATAMODEL_ESETABLE_H_ diff --git a/Common/TableProducer/eseTableProducer.cxx b/Common/TableProducer/eseTableProducer.cxx index 877815873e8..c37279d43b4 100644 --- a/Common/TableProducer/eseTableProducer.cxx +++ b/Common/TableProducer/eseTableProducer.cxx @@ -16,11 +16,13 @@ #include "FFitWeights.h" +#include "Common/Core/TrackSelection.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EseTable.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Qvectors.h" +#include "Common/DataModel/TrackSelectionTables.h" #include #include @@ -58,10 +60,14 @@ struct EseTableProducer { Produces qPercsTPCneg; Produces qPercsTPCpos; - OutputObj FFitObj{FFitWeights("weights")}; + Produces meanPts; + Produces meanPtShapes; + + OutputObj weightsFFit{FFitWeights("weights")}; HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; Configurable cfgESE{"cfgESE", 1, "ese activation step: false = no ese, true = evaluate qSelection and fill table"}; + Configurable cfgMeanPt{"cfgMeanPt", 0, "lvl, 0: First profile, 1: Second profile, 2: fill table"}; Configurable cfgEsePath{"cfgEsePath", "Users/j/joachiha/ESE/local/ffitsplines", "CCDB path for ese splines"}; Configurable> cfgDetectors{"cfgDetectors", {"FT0C"}, "detectors to loop over: ['FT0C', 'FT0A', 'FV0A', 'TPCall', 'TPCneg', 'TPCpos']"}; Configurable> cfgLoopHarmonics{"cfgLoopHarmonics", {2, 3}, "Harmonics to loop over when filling and evaluating q-Selection"}; @@ -74,6 +80,10 @@ struct EseTableProducer { int runNumber{-1}; + static constexpr float ThresholdAmplitude{1e-8f}; + static constexpr int Step1{1}; + static constexpr int Step2{2}; + enum class DetID { FT0C, FT0A, FT0M, @@ -91,10 +101,24 @@ struct EseTableProducer { {"TPCneg", DetID::TPCneg}, {"TPCall", DetID::TPCall}}; - FFitWeights* qSelection{nullptr}; + FFitWeights* eventShape{nullptr}; Service ccdb; + Configurable cfgVtxZ{"cfgVtxZ", 10.0f, "max z vertex position"}; + Configurable cfgEta{"cfgEta", 0.8f, "max eta"}; + Configurable cfgPtmin{"cfgPtmin", 0.2f, "min pt"}; + Configurable cfgPtmax{"cfgPtmax", 5.0f, "max pt"}; + Configurable cfgChi2PrITSCls{"cfgChi2PrITSCls", 4.0f, "max chi2 per ITS cluster"}; + Configurable cfgChi2PrTPCCls{"cfgChi2PrTPCCls", 2.5f, "max chi2 per TPC cluster"}; + Configurable cfgDCAz{"cfgDCAz", 2.0f, "max DCAz cut"}; + + // o2::framework::expressions::Filter collisionFilter = nabs(aod::collision::posZ) < cfgVtxZ; + o2::framework::expressions::Filter trackFilter = nabs(aod::track::eta) < cfgEta && aod::track::pt > cfgPtmin&& aod::track::pt < cfgPtmax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == static_cast(true))) && (aod::track::itsChi2NCl < cfgChi2PrITSCls) && (aod::track::tpcChi2NCl < cfgChi2PrTPCCls) && nabs(aod::track::dcaZ) < cfgDCAz; + + Preslice perCollision = aod::track::collisionId; + using GFWTracks = soa::Filtered>; + void init(o2::framework::InitContext&) { @@ -102,6 +126,7 @@ struct EseTableProducer { registry.add("hEventCounter", "event status;event status;entries", {HistType::kTH1F, {{4, 0.0, 4.0}}}); registry.add("hESEstat", "ese status;ese status;entries", {HistType::kTH1F, {{4, 0.0, 4.0}}}); + registry.add("hMeanPtStat", "", {HistType::kTH1F, {{4, 0.0, 4.0}}}); ccdb->setURL("http://alice-ccdb.cern.ch"); ccdb->setCaching(true); @@ -116,10 +141,10 @@ struct EseTableProducer { veccfg.push_back({cfgLoopHarmonics->at(i), cfgDetectors->at(j)}); } } - FFitObj->setBinAxis(cfgaxisqn->at(0), cfgaxisqn->at(1), cfgaxisqn->at(2)); - FFitObj->setResolution(cfgnResolution); - FFitObj->setQnType(veccfg); - FFitObj->init(); + weightsFFit->setBinAxis(cfgaxisqn->at(0), cfgaxisqn->at(1), cfgaxisqn->at(2)); + weightsFFit->setResolution(cfgnResolution); + weightsFFit->setQnType(veccfg); + weightsFFit->init(); } void initCCDB(aod::BCsWithTimestamps::iterator const& bc) @@ -128,20 +153,20 @@ struct EseTableProducer { auto timestamp = bc.timestamp(); if (cfgESE) { - qSelection = ccdb->getForTimeStamp(cfgEsePath, timestamp); - if (!qSelection) + eventShape = ccdb->getForTimeStamp(cfgEsePath, timestamp); + if (!eventShape) LOGF(fatal, "failed loading qSelection with ese flag"); LOGF(info, "successfully loaded qSelection"); } } - float Calcqn(const float& Qx, const float& Qy, const float& Mult) + float calcRedqn(const float& Qx, const float& Qy, const float& Mult) { float dqn{0.0f}; float qn{0.0f}; dqn = Qx * Qx + Qy * Qy; - qn = TMath::Sqrt(dqn) / TMath::Sqrt(Mult); + qn = std::sqrt(dqn) / std::sqrt(Mult); return qn; } @@ -168,11 +193,11 @@ struct EseTableProducer { void doSpline(float& splineVal, const float& centr, const float& nHarm, const char* pf, const auto& QX, const auto& QY, const auto& sumAmpl) { - if (sumAmpl > 1e-8) { - float qnval = Calcqn(QX * sumAmpl, QY * sumAmpl, sumAmpl); - FFitObj->fillWeights(centr, qnval, nHarm, pf); + if (sumAmpl > ThresholdAmplitude) { + float qnval = calcRedqn(QX * sumAmpl, QY * sumAmpl, sumAmpl); + weightsFFit->fillWeights(centr, qnval, nHarm, pf); if (cfgESE) { - splineVal = qSelection->eval(centr, qnval, nHarm, pf); + splineVal = eventShape->eval(centr, qnval, nHarm, pf); } } } @@ -182,10 +207,10 @@ struct EseTableProducer { { const int detId = detIDN(id); const int detInd{detId * 4 + cfgnTotalSystem * 4 * (nHarm - 2)}; - const auto Qx{col.qvecRe()[detInd + cfgnCorrLevel]}; - const auto Qy{col.qvecIm()[detInd + cfgnCorrLevel]}; + const auto fQx{col.qvecRe()[detInd + cfgnCorrLevel]}; + const auto fQy{col.qvecIm()[detInd + cfgnCorrLevel]}; const auto sumAmpl{col.qvecAmp()[detId]}; - return {Qx, Qy, sumAmpl}; + return {fQx, fQy, sumAmpl}; } template @@ -230,6 +255,20 @@ struct EseTableProducer { } }; + template + double calculateMeanPt(TTracks const& tracks, Cent const& centrality) + { + std::vector meanPtEvent; + for (const auto& track : tracks) { + meanPtEvent.push_back(track.pt()); + weightsFFit->fillPt(centrality, track.pt(), true); + } + if (meanPtEvent.empty()) + return 0.0; + auto mean = std::accumulate(meanPtEvent.begin(), meanPtEvent.end(), 0.0) / meanPtEvent.size(); + return mean; + } + void processESE(CollWithMults::iterator const& collision, aod::BCsWithTimestamps const&, aod::FV0As const&, aod::FT0s const&) { float counter{0.5}; @@ -259,6 +298,46 @@ struct EseTableProducer { qPercsTPCpos(qnpTPCpos); registry.fill(HIST("hEventCounter"), counter++); } - PROCESS_SWITCH(EseTableProducer, processESE, "proccess q vectors to calculate reduced q-vector", true); + PROCESS_SWITCH(EseTableProducer, processESE, "process q vectors to calculate reduced q-vector", true); + + void processMeanPt(soa::Join::iterator const& collision, aod::BCsWithTimestamps const&, GFWTracks const& tracks) + { + + std::vector meanPt{-1}; + std::vector meanPtShape{-1}; + if (collision.posZ() < -cfgVtxZ || collision.posZ() > cfgVtxZ) { + meanPts(meanPt); + meanPtShapes(meanPtShape); + return; + } + + registry.fill(HIST("hMeanPtStat"), 0.5); + const auto centrality = collision.centFT0C(); + const auto mean = calculateMeanPt(tracks, centrality); + + if (cfgMeanPt == 0) { + registry.fill(HIST("hMeanPtStat"), 1.5); + } else { + const auto avgpt = eventShape->getPtMult(centrality); + if (mean == 0.0) { + registry.fill(HIST("hMeanPtStat"), cfgMeanPt == Step1 ? 2.5 : 3.5); + } else { + const auto binval = (mean - avgpt) / avgpt; + weightsFFit->fillPt(centrality, binval, false); + meanPt[0] = binval; + if (cfgMeanPt == Step1) { + registry.fill(HIST("hMeanPtStat"), 2.5); + } else if (cfgMeanPt == Step2) { + registry.fill(HIST("hMeanPtStat"), 3.5); + const auto value = eventShape->evalPt(centrality, binval); + meanPtShape[0] = value; + } + } + } + + meanPts(meanPt); + meanPtShapes(meanPtShape); + } + PROCESS_SWITCH(EseTableProducer, processMeanPt, "process mean pt selection", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } diff --git a/PWGCF/Flow/Tasks/flowGfwEse.cxx b/PWGCF/Flow/Tasks/flowGfwEse.cxx index fc4e06240f1..633fb6ff332 100644 --- a/PWGCF/Flow/Tasks/flowGfwEse.cxx +++ b/PWGCF/Flow/Tasks/flowGfwEse.cxx @@ -240,6 +240,9 @@ struct FlowGfwEse { int density; DensityCorr() : psi2Est(0.), psi3Est(0.), psi4Est(0.), v2(0.), v3(0.), v4(0.), density(0) {} }; + + O2_DEFINE_CONFIGURABLE(cfgAnalysisType, bool, true, "true for ese, false for mean-pT"); + const std::string shapesel = cfgAnalysisType ? "ese" : "mpt"; static constexpr int EseBins = 100; // region indices for consistency flag @@ -367,6 +370,12 @@ struct FlowGfwEse { int ptbins = o2::analysis::gfwflowese::ptbinning.size() - 1; fSecondAxis = (cfgTimeDependent) ? new TAxis(timeAxis.binEdges.size() - 1, &(timeAxis.binEdges[0])) : new TAxis(ptbins, &o2::analysis::gfwflowese::ptbinning[0]); + if (doprocessMptq2) { + registry.add("mptcorr/eventcounter", "", HistType::kTH1F, {{3, 0, 3}}); + registry.add("mptcorr/h3_cent_q2_meanptperc", ";Centrality;#it{q}_{2};mean-#it{p}_{T}", HistType::kTH3D, {{100, 0, 100}, {100, 0, 100}, {100, 0, 100}}); + registry.add("mptcorr/h3_cent_q2_mptvalue", ";Centrality;#it{q}_{2};mean-#it{p}_{T}", HistType::kTH3D, {{100, 0, 100}, {100, 0, 100}, {200, -1, 1}}); + } + if (doprocessData) { registry.add("trackQA/before/phi_eta_vtxZ", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); registry.add("trackQA/before/pt_dcaXY_dcaZ", "", {HistType::kTH3D, {ptAxis, dcaXYAXis, dcaZAXis}}); @@ -541,12 +550,12 @@ struct FlowGfwEse { for (int jese = 0; jese < EseBins; ++jese) { if (it->pTDif) { for (int i = 0; i < fSecondAxis->GetNbins(); ++i) { - std::string name = Form("ese_%d_%s_pt_%d", jese, it->Head.c_str(), i + 1); + std::string name = Form("%s_%d_%s_pt_%d", shapesel.c_str(), jese, it->Head.c_str(), i + 1); std::string title = it->Head + std::string("_ptDiff"); oba->Add(new TNamed(name.c_str(), title.c_str())); } } else { - std::string name = Form("ese_%d_%s", jese, it->Head.c_str()); + std::string name = Form("%s_%d_%s", shapesel.c_str(), jese, it->Head.c_str()); std::string title = it->Head + std::string("_ese"); oba->Add(new TNamed(name.c_str(), title.c_str())); } @@ -773,12 +782,12 @@ struct FlowGfwEse { } template - void fillOutputContainers(const float& centmult, const double& rndm, const int& run = 0, const float& qPerc = -1.0f) + void fillOutputContainers(const float& centmult, const double& rndm, const int& run = 0, const float& fPerc = -1.0f) { (dt == kGen) ? fFCptgen->calculateCorrelations() : fFCpt->calculateCorrelations(); (dt == kGen) ? fFCptgen->fillPtProfiles(centmult, rndm) : fFCpt->fillPtProfiles(centmult, rndm); (dt == kGen) ? fFCptgen->fillCMProfiles(centmult, rndm) : fFCpt->fillCMProfiles(centmult, rndm); - int qPtmp = static_cast(qPerc); + int qPtmp = static_cast(fPerc); for (uint l_ind = 0; l_ind < corrconfigs.size(); ++l_ind) { if (!corrconfigs.at(l_ind).pTDif) { auto dnx = fGFW->Calculate(corrconfigs.at(l_ind), 0, kTRUE).real(); @@ -786,7 +795,7 @@ struct FlowGfwEse { continue; auto val = fGFW->Calculate(corrconfigs.at(l_ind), 0, kFALSE).real() / dnx; if (std::abs(val) < 1) { - (dt == kGen) ? fFCgen->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm) : fFC->FillProfile(Form("ese_%i_%s", qPtmp, corrconfigs.at(l_ind).Head.c_str()), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm); + (dt == kGen) ? fFCgen->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm) : fFC->FillProfile(Form("%s_%i_%s", shapesel.c_str(), qPtmp, corrconfigs.at(l_ind).Head.c_str()), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm); (dt == kGen) ? fFCptgen->fillVnPtProfiles(centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm, o2::analysis::gfwflowese::configs.GetpTCorrMasks()[l_ind]) : fFCpt->fillVnPtProfiles(centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm, o2::analysis::gfwflowese::configs.GetpTCorrMasks()[l_ind]); if (cfgRunByRun && cfgFillFlowRunByRun && dt != kGen && l_ind == 0) { tpfsList[run][pfCorr22]->Fill(centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0); @@ -800,7 +809,7 @@ struct FlowGfwEse { continue; auto val = fGFW->Calculate(corrconfigs.at(l_ind), i - 1, kFALSE).real() / dnx; if (std::abs(val) < 1) - (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm) : fFC->FillProfile(Form("ese_%i_%s_pt_%i", qPtmp, corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm); + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm) : fFC->FillProfile(Form("%s_%i_%s_pt_%i", shapesel.c_str(), qPtmp, corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm); // (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, (cfgUseMultiplicityFlowWeights) ? dnx : 1.0, rndm); } } @@ -898,11 +907,11 @@ struct FlowGfwEse { if (acceptedTracks.nPos < 2 || acceptedTracks.nMid < 2 || acceptedTracks.nNeg < 2) // o2-linter: disable=magic-number (at least two tracks in all three subevents) return; } - const auto qPerc{collision.qPERCFT0C()}; + const auto fPerc = cfgAnalysisType ? collision.qPERCFT0C() : collision.fMEANPTSHAPE(); if (!cfgFillWeights) fillOutputContainers
((cfgTimeDependent) ? xaxis.time : (cfgUseNch) ? xaxis.multiplicity : xaxis.centrality, - lRandom, run, qPerc[0]); + lRandom, run, fPerc[0]); } bool isStable(int pdg) @@ -1134,7 +1143,7 @@ struct FlowGfwEse { return static_cast(diff) / 3600000.0; } - void processData(soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, GFWTracks const& tracks) + void processData(soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, GFWTracks const& tracks) { auto bc = collision.bc_as(); int run = bc.runNumber(); @@ -1168,8 +1177,8 @@ struct FlowGfwEse { if (occupancy < 0 || occupancy > cfgOccupancySelection) return; } - const auto qPerc{collision.qPERCFT0C()}; - if (qPerc[0] < 0) + const auto fPerc = cfgAnalysisType ? collision.qPERCFT0C() : collision.fMEANPTSHAPE(); + if (fPerc[0] < 0) return; registry.fill(HIST("eventQA/eventSel"), kOccupancy); if (cfgRunByRun) @@ -1190,6 +1199,24 @@ struct FlowGfwEse { processCollision(collision, tracks, xaxis, run); } PROCESS_SWITCH(FlowGfwEse, processData, "Process analysis for non-derived data", true); + + // void processMptq2(soa::Filtered::iterator const& collision, aod::BCsWithTimestamps const&, GFWTracks const& tracks) + + void processMptq2(soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const& /*, GFWTracks const& tracks*/) + { + float count{0.5}; + registry.fill(HIST("mptcorr/eventcounter"), count++); + const auto centr = collision.centFT0C(); + const auto qPerc = collision.qPERCFT0C(); + const auto mPt = collision.fMEANPTSHAPE(); + const auto mPtv = collision.fMEANPT(); + if (qPerc[0] < 0 || mPt[0] < 0) + return; + registry.fill(HIST("mptcorr/eventcounter"), count++); + registry.fill(HIST("mptcorr/h3_cent_q2_meanptperc"), centr, qPerc[0], mPt[0]); + registry.fill(HIST("mptcorr/h3_cent_q2_mptvalue"), centr, qPerc[0], mPtv[0]); + } + PROCESS_SWITCH(FlowGfwEse, processMptq2, "Process analysis for mpt-q2 correlation", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)