Skip to content

Commit

Permalink
PWGUD: Fixing bug in personal task (AliceO2Group#7274)
Browse files Browse the repository at this point in the history
* fixing bug in logic

* Please consider the following formatting changes

* forgot to delete useless histogram

---------

Co-authored-by: ALICE Action Bot <[email protected]>
  • Loading branch information
rolavick and alibuild authored Aug 12, 2024
1 parent 5a8854e commit 870c26f
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions PWGUD/Tasks/upcEventITSROFcounter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,24 @@ struct UpcEventITSROFcounter {
int arrUPCcolls[1000] = {0};

// next is based on matching of collision bc within ITSROF range in bcs
for (auto& collision : collisions) {
int index = 0;
for (auto& itsrofBorder : vecITSROFborders) {
for (auto& itsrofBorder : vecITSROFborders) {
int nAllCollsInROF = 0;
int nUpcCollsInROF = 0;
for (auto& collision : collisions) {
if ((itsrofBorder.first < collision.bcId()) && (collision.bcId() < itsrofBorder.second)) {
break;
nAllCollsInROF++;
if (collision.numContrib() < nTracksForUPCevent + 1) {
nUpcCollsInROF++;
}
}
index++;
}
arrAllColls[index]++;
if (collision.numContrib() < nTracksForUPCevent + 1) {
arrUPCcolls[index]++;
}
} // end loop over collisions
} // end loop over collisions
arrAllColls[nAllCollsInROF]++;
arrUPCcolls[nUpcCollsInROF]++;
} // end loop over ITSROFs

for (int i = 0; i < vecITSROFborders.size(); i++) {
histos.get<TH1>(HIST("Events/hCountCollisionsInROFborderMatching"))->Fill(arrAllColls[i]);
histos.get<TH1>(HIST("Events/hCountUPCcollisionsInROFborderMatching"))->Fill(arrUPCcolls[i]);
for (int ncol = 0; ncol < 12; ncol++) {
histos.get<TH1>(HIST("Events/hCountCollisionsInROFborderMatching"))->Fill(ncol, arrAllColls[ncol]);
histos.get<TH1>(HIST("Events/hCountUPCcollisionsInROFborderMatching"))->Fill(ncol, arrUPCcolls[ncol]);
}
}

Expand Down

0 comments on commit 870c26f

Please sign in to comment.