Skip to content

Commit 4e3f129

Browse files
authored
Merge branch 'master' into processMCOutlier
2 parents 04e1f91 + 2fd6543 commit 4e3f129

File tree

53 files changed

+6128
-1289
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+6128
-1289
lines changed

.github/workflows/o2-linter.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Find issues in O2 code
33
name: O2 linter
44

5-
# "on": [pull_request_target, push]
5+
#"on": [pull_request_target, push]
66
permissions: {}
77
env:
88
BRANCH_MAIN: master
@@ -47,6 +47,8 @@ jobs:
4747
fi
4848
echo "linter_ran=1" >> "$GITHUB_OUTPUT"
4949
[[ "${{ github.event_name }}" == "pull_request_target" ]] && options="-g"
50+
# Checkout the script from the base branch to prevent execution of arbitrary code in the head branch.
51+
git checkout ${{ env.BRANCH_BASE }} -- Scripts/o2_linter.py
5052
# shellcheck disable=SC2086 # Ignore unquoted options.
5153
python3 Scripts/o2_linter.py $options "${files[@]}"
5254
echo "Tip: If you allow actions in your fork repository, O2 linter will run when you push commits."

ALICE3/Core/DelphesO2TrackSmearer.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
6464
if (strncmp(filename, "ccdb:", 5) == 0) { // Check if filename starts with "ccdb:"
6565
LOG(info) << " --- LUT file source identified as CCDB.";
6666
std::string path = std::string(filename).substr(5); // Remove "ccdb:" prefix
67-
const std::string outPath = "/tmp/LUTs/";
68-
filename = Form("%s/%s/snapshot.root", outPath.c_str(), path.c_str());
67+
filename = Form("%s/%s/snapshot.root", mOutPath.c_str(), path.c_str());
6968
LOG(info) << " --- Local LUT filename will be: " << filename;
7069
std::ifstream checkFile(filename); // Check if file already exists
7170
if (!checkFile.is_open()) { // File does not exist, retrieve from CCDB
@@ -74,7 +73,7 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
7473
LOG(fatal) << " --- CCDB manager not set. Please set it before loading LUT from CCDB.";
7574
}
7675
std::map<std::string, std::string> metadata;
77-
mCcdbManager->getCCDBAccessor().retrieveBlob(path, outPath, metadata, 1);
76+
mCcdbManager->getCCDBAccessor().retrieveBlob(path, mOutPath, metadata, 1);
7877
// Add CCDB handling logic here if needed
7978
LOG(info) << " --- Now retrieving LUT file from CCDB to: " << filename;
8079
if (mCleanupDownloadedFile) { // Clean up the downloaded file if needed
@@ -105,6 +104,7 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
105104
lutFile.read(reinterpret_cast<char*>(mLUTHeader[ipdg]), sizeof(lutHeader_t));
106105
if (lutFile.gcount() != sizeof(lutHeader_t)) {
107106
LOG(info) << " --- troubles reading covariance matrix header for PDG " << pdg << ": " << filename << std::endl;
107+
LOG(info) << " --- expected/detected " << sizeof(lutHeader_t) << "/" << lutFile.gcount() << std::endl;
108108
delete mLUTHeader[ipdg];
109109
mLUTHeader[ipdg] = nullptr;
110110
return false;
@@ -148,6 +148,7 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
148148
lutFile.read(reinterpret_cast<char*>(mLUTEntry[ipdg][inch][irad][ieta][ipt]), sizeof(lutEntry_t));
149149
if (lutFile.gcount() != sizeof(lutEntry_t)) {
150150
LOG(info) << " --- troubles reading covariance matrix entry for PDG " << pdg << ": " << filename << std::endl;
151+
LOG(info) << " --- expected/detected " << sizeof(lutHeader_t) << "/" << lutFile.gcount() << std::endl;
151152
return false;
152153
}
153154
}

ALICE3/Core/DelphesO2TrackSmearer.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <fstream>
3434
#include <iostream>
3535
#include <map>
36+
#include <string>
3637

3738
///////////////////////////////
3839
/// DelphesO2/src/lutCovm.hh //
@@ -248,9 +249,10 @@ class TrackSmearer
248249
return "pion"; // Default: pion
249250
}
250251
}
251-
void setdNdEta(float val) { mdNdEta = val; } //;
252-
void setCcdbManager(o2::ccdb::BasicCCDBManager* mgr) { mCcdbManager = mgr; } //;
253-
void setCleanupDownloadedFile(bool val) { mCleanupDownloadedFile = val; } //;
252+
void setdNdEta(float val) { mdNdEta = val; } //;
253+
void setCcdbManager(o2::ccdb::BasicCCDBManager* mgr) { mCcdbManager = mgr; } //;
254+
void setCleanupDownloadedFile(bool val) { mCleanupDownloadedFile = val; } //;
255+
void setDownloadPath(const std::string& path) { mOutPath = "/tmp/LUTs/" + path; } //;
254256

255257
protected:
256258
static constexpr unsigned int nLUTs = 9; // Number of LUT available
@@ -265,6 +267,7 @@ class TrackSmearer
265267
private:
266268
o2::ccdb::BasicCCDBManager* mCcdbManager = nullptr;
267269
bool mCleanupDownloadedFile = true;
270+
std::string mOutPath = "/tmp/LUTs/";
268271
};
269272

270273
} // namespace delphes

ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ struct OnTheFlyRichPid {
301301
mSmearer.emplace_back(std::make_unique<o2::delphes::DelphesO2TrackSmearer>());
302302
mSmearer[icfg]->setCleanupDownloadedFile(cleanLutWhenLoaded.value);
303303
mSmearer[icfg]->setCcdbManager(ccdb.operator->());
304+
mSmearer[icfg]->setDownloadPath("RICHPID");
304305
std::map<std::string, std::string> globalConfiguration = mGeoContainer.getConfiguration(icfg, "global");
305306
for (const auto& entry : globalConfiguration) {
306307
int pdg = 0;

ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ struct OnTheFlyTofPid {
160160
mSmearer.emplace_back(std::make_unique<o2::delphes::DelphesO2TrackSmearer>());
161161
mSmearer[icfg]->setCleanupDownloadedFile(cleanLutWhenLoaded.value);
162162
mSmearer[icfg]->setCcdbManager(ccdb.operator->());
163+
mSmearer[icfg]->setDownloadPath("TOFPID");
163164
std::map<std::string, std::string> globalConfiguration = mGeoContainer.getConfiguration(icfg, "global");
164165
for (const auto& entry : globalConfiguration) {
165166
int pdg = 0;

0 commit comments

Comments
 (0)