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: 7 additions & 0 deletions EventFiltering/macros/uploadOTSobjects.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

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

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -8,7 +8,7 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
//

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

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

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

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

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

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

#include <fstream>
#include <iostream>
Expand All @@ -29,7 +29,7 @@
#include "EventFiltering/ZorroHelper.h"
#include "CommonConstants/LHCConstants.h"

constexpr uint32_t chunkSize = 1000000;

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/constexpr-constant]

Use UpperCamelCase for names of constexpr constants. Names of special constants may be prefixed with "k".

void uploadOTSobjects(std::string inputList, std::string passName, bool useAlien, bool chunkedProcessing)
{
Expand Down Expand Up @@ -67,12 +67,19 @@
api.storeAsTFile(scalers, baseCCDBpath + "FilterCounters", metadata, duration.first, duration.second + 1);
api.storeAsTFile(filters, baseCCDBpath + "SelectionCounters", metadata, duration.first, duration.second + 1);
TH1* hCounterTVX = static_cast<TH1*>(scalersFile->Get("bc-selection-task/hCounterTVX"));
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;
}
}
api.storeAsTFile(hCounterTVX, baseCCDBpath + "InspectedTVX", metadata, duration.first, duration.second + 1);

std::vector<ZorroHelper> zorroHelpers;
std::unique_ptr<TFile> bcRangesFile{TFile::Open((path + "/bcRanges_fullrun.root").data(), "READ")};
int Nmax = 0;

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
for (auto key : *(bcRangesFile->GetListOfKeys())) {

Check failure on line 82 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 @@ -117,7 +124,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 127 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