Skip to content

Commit 4004c68

Browse files
fuchuncuifuchuncui
andauthored
[PWGCF] add cascades' run by run NUA correction (#12926)
Co-authored-by: fuchuncui <fcui@cern.ch>
1 parent 32984cf commit 4004c68

File tree

1 file changed

+87
-2
lines changed

1 file changed

+87
-2
lines changed

PWGCF/Flow/Tasks/flowGfwOmegaXi.cxx

Lines changed: 87 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@
5050
#include <TRandom3.h>
5151

5252
#include <cmath>
53+
#include <map>
5354
#include <memory>
5455
#include <string>
56+
#include <unordered_map>
57+
#include <utility>
5558
#include <vector>
5659

5760
using namespace o2;
@@ -79,6 +82,7 @@ std::shared_ptr<TProfile3D> omegac22[10];
7982
std::shared_ptr<TProfile3D> omegac24[10];
8083
std::shared_ptr<TProfile3D> omegac22Full[10];
8184
std::shared_ptr<TProfile3D> omegac32[10];
85+
8286
} // namespace
8387

8488
#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable<TYPE> NAME{#NAME, DEFAULT, HELP};
@@ -166,13 +170,15 @@ struct FlowGfwOmegaXi {
166170
O2_DEFINE_CONFIGURABLE(cfgLocDenParaOmega, std::vector<double>, (std::vector<double>{-0.000444324, -6.0424, -0.000566208, -5.42168, -0.000580338, -4.96967, -0.000721054, -4.41994, -0.000626394, -4.27934, -0.000652167, -3.9543, -0.000592327, -3.79053, -0.000544721, -3.73292, -0.000613419, -3.43849, -0.000402506, -3.47687, -0.000602687, -3.24491, -0.000460848, -3.056, -0.00039428, -2.35188, -0.00041908, -2.03642}), "Local density efficiency function parameter for Omega, exp(Ax + B)")
167171
O2_DEFINE_CONFIGURABLE(cfgLocDenParaK0s, std::vector<double>, (std::vector<double>{-0.00043057, -3.2435, -0.000385085, -2.97687, -0.000350298, -2.81502, -0.000326159, -2.71091, -0.000299563, -2.65448, -0.000294284, -2.60865, -0.000277938, -2.589, -0.000277091, -2.56983, -0.000272783, -2.56825, -0.000252706, -2.58996, -0.000247834, -2.63158, -0.00024379, -2.76976, -0.000286468, -2.92484, -0.000310149, -3.27746}), "Local density efficiency function parameter for K0s, exp(Ax + B)")
168172
O2_DEFINE_CONFIGURABLE(cfgLocDenParaLambda, std::vector<double>, (std::vector<double>{-0.000510948, -4.4846, -0.000460629, -4.14465, -0.000433729, -3.94173, -0.000412751, -3.81839, -0.000411211, -3.72502, -0.000401511, -3.68426, -0.000407461, -3.67005, -0.000379371, -3.71153, -0.000392828, -3.73214, -0.000403996, -3.80717, -0.000403376, -3.90917, -0.000354624, -4.34629, -0.000477606, -4.66307, -0.000541139, -4.61364}), "Local density efficiency function parameter for Lambda, exp(Ax + B)")
173+
O2_DEFINE_CONFIGURABLE(cfgRunNumbers, std::vector<int>, (std::vector<int>{544095, 544098, 544116, 544121, 544122, 544123, 544124}), "Preconfigured run numbers")
169174
// switch
170175
O2_DEFINE_CONFIGURABLE(cfgDoAccEffCorr, bool, false, "do acc and eff corr")
171176
O2_DEFINE_CONFIGURABLE(cfgDoLocDenCorr, bool, false, "do local density corr")
172177
O2_DEFINE_CONFIGURABLE(cfgDoJackknife, bool, false, "do jackknife")
173178
O2_DEFINE_CONFIGURABLE(cfgOutputV0, bool, true, "Fill and output V0s flow")
174179
O2_DEFINE_CONFIGURABLE(cfgOutputCasc, bool, true, "Fill and output cascades flow")
175180
O2_DEFINE_CONFIGURABLE(cfgOutputNUAWeights, bool, false, "Fill and output NUA weights")
181+
O2_DEFINE_CONFIGURABLE(cfgOutputrunbyrun, bool, false, "Fill and output NUA weights run by run")
176182
O2_DEFINE_CONFIGURABLE(cfgOutputLocDenWeights, bool, false, "Fill and output local density weights")
177183
O2_DEFINE_CONFIGURABLE(cfgOutputQA, bool, false, "do QA")
178184

@@ -221,6 +227,32 @@ struct FlowGfwOmegaXi {
221227
std::vector<std::string> cfgEfficiency;
222228
std::vector<float> cfgNSigma;
223229
std::vector<int> cfgmassbins;
230+
std::vector<int> runNumbers;
231+
std::map<int, std::vector<std::shared_ptr<TH1>>> th1sList;
232+
std::map<int, std::vector<std::shared_ptr<TH3>>> th3sList;
233+
enum OutputTH1Names {
234+
// here are TProfiles for vn-pt correlations that are not implemented in GFW
235+
hPhi = 0,
236+
hPhicorr,
237+
hPhiK0s,
238+
hPhiLambda,
239+
hPhiXi,
240+
hPhiOmega,
241+
hPhiK0scorr,
242+
hPhiLambdacorr,
243+
hPhiXicorr,
244+
hPhiOmegacorr,
245+
kCount_TH1Names
246+
};
247+
248+
enum OutputTH3Names {
249+
hPhiEtaVtxz = 0,
250+
hPhiEtaVtxzK0s,
251+
hPhiEtaVtxzLambda,
252+
hPhiEtaVtxzXi,
253+
hPhiEtaVtxzOmega,
254+
kCount_TH3Names
255+
};
224256

225257
std::vector<GFWWeights*> mAcceptance;
226258
std::vector<TH1D*> mEfficiency;
@@ -325,6 +357,32 @@ struct FlowGfwOmegaXi {
325357
registry.add("hEtaPhiVtxzPOIK0s", "", {HistType::kTH3D, {cfgaxisPhi, cfgaxisEta, {20, -10, 10}}});
326358
registry.add("hEtaPhiVtxzPOILambda", "", {HistType::kTH3D, {cfgaxisPhi, cfgaxisEta, {20, -10, 10}}});
327359

360+
if (cfgOutputrunbyrun) {
361+
runNumbers = cfgRunNumbers;
362+
for (const auto& runNumber : runNumbers) {
363+
std::vector<std::shared_ptr<TH1>> histosPhi(kCount_TH1Names);
364+
histosPhi[hPhi] = registry.add<TH1>(Form("%d/hPhi", runNumber), "", {HistType::kTH1D, {cfgaxisPhi}});
365+
histosPhi[hPhicorr] = registry.add<TH1>(Form("%d/hPhicorr", runNumber), "", {HistType::kTH1D, {cfgaxisPhi}});
366+
histosPhi[hPhiK0s] = registry.add<TH1>(Form("%d/hPhiK0s", runNumber), "", {HistType::kTH1D, {cfgaxisPhi}});
367+
histosPhi[hPhiLambda] = registry.add<TH1>(Form("%d/hPhiLambda", runNumber), "", {HistType::kTH1D, {cfgaxisPhi}});
368+
histosPhi[hPhiXi] = registry.add<TH1>(Form("%d/hPhiXi", runNumber), "", {HistType::kTH1D, {cfgaxisPhi}});
369+
histosPhi[hPhiOmega] = registry.add<TH1>(Form("%d/hPhiOmega", runNumber), "", {HistType::kTH1D, {cfgaxisPhi}});
370+
histosPhi[hPhiK0scorr] = registry.add<TH1>(Form("%d/hPhiK0scorr", runNumber), "", {HistType::kTH1D, {cfgaxisPhi}});
371+
histosPhi[hPhiLambdacorr] = registry.add<TH1>(Form("%d/hPhiLambdacorr", runNumber), "", {HistType::kTH1D, {cfgaxisPhi}});
372+
histosPhi[hPhiXicorr] = registry.add<TH1>(Form("%d/hPhiXicorr", runNumber), "", {HistType::kTH1D, {cfgaxisPhi}});
373+
histosPhi[hPhiOmegacorr] = registry.add<TH1>(Form("%d/hPhiOmegacorr", runNumber), "", {HistType::kTH1D, {cfgaxisPhi}});
374+
th1sList.insert(std::make_pair(runNumber, histosPhi));
375+
376+
std::vector<std::shared_ptr<TH3>> nuaTH3(kCount_TH3Names);
377+
nuaTH3[hPhiEtaVtxz] = registry.add<TH3>(Form("%d/hPhiEtaVtxz", runNumber), ";#varphi;#eta;v_{z}", {HistType::kTH3D, {cfgaxisPhi, {64, -1.6, 1.6}, cfgaxisVertex}});
378+
nuaTH3[hPhiEtaVtxzK0s] = registry.add<TH3>(Form("%d/hPhiEtaVtxzK0s", runNumber), ";#varphi;#eta;v_{z}", {HistType::kTH3D, {cfgaxisPhi, {64, -1.6, 1.6}, cfgaxisVertex}});
379+
nuaTH3[hPhiEtaVtxzLambda] = registry.add<TH3>(Form("%d/hPhiEtaVtxzLambda", runNumber), ";#varphi;#eta;v_{z}", {HistType::kTH3D, {cfgaxisPhi, {64, -1.6, 1.6}, cfgaxisVertex}});
380+
nuaTH3[hPhiEtaVtxzXi] = registry.add<TH3>(Form("%d/hPhiEtaVtxzXi", runNumber), ";#varphi;#eta;v_{z}", {HistType::kTH3D, {cfgaxisPhi, {64, -1.6, 1.6}, cfgaxisVertex}});
381+
nuaTH3[hPhiEtaVtxzOmega] = registry.add<TH3>(Form("%d/hPhiEtaVtxzOmega", runNumber), ";#varphi;#eta;v_{z}", {HistType::kTH3D, {cfgaxisPhi, {64, -1.6, 1.6}, cfgaxisVertex}});
382+
th3sList.insert(std::make_pair(runNumber, nuaTH3));
383+
}
384+
}
385+
328386
registry.add("hEventCount", "", {HistType::kTH1D, {{12, 0, 12}}});
329387
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(1, "Filtered event");
330388
registry.get<TH1>(HIST("hEventCount"))->GetXaxis()->SetBinLabel(2, "after sel8");
@@ -446,7 +504,7 @@ struct FlowGfwOmegaXi {
446504
registry.add("MC/Lambdac22dptMC", ";pt ; C_{2}{2} ", {HistType::kTProfile2D, {cfgaxisPtLambda, axisMultiplicity}});
447505
// InvMass(GeV) of casc and v0
448506
AxisSpec axisOmegaMass = {80, 1.63f, 1.71f, "Inv. Mass (GeV)"};
449-
AxisSpec axisXiMass = {70, 1.3f, 1.37f, "Inv. Mass (GeV)"};
507+
AxisSpec axisXiMass = {80, 1.29f, 1.37f, "Inv. Mass (GeV)"};
450508
AxisSpec axisK0sMass = {400, 0.4f, 0.6f, "Inv. Mass (GeV)"};
451509
AxisSpec axisLambdaMass = {160, 1.08f, 1.16f, "Inv. Mass (GeV)"};
452510
registry.add("InvMassXi_all", "", {HistType::kTHnSparseF, {cfgaxisPtXi, axisXiMass, cfgaxisEta, axisMultiplicity}});
@@ -919,6 +977,7 @@ struct FlowGfwOmegaXi {
919977
return;
920978
TH1D* hLocalDensity = new TH1D("hphi", "hphi", 400, -constants::math::TwoPI, constants::math::TwoPI);
921979
auto bc = collision.bc_as<aod::BCsWithTimestamps>();
980+
int runNumber = bc.runNumber();
922981
loadCorrections(bc.timestamp());
923982
float vtxz = collision.posZ();
924983
registry.fill(HIST("hVtxZ"), vtxz);
@@ -954,6 +1013,12 @@ struct FlowGfwOmegaXi {
9541013
}
9551014
if (cfgOutputNUAWeights)
9561015
fWeightsREF->fill(track.phi(), track.eta(), vtxz, track.pt(), cent, 0);
1016+
1017+
if (cfgOutputrunbyrun) {
1018+
th1sList[runNumber][hPhi]->Fill(track.phi());
1019+
th1sList[runNumber][hPhicorr]->Fill(track.phi(), wacc);
1020+
th3sList[runNumber][hPhiEtaVtxz]->Fill(track.phi(), track.eta(), vtxz);
1021+
}
9571022
}
9581023
if (cfgDoLocDenCorr) {
9591024
registry.fill(HIST("hCentvsNch"), cent, nch);
@@ -1080,6 +1145,11 @@ struct FlowGfwOmegaXi {
10801145
fGFW->Fill(v0.eta(), fK0sPtAxis->FindBin(v0.pt()) - 1 + ((fK0sMass->FindBin(v0.mK0Short()) - 1) * nK0sPtBins), v0.phi(), wacc * weff * wloc, 8);
10811146
if (cfgOutputNUAWeights)
10821147
fWeightsK0s->fill(v0.phi(), v0.eta(), vtxz, v0.pt(), cent, 0);
1148+
if (cfgOutputrunbyrun) {
1149+
th1sList[runNumber][hPhiK0s]->Fill(v0.phi());
1150+
th1sList[runNumber][hPhiK0scorr]->Fill(v0.phi(), wacc);
1151+
th3sList[runNumber][hPhiEtaVtxzK0s]->Fill(v0.phi(), v0.eta(), vtxz);
1152+
}
10831153
}
10841154
if (isLambda) {
10851155
if (cfgDoAccEffCorr)
@@ -1099,6 +1169,11 @@ struct FlowGfwOmegaXi {
10991169
fGFW->Fill(v0.eta(), fK0sPtAxis->FindBin(v0.pt()) - 1 + ((fLambdaMass->FindBin(v0.mLambda()) - 1) * nK0sPtBins), v0.phi(), wacc * weff * wloc, 16);
11001170
if (cfgOutputNUAWeights)
11011171
fWeightsLambda->fill(v0.phi(), v0.eta(), vtxz, v0.pt(), cent, 0);
1172+
if (cfgOutputrunbyrun) {
1173+
th1sList[runNumber][hPhiLambda]->Fill(v0.phi());
1174+
th1sList[runNumber][hPhiLambdacorr]->Fill(v0.phi(), wacc);
1175+
th3sList[runNumber][hPhiEtaVtxzLambda]->Fill(v0.phi(), v0.eta(), vtxz);
1176+
}
11021177
}
11031178
}
11041179
}
@@ -1222,7 +1297,7 @@ struct FlowGfwOmegaXi {
12221297
isXi = false;
12231298
}
12241299
if (isOmega && std::fabs(casc.mXi() - o2::constants::physics::MassXiMinus) < cascBuilderOpts.cfgcasc_compmassrej.value) {
1225-
isXi = false;
1300+
isOmega = false;
12261301
}
12271302
// fill QA
12281303
if (cfgOutputQA) {
@@ -1264,6 +1339,11 @@ struct FlowGfwOmegaXi {
12641339

12651340
if (cfgOutputNUAWeights)
12661341
fWeightsOmega->fill(casc.phi(), casc.eta(), vtxz, casc.pt(), cent, 0);
1342+
if (cfgOutputrunbyrun) {
1343+
th1sList[runNumber][hPhiOmega]->Fill(casc.phi());
1344+
th1sList[runNumber][hPhiOmegacorr]->Fill(casc.phi(), wacc);
1345+
th3sList[runNumber][hPhiEtaVtxzOmega]->Fill(casc.phi(), casc.eta(), vtxz);
1346+
}
12671347
}
12681348
if (isXi) {
12691349
if (cfgDoAccEffCorr) {
@@ -1285,6 +1365,11 @@ struct FlowGfwOmegaXi {
12851365

12861366
if (cfgOutputNUAWeights)
12871367
fWeightsXi->fill(casc.phi(), casc.eta(), vtxz, casc.pt(), cent, 0);
1368+
if (cfgOutputrunbyrun) {
1369+
th1sList[runNumber][hPhiXi]->Fill(casc.phi());
1370+
th1sList[runNumber][hPhiXicorr]->Fill(casc.phi(), wacc);
1371+
th3sList[runNumber][hPhiEtaVtxzXi]->Fill(casc.phi(), casc.eta(), vtxz);
1372+
}
12881373
}
12891374
}
12901375
}

0 commit comments

Comments
 (0)