Skip to content

Commit 4176aba

Browse files
committed
Wrong size comparison fix
1 parent 6dd7843 commit 4176aba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

PWGLF/Tasks/Strangeness/strangeCascTrack.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -772,14 +772,14 @@ struct StrangeCascTrack {
772772
// apply general cascade cuts
773773
if (doApplyGenCutsXi) {
774774
auto genSels = isValidCasc(collision, cascade, stdCasc, "Xi");
775-
for (int i = 0; i < sizeof(genSels); ++i) {
775+
for (int i = 0; i < std::size(genSels); ++i) {
776776
if (genSels[i]) {
777777
histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/GenFiltersXi"), (i + 0.5));
778778
if (fillTruthXi)
779779
histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/GenFiltersXi"), (i + 0.5));
780780
}
781781
}
782-
if (genSels[sizeof(genSels) - 1]) {
782+
if (genSels[std::size(genSels) - 1]) {
783783
histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersXi"), 1.5);
784784
if (fillTruthXi)
785785
histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersXi"), 1.5);
@@ -789,14 +789,14 @@ struct StrangeCascTrack {
789789
}
790790
if (doApplyGenCutsOmega) {
791791
auto genSels = isValidCasc(collision, cascade, stdCasc, "Omega");
792-
for (int i = 0; i < sizeof(genSels); ++i) {
792+
for (int i = 0; i < std::size(genSels); ++i) {
793793
if (genSels[i]) {
794794
histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/GenFiltersOmega"), (i + 0.5));
795795
if (fillTruthOmega)
796796
histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/GenFiltersOmega"), (i + 0.5));
797797
}
798798
}
799-
if (genSels[sizeof(genSels) - 1]) {
799+
if (genSels[std::size(genSels) - 1]) {
800800
histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 1.5);
801801
if (fillTruthOmega)
802802
histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 1.5);

0 commit comments

Comments
 (0)