Skip to content

Commit 64ea85f

Browse files
authored
[PWGLF] Update on Nch-dependet corrections (#11662)
1 parent fb549b3 commit 64ea85f

File tree

1 file changed

+65
-49
lines changed

1 file changed

+65
-49
lines changed

PWGLF/Tasks/GlobalEventProperties/uccZdc.cxx

Lines changed: 65 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ struct UccZdc {
173173
// define axes you want to use
174174
const AxisSpec axisZpos{48, -12., 12., "Vtx_{z} (cm)"};
175175
const AxisSpec axisEvent{18, 0.5, 18.5, ""};
176-
const AxisSpec axisEta{30, -1.05, +1.05, "#eta"};
176+
const AxisSpec axisEta{40, -1., +1., "#eta"};
177177
const AxisSpec axisPt{binsPt, "#it{p}_{T} (GeV/#it{c})"};
178178
const AxisSpec axisDeltaPt{100, -1.0, +1.0, "#Delta(p_{T})"};
179179
const AxisSpec axisCent{binsCent, "T0C centrality"};
@@ -245,27 +245,25 @@ struct UccZdc {
245245
registry.add("NchVsThreeParCorr", "MC closure;#it{N}_{ch} (|#eta| < 0.8, Corrected);#LT[#it{p}_{T}^{(3)}]#GT", kTProfile, {{nBinsNch, minNch, maxNch}});
246246
registry.add("NchVsFourParCorr", "MC closure;#it{N}_{ch} (|#eta| < 0.8, Corrected);#LT[#it{p}_{T}^{(4)}]#GT", kTProfile, {{nBinsNch, minNch, maxNch}});
247247
// Corrections
248-
registry.add("NchRec", "Corrections;#it{N}_{ch} (|#eta| < 0.8);Entries;", kTH1F, {{nBinsNch, minNch, maxNch}});
249-
registry.add("NchTrue", "Corrections;#it{N}_{ch} (|#eta| < 0.8);Entries;", kTH1F, {{nBinsNch, minNch, maxNch}});
250-
251248
registry.add("zPosMC", "Filled at MC closure + Corrections;;Entries;", kTH1F, {axisZpos});
252249
registry.add("hEventCounterMC", "Event counter", kTH1F, {axisEvent});
253250
registry.add("nRecColvsCent", "", kTH2F, {{6, -0.5, 5.5}, {{axisCent}}});
254-
registry.add("Pt_all_ch", "Corrections;;;", kTH2F, {{axisCent}, {axisPt}});
255-
registry.add("Pt_ch", "Corrections;;;", kTH2F, {{axisCent}, {axisPt}});
256-
registry.add("Pt_pi", "Corrections;;;", kTH2F, {{axisCent}, {axisPt}});
257-
registry.add("Pt_ka", "Corrections;;;", kTH2F, {{axisCent}, {axisPt}});
258-
registry.add("Pt_pr", "Corrections;;;", kTH2F, {{axisCent}, {axisPt}});
259-
registry.add("Pt_sigpos", "Corrections;;;", kTH2F, {{axisCent}, {axisPt}});
260-
registry.add("Pt_signeg", "Corrections;;;", kTH2F, {{axisCent}, {axisPt}});
261-
registry.add("Pt_re", "Corrections;;;", kTH2F, {{axisCent}, {axisPt}});
262-
registry.add("PtMC_ch", "Corrections;;;", kTH2F, {{axisCent}, {axisPt}});
263-
registry.add("PtMC_pi", "Corrections;;;", kTH2F, {{axisCent}, {axisPt}});
264-
registry.add("PtMC_ka", "Corrections;;;", kTH2F, {{axisCent}, {axisPt}});
265-
registry.add("PtMC_pr", "Corrections;;;", kTH2F, {{axisCent}, {axisPt}});
266-
registry.add("PtMC_sigpos", "Corrections;;;", kTH2F, {{axisCent}, {axisPt}});
267-
registry.add("PtMC_signeg", "Corrections;;;", kTH2F, {{axisCent}, {axisPt}});
268-
registry.add("PtMC_re", "Corrections;;;", kTH2F, {{axisCent}, {axisPt}});
251+
registry.add("Pt_all_ch", "Corrections;#it{N}_{ch} (|#eta|<0.8);;", kTH2F, {{nBinsNch, minNch, maxNch}, {axisPt}});
252+
registry.add("Pt_ch", "Corrections;#it{N}_{ch} (|#eta|<0.8);;", kTH2F, {{nBinsNch, minNch, maxNch}, {axisPt}});
253+
registry.add("Pt_pi", "Corrections;#it{N}_{ch} (|#eta|<0.8);;", kTH2F, {{nBinsNch, minNch, maxNch}, {axisPt}});
254+
registry.add("Pt_ka", "Corrections;#it{N}_{ch} (|#eta|<0.8);;", kTH2F, {{nBinsNch, minNch, maxNch}, {axisPt}});
255+
registry.add("Pt_pr", "Corrections;#it{N}_{ch} (|#eta|<0.8);;", kTH2F, {{nBinsNch, minNch, maxNch}, {axisPt}});
256+
registry.add("Pt_sigpos", "Corrections;;;", kTH2F, {{nBinsNch, minNch, maxNch}, {axisPt}});
257+
registry.add("Pt_signeg", "Corrections;;;", kTH2F, {{nBinsNch, minNch, maxNch}, {axisPt}});
258+
registry.add("Pt_re", "Corrections;;;", kTH2F, {{nBinsNch, minNch, maxNch}, {axisPt}});
259+
registry.add("PtMC_ch", "Corrections;;;", kTH2F, {{nBinsNch, minNch, maxNch}, {axisPt}});
260+
registry.add("PtMC_pi", "Corrections;;;", kTH2F, {{nBinsNch, minNch, maxNch}, {axisPt}});
261+
registry.add("PtMC_ka", "Corrections;;;", kTH2F, {{nBinsNch, minNch, maxNch}, {axisPt}});
262+
registry.add("PtMC_pr", "Corrections;;;", kTH2F, {{nBinsNch, minNch, maxNch}, {axisPt}});
263+
registry.add("PtMC_sigpos", "Corrections;;;", kTH2F, {{nBinsNch, minNch, maxNch}, {axisPt}});
264+
registry.add("PtMC_signeg", "Corrections;;;", kTH2F, {{nBinsNch, minNch, maxNch}, {axisPt}});
265+
registry.add("PtMC_re", "Corrections;;;", kTH2F, {{nBinsNch, minNch, maxNch}, {axisPt}});
266+
registry.add("McNchVsFT0M", ";T0A+T0C (#times 1/100, -3.3 < #eta < -2.1 and 3.5 < #eta < 4.9);#it{N}_{ch} (|#eta|<0.8);", kTH2F, {{{nBinsAmpFT0, 0., maxAmpFT0}, {nBinsNch, minNch, maxNch}}});
269267

270268
auto hECMC = registry.get<TH1>(HIST("hEventCounterMC"));
271269
auto* x = hECMC->GetXaxis();
@@ -818,7 +816,7 @@ struct UccZdc {
818816
// Preslice<aod::McParticles> perMCCollision = aod::mcparticle::mcCollisionId;
819817
Preslice<TheFilteredSimTracks> perCollision = aod::track::collisionId;
820818
TRandom* randPointer = new TRandom();
821-
void processMCclosure(aod::McCollisions::iterator const& mccollision, soa::SmallGroups<o2::aod::SimCollisions> const& collisions, o2::aod::BCsRun3 const& /*bcs*/, aod::McParticles const& mcParticles, TheFilteredSimTracks const& simTracks)
819+
void processMCclosure(aod::McCollisions::iterator const& mccollision, soa::SmallGroups<o2::aod::SimCollisions> const& collisions, o2::aod::BCsRun3 const& /*bcs*/, aod::FT0s const& /*ft0s*/, aod::McParticles const& mcParticles, TheFilteredSimTracks const& simTracks)
822820
{
823821
float rndNum = randPointer->Uniform(0.0, 1.0);
824822
registry.fill(HIST("RandomNumber"), rndNum);
@@ -840,6 +838,25 @@ struct UccZdc {
840838
continue;
841839
}
842840

841+
const auto& foundBC = collision.foundBC_as<o2::aod::BCsRun3>();
842+
843+
float aT0A = 0., aT0C = 0.;
844+
if (foundBC.has_ft0()) {
845+
for (const auto& amplitude : foundBC.ft0().amplitudeA()) {
846+
aT0A += amplitude;
847+
}
848+
for (const auto& amplitude : foundBC.ft0().amplitudeC()) {
849+
aT0C += amplitude;
850+
}
851+
} else {
852+
return;
853+
}
854+
855+
double nchRaw{0.};
856+
double nchMult{0.};
857+
double normT0M{0.};
858+
normT0M = (aT0A + aT0C) / 100.;
859+
843860
registry.fill(HIST("zPos"), collision.posZ());
844861
registry.fill(HIST("zPosMC"), mccollision.posZ());
845862
registry.fill(HIST("hEventCounterMC"), EvCutLabel::VtxZ);
@@ -853,13 +870,11 @@ struct UccZdc {
853870
registry.fill(HIST("EvtsDivided"), 0);
854871

855872
// To use run-by-run efficiency
856-
const auto& foundBC = collision.foundBC_as<o2::aod::BCsRun3>();
857873
auto efficiency = ccdb->getForTimeStamp<TH1F>(paTHEff.value, foundBC.timestamp());
858874
if (!efficiency) {
859875
return;
860876
}
861877

862-
int nchRaw{0};
863878
std::vector<float> pTs;
864879
std::vector<float> vecFD;
865880
std::vector<float> vecOneOverEff;
@@ -876,6 +891,7 @@ struct UccZdc {
876891
float effValue{1.};
877892
float fdValue{1.};
878893
nchRaw++;
894+
879895
if (applyEff) {
880896
effValue = efficiency->GetBinContent(efficiency->FindBin(pt));
881897
fdValue = fd->GetBinContent(fd->FindBin(pt));
@@ -887,7 +903,6 @@ struct UccZdc {
887903
}
888904
}
889905

890-
double nchMult{0.};
891906
nchMult = std::accumulate(vecOneOverEff.begin(), vecOneOverEff.end(), 0);
892907
if (nchMult < minNchSel) {
893908
return;
@@ -969,9 +984,18 @@ struct UccZdc {
969984
} else { // Correction with the remaining half of the sample
970985
registry.fill(HIST("EvtsDivided"), 1);
971986
//----- MC reconstructed -----//
972-
int nchTrue{0};
973-
int nchRec{0};
974987
const auto& groupedTracks{simTracks.sliceBy(perCollision, collision.globalIndex())};
988+
for (const auto& track : groupedTracks) {
989+
// Track Selection
990+
if (!track.isGlobalTrack()) {
991+
continue;
992+
}
993+
registry.fill(HIST("ZposVsEta"), collision.posZ(), track.eta());
994+
registry.fill(HIST("EtaVsPhi"), track.eta(), track.phi());
995+
registry.fill(HIST("dcaXYvspT"), track.dcaXY(), track.pt());
996+
nchRaw++;
997+
}
998+
975999
for (const auto& track : groupedTracks) {
9761000
// Track Selection
9771001
if (!track.isGlobalTrack()) {
@@ -981,31 +1005,26 @@ struct UccZdc {
9811005
if (!track.has_mcParticle()) {
9821006
continue;
9831007
}
1008+
registry.fill(HIST("Pt_all_ch"), nchRaw, track.pt());
9841009

9851010
const auto& particle{track.mcParticle()};
986-
registry.fill(HIST("Pt_all_ch"), cent, track.pt());
987-
registry.fill(HIST("ZposVsEta"), collision.posZ(), track.eta());
988-
registry.fill(HIST("EtaVsPhi"), track.eta(), track.phi());
989-
registry.fill(HIST("dcaXYvspT"), track.dcaXY(), track.pt());
990-
9911011
if (!particle.isPhysicalPrimary()) {
9921012
continue;
9931013
}
9941014

995-
nchRec++;
996-
registry.fill(HIST("Pt_ch"), cent, track.pt());
1015+
registry.fill(HIST("Pt_ch"), nchRaw, track.pt());
9971016
if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus) {
998-
registry.fill(HIST("Pt_pi"), cent, track.pt());
1017+
registry.fill(HIST("Pt_pi"), nchRaw, track.pt());
9991018
} else if (particle.pdgCode() == PDG_t::kKPlus || particle.pdgCode() == PDG_t::kKMinus) {
1000-
registry.fill(HIST("Pt_ka"), cent, track.pt());
1019+
registry.fill(HIST("Pt_ka"), nchRaw, track.pt());
10011020
} else if (particle.pdgCode() == PDG_t::kProton || particle.pdgCode() == PDG_t::kProtonBar) {
1002-
registry.fill(HIST("Pt_pr"), cent, track.pt());
1021+
registry.fill(HIST("Pt_pr"), nchRaw, track.pt());
10031022
} else if (particle.pdgCode() == PDG_t::kSigmaPlus || particle.pdgCode() == PDG_t::kSigmaBarMinus) {
1004-
registry.fill(HIST("Pt_sigpos"), cent, track.pt());
1023+
registry.fill(HIST("Pt_sigpos"), nchRaw, track.pt());
10051024
} else if (particle.pdgCode() == PDG_t::kSigmaMinus || particle.pdgCode() == PDG_t::kSigmaBarPlus) {
1006-
registry.fill(HIST("Pt_signeg"), cent, track.pt());
1025+
registry.fill(HIST("Pt_signeg"), nchRaw, track.pt());
10071026
} else {
1008-
registry.fill(HIST("Pt_re"), cent, track.pt());
1027+
registry.fill(HIST("Pt_re"), nchRaw, track.pt());
10091028
}
10101029
}
10111030

@@ -1021,26 +1040,23 @@ struct UccZdc {
10211040
continue;
10221041
}
10231042

1024-
nchTrue++;
1025-
registry.fill(HIST("PtMC_ch"), cent, particle.pt());
1043+
registry.fill(HIST("PtMC_ch"), nchRaw, particle.pt());
10261044
if (particle.pdgCode() == PDG_t::kPiPlus || particle.pdgCode() == PDG_t::kPiMinus) { // pion
1027-
registry.fill(HIST("PtMC_pi"), cent, particle.pt());
1045+
registry.fill(HIST("PtMC_pi"), nchRaw, particle.pt());
10281046
} else if (particle.pdgCode() == PDG_t::kKPlus || particle.pdgCode() == PDG_t::kKMinus) { // kaon
1029-
registry.fill(HIST("PtMC_ka"), cent, particle.pt());
1047+
registry.fill(HIST("PtMC_ka"), nchRaw, particle.pt());
10301048
} else if (particle.pdgCode() == PDG_t::kProton || particle.pdgCode() == PDG_t::kProtonBar) { // proton
1031-
registry.fill(HIST("PtMC_pr"), cent, particle.pt());
1049+
registry.fill(HIST("PtMC_pr"), nchRaw, particle.pt());
10321050
} else if (particle.pdgCode() == PDG_t::kSigmaPlus || particle.pdgCode() == PDG_t::kSigmaBarMinus) { // positive sigma
1033-
registry.fill(HIST("PtMC_sigpos"), cent, particle.pt());
1051+
registry.fill(HIST("PtMC_sigpos"), nchRaw, particle.pt());
10341052
} else if (particle.pdgCode() == PDG_t::kSigmaMinus || particle.pdgCode() == PDG_t::kSigmaBarPlus) { // negative sigma
1035-
registry.fill(HIST("PtMC_signeg"), cent, particle.pt());
1053+
registry.fill(HIST("PtMC_signeg"), nchRaw, particle.pt());
10361054
} else { // rest
1037-
registry.fill(HIST("PtMC_re"), cent, particle.pt());
1055+
registry.fill(HIST("PtMC_re"), nchRaw, particle.pt());
10381056
}
10391057
}
1040-
1041-
registry.fill(HIST("NchRec"), nchRec);
1042-
registry.fill(HIST("NchTrue"), nchTrue);
10431058
} // Half of statistics for corrections
1059+
registry.fill(HIST("McNchVsFT0M"), normT0M, nchRaw);
10441060
} // Collisions
10451061
}
10461062
PROCESS_SWITCH(UccZdc, processMCclosure, "Process MC closure", false);

0 commit comments

Comments
 (0)