From 8e938b08682008a23ff9fc2dac5d9715950ae34d Mon Sep 17 00:00:00 2001 From: Emil Gorm Nielsen Date: Thu, 10 Jul 2025 19:48:08 +0200 Subject: [PATCH] Add run-by-run flow, fixed mult selection --- .../Tasks/flowGfwLightIons.cxx | 317 +++++------------- 1 file changed, 86 insertions(+), 231 deletions(-) diff --git a/PWGCF/GenericFramework/Tasks/flowGfwLightIons.cxx b/PWGCF/GenericFramework/Tasks/flowGfwLightIons.cxx index 0464fb9e556..d2d7e256d14 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwLightIons.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwLightIons.cxx @@ -89,6 +89,7 @@ struct FlowGfwLightIons { O2_DEFINE_CONFIGURABLE(cfgUseNch, bool, false, "Do correlations as function of Nch") O2_DEFINE_CONFIGURABLE(cfgFillWeights, bool, false, "Fill NUA weights") O2_DEFINE_CONFIGURABLE(cfgRunByRun, bool, false, "Fill histograms on a run-by-run basis") + O2_DEFINE_CONFIGURABLE(cfgFillFlowRunByRun, bool, false, "Fill flow profile run-by-run (only for v22)") O2_DEFINE_CONFIGURABLE(cfgTimeDependent, bool, false, "Fill output as function of time (for contamination studies)") O2_DEFINE_CONFIGURABLE(cfgFirstRunsOfFill, std::vector, {}, "First runs of a fill for time dependent analysis") O2_DEFINE_CONFIGURABLE(cfgFillQA, bool, false, "Fill QA histograms") @@ -112,7 +113,7 @@ struct FlowGfwLightIons { O2_DEFINE_CONFIGURABLE(cfgOccupancySelection, int, 2000, "Max occupancy selection, -999 to disable"); O2_DEFINE_CONFIGURABLE(cfgNoSameBunchPileupCut, bool, true, "kNoSameBunchPileupCut"); O2_DEFINE_CONFIGURABLE(cfgIsGoodZvtxFT0vsPV, bool, true, "kIsGoodZvtxFT0vsPV"); - O2_DEFINE_CONFIGURABLE(cfgNoITSROFBorder, bool, true, "kNoITSROFFrameBorder"); + O2_DEFINE_CONFIGURABLE(cfgNoITSROFBorder, bool, true, "kNoITSROFrameBorder"); O2_DEFINE_CONFIGURABLE(cfgNoTimeFrameBorder, bool, true, "kNoTimeFrameBorder"); O2_DEFINE_CONFIGURABLE(cfgIsGoodITSLayersAll, bool, true, "kIsGoodITSLayersAll"); O2_DEFINE_CONFIGURABLE(cfgNoCollInTimeRangeStandard, bool, true, "kNoCollInTimeRangeStandard"); @@ -121,6 +122,8 @@ struct FlowGfwLightIons { 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(cfgFixedMultMin, int, 1, "Minimum for fixed nch range"); + O2_DEFINE_CONFIGURABLE(cfgFixedMultMax, int, 3000, "Maximum for fixed nch range"); O2_DEFINE_CONFIGURABLE(cfgUseDensityDependentCorrection, bool, false, "Use density dependent efficiency correction based on Run 2 measurements"); Configurable> cfgTrackDensityP0{"cfgTrackDensityP0", std::vector{0.7217476707, 0.7384792571, 0.7542625668, 0.7640680200, 0.7701951667, 0.7755299053, 0.7805901710, 0.7849446786, 0.7957356586, 0.8113039262, 0.8211968966, 0.8280558878, 0.8329342135}, "parameter 0 for track density efficiency correction"}; Configurable> cfgTrackDensityP1{"cfgTrackDensityP1", std::vector{-2.169488e-05, -2.191913e-05, -2.295484e-05, -2.556538e-05, -2.754463e-05, -2.816832e-05, -2.846502e-05, -2.843857e-05, -2.705974e-05, -2.477018e-05, -2.321730e-05, -2.203315e-05, -2.109474e-05}, "parameter 1 for track density efficiency correction"}; @@ -152,6 +155,7 @@ struct FlowGfwLightIons { // QA outputs std::map>> th1sList; + std::map>> tpfsList; std::map>> th3sList; enum OutputTH1Names { hPhi = 0, @@ -162,6 +166,10 @@ struct FlowGfwLightIons { hEventSel, kCount_TH1Names }; + enum OutputTProfileNames { + pfCorr22 = 0, + kCount_TProfileNames + }; // NUA outputs enum OutputTH3Names { hNUAref = 0, @@ -177,6 +185,22 @@ struct FlowGfwLightIons { kCentMFT }; + enum EventSelFlags { + kFilteredEvent = 1, + kSel8, + kOccupancy, + kTVXTRD, + kNoSamebunchPU, + kZVtxFT0PV, + kNoCollTRStd, + kVtxITSTPC, + kGoodITSLayers, + kNoITSROFBorder, + kNoTFBorder, + kMultCuts, + kTrackCent + }; + // Define global variables // Generic Framework GFW* fGFW = new GFW(); @@ -333,7 +357,7 @@ struct FlowGfwLightIons { int ptbins = o2::analysis::gfw::ptbinning.size() - 1; fSecondAxis = (cfgTimeDependent) ? new TAxis(timeAxis.binEdges.size() - 1, &(timeAxis.binEdges[0])) : new TAxis(ptbins, &o2::analysis::gfw::ptbinning[0]); - if (doprocessMCGen || doprocessMCGenNoCent || doprocessOnTheFly) { + if (doprocessMCGen || doprocessOnTheFly) { registry.add("MCGen/trackQA/nch_pt", "#it{p}_{T} vs multiplicity; N_{ch}; #it{p}_{T}", {HistType::kTH2D, {nchAxis, ptAxis}}); registry.add("MCGen/trackQA/phi_eta_vtxZ", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); registry.add("MCGen/trackQA/pt_ref", "Reference #it{p}_{T}; #it{p}_{T}; Counts", {HistType::kTH1D, {{100, o2::analysis::gfw::ptreflow, o2::analysis::gfw::ptrefup}}}); @@ -345,7 +369,7 @@ struct FlowGfwLightIons { if (doprocessMCGen) registry.add("MCGen/eventQA/centrality", "", {HistType::kTH1D, {centAxis}}); } - if (doprocessMCReco || doprocessData || doprocessDataNoCent || doprocessMCRecoNoCent) { + if (doprocessMCReco || 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}}); registry.add("trackQA/before/nch_pt", "#it{p}_{T} vs multiplicity; N_{ch}; #it{p}_{T}", {HistType::kTH2D, {nchAxis, ptAxis}}); @@ -380,21 +404,20 @@ struct FlowGfwLightIons { } registry.addClone("eventQA/before/", "eventQA/after/"); - registry.add("eventQA/eventSel", "Number of Events;; Counts", {HistType::kTH1D, {{13, 0, 13}}}); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(1, "Filtered event"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(2, "sel8"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(3, "occupancy"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(4, "kTVXinTRD"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(5, "kNoSameBunchPileup"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(6, "kIsGoodZvtxFT0vsPV"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(7, "kNoCollInTimeRangeStandard"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(8, "kIsVertexITSTPC"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(9, "kIsGoodITSLayersAll"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(10, "kNoITSROFBorder"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(11, "kNoTimeFrameBorder"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(12, "after Mult cuts"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(13, "has track + within cent"); - + registry.add("eventQA/eventSel", "Number of Events;; Counts", {HistType::kTH1D, {{13, 0.5, 13.5}}}); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kFilteredEvent, "Filtered event"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kSel8, "sel8"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kOccupancy, "occupancy"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kTVXTRD, "kTVXinTRD"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoSamebunchPU, "kNoSameBunchPileup"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kZVtxFT0PV, "kIsGoodZvtxFT0vsPV"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoCollTRStd, "kNoCollInTimeRangeStandard"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kVtxITSTPC, "kIsVertexITSTPC"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kGoodITSLayers, "kIsGoodITSLayersAll"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoITSROFBorder, "kNoITSROFBorder"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoTFBorder, "kNoTimeFrameBorder"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kMultCuts, "after Mult cuts"); + registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kTrackCent, "has track + within cent"); if (!cfgRunByRun && cfgFillWeights) { registry.add("phi_eta_vtxz_ref", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); } @@ -413,12 +436,12 @@ struct FlowGfwLightIons { fGFW->CreateRegions(); TObjArray* oba = new TObjArray(); addConfigObjectsToObjArray(oba, corrconfigs); - if (doprocessData || doprocessMCReco || doprocessDataNoCent || doprocessMCRecoNoCent) { + if (doprocessData || doprocessMCReco) { fFC->SetName("FlowContainer"); fFC->SetXAxis(fSecondAxis); fFC->Initialize(oba, multAxis, cfgNbootstrap); } - if (doprocessMCGen || doprocessMCGenNoCent || doprocessOnTheFly) { + if (doprocessMCGen || doprocessOnTheFly) { fFCgen->SetName("FlowContainer_gen"); fFCgen->SetXAxis(fSecondAxis); fFCgen->Initialize(oba, multAxis, cfgNbootstrap); @@ -551,20 +574,19 @@ struct FlowGfwLightIons { // "CMTVX-B-NOPF-TRD,minbias_TVX" return 0; } - registry.fill(HIST("eventQA/eventSel"), 3.5); + registry.fill(HIST("eventQA/eventSel"), kTVXTRD); if (cfgRunByRun) - th1sList[run][hEventSel]->Fill(3.5); + th1sList[run][hEventSel]->Fill(kTVXTRD); } - if (cfgNoSameBunchPileupCut) { if (!collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { // rejects collisions which are associated with the same "found-by-T0" bunch crossing // https://indico.cern.ch/event/1396220/#1-event-selection-with-its-rof return 0; } - registry.fill(HIST("eventQA/eventSel"), 4.5); + registry.fill(HIST("eventQA/eventSel"), kNoSamebunchPU); if (cfgRunByRun) - th1sList[run][hEventSel]->Fill(4.5); + th1sList[run][hEventSel]->Fill(kNoSamebunchPU); } if (cfgIsGoodZvtxFT0vsPV) { if (!collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { @@ -572,18 +594,18 @@ struct FlowGfwLightIons { // use this cut at low multiplicities with caution return 0; } - registry.fill(HIST("eventQA/eventSel"), 5.5); + registry.fill(HIST("eventQA/eventSel"), kZVtxFT0PV); if (cfgRunByRun) - th1sList[run][hEventSel]->Fill(5.5); + th1sList[run][hEventSel]->Fill(kZVtxFT0PV); } if (cfgNoCollInTimeRangeStandard) { if (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { // Rejection of the collisions which have other events nearby return 0; } - registry.fill(HIST("eventQA/eventSel"), 6.5); + registry.fill(HIST("eventQA/eventSel"), kNoCollTRStd); if (cfgRunByRun) - th1sList[run][hEventSel]->Fill(6.5); + th1sList[run][hEventSel]->Fill(kNoCollTRStd); } if (cfgIsVertexITSTPC) { @@ -591,36 +613,36 @@ struct FlowGfwLightIons { // selects collisions with at least one ITS-TPC track, and thus rejects vertices built from ITS-only tracks return 0; } - registry.fill(HIST("eventQA/eventSel"), 7.5); + registry.fill(HIST("eventQA/eventSel"), kVtxITSTPC); if (cfgRunByRun) - th1sList[run][hEventSel]->Fill(7.5); + th1sList[run][hEventSel]->Fill(kVtxITSTPC); } if (cfgIsGoodITSLayersAll) { if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) { return 0; } - registry.fill(HIST("eventQA/eventSel"), 8.5); + registry.fill(HIST("eventQA/eventSel"), kGoodITSLayers); if (cfgRunByRun) - th1sList[run][hEventSel]->Fill(8.5); + th1sList[run][hEventSel]->Fill(kGoodITSLayers); } if (cfgNoITSROFBorder) { if (!collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { return 0; } - registry.fill(HIST("eventQA/eventSel"), 9.5); + registry.fill(HIST("eventQA/eventSel"), kNoITSROFBorder); if (cfgRunByRun) - th1sList[run][hEventSel]->Fill(9.5); + th1sList[run][hEventSel]->Fill(kNoITSROFBorder); } if (cfgNoTimeFrameBorder) { if (!collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { return 0; } - registry.fill(HIST("eventQA/eventSel"), 10.5); + registry.fill(HIST("eventQA/eventSel"), kNoTFBorder); if (cfgRunByRun) - th1sList[run][hEventSel]->Fill(10.5); + th1sList[run][hEventSel]->Fill(kNoTFBorder); } float vtxz = -999; if (collision.numContrib() > 1) { @@ -645,9 +667,9 @@ struct FlowGfwLightIons { return 0; if (multTrk > fMultCutHigh->Eval(centrality)) return 0; - registry.fill(HIST("eventQA/eventSel"), 11.5); + registry.fill(HIST("eventQA/eventSel"), kMultCuts); if (cfgRunByRun) - th1sList[run][hEventSel]->Fill(11.5); + th1sList[run][hEventSel]->Fill(kMultCuts); } return 1; } @@ -688,7 +710,12 @@ struct FlowGfwLightIons { histos[hVtxZ] = registry.add(Form("%d/vtxz", run), "", {HistType::kTH1D, {vtxAxis}}); histos[hMult] = registry.add(Form("%d/mult", run), "", {HistType::kTH1D, {nchAxis}}); histos[hCent] = registry.add(Form("%d/cent", run), "", {HistType::kTH1D, {centAxis}}); - histos[hEventSel] = registry.add(Form("%d/eventSel", run), "Number of Events;; Counts", {HistType::kTH1D, {{11, 0, 11}}}); + if (cfgFillFlowRunByRun) { + std::vector> profiles(kCount_TProfileNames); + profiles[pfCorr22] = registry.add(Form("%d/corr22", run), "", {HistType::kTProfile, {(cfgUseNch) ? nchAxis : centAxis}}); + tpfsList.insert(std::make_pair(run, profiles)); + } + histos[hEventSel] = registry.add(Form("%d/eventSel", run), "Number of Events;; Counts", {HistType::kTH1D, {{13, 0.5, 13.5}}}); histos[hEventSel]->GetXaxis()->SetBinLabel(1, "Filtered event"); histos[hEventSel]->GetXaxis()->SetBinLabel(2, "sel8"); histos[hEventSel]->GetXaxis()->SetBinLabel(3, "occupancy"); @@ -710,7 +737,7 @@ struct FlowGfwLightIons { } template - void fillOutputContainers(const float& centmult, const double& rndm) + void fillOutputContainers(const float& centmult, const double& rndm, const int& run = 0) { (dt == kGen) ? fFCptgen->calculateCorrelations() : fFCpt->calculateCorrelations(); (dt == kGen) ? fFCptgen->fillPtProfiles(centmult, rndm) : fFCpt->fillPtProfiles(centmult, rndm); @@ -724,6 +751,9 @@ struct FlowGfwLightIons { if (std::abs(val) < 1) { (dt == kGen) ? fFCgen->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, dnx, rndm) : fFC->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, dnx, rndm); (dt == kGen) ? fFCptgen->fillVnPtProfiles(centmult, val, dnx, rndm, o2::analysis::gfw::configs.GetpTCorrMasks()[l_ind]) : fFCpt->fillVnPtProfiles(centmult, val, dnx, rndm, o2::analysis::gfw::configs.GetpTCorrMasks()[l_ind]); + if (cfgRunByRun && cfgFillFlowRunByRun && dt != kGen && l_ind == 0) { + tpfsList[run][pfCorr22]->Fill(centmult, val, dnx); + } } continue; } @@ -752,11 +782,16 @@ struct FlowGfwLightIons { return; if (dt != kGen && xaxis.centrality >= 0 && (xaxis.centrality < o2::analysis::gfw::centbinning.front() || xaxis.centrality > o2::analysis::gfw::centbinning.back())) return; + if (xaxis.multiplicity < cfgFixedMultMin || xaxis.multiplicity > cfgFixedMultMax) + return; if (dt != kGen) { - registry.fill(HIST("eventQA/eventSel"), 12.5); + registry.fill(HIST("eventQA/eventSel"), kTrackCent); if (cfgRunByRun) - th1sList[run][hEventSel]->Fill(12.5); + th1sList[run][hEventSel]->Fill(kTrackCent); } + if (xaxis.centrality >= 0) + registry.fill(HIST("eventQA/after/centrality"), xaxis.centrality); + registry.fill(HIST("eventQA/after/multiplicity"), xaxis.multiplicity); float vtxz = collision.posZ(); if (dt != kGen && cfgRunByRun) { th1sList[run][hVtxZ]->Fill(vtxz); @@ -809,7 +844,7 @@ struct FlowGfwLightIons { if (!cfgFillWeights) fillOutputContainers
((cfgTimeDependent) ? xaxis.time : (cfgUseNch) ? xaxis.multiplicity : xaxis.centrality, - lRandom); + lRandom, run); } bool isStable(int pdg) @@ -893,6 +928,7 @@ struct FlowGfwLightIons { if (cfgRunByRun) { th1sList[run][hPhi]->Fill(track.phi()); th1sList[run][hEta]->Fill(track.eta()); + th3sList[run][hNUAref]->Fill(track.phi(), track.eta(), vtxz, getAcceptance(track, vtxz)); } } } @@ -1040,22 +1076,22 @@ struct FlowGfwLightIons { } if (!cfgFillWeights && !cfgRunByRun) loadCorrections(bc); - registry.fill(HIST("eventQA/eventSel"), 0.5); + registry.fill(HIST("eventQA/eventSel"), kFilteredEvent); if (cfgRunByRun) - th1sList[run][hEventSel]->Fill(0.5); + th1sList[run][hEventSel]->Fill(kFilteredEvent); if (!collision.sel8()) return; - registry.fill(HIST("eventQA/eventSel"), 1.5); + registry.fill(HIST("eventQA/eventSel"), kSel8); if (cfgRunByRun) - th1sList[run][hEventSel]->Fill(1.5); + th1sList[run][hEventSel]->Fill(kSel8); if (cfgDoOccupancySel) { int occupancy = collision.trackOccupancyInTimeRange(); if (occupancy < 0 || occupancy > cfgOccupancySelection) return; } - registry.fill(HIST("eventQA/eventSel"), 2.5); + registry.fill(HIST("eventQA/eventSel"), kOccupancy); if (cfgRunByRun) - th1sList[run][hEventSel]->Fill(2.5); + th1sList[run][hEventSel]->Fill(kOccupancy); const XAxis xaxis{getCentrality(collision), tracks.size(), (cfgTimeDependent) ? getTimeSinceStartOfFill(bc.timestamp(), *firstRunOfCurrentFill) : -1.0}; if (cfgTimeDependent && run == *firstRunOfCurrentFill && firstRunOfCurrentFill != o2::analysis::gfw::firstRunsOfFill.end() - 1) @@ -1069,66 +1105,10 @@ struct FlowGfwLightIons { return; if (cfgFillQA) fillEventQA(collision, xaxis); - registry.fill(HIST("eventQA/after/centrality"), xaxis.centrality); - registry.fill(HIST("eventQA/after/multiplicity"), xaxis.multiplicity); processCollision(collision, tracks, xaxis, run); } PROCESS_SWITCH(FlowGfwLightIons, processData, "Process analysis for non-derived data", true); - void processDataNoCent(soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, GFWTracks const& tracks) - { - auto bc = collision.bc_as(); - 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); - createRunByRunHistograms(run); - runNumbers.push_back(run); - } else { - LOGF(info, "run %d already in runNumbers", run); - } - if (!cfgFillWeights) - loadCorrections(bc); - } - } - if (!cfgFillWeights && !cfgRunByRun) - loadCorrections(bc); - 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 (cfgDoOccupancySel) { - 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 XAxis xaxis{-1., tracks.size(), (cfgTimeDependent) ? getTimeSinceStartOfFill(bc.timestamp(), *firstRunOfCurrentFill) : -1.0}; - if (cfgTimeDependent && run == *firstRunOfCurrentFill && firstRunOfCurrentFill != o2::analysis::gfw::firstRunsOfFill.end() - 1) - ++firstRunOfCurrentFill; - - if (cfgFillQA) - fillEventQA(collision, xaxis); - registry.fill(HIST("eventQA/before/multiplicity"), xaxis.multiplicity); - if (cfgUseAdditionalEventCut && !eventSelected(collision, xaxis.multiplicity, xaxis.centrality, run)) - return; - if (cfgFillQA) - fillEventQA(collision, xaxis); - registry.fill(HIST("eventQA/after/multiplicity"), xaxis.multiplicity); - processCollision(collision, tracks, xaxis, run); - } - PROCESS_SWITCH(FlowGfwLightIons, processDataNoCent, "Process analysis for non-derived data without centrality", true); - void processMCReco(soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, soa::Filtered> const& tracks, aod::McParticles const&) { auto bc = collision.bc_as(); @@ -1153,119 +1133,12 @@ struct FlowGfwLightIons { return; if (cfgFillQA) fillEventQA(collision, xaxis); - registry.fill(HIST("eventQA/after/centrality"), xaxis.centrality); - registry.fill(HIST("eventQA/after/multiplicity"), xaxis.multiplicity); - if (!cfgFillWeights) loadCorrections(bc); processCollision(collision, tracks, xaxis, run); } PROCESS_SWITCH(FlowGfwLightIons, processMCReco, "Process analysis for MC reconstructed events", false); - void processMCRecoNoCent(soa::Filtered>::iterator const& collision, aod::BCsWithTimestamps const&, soa::Filtered> const& tracks, aod::McParticles const&) - { - auto bc = collision.bc_as(); - int run = bc.runNumber(); - if (run != lastRun) { - lastRun = run; - if (cfgRunByRun) - createRunByRunHistograms(run); - } - registry.fill(HIST("eventQA/eventSel"), 0.5); - if (!collision.sel8()) - return; - - registry.fill(HIST("eventQA/eventSel"), 1.5); - if (cfgDoOccupancySel) { - int occupancy = collision.trackOccupancyInTimeRange(); - if (occupancy < 0 || occupancy > cfgOccupancySelection) - return; - } - registry.fill(HIST("eventQA/eventSel"), 2.5); - - const XAxis xaxis{-1., tracks.size(), (cfgTimeDependent) ? getTimeSinceStartOfFill(bc.timestamp(), *firstRunOfCurrentFill) : -1.}; - if (cfgTimeDependent && run == *firstRunOfCurrentFill && firstRunOfCurrentFill != o2::analysis::gfw::firstRunsOfFill.end() - 1) - ++firstRunOfCurrentFill; - - registry.fill(HIST("eventQA/before/multiplicity"), tracks.size()); - if (cfgUseAdditionalEventCut) { - if (cfgTVXinTRD) { - if (collision.alias_bit(kTVXinTRD)) { - // TRD triggered - // "CMTVX-B-NOPF-TRD,minbias_TVX" - return; - } - registry.fill(HIST("eventQA/eventSel"), 3.5); - } - if (cfgNoSameBunchPileupCut) { - if (!collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { - // rejects collisions which are associated with the same "found-by-T0" bunch crossing - // https://indico.cern.ch/event/1396220/#1-event-selection-with-its-rof - return; - } - registry.fill(HIST("eventQA/eventSel"), 4.5); - } - if (cfgIsGoodZvtxFT0vsPV) { - if (!collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { - // removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference - // use this cut at low multiplicities with caution - return; - } - registry.fill(HIST("eventQA/eventSel"), 5.5); - } - if (cfgNoCollInTimeRangeStandard) { - if (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { - // Rejection of the collisions which have other events nearby - return; - } - registry.fill(HIST("eventQA/eventSel"), 6.5); - } - if (cfgIsVertexITSTPC) { - if (!collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { - // selects collisions with at least one ITS-TPC track, and thus rejects vertices built from ITS-only tracks - return; - } - registry.fill(HIST("eventQA/eventSel"), 7.5); - } - if (cfgIsGoodITSLayersAll) { - if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) { - return; - } - registry.fill(HIST("eventQA/eventSel"), 8.5); - } - if (cfgNoITSROFBorder) { - if (!collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { - return; - } - registry.fill(HIST("eventQA/eventSel"), 9.5); - } - if (cfgNoTimeFrameBorder) { - if (!collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { - return; - } - registry.fill(HIST("eventQA/eventSel"), 10.5); - } - float vtxz = -999; - if (collision.numContrib() > 1) { - vtxz = collision.posZ(); - float zRes = std::sqrt(collision.covZZ()); - float minZRes = 0.25; - int minNContrib = 20; - if (zRes > minZRes && collision.numContrib() < minNContrib) - vtxz = -999; - } - - if (vtxz > o2::analysis::gfw::vtxZup || vtxz < o2::analysis::gfw::vtxZlow) - return; - } - - registry.fill(HIST("eventQA/after/multiplicity"), xaxis.multiplicity); - if (!cfgFillWeights) - loadCorrections(bc); - processCollision(collision, tracks, xaxis, run); - } - PROCESS_SWITCH(FlowGfwLightIons, processMCRecoNoCent, "Process analysis for MC reconstructed events without centrality/mult table", false); - void processMCGen(soa::Filtered::iterator const& mcCollision, soa::SmallGroups> const& collisions, aod::McParticles const& particles, GFWTracks const& tracks) { if (collisions.size() != 1) @@ -1283,27 +1156,9 @@ struct FlowGfwLightIons { const XAxis xaxis{centrality, numberOfTracks[0], -1.0}; int run = 0; processCollision(mcCollision, particles, xaxis, run); - registry.fill(HIST("MCGen/eventQA/multiplicity"), xaxis.multiplicity); - registry.fill(HIST("MCGen/eventQA/centrality"), xaxis.centrality); } PROCESS_SWITCH(FlowGfwLightIons, processMCGen, "Process analysis for MC generated events", false); - void processMCGenNoCent(soa::Filtered::iterator const& mcCollision, soa::SmallGroups> const& collisions, aod::McParticles const& particles, GFWTracks const& tracks) - { - if (collisions.size() != 1) - return; - std::vector numberOfTracks; - for (auto const& collision : collisions) { - auto groupedTracks = tracks.sliceBy(perCollision, collision.globalIndex()); - numberOfTracks.emplace_back(groupedTracks.size()); - } - const XAxis xaxis{-1., numberOfTracks[0], -1.}; - int run = 0; - registry.fill(HIST("MCGen/eventQA/multiplicity"), xaxis.multiplicity); - processCollision(mcCollision, particles, xaxis, run); - } - PROCESS_SWITCH(FlowGfwLightIons, processMCGenNoCent, "Process analysis for MC generated events", false); - void processOnTheFly(soa::Filtered::iterator const& mcCollision, aod::McParticles const& mcParticles) { int run = 0;