Skip to content

Commit dd53321

Browse files
authored
[PWGCF] Add track selection and optimize NUA output (#14394)
1 parent a5a7600 commit dd53321

File tree

1 file changed

+40
-16
lines changed

1 file changed

+40
-16
lines changed

PWGCF/Flow/Tasks/flowGfwOmegaXi.cxx

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ struct FlowGfwOmegaXi {
159159
O2_DEFINE_CONFIGURABLE(cfgDoTVXinTRD, bool, true, "check kTVXinTRD")
160160
O2_DEFINE_CONFIGURABLE(cfgDoNoTimeFrameBorder, bool, true, "check kNoTimeFrameBorder")
161161
O2_DEFINE_CONFIGURABLE(cfgDoNoITSROFrameBorder, bool, true, "check kNoITSROFrameBorder")
162-
O2_DEFINE_CONFIGURABLE(cfgDoNoSameBunchPileup, bool, true, "check kNoITSROFrameBorder")
162+
O2_DEFINE_CONFIGURABLE(cfgDoNoSameBunchPileup, bool, true, "rejects collisions which are associated with the same found-by-T0 bunch crossing")
163163
O2_DEFINE_CONFIGURABLE(cfgDoIsGoodZvtxFT0vsPV, bool, true, "check kIsGoodZvtxFT0vsPV")
164164
O2_DEFINE_CONFIGURABLE(cfgDoNoCollInTimeRangeStandard, bool, true, "check kNoCollInTimeRangeStandard")
165165
O2_DEFINE_CONFIGURABLE(cfgDoIsGoodITSLayersAll, bool, true, "check kIsGoodITSLayersAll")
@@ -190,6 +190,7 @@ struct FlowGfwOmegaXi {
190190
O2_DEFINE_CONFIGURABLE(cfgOutputrunbyrun, bool, false, "Fill and output NUA weights run by run")
191191
O2_DEFINE_CONFIGURABLE(cfgOutputLocDenWeights, bool, false, "Fill and output local density weights")
192192
O2_DEFINE_CONFIGURABLE(cfgOutputQA, bool, false, "do QA")
193+
O2_DEFINE_CONFIGURABLE(cfgUseT0MCent, bool, false, "Use T0M cent")
193194

194195
ConfigurableAxis cfgaxisVertex{"cfgaxisVertex", {20, -10, 10}, "vertex axis for histograms"};
195196
ConfigurableAxis cfgaxisPhi{"cfgaxisPhi", {60, 0.0, constants::math::TwoPI}, "phi axis for histograms"};
@@ -205,6 +206,7 @@ struct FlowGfwOmegaXi {
205206
ConfigurableAxis cfgaxisLambdaMassforflow{"cfgaxisLambdaMassforflow", {32, 1.08f, 1.16f}, "Inv. Mass (GeV)"};
206207
ConfigurableAxis cfgaxisNch{"cfgaxisNch", {3000, 0.5, 3000.5}, "Nch"};
207208
ConfigurableAxis cfgaxisLocalDensity{"cfgaxisLocalDensity", {200, 0, 600}, "local density"};
209+
ConfigurableAxis cfgaxisRun{"cfgaxisRun", {7, 0, 7}, "axis of runs in the data"};
208210

209211
AxisSpec axisMultiplicity{{0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "Centrality (%)"};
210212

@@ -213,7 +215,7 @@ struct FlowGfwOmegaXi {
213215

214216
using TracksPID = soa::Join<aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCPr, aod::pidTOFPi, aod::pidTOFKa, aod::pidTOFPr>;
215217
using AodTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection, o2::aod::TrackSelectionExtension, aod::TracksExtra, TracksPID, aod::TracksIU>>; // tracks filter
216-
using AodCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::MultsRun3>>; // collisions filter
218+
using AodCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::CentFT0Ms, aod::MultsRun3>>; // collisions filter
217219
using DaughterTracks = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, TracksPID, aod::TrackSelection, o2::aod::TrackSelectionExtension>;
218220

219221
// Connect to ccdb
@@ -385,14 +387,19 @@ struct FlowGfwOmegaXi {
385387
histosPhi[hPhiOmegacorr] = registry.add<TH1>(Form("%d/hPhiOmegacorr", runNumber), "", {HistType::kTH1D, {cfgaxisPhi}});
386388
th1sList.insert(std::make_pair(runNumber, histosPhi));
387389
}
388-
389-
std::vector<std::shared_ptr<TH3>> nuaTH3(kCount_TH3Names);
390-
nuaTH3[hPhiEtaVtxz] = registry.add<TH3>(Form("%d/hPhiEtaVtxz", runNumber), ";#varphi;#eta;v_{z}", {HistType::kTH3D, {cfgaxisPhi, {64, -1.6, 1.6}, cfgaxisVertex}});
391-
nuaTH3[hPhiEtaVtxzK0s] = registry.add<TH3>(Form("%d/hPhiEtaVtxzK0s", runNumber), ";#varphi;#eta;v_{z}", {HistType::kTH3D, {cfgaxisPhi, {64, -1.6, 1.6}, cfgaxisVertex}});
392-
nuaTH3[hPhiEtaVtxzLambda] = registry.add<TH3>(Form("%d/hPhiEtaVtxzLambda", runNumber), ";#varphi;#eta;v_{z}", {HistType::kTH3D, {cfgaxisPhi, {64, -1.6, 1.6}, cfgaxisVertex}});
393-
nuaTH3[hPhiEtaVtxzXi] = registry.add<TH3>(Form("%d/hPhiEtaVtxzXi", runNumber), ";#varphi;#eta;v_{z}", {HistType::kTH3D, {cfgaxisPhi, {64, -1.6, 1.6}, cfgaxisVertex}});
394-
nuaTH3[hPhiEtaVtxzOmega] = registry.add<TH3>(Form("%d/hPhiEtaVtxzOmega", runNumber), ";#varphi;#eta;v_{z}", {HistType::kTH3D, {cfgaxisPhi, {64, -1.6, 1.6}, cfgaxisVertex}});
395-
th3sList.insert(std::make_pair(runNumber, nuaTH3));
390+
}
391+
// hist for NUA
392+
registry.add("correction/hRunNumberPhiEtaVertex", "", {HistType::kTHnSparseF, {cfgaxisRun, cfgaxisPhi, cfgaxisEta, cfgaxisVertex}});
393+
registry.add("correction/hRunNumberPhiEtaVertexK0s", "", {HistType::kTHnSparseF, {cfgaxisRun, cfgaxisPhi, cfgaxisEta, cfgaxisVertex}});
394+
registry.add("correction/hRunNumberPhiEtaVertexLambda", "", {HistType::kTHnSparseF, {cfgaxisRun, cfgaxisPhi, cfgaxisEta, cfgaxisVertex}});
395+
registry.add("correction/hRunNumberPhiEtaVertexXi", "", {HistType::kTHnSparseF, {cfgaxisRun, cfgaxisPhi, cfgaxisEta, cfgaxisVertex}});
396+
registry.add("correction/hRunNumberPhiEtaVertexOmega", "", {HistType::kTHnSparseF, {cfgaxisRun, cfgaxisPhi, cfgaxisEta, cfgaxisVertex}});
397+
for (uint64_t idx = 1; idx <= runNumbers.size(); idx++) {
398+
registry.get<THnSparse>(HIST("correction/hRunNumberPhiEtaVertex"))->GetAxis(0)->SetBinLabel(idx, std::to_string(runNumbers[idx - 1]).c_str());
399+
registry.get<THnSparse>(HIST("correction/hRunNumberPhiEtaVertexK0s"))->GetAxis(0)->SetBinLabel(idx, std::to_string(runNumbers[idx - 1]).c_str());
400+
registry.get<THnSparse>(HIST("correction/hRunNumberPhiEtaVertexLambda"))->GetAxis(0)->SetBinLabel(idx, std::to_string(runNumbers[idx - 1]).c_str());
401+
registry.get<THnSparse>(HIST("correction/hRunNumberPhiEtaVertexXi"))->GetAxis(0)->SetBinLabel(idx, std::to_string(runNumbers[idx - 1]).c_str());
402+
registry.get<THnSparse>(HIST("correction/hRunNumberPhiEtaVertexOmega"))->GetAxis(0)->SetBinLabel(idx, std::to_string(runNumbers[idx - 1]).c_str());
396403
}
397404
}
398405

@@ -1011,13 +1018,26 @@ struct FlowGfwOmegaXi {
10111018
if (nTot < 1)
10121019
return;
10131020
fGFW->Clear();
1014-
const auto cent = collision.centFT0C();
1021+
auto cent = collision.centFT0C();
1022+
if (cfgUseT0MCent)
1023+
cent = collision.centFT0M();
10151024
if (!collision.sel8())
10161025
return;
10171026
registry.fill(HIST("hEventCount"), 1.5);
10181027

10191028
if (!eventSelected(collision, cent, interactionRate))
10201029
return;
1030+
int matchedPosition = -1;
1031+
for (uint64_t idxPosition = 0; idxPosition < this->runNumbers.size(); idxPosition++) {
1032+
if (this->runNumbers[idxPosition] == runNumber) {
1033+
matchedPosition = idxPosition;
1034+
break;
1035+
}
1036+
}
1037+
if (matchedPosition == -1) {
1038+
return;
1039+
}
1040+
10211041
TH1D* hLocalDensity = new TH1D("hphi", "hphi", 400, -constants::math::TwoPI, constants::math::TwoPI);
10221042
loadCorrections(bc.timestamp());
10231043
float vtxz = collision.posZ();
@@ -1036,6 +1056,8 @@ struct FlowGfwOmegaXi {
10361056
if (!setCurrentParticleWeights(weff, wacc, track, vtxz, 0))
10371057
continue;
10381058
}
1059+
if ((track.tpcNClsFound() <= trkQualityOpts.cfgTPCNCls.value) || (track.tpcNClsCrossedRows() <= trkQualityOpts.cfgTPCCrossedRows.value) || (track.itsNCls() <= trkQualityOpts.cfgITSNCls.value))
1060+
continue;
10391061
registry.fill(HIST("hPhi"), track.phi());
10401062
registry.fill(HIST("hPhicorr"), track.phi(), wacc);
10411063
registry.fill(HIST("hEta"), track.eta());
@@ -1060,7 +1082,7 @@ struct FlowGfwOmegaXi {
10601082
th1sList[runNumber][hPhi]->Fill(track.phi());
10611083
th1sList[runNumber][hPhicorr]->Fill(track.phi(), wacc);
10621084
}
1063-
th3sList[runNumber][hPhiEtaVtxz]->Fill(track.phi(), track.eta(), vtxz);
1085+
registry.fill(HIST("correction/hRunNumberPhiEtaVertex"), matchedPosition, track.phi(), track.eta(), vtxz);
10641086
}
10651087
}
10661088
if (cfgDoLocDenCorr) {
@@ -1190,14 +1212,16 @@ struct FlowGfwOmegaXi {
11901212
registry.fill(HIST("hPhiK0s"), v0.phi());
11911213
registry.fill(HIST("hPhiK0scorr"), v0.phi(), wacc);
11921214
fGFW->Fill(v0.eta(), fK0sPtAxis->FindBin(v0.pt()) - 1 + ((fK0sMass->FindBin(v0.mK0Short()) - 1) * nK0sPtBins), v0.phi(), wacc * weff * wloc, 8);
1215+
if (fK0sPtAxis->FindBin(v0.pt()) - 1 == 6)
1216+
fGFW->Fill(v0.eta(), (fK0sMass->FindBin(v0.mK0Short()) - 1), v0.phi(), wacc * weff * wloc, 2048);
11931217
if (cfgOutputNUAWeights)
11941218
fWeightsK0s->fill(v0.phi(), v0.eta(), vtxz, v0.pt(), cent, 0);
11951219
if (cfgOutputrunbyrun) {
11961220
if (cfgOutputQA) {
11971221
th1sList[runNumber][hPhiK0s]->Fill(v0.phi());
11981222
th1sList[runNumber][hPhiK0scorr]->Fill(v0.phi(), wacc);
11991223
}
1200-
th3sList[runNumber][hPhiEtaVtxzK0s]->Fill(v0.phi(), v0.eta(), vtxz);
1224+
registry.fill(HIST("correction/hRunNumberPhiEtaVertexK0s"), matchedPosition, v0.phi(), v0.eta(), vtxz);
12011225
}
12021226
}
12031227
if (isLambda) {
@@ -1224,7 +1248,7 @@ struct FlowGfwOmegaXi {
12241248
th1sList[runNumber][hPhiLambda]->Fill(v0.phi());
12251249
th1sList[runNumber][hPhiLambdacorr]->Fill(v0.phi(), wacc);
12261250
}
1227-
th3sList[runNumber][hPhiEtaVtxzLambda]->Fill(v0.phi(), v0.eta(), vtxz);
1251+
registry.fill(HIST("correction/hRunNumberPhiEtaVertexLambda"), matchedPosition, v0.phi(), v0.eta(), vtxz);
12281252
}
12291253
}
12301254
}
@@ -1401,7 +1425,7 @@ struct FlowGfwOmegaXi {
14011425
th1sList[runNumber][hPhiOmega]->Fill(casc.phi());
14021426
th1sList[runNumber][hPhiOmegacorr]->Fill(casc.phi(), wacc);
14031427
}
1404-
th3sList[runNumber][hPhiEtaVtxzOmega]->Fill(casc.phi(), casc.eta(), vtxz);
1428+
registry.fill(HIST("correction/hRunNumberPhiEtaVertexOmega"), matchedPosition, casc.phi(), casc.eta(), vtxz);
14051429
}
14061430
}
14071431
if (isXi) {
@@ -1430,7 +1454,7 @@ struct FlowGfwOmegaXi {
14301454
th1sList[runNumber][hPhiXi]->Fill(casc.phi());
14311455
th1sList[runNumber][hPhiXicorr]->Fill(casc.phi(), wacc);
14321456
}
1433-
th3sList[runNumber][hPhiEtaVtxzXi]->Fill(casc.phi(), casc.eta(), vtxz);
1457+
registry.fill(HIST("correction/hRunNumberPhiEtaVertexXi"), matchedPosition, casc.phi(), casc.eta(), vtxz);
14341458
}
14351459
}
14361460
}

0 commit comments

Comments
 (0)