From c70d5572be5c3bcebdc2b32eff4090dcdcbe2598 Mon Sep 17 00:00:00 2001 From: Emil Gorm Nielsen Date: Thu, 20 Feb 2025 14:09:42 +0100 Subject: [PATCH 1/7] move to TH3D in registry for weight filling --- .../Tasks/flowGenericFramework.cxx | 247 ++++++++++++------ 1 file changed, 168 insertions(+), 79 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index 632dff15c85..f0acabc8bc3 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -86,7 +86,7 @@ struct FlowGenericFramework { O2_DEFINE_CONFIGURABLE(cfgMpar, int, 8, "Highest order of pt-pt correlations") O2_DEFINE_CONFIGURABLE(cfgUseNch, bool, false, "Do correlations as function of Nch") O2_DEFINE_CONFIGURABLE(cfgFillWeights, bool, false, "Fill NUA weights") - O2_DEFINE_CONFIGURABLE(cfgRunByRunWeights, bool, false, "Use run by run NUA corrections") + O2_DEFINE_CONFIGURABLE(cfgRunByRun, bool, false, "Fill histograms on a run-by-run basis") O2_DEFINE_CONFIGURABLE(cfgFillQA, bool, false, "Fill QA histograms") O2_DEFINE_CONFIGURABLE(cfgUseAdditionalEventCut, bool, false, "Use additional event cut on mult correlations") O2_DEFINE_CONFIGURABLE(cfgUseAdditionalTrackCut, bool, false, "Use additional track cut on phi") @@ -113,6 +113,8 @@ struct FlowGenericFramework { O2_DEFINE_CONFIGURABLE(cfgTVXinTRD, bool, true, "Use kTVXinTRD (reject TRD triggered events)"); O2_DEFINE_CONFIGURABLE(cfgIsVertexITSTPC, bool, true, "Selects collisions with at least one ITS-TPC track"); O2_DEFINE_CONFIGURABLE(cfgMagField, float, 99999, "Configurable magnetic field; default CCDB will be queried"); + O2_DEFINE_CONFIGURABLE(cfgTofPtCut, float, 1.0, "pt cut on TOF for PID"); + Configurable cfgGFWBinning{"cfgGFWBinning", {40, 16, 72, 300, 0, 3000, 0.2, 10.0, 0.2, 3.0, {0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.5, 4, 5, 6, 8, 10}, {0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}}, "Configuration for binning"}; Configurable cfgRegions{"cfgRegions", {{"refN", "refP", "refFull"}, {-0.8, 0.4, -0.8}, {-0.4, 0.8, 0.8}, {0, 0, 0}, {1, 1, 1}}, "Configurations for GFW regions"}; @@ -125,7 +127,7 @@ struct FlowGenericFramework { struct Config { TH1D* mEfficiency = nullptr; - GFWWeightsList* mAcceptance; + std::vector mAcceptance; bool correctionsLoaded = false; } cfg; @@ -133,16 +135,35 @@ struct FlowGenericFramework { OutputObj fFC{FlowContainer("FlowContainer")}; OutputObj fFCpt{FlowPtContainer("FlowPtContainer")}; OutputObj fFCgen{FlowContainer("FlowContainer_gen")}; - OutputObj fWeightList{GFWWeightsList("WeightList")}; HistogramRegistry registry{"registry"}; + std::map>> th1sList; + std::map>> th3sList; + enum OutputTH1Names { + hPhi = 0, + hEta, + hVtxZ, + hMult, + hCent, + hEventSel, + kCount_TH1Names + }; + enum OutputTH3Names { + hNUAref = 0, + hNUAch, + hNUApi, + hNUAka, + hNUApr, + kCount_TH3Names + }; + // define global variables GFW* fGFW = new GFW(); std::vector corrconfigs; TRandom3* fRndm = new TRandom3(0); TAxis* fPtAxis; - int lastRun = 0; - + int lastRun = -1; + std::vector runNumbers; // Event selection cuts - Alex TF1* fPhiCutLow = nullptr; TF1* fPhiCutHigh = nullptr; @@ -212,16 +233,6 @@ struct FlowGenericFramework { int ptbins = ptbinning.size() - 1; fPtAxis = new TAxis(ptbins, &ptbinning[0]); - fWeightList->init("weightList"); - - if (!cfgRunByRunWeights && cfgFillWeights) { - if (cfgUsePID) { - fWeightList->addPIDGFWWeightsByName("weight", fPtAxis->GetNbins(), &ptbinning[0], ptrefup, true, false); - } else { - fWeightList->addGFWWeightsByName("weight", fPtAxis->GetNbins(), &ptbinning[0], true, false); - } - } - if (doprocessMCGen) { registry.add("MCGen/before/pt_gen", "", {HistType::kTH1D, {ptAxis}}); registry.add("MCGen/before/phi_eta_vtxZ_gen", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); @@ -255,6 +266,19 @@ struct FlowGenericFramework { registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(9, "kIsGoodITSLayersAll"); registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(10, "after Mult cuts"); registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(11, "has track + within cent"); + + if(!cfgRunByRun){ + if(cfgUsePID){ + registry.add("phi_eta_vtxz_ref", "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); + registry.add("phi_eta_vtxz_ch", "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); + registry.add("phi_eta_vtxz_pi", "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); + registry.add("phi_eta_vtxz_ka", "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); + registry.add("phi_eta_vtxz_pr", "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); + } + else { + registry.add("phi_eta_vtxz_ref", "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); + } + } } if (regions.GetSize() < 0) @@ -361,14 +385,29 @@ struct FlowGenericFramework { uint64_t timestamp = bc.timestamp(); if (cfg.correctionsLoaded) return; - if (!cfgAcceptance.value.empty()) { - cfg.mAcceptance = ccdb->getForTimeStamp(cfgAcceptance, timestamp); + //old +/* if (!cfgAcceptance.value.empty()) { + cfg.mAcceptance = ccdb->getForTimeStamp(cfgAcceptance, timestamp); if (cfg.mAcceptance) LOGF(info, "Loaded acceptance weights from %s", cfgAcceptance.value.c_str()); else LOGF(warning, "Could not load acceptance weights from %s", cfgAcceptance.value.c_str()); + } */ + //new + /*if(!cfgAcceptance.value.empty()) { + std::string runstr = (cfgRunByRun)?"RBR/":""; + if(cfgUsePID){ + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance+runstr+"ref/", timestamp)); + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance+runstr+"ch/", timestamp)); + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance+runstr+"pi/", timestamp)); + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance+runstr+"ka/", timestamp)); + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance+runstr+"pr/", timestamp)); + } + else { + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance + runstr, timestamp)); + } } - + */ if (!cfgEfficiency.value.empty()) { cfg.mEfficiency = ccdb->getForTimeStamp(cfgEfficiency, timestamp); if (cfg.mEfficiency == nullptr) { @@ -383,20 +422,9 @@ struct FlowGenericFramework { double getAcceptance(TTrack track, const double& vtxz, int index) { // 0 ref, 1 ch, 2 pi, 3 ka, 4 pr double wacc = 1; - if (cfg.mAcceptance) { - if (cfgUsePID) { - if (cfgRunByRunWeights) - wacc = cfg.mAcceptance->getPIDGFWWeightsByRun(lastRun, index)->getNUA(track.phi(), track.eta(), vtxz); - else - wacc = cfg.mAcceptance->getPIDGFWWeightsByName("weight", index)->getNUA(track.phi(), track.eta(), vtxz); - } else { - if (cfgRunByRunWeights) - wacc = cfg.mAcceptance->getGFWWeightsByRun(lastRun)->getNUA(track.phi(), track.eta(), vtxz); - else - wacc = cfg.mAcceptance->getGFWWeightsByName("weight")->getNUA(track.phi(), track.eta(), vtxz); - } - } - return wacc; +/* if (!cfg.mAcceptance.empty()) + wacc = cfg.mAcceptance[index]->getNUA(track.phi(), track.eta(), vtxz); + return wacc;*/ } template @@ -410,24 +438,6 @@ struct FlowGenericFramework { else return 1. / eff; } - // Obsolete for now untill service wagons get added - /* template - int getBayesPIDIndex(TTrack track) { - float maxProb[3] = {0.95,0.85,0.85}; - int pidID = 0; - if(track.bayesID()==o2::track::PID::Pion || track.bayesID()==o2::track::PID::Kaon || track.bayesID()==o2::track::PID::Proton){ - pidID = track.bayesID()-1; //Realign - float nsigmaTPC[3] = {track.tpcNSigmaPi(),track.tpcNSigmaKa(),track.tpcNSigmaPr()}; - float nsigmaTOF[3] = {track.tofNSigmaPi(),track.tofNSigmaKa(),track.tofNSigmaPr()}; - if(track.bayesProb() > maxProb[pidID-1]) { - if(std::abs(nsigmaTPC[pidID-1]) > 3) return 0; - if(std::abs(nsigmaTOF[pidID-1]) > 3) return 0; - return pidID; - } - else return 0; - } - return 0; - } */ template int getNsigmaPID(TTrack track) @@ -439,7 +449,9 @@ struct FlowGenericFramework { float nsigma = 3.0; // Choose which nSigma to use - std::array nSigmaToUse = (track.pt() > 0.4 && track.hasTOF()) ? nSigmaCombined : nSigmaTPC; + std::array nSigmaToUse = (track.pt() > cfgTofPtCut && track.hasTOF()) ? nSigmaCombined : nSigmaTPC; + if (track.pt() >= cfgTofPtCut && !track.hasTOF()) + return -1; // Select particle with the lowest nsigma for (int i = 0; i < 3; ++i) { @@ -452,7 +464,7 @@ struct FlowGenericFramework { } template - bool eventSelected(TCollision collision, const int& multTrk, const float& centrality) + bool eventSelected(TCollision collision, const int& multTrk, const float& centrality, const int &run) { if (cfgTVXinTRD) { if (collision.alias_bit(kTVXinTRD)) { @@ -461,6 +473,7 @@ struct FlowGenericFramework { return 0; } registry.fill(HIST("eventQA/eventSel"), 3.5); + if(cfgRunByRun) th1sList[run][hEventSel]->Fill(3.5); } if (cfgNoSameBunchPileupCut) { @@ -470,6 +483,7 @@ struct FlowGenericFramework { return 0; } registry.fill(HIST("eventQA/eventSel"), 4.5); + if(cfgRunByRun) th1sList[run][hEventSel]->Fill(4.5); } if (cfgIsGoodZvtxFT0vsPV) { if (!collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { @@ -478,6 +492,7 @@ struct FlowGenericFramework { return 0; } registry.fill(HIST("eventQA/eventSel"), 5.5); + if(cfgRunByRun) th1sList[run][hEventSel]->Fill(5.5); } if (cfgNoCollInTimeRangeStandard) { if (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { @@ -485,6 +500,7 @@ struct FlowGenericFramework { return 0; } registry.fill(HIST("eventQA/eventSel"), 6.5); + if(cfgRunByRun) th1sList[run][hEventSel]->Fill(6.5); } if (cfgIsVertexITSTPC) { @@ -493,6 +509,7 @@ struct FlowGenericFramework { return 0; } registry.fill(HIST("eventQA/eventSel"), 7.5); + if(cfgRunByRun) th1sList[run][hEventSel]->Fill(7.5); } if (cfgIsGoodITSLayersAll) { @@ -500,6 +517,7 @@ struct FlowGenericFramework { return 0; } registry.fill(HIST("eventQA/eventSel"), 8.5); + if(cfgRunByRun) th1sList[run][hEventSel]->Fill(8.5); } float vtxz = -999; if (collision.numContrib() > 1) { @@ -526,6 +544,7 @@ struct FlowGenericFramework { if (multTrk > fMultCutHigh->Eval(centrality)) return 0; registry.fill(HIST("eventQA/eventSel"), 9.5); + if(cfgRunByRun) th1sList[run][hEventSel]->Fill(9.5); } /* 22s @@ -571,40 +590,82 @@ struct FlowGenericFramework { }; template - void fillWeights(const TTrack track, const double vtxz, const double multcent, const int& pid_index, const int& run) + void fillWeights(const TTrack track, const double vtxz, const int& pid_index, const int& run) { if (cfgUsePID) { double ptpidmins[] = {ptpoilow, ptpoilow, 0.3, 0.5}; // min pt for ch, pi, ka, pr double ptpidmaxs[] = {ptpoiup, ptpoiup, 6.0, 6.0}; // max pt for ch, pi, ka, pr bool withinPtPOI = (ptpidmins[pid_index] < track.pt()) && (track.pt() < ptpidmaxs[pid_index]); // within POI pT range bool withinPtRef = (ptreflow < track.pt()) && (track.pt() < ptrefup); // within RF pT range - if (cfgRunByRunWeights) { + if (cfgRunByRun) { if (withinPtRef && !pid_index) - fWeightList->getPIDGFWWeightsByRun(run, pid_index)->fill(track.phi(), track.eta(), vtxz, track.pt(), multcent, 0); // pt-subset of charged particles for ref flow + th3sList[run][hNUAref]->Fill(track.phi(), track.eta(), vtxz); // pt-subset of charged particles for ref flow if (withinPtPOI) - fWeightList->getPIDGFWWeightsByRun(run, pid_index + 1)->fill(track.phi(), track.eta(), vtxz, track.pt(), multcent, 0); // charged and id'ed particle weights + th3sList[run][hNUAch+pid_index]->Fill(track.phi(), track.eta(), vtxz); // charged and id'ed particle weights } else { if (withinPtRef && !pid_index) - fWeightList->getPIDGFWWeightsByName("weight", pid_index)->fill(track.phi(), track.eta(), vtxz, track.pt(), multcent, 0); // pt-subset of charged particles for ref flow - if (withinPtPOI) - fWeightList->getPIDGFWWeightsByName("weight", pid_index + 1)->fill(track.phi(), track.eta(), vtxz, track.pt(), multcent, 0); // charged and id'ed particle weights + registry.fill(HIST("hPhiEtaVtxz_ref"), track.phi(), track.eta(), vtxz); // pt-subset of charged particles for ref flow + if (withinPtPOI){ + switch(pid_index){ + case 0: + registry.fill(HIST("hPhiEtaVtxz_ch"), track.phi(), track.eta(), vtxz); // charged particle weights + break; + case 1: + registry.fill(HIST("hPhiEtaVtxz_pi"), track.phi(), track.eta(), vtxz); // pion weights + break; + case 2: + registry.fill(HIST("hPhiEtaVtxz_ka"), track.phi(), track.eta(), vtxz); // kaon weights + break; + case 3: + registry.fill(HIST("hPhiEtaVtxz_pr"), track.phi(), track.eta(), vtxz); // proton weights + break; + } + } } } else { - if (cfgRunByRunWeights) - fWeightList->getGFWWeightsByRun(lastRun)->fill(track.phi(), track.eta(), vtxz, track.pt(), multcent, 0); + if (cfgRunByRun) + th3sList[run][hNUAref]->Fill(track.phi(), track.eta(), vtxz); else - fWeightList->getGFWWeightsByName("weight")->fill(track.phi(), track.eta(), vtxz, track.pt(), multcent, 0); + registry.fill(HIST("hPhiEtaVtxz_ref"), track.phi(), track.eta(), vtxz); } return; } - void createRunByRunWeights(int run) + void createRunByRunHistograms(const int &run) { + AxisSpec phiAxis = {phibins, philow, phiup, "#phi"}; + AxisSpec etaAxis = {etabins, -cfgEta, cfgEta, "#eta"}; + AxisSpec vtxAxis = {vtxZbins, -cfgVtxZ, cfgVtxZ, "Vtx_{z} (cm)"}; + std::vector> histos(kCount_TH1Names); + histos[hPhi] = registry.add(Form("%d/phi", run), "", {HistType::kTH1D, {phiAxis}}); + histos[hEta] = registry.add(Form("%d/eta", run), "", {HistType::kTH1D, {etaAxis}}); + histos[hVtxZ] = registry.add(Form("%d/vtxz", run), "", {HistType::kTH1D, {vtxAxis}}); + histos[hMult] = registry.add(Form("%d/mult", run), "", {HistType::kTH1D, {{3000, 0.5, 3000.5}}}); + histos[hCent] = registry.add(Form("%d/cent", run), "", {HistType::kTH1D, {{90, 0, 90}}}); + histos[hEventSel] = registry.add(Form("%d/eventSel", run), "Number of Events;; Counts", {HistType::kTH1D, {{11, 0, 11}}}); + histos[hEventSel]->GetXaxis()->SetBinLabel(1, "Filtered event"); + histos[hEventSel]->GetXaxis()->SetBinLabel(2, "sel8"); + histos[hEventSel]->GetXaxis()->SetBinLabel(3, "occupancy"); + histos[hEventSel]->GetXaxis()->SetBinLabel(4, "kTVXinTRD"); + histos[hEventSel]->GetXaxis()->SetBinLabel(5, "kNoSameBunchPileup"); + histos[hEventSel]->GetXaxis()->SetBinLabel(6, "kIsGoodZvtxFT0vsPV"); + histos[hEventSel]->GetXaxis()->SetBinLabel(7, "kNoCollInTimeRangeStandard"); + histos[hEventSel]->GetXaxis()->SetBinLabel(8, "kIsVertexITSTPC"); + histos[hEventSel]->GetXaxis()->SetBinLabel(9, "kIsGoodITSLayersAll"); + histos[hEventSel]->GetXaxis()->SetBinLabel(10, "after Mult cuts"); + histos[hEventSel]->GetXaxis()->SetBinLabel(11, "has track + within cent"); + th1sList.insert(std::make_pair(run, histos)); + std::vector> histos3d(kCount_TH3Names); if (cfgUsePID) { - fWeightList->addPIDGFWWeightsByRun(run, fPtAxis->GetNbins(), &ptbinning[0], ptrefup, true, false); + histos3d[hNUAref] = registry.add(Form("%d/phi_eta_vtxz_ref", run), "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); + histos3d[hNUAch] = registry.add(Form("%d/phi_eta_vtxz_ch", run), "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); + histos3d[hNUApi] = registry.add(Form("%d/phi_eta_vtxz_pi", run), "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); + histos3d[hNUAka] = registry.add(Form("%d/phi_eta_vtxz_ka", run), "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); + histos3d[hNUApr] = registry.add(Form("%d/phi_eta_vtxz_pr", run), "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); } else { - fWeightList->addGFWWeightsByRun(run, fPtAxis->GetNbins(), &ptbinning[0], true, false); + histos3d[hNUAref] = registry.add(Form("%d/phi_eta_vtxz_ref", run), "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); } + th3sList.insert(std::make_pair(run, histos3d)); return; } @@ -649,7 +710,13 @@ struct FlowGenericFramework { if (centrality < centbinning.front() || centrality > centbinning.back()) return; registry.fill(HIST("eventQA/eventSel"), 10.5); + if(cfgRunByRun) th1sList[run][hEventSel]->Fill(10.5); float vtxz = collision.posZ(); + if(dt!=kGen && cfgRunByRun){ + th1sList[run][hVtxZ]->Fill(vtxz); + th1sList[run][hMult]->Fill(tracks.size()); + th1sList[run][hCent]->Fill(centrality); + } fGFW->Clear(); fFCpt->clearVector(); float lRandom = fRndm->Rndm(); @@ -690,14 +757,19 @@ struct FlowGenericFramework { } if (cfgFillWeights) { - fillWeights(mcParticle, vtxz, centrality, 0, run); + fillWeights(mcParticle, vtxz, 0, run); } else { fillPtSums(track, vtxz); fillGFW(mcParticle, vtxz, pidIndex); } - if (cfgFillQA) + if (cfgFillQA){ fillTrackQA(track, vtxz); + if(cfgRunByRun){ + th1sList[run][hPhi]->Fill(track.phi()); + th1sList[run][hEta]->Fill(track.eta()); + } + } } else if constexpr (framework::has_type_v) { if (!track.isPhysicalPrimary()) @@ -738,13 +810,18 @@ struct FlowGenericFramework { pidIndex = getNsigmaPID(track); } if (cfgFillWeights) { - fillWeights(track, vtxz, centrality, pidIndex, run); + fillWeights(track, vtxz, pidIndex, run); } else { fillPtSums(track, vtxz); fillGFW(track, vtxz, pidIndex); } - if (cfgFillQA) + if (cfgFillQA){ fillTrackQA(track, vtxz); + if(cfgRunByRun){ + th1sList[run][hPhi]->Fill(track.phi()); + th1sList[run][hEta]->Fill(track.eta()); + } + } } } @@ -842,25 +919,37 @@ struct FlowGenericFramework { int run = bc.runNumber(); if (run != lastRun) { lastRun = run; - if (cfgFillWeights && cfgRunByRunWeights) - createRunByRunWeights(run); + LOGF(info,"run = %d",run); + if(cfgRunByRun){ + LOGF(info,"cfgRunByRun = true"); + if(std::find(runNumbers.begin(), runNumbers.end(), run) == runNumbers.end()){ + LOGF(info,"Creating histograms for run %d",run); + createRunByRunHistograms(run); + runNumbers.push_back(run); + } + else { + LOGF(info,"run %d already in runNumbers",run); + } + } + else LOGF(info,"cfgRunByRun = false"); } registry.fill(HIST("eventQA/eventSel"), 0.5); + if(cfgRunByRun) th1sList[run][hEventSel]->Fill(0.5); if (!collision.sel8()) return; registry.fill(HIST("eventQA/eventSel"), 1.5); - + if(cfgRunByRun) th1sList[run][hEventSel]->Fill(1.5); if (cfgOccupancySelection != -999) { int occupancy = collision.trackOccupancyInTimeRange(); if (occupancy < 0 || occupancy > cfgOccupancySelection) return; } registry.fill(HIST("eventQA/eventSel"), 2.5); + if(cfgRunByRun) th1sList[run][hEventSel]->Fill(2.5); const auto centrality = collision.centFT0C(); - if (cfgFillQA) fillEventQA(collision, tracks); - if (cfgUseAdditionalEventCut && !eventSelected(collision, tracks.size(), centrality)) + if (cfgUseAdditionalEventCut && !eventSelected(collision, tracks.size(), centrality, run)) return; if (cfgFillQA) fillEventQA(collision, tracks); @@ -877,15 +966,15 @@ struct FlowGenericFramework { int run = bc.runNumber(); if (run != lastRun) { lastRun = run; - if (cfgFillWeights && cfgRunByRunWeights) - createRunByRunWeights(run); + if (cfgRunByRun) + createRunByRunHistograms(run); } if (!collision.sel8()) return; const auto centrality = collision.centFT0C(); if (cfgFillQA) fillEventQA(collision, tracks); - if (cfgUseAdditionalEventCut && !eventSelected(collision, tracks.size(), centrality)) + if (cfgUseAdditionalEventCut && !eventSelected(collision, tracks.size(), centrality, run)) return; if (cfgFillQA) fillEventQA(collision, tracks); @@ -916,8 +1005,8 @@ struct FlowGenericFramework { int run = bc.runNumber(); if (run != lastRun) { lastRun = run; - if (cfgFillWeights && cfgRunByRunWeights) - createRunByRunWeights(run); + if (cfgRunByRun) + createRunByRunHistograms(run); } if (!collision.sel7()) return; From 1303b6868effc6e55f570cedef8bf8af0d050579 Mon Sep 17 00:00:00 2001 From: Emil Gorm Nielsen Date: Thu, 20 Feb 2025 14:17:27 +0100 Subject: [PATCH 2/7] load run-by-run weights with PID information correctly --- .../Tasks/flowGenericFramework.cxx | 30 +++++++------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index f0acabc8bc3..e416d2b16dd 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -385,29 +385,19 @@ struct FlowGenericFramework { uint64_t timestamp = bc.timestamp(); if (cfg.correctionsLoaded) return; - //old -/* if (!cfgAcceptance.value.empty()) { - cfg.mAcceptance = ccdb->getForTimeStamp(cfgAcceptance, timestamp); - if (cfg.mAcceptance) - LOGF(info, "Loaded acceptance weights from %s", cfgAcceptance.value.c_str()); - else - LOGF(warning, "Could not load acceptance weights from %s", cfgAcceptance.value.c_str()); - } */ - //new - /*if(!cfgAcceptance.value.empty()) { - std::string runstr = (cfgRunByRun)?"RBR/":""; + if(!cfgAcceptance.value.empty()) { + std::string runstr = (cfgRunByRun)?"RBR/":""; if(cfgUsePID){ - cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance+runstr+"ref/", timestamp)); - cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance+runstr+"ch/", timestamp)); - cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance+runstr+"pi/", timestamp)); - cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance+runstr+"ka/", timestamp)); - cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance+runstr+"pr/", timestamp)); + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value+runstr+"ref/", timestamp)); + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value+runstr+"ch/", timestamp)); + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value+runstr+"pi/", timestamp)); + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value+runstr+"ka/", timestamp)); + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value+runstr+"pr/", timestamp)); } else { - cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance + runstr, timestamp)); + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value + runstr, timestamp)); } } - */ if (!cfgEfficiency.value.empty()) { cfg.mEfficiency = ccdb->getForTimeStamp(cfgEfficiency, timestamp); if (cfg.mEfficiency == nullptr) { @@ -422,9 +412,9 @@ struct FlowGenericFramework { double getAcceptance(TTrack track, const double& vtxz, int index) { // 0 ref, 1 ch, 2 pi, 3 ka, 4 pr double wacc = 1; -/* if (!cfg.mAcceptance.empty()) + if (!cfg.mAcceptance.empty()) wacc = cfg.mAcceptance[index]->getNUA(track.phi(), track.eta(), vtxz); - return wacc;*/ + return wacc; } template From ea08eaae656f6c5f3992fe941737d8d71a584d1a Mon Sep 17 00:00:00 2001 From: Emil Gorm Nielsen Date: Tue, 25 Feb 2025 12:20:03 +0100 Subject: [PATCH 3/7] move to TH3D in registry for weights --- PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index e416d2b16dd..4172fadc726 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -383,10 +383,11 @@ struct FlowGenericFramework { void loadCorrections(aod::BCsWithTimestamps::iterator const& bc) { uint64_t timestamp = bc.timestamp(); - if (cfg.correctionsLoaded) + if (!cfgRunByRun && cfg.correctionsLoaded) return; if(!cfgAcceptance.value.empty()) { std::string runstr = (cfgRunByRun)?"RBR/":""; + cfg.mAcceptance.clear(); if(cfgUsePID){ cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value+runstr+"ref/", timestamp)); cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value+runstr+"ch/", timestamp)); @@ -911,7 +912,6 @@ struct FlowGenericFramework { lastRun = run; LOGF(info,"run = %d",run); if(cfgRunByRun){ - LOGF(info,"cfgRunByRun = true"); if(std::find(runNumbers.begin(), runNumbers.end(), run) == runNumbers.end()){ LOGF(info,"Creating histograms for run %d",run); createRunByRunHistograms(run); @@ -920,9 +920,12 @@ struct FlowGenericFramework { else { LOGF(info,"run %d already in runNumbers",run); } + if (!cfgFillWeights) + loadCorrections(bc); } - else LOGF(info,"cfgRunByRun = false"); } + if (!cfgFillWeights && !cfgRunByRun) + loadCorrections(bc); registry.fill(HIST("eventQA/eventSel"), 0.5); if(cfgRunByRun) th1sList[run][hEventSel]->Fill(0.5); if (!collision.sel8()) @@ -943,8 +946,6 @@ struct FlowGenericFramework { return; if (cfgFillQA) fillEventQA(collision, tracks); - if (!cfgFillWeights) - loadCorrections(bc); auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; processCollision(collision, tracks, centrality, field, run); } From 985138db07d2283b63891e0556382870912fd142 Mon Sep 17 00:00:00 2001 From: Emil Gorm Nielsen Date: Tue, 25 Feb 2025 12:30:47 +0100 Subject: [PATCH 4/7] clang format --- .../Tasks/flowGenericFramework.cxx | 121 +++++++++--------- 1 file changed, 64 insertions(+), 57 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index 4172fadc726..515f88f50f4 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -115,7 +115,6 @@ struct FlowGenericFramework { O2_DEFINE_CONFIGURABLE(cfgMagField, float, 99999, "Configurable magnetic field; default CCDB will be queried"); O2_DEFINE_CONFIGURABLE(cfgTofPtCut, float, 1.0, "pt cut on TOF for PID"); - Configurable cfgGFWBinning{"cfgGFWBinning", {40, 16, 72, 300, 0, 3000, 0.2, 10.0, 0.2, 3.0, {0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.5, 4, 5, 6, 8, 10}, {0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}}, "Configuration for binning"}; Configurable cfgRegions{"cfgRegions", {{"refN", "refP", "refFull"}, {-0.8, 0.4, -0.8}, {-0.4, 0.8, 0.8}, {0, 0, 0}, {1, 1, 1}}, "Configurations for GFW regions"}; @@ -267,16 +266,15 @@ struct FlowGenericFramework { registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(10, "after Mult cuts"); registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(11, "has track + within cent"); - if(!cfgRunByRun){ - if(cfgUsePID){ - registry.add("phi_eta_vtxz_ref", "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); - registry.add("phi_eta_vtxz_ch", "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); - registry.add("phi_eta_vtxz_pi", "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); - registry.add("phi_eta_vtxz_ka", "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); - registry.add("phi_eta_vtxz_pr", "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); - } - else { - registry.add("phi_eta_vtxz_ref", "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); + if (!cfgRunByRun) { + if (cfgUsePID) { + registry.add("phi_eta_vtxz_ref", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + registry.add("phi_eta_vtxz_ch", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + registry.add("phi_eta_vtxz_pi", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + registry.add("phi_eta_vtxz_ka", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + registry.add("phi_eta_vtxz_pr", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + } else { + registry.add("phi_eta_vtxz_ref", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); } } } @@ -385,17 +383,16 @@ struct FlowGenericFramework { uint64_t timestamp = bc.timestamp(); if (!cfgRunByRun && cfg.correctionsLoaded) return; - if(!cfgAcceptance.value.empty()) { - std::string runstr = (cfgRunByRun)?"RBR/":""; + if (!cfgAcceptance.value.empty()) { + std::string runstr = (cfgRunByRun) ? "RBR/" : ""; cfg.mAcceptance.clear(); - if(cfgUsePID){ - cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value+runstr+"ref/", timestamp)); - cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value+runstr+"ch/", timestamp)); - cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value+runstr+"pi/", timestamp)); - cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value+runstr+"ka/", timestamp)); - cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value+runstr+"pr/", timestamp)); - } - else { + if (cfgUsePID) { + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value + runstr + "ref/", timestamp)); + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value + runstr + "ch/", timestamp)); + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value + runstr + "pi/", timestamp)); + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value + runstr + "ka/", timestamp)); + cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value + runstr + "pr/", timestamp)); + } else { cfg.mAcceptance.push_back(ccdb->getForTimeStamp(cfgAcceptance.value + runstr, timestamp)); } } @@ -413,7 +410,7 @@ struct FlowGenericFramework { double getAcceptance(TTrack track, const double& vtxz, int index) { // 0 ref, 1 ch, 2 pi, 3 ka, 4 pr double wacc = 1; - if (!cfg.mAcceptance.empty()) + if (!cfg.mAcceptance.empty()) wacc = cfg.mAcceptance[index]->getNUA(track.phi(), track.eta(), vtxz); return wacc; } @@ -455,7 +452,7 @@ struct FlowGenericFramework { } template - bool eventSelected(TCollision collision, const int& multTrk, const float& centrality, const int &run) + bool eventSelected(TCollision collision, const int& multTrk, const float& centrality, const int& run) { if (cfgTVXinTRD) { if (collision.alias_bit(kTVXinTRD)) { @@ -464,7 +461,8 @@ struct FlowGenericFramework { return 0; } registry.fill(HIST("eventQA/eventSel"), 3.5); - if(cfgRunByRun) th1sList[run][hEventSel]->Fill(3.5); + if (cfgRunByRun) + th1sList[run][hEventSel]->Fill(3.5); } if (cfgNoSameBunchPileupCut) { @@ -474,7 +472,8 @@ struct FlowGenericFramework { return 0; } registry.fill(HIST("eventQA/eventSel"), 4.5); - if(cfgRunByRun) th1sList[run][hEventSel]->Fill(4.5); + if (cfgRunByRun) + th1sList[run][hEventSel]->Fill(4.5); } if (cfgIsGoodZvtxFT0vsPV) { if (!collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { @@ -483,7 +482,8 @@ struct FlowGenericFramework { return 0; } registry.fill(HIST("eventQA/eventSel"), 5.5); - if(cfgRunByRun) th1sList[run][hEventSel]->Fill(5.5); + if (cfgRunByRun) + th1sList[run][hEventSel]->Fill(5.5); } if (cfgNoCollInTimeRangeStandard) { if (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { @@ -491,7 +491,8 @@ struct FlowGenericFramework { return 0; } registry.fill(HIST("eventQA/eventSel"), 6.5); - if(cfgRunByRun) th1sList[run][hEventSel]->Fill(6.5); + if (cfgRunByRun) + th1sList[run][hEventSel]->Fill(6.5); } if (cfgIsVertexITSTPC) { @@ -500,7 +501,8 @@ struct FlowGenericFramework { return 0; } registry.fill(HIST("eventQA/eventSel"), 7.5); - if(cfgRunByRun) th1sList[run][hEventSel]->Fill(7.5); + if (cfgRunByRun) + th1sList[run][hEventSel]->Fill(7.5); } if (cfgIsGoodITSLayersAll) { @@ -508,7 +510,8 @@ struct FlowGenericFramework { return 0; } registry.fill(HIST("eventQA/eventSel"), 8.5); - if(cfgRunByRun) th1sList[run][hEventSel]->Fill(8.5); + if (cfgRunByRun) + th1sList[run][hEventSel]->Fill(8.5); } float vtxz = -999; if (collision.numContrib() > 1) { @@ -535,7 +538,8 @@ struct FlowGenericFramework { if (multTrk > fMultCutHigh->Eval(centrality)) return 0; registry.fill(HIST("eventQA/eventSel"), 9.5); - if(cfgRunByRun) th1sList[run][hEventSel]->Fill(9.5); + if (cfgRunByRun) + th1sList[run][hEventSel]->Fill(9.5); } /* 22s @@ -592,12 +596,12 @@ struct FlowGenericFramework { if (withinPtRef && !pid_index) th3sList[run][hNUAref]->Fill(track.phi(), track.eta(), vtxz); // pt-subset of charged particles for ref flow if (withinPtPOI) - th3sList[run][hNUAch+pid_index]->Fill(track.phi(), track.eta(), vtxz); // charged and id'ed particle weights + th3sList[run][hNUAch + pid_index]->Fill(track.phi(), track.eta(), vtxz); // charged and id'ed particle weights } else { if (withinPtRef && !pid_index) registry.fill(HIST("hPhiEtaVtxz_ref"), track.phi(), track.eta(), vtxz); // pt-subset of charged particles for ref flow - if (withinPtPOI){ - switch(pid_index){ + if (withinPtPOI) { + switch (pid_index) { case 0: registry.fill(HIST("hPhiEtaVtxz_ch"), track.phi(), track.eta(), vtxz); // charged particle weights break; @@ -622,7 +626,7 @@ struct FlowGenericFramework { return; } - void createRunByRunHistograms(const int &run) + void createRunByRunHistograms(const int& run) { AxisSpec phiAxis = {phibins, philow, phiup, "#phi"}; AxisSpec etaAxis = {etabins, -cfgEta, cfgEta, "#eta"}; @@ -648,13 +652,13 @@ struct FlowGenericFramework { th1sList.insert(std::make_pair(run, histos)); std::vector> histos3d(kCount_TH3Names); if (cfgUsePID) { - histos3d[hNUAref] = registry.add(Form("%d/phi_eta_vtxz_ref", run), "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); - histos3d[hNUAch] = registry.add(Form("%d/phi_eta_vtxz_ch", run), "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); - histos3d[hNUApi] = registry.add(Form("%d/phi_eta_vtxz_pi", run), "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); - histos3d[hNUAka] = registry.add(Form("%d/phi_eta_vtxz_ka", run), "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); - histos3d[hNUApr] = registry.add(Form("%d/phi_eta_vtxz_pr", run), "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); + histos3d[hNUAref] = registry.add(Form("%d/phi_eta_vtxz_ref", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + histos3d[hNUAch] = registry.add(Form("%d/phi_eta_vtxz_ch", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + histos3d[hNUApi] = registry.add(Form("%d/phi_eta_vtxz_pi", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + histos3d[hNUAka] = registry.add(Form("%d/phi_eta_vtxz_ka", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + histos3d[hNUApr] = registry.add(Form("%d/phi_eta_vtxz_pr", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); } else { - histos3d[hNUAref] = registry.add(Form("%d/phi_eta_vtxz_ref", run), "", {HistType::kTH3D, {phiAxis,etaAxis,vtxAxis}}); + histos3d[hNUAref] = registry.add(Form("%d/phi_eta_vtxz_ref", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); } th3sList.insert(std::make_pair(run, histos3d)); return; @@ -701,9 +705,10 @@ struct FlowGenericFramework { if (centrality < centbinning.front() || centrality > centbinning.back()) return; registry.fill(HIST("eventQA/eventSel"), 10.5); - if(cfgRunByRun) th1sList[run][hEventSel]->Fill(10.5); + if (cfgRunByRun) + th1sList[run][hEventSel]->Fill(10.5); float vtxz = collision.posZ(); - if(dt!=kGen && cfgRunByRun){ + if (dt != kGen && cfgRunByRun) { th1sList[run][hVtxZ]->Fill(vtxz); th1sList[run][hMult]->Fill(tracks.size()); th1sList[run][hCent]->Fill(centrality); @@ -754,9 +759,9 @@ struct FlowGenericFramework { fillGFW(mcParticle, vtxz, pidIndex); } - if (cfgFillQA){ + if (cfgFillQA) { fillTrackQA(track, vtxz); - if(cfgRunByRun){ + if (cfgRunByRun) { th1sList[run][hPhi]->Fill(track.phi()); th1sList[run][hEta]->Fill(track.eta()); } @@ -806,9 +811,9 @@ struct FlowGenericFramework { fillPtSums(track, vtxz); fillGFW(track, vtxz, pidIndex); } - if (cfgFillQA){ + if (cfgFillQA) { fillTrackQA(track, vtxz); - if(cfgRunByRun){ + if (cfgRunByRun) { th1sList[run][hPhi]->Fill(track.phi()); th1sList[run][hEta]->Fill(track.eta()); } @@ -901,7 +906,7 @@ struct FlowGenericFramework { } Filter collisionFilter = nabs(aod::collision::posZ) < cfgVtxZ; - Filter trackFilter = nabs(aod::track::eta) < cfgEta && aod::track::pt > cfgPtmin&& aod::track::pt < cfgPtmax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && nabs(aod::track::dcaXY) < cfgDCAxy&& nabs(aod::track::dcaZ) < cfgDCAz; + Filter trackFilter = nabs(aod::track::eta) < cfgEta && aod::track::pt > cfgPtmin&& aod::track::pt < cfgPtmax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && nabs(aod::track::dcaXY) < cfgDCAxy&& nabs(aod::track::dcaZ) < cfgDCAz; using GFWTracks = soa::Filtered>; void processData(soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, GFWTracks const& tracks) @@ -910,15 +915,14 @@ struct FlowGenericFramework { int run = bc.runNumber(); if (run != lastRun) { lastRun = run; - LOGF(info,"run = %d",run); - if(cfgRunByRun){ - if(std::find(runNumbers.begin(), runNumbers.end(), run) == runNumbers.end()){ - LOGF(info,"Creating histograms for run %d",run); + LOGF(info, "run = %d", run); + if (cfgRunByRun) { + if (std::find(runNumbers.begin(), runNumbers.end(), run) == runNumbers.end()) { + LOGF(info, "Creating histograms for run %d", run); createRunByRunHistograms(run); runNumbers.push_back(run); - } - else { - LOGF(info,"run %d already in runNumbers",run); + } else { + LOGF(info, "run %d already in runNumbers", run); } if (!cfgFillWeights) loadCorrections(bc); @@ -927,18 +931,21 @@ struct FlowGenericFramework { if (!cfgFillWeights && !cfgRunByRun) loadCorrections(bc); registry.fill(HIST("eventQA/eventSel"), 0.5); - if(cfgRunByRun) th1sList[run][hEventSel]->Fill(0.5); + if (cfgRunByRun) + th1sList[run][hEventSel]->Fill(0.5); if (!collision.sel8()) return; registry.fill(HIST("eventQA/eventSel"), 1.5); - if(cfgRunByRun) th1sList[run][hEventSel]->Fill(1.5); + if (cfgRunByRun) + th1sList[run][hEventSel]->Fill(1.5); if (cfgOccupancySelection != -999) { int occupancy = collision.trackOccupancyInTimeRange(); if (occupancy < 0 || occupancy > cfgOccupancySelection) return; } registry.fill(HIST("eventQA/eventSel"), 2.5); - if(cfgRunByRun) th1sList[run][hEventSel]->Fill(2.5); + if (cfgRunByRun) + th1sList[run][hEventSel]->Fill(2.5); const auto centrality = collision.centFT0C(); if (cfgFillQA) fillEventQA(collision, tracks); From 4403c63e19d6ba24a469274b0fe35056081b600e Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 25 Feb 2025 11:31:22 +0000 Subject: [PATCH 5/7] Please consider the following formatting changes --- PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index 515f88f50f4..d61862e4b97 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -906,7 +906,7 @@ struct FlowGenericFramework { } Filter collisionFilter = nabs(aod::collision::posZ) < cfgVtxZ; - Filter trackFilter = nabs(aod::track::eta) < cfgEta && aod::track::pt > cfgPtmin&& aod::track::pt < cfgPtmax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && nabs(aod::track::dcaXY) < cfgDCAxy&& nabs(aod::track::dcaZ) < cfgDCAz; + Filter trackFilter = nabs(aod::track::eta) < cfgEta && aod::track::pt > cfgPtmin&& aod::track::pt < cfgPtmax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && nabs(aod::track::dcaXY) < cfgDCAxy&& nabs(aod::track::dcaZ) < cfgDCAz; using GFWTracks = soa::Filtered>; void processData(soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, GFWTracks const& tracks) From 9be44683e5fd5b8f3c2abfbf84c56d04133b45c1 Mon Sep 17 00:00:00 2001 From: Emil Gorm Nielsen Date: Tue, 25 Feb 2025 12:52:42 +0100 Subject: [PATCH 6/7] includes --- PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index d61862e4b97..2447e3d0143 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" From ca56b142f7e59863e34b258857b0dd47c3d8504f Mon Sep 17 00:00:00 2001 From: Emil Gorm Nielsen Date: Tue, 25 Feb 2025 14:02:28 +0100 Subject: [PATCH 7/7] remove unused argument in ProcessTrack --- PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index 2447e3d0143..f5dab09c53b 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -719,14 +719,14 @@ struct FlowGenericFramework { fFCpt->clearVector(); float lRandom = fRndm->Rndm(); for (const auto& track : tracks) { - processTrack(track, centrality, vtxz, field, run); + processTrack(track, vtxz, field, run); } if (!cfgFillWeights) fillOutputContainers
((cfgUseNch) ? tracks.size() : centrality, lRandom); } template - inline void processTrack(TTrack const& track, const float& centrality, const float& vtxz, const int& field, const int& run) + inline void processTrack(TTrack const& track, const float& vtxz, const int& field, const int& run) { if constexpr (framework::has_type_v) { if (track.mcParticleId() < 0 || !(track.has_mcParticle()))