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
11 changes: 4 additions & 7 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,15 +29,12 @@
#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)
void uploadOTSobjects(std::string inputList, std::string passName, bool useAlien, bool chunkedProcessing = true)
{
const std::string kBaseCCDBPath = "Users/m/mpuccio/EventFiltering/OTS/";
const std::string kBaseCCDBPath = "EventFiltering/Zorro/";
std::string baseCCDBpath = passName.empty() ? kBaseCCDBPath : kBaseCCDBPath + passName + "/";
if (chunkedProcessing) {
baseCCDBpath += "Chunked/";
}
if (useAlien) {
TGrid::Connect("alien://");
}
Expand Down Expand Up @@ -78,8 +75,8 @@

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

Check failure on line 78 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 79 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 @@ -124,7 +121,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 124 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 All @@ -141,9 +138,9 @@
}
}

void uploadOTSobjects(std::string periodName, bool chunkedProcessing)
void uploadOTSobjects(std::string periodName)
{
int year = 2000 + std::stoi(periodName.substr(3, 2));
gSystem->Exec(Form("alien_find /alice/data/%i/%s/ ctf_skim_full/AnalysisResults_fullrun.root | sed 's:/AnalysisResults_fullrun\\.root::' > list_%s.txt", year, periodName.data(), periodName.data()));
uploadOTSobjects(Form("list_%s.txt", periodName.data()), "", true, chunkedProcessing);
uploadOTSobjects(Form("list_%s.txt", periodName.data()), "", true, true);
}
Loading