Skip to content

Commit 59ad8c6

Browse files
authored
[PWGCF] Fix track type histograms. (#10178)
1 parent 38625fe commit 59ad8c6

File tree

1 file changed

+14
-22
lines changed

1 file changed

+14
-22
lines changed

PWGCF/Flow/Tasks/flowGfwTask.cxx

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -313,15 +313,16 @@ struct FlowGfwTask {
313313
// Track plots
314314
registry.add("Nch", "N_{ch 0-5%} vs #Events;N_{ch 0-5%};No. of Events", {HistType::kTH1D, {axisNch}});
315315
registry.add("Events_per_Centrality_Bin", "Events_per_Centrality_Bin;Centrality FT0C;No. of Events", kTH1F, {axisCentrality});
316+
registry.add("Tracks_per_Centrality_Bin", "Tracks_per_Centrality_Bin;Centrality FT0C;No. of Tracks", kTH1F, {axisCentrality});
316317
registry.add("pt_Cen_GlobalOnly", "pt_Cen_Global;Centrality (%); p_{T} (GeV/c);", {HistType::kTH2D, {axisCentrality, axisPt}});
317318
registry.add("phi_Cen_GlobalOnly", "phi_Cen_Global;Centrality (%); #phi;", {HistType::kTH2D, {axisCentrality, axisPhi}});
318319
registry.add("pt_Cen_ITSOnly", "pt_Cen_ITS;Centrality (%); p_{T} (GeV/c);", {HistType::kTH2D, {axisCentrality, axisPt}});
319320
registry.add("phi_Cen_ITSOnly", "phi_Cen_ITS;Centrality (%); #phi;", {HistType::kTH2D, {axisCentrality, axisPhi}});
320321

321322
// Track types
322-
registry.add("GlobalplusITS", "Global plus ITS;Centrality FT0C;Nch", kTH1F, {axisCentrality});
323-
registry.add("Globalonly", "Global only;Centrality FT0C;Nch", kTH1F, {axisCentrality});
324-
registry.add("ITSonly", "ITS only;Centrality FT0C;Nch", kTH1F, {axisCentrality});
323+
registry.add("GlobalplusITS", "Global plus ITS;Centrality FT0C;Nch", {HistType::kTH2D, {axisCentrality, axisNch}});
324+
registry.add("Globalonly", "Global only;Centrality FT0C;Nch", {HistType::kTH2D, {axisCentrality, axisNch}});
325+
registry.add("ITSonly", "ITS only;Centrality FT0C;Nch", {HistType::kTH2D, {axisCentrality, axisNch}});
325326

326327
// Track QA
327328
registry.add("hPt", "p_{T} distribution before cut", {HistType::kTH1D, {axisPtHist}});
@@ -868,9 +869,6 @@ struct FlowGfwTask {
868869

869870
// track loop
870871
int globalTracksNch = 0;
871-
int globalPlusitsNch = 0;
872-
int gloabalOnlyNch = 0;
873-
int itsOnlyNch = 0;
874872

875873
for (const auto& track : tracks) {
876874
if (!trackSelected(track))
@@ -900,33 +898,32 @@ struct FlowGfwTask {
900898
registry.fill(HIST("hDCAxy"), track.dcaXY(), track.pt());
901899
}
902900

903-
globalPlusitsNch++;
904-
905901
if (cfgGlobalplusITS) {
906902
if (withinPtRef) {
907903
fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 1);
908-
registry.fill(HIST("GlobalplusITS"), centrality);
904+
globalTracksNch++;
905+
registry.fill(HIST("GlobalplusITS"), centrality, globalTracksNch);
909906
}
910907
}
911908

912909
if (track.hasTPC()) {
913910
if (cfgGlobalonly) {
914911
if (withinPtRef) {
915912
fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 1);
916-
gloabalOnlyNch++;
917-
registry.fill(HIST("Globalonly"), centrality);
913+
globalTracksNch++;
914+
registry.fill(HIST("Globalonly"), centrality, globalTracksNch);
918915
registry.fill(HIST("pt_Cen_GlobalOnly"), centrality, track.pt());
919-
registry.fill(HIST("phi_Cen_GlobalOnly"), centrality, track.pt());
916+
registry.fill(HIST("phi_Cen_GlobalOnly"), centrality, track.phi());
920917
}
921918
}
922919
} else {
923920
if (cfgITSonly) {
924921
if (withinPtRef) {
925922
fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 1);
926-
itsOnlyNch++;
927-
registry.fill(HIST("ITSonly"), centrality);
923+
globalTracksNch++;
924+
registry.fill(HIST("ITSonly"), centrality, globalTracksNch);
928925
registry.fill(HIST("pt_Cen_ITSOnly"), centrality, track.pt());
929-
registry.fill(HIST("phi_Cen_ITSOnly"), centrality, track.pt());
926+
registry.fill(HIST("phi_Cen_ITSOnly"), centrality, track.phi());
930927
}
931928
}
932929
}
@@ -936,14 +933,9 @@ struct FlowGfwTask {
936933

937934
} // End of track loop
938935

939-
globalTracksNch = globalPlusitsNch;
940-
globalTracksNch = gloabalOnlyNch;
941-
globalTracksNch = itsOnlyNch;
942-
936+
// Only one type of track will be plotted
943937
registry.fill(HIST("Events_per_Centrality_Bin"), centrality);
944-
registry.fill(HIST("GlobalplusITS"), centrality, globalPlusitsNch);
945-
registry.fill(HIST("Globalonly"), centrality, gloabalOnlyNch);
946-
registry.fill(HIST("ITSonly"), centrality, itsOnlyNch);
938+
registry.fill(HIST("Tracks_per_Centrality_Bin"), centrality, globalTracksNch);
947939

948940
// Filling c22 with ROOT TProfile
949941
fillProfile(corrconfigs.at(0), HIST("c22"), centrality);

0 commit comments

Comments
 (0)