Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions EventFiltering/macros/uploadOTSobjects.C
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@
if (!hCounterTVX) {
hCounterTVX = static_cast<TH1*>(scalersFile->Get("lumi-task/hCounterTVX"));
if (!hCounterTVX) {
std::cout << "No hCounterTVX histogram found in the file, skipping upload for run " << runString << std::endl;
continue;
hCounterTVX = static_cast<TH1*>(scalersFile->Get("eventselection-run3/luminosity/hCounterTVX"));
Copy link
Copy Markdown
Collaborator

@vkucera vkucera Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never use static_cast to downcast pointers. It's not safe. Use dynamic_cast.

if (!hCounterTVX) {
std::cout << "No hCounterTVX histogram found in the file, skipping upload for run " << runString << std::endl;
continue;
}
}
}
api.storeAsTFile(hCounterTVX, baseCCDBpath + "InspectedTVX", metadata, duration.first, duration.second + 1);
Expand All @@ -84,7 +87,7 @@
std::vector<ZorroHelper> zorroHelpers;
std::unique_ptr<TFile> bcRangesFile{TFile::Open((path + "/bcRanges_fullrun.root").data(), "READ")};
int Nmax = 0;
for (auto key : *(bcRangesFile->GetListOfKeys())) {

Check failure on line 90 in EventFiltering/macros/uploadOTSobjects.C

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
TTree* cefpTree = static_cast<TTree*>(bcRangesFile->Get(Form("%s/selectedBC", key->GetName())));
if (!cefpTree)
continue;
Expand Down Expand Up @@ -129,7 +132,7 @@
auto bcEnd{zorroHelpers[endIndex].bcAOD > zorroHelpers[endIndex].bcEvSel ? zorroHelpers[endIndex].bcAOD : zorroHelpers[endIndex].bcEvSel};
const auto& nextHelper = zorroHelpers[endIndex + 1];
auto bcNext{nextHelper.bcAOD < nextHelper.bcEvSel ? nextHelper.bcAOD : nextHelper.bcEvSel};
if (bcNext - bcEnd > 2001 / o2::constants::lhc::LHCBunchSpacingMUS) { /// ensure a gap of 2ms between chunks

Check failure on line 135 in EventFiltering/macros/uploadOTSobjects.C

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
chunk.insert(chunk.begin(), zorroHelpers.begin() + helperIndex, zorroHelpers.begin() + endIndex + 1);
endTS = (orbitResetTimestamp + int64_t(bcEnd * o2::constants::lhc::LHCBunchSpacingNS * 1e-3)) / 1000 + 1;
break;
Expand Down
Loading