Skip to content

Commit 7b8b572

Browse files
authored
Merge branch 'master' into rashi
2 parents a48ea43 + 31aed8c commit 7b8b572

File tree

626 files changed

+88771
-30977
lines changed

Some content is hidden

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

626 files changed

+88771
-30977
lines changed

.github/labeler.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,7 @@ trigger:
8787
tutorial:
8888
- changed-files:
8989
- any-glob-to-any-file: ["Tutorials/**"]
90+
91+
photon:
92+
- changed-files:
93+
- any-glob-to-any-file: ["PWGEM/PhotonMeson/**", "*/PWGEM/PhotonMeson/**"]

.github/workflows/mega-linter.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
id: ml
3939
# You can override MegaLinter flavor used to have faster performances
4040
# More info at https://megalinter.io/flavors/
41-
uses: oxsecurity/megalinter@v9.3.0
41+
uses: oxsecurity/megalinter@v9.4.0
4242
env:
4343
# All available variables are described in documentation:
4444
# https://megalinter.io/configuration/
@@ -49,7 +49,7 @@ jobs:
4949

5050
# Upload MegaLinter artifacts
5151
- name: Archive production artifacts
52-
uses: actions/upload-artifact@v5
52+
uses: actions/upload-artifact@v7
5353
if: success() || failure()
5454
with:
5555
name: MegaLinter reports

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repos:
77
- id: trailing-whitespace
88
- id: end-of-file-fixer
99
- repo: https://github.com/pre-commit/mirrors-clang-format
10-
rev: v21.1.8 # clang-format version
10+
rev: v20.1.3 # clang-format version (keep synced with https://github.com/alisw/ali-bot/blob/master/.github/workflows/c++-code-formatting.yml)
1111
hooks:
1212
- id: clang-format
1313
- repo: https://github.com/cpplint/cpplint

ALICE3/Core/ALICE3CoreLinkDef.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@
1414
#pragma link off all functions;
1515

1616
#pragma link C++ class o2::pid::tof::TOFResoALICE3 + ;
17+
#pragma link C++ class std::vector < std::vector < unsigned int>> + ;
18+
#pragma link C++ class std::vector < std::vector < std::uint32_t>> + ;

ALICE3/Core/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ o2physics_add_library(ALICE3Core
1313
SOURCES TOFResoALICE3.cxx
1414
TrackUtilities.cxx
1515
DelphesO2TrackSmearer.cxx
16+
GeometryContainer.cxx
1617
PUBLIC_LINK_LIBRARIES O2::Framework
1718
O2Physics::AnalysisCore)
1819

1920
o2physics_target_root_dictionary(ALICE3Core
2021
HEADERS TOFResoALICE3.h
2122
TrackUtilities.h
2223
DelphesO2TrackSmearer.h
24+
GeometryContainer.h
2325
LINKDEF ALICE3CoreLinkDef.h)
2426

2527
o2physics_add_library(FastTracker

ALICE3/Core/DelphesO2TrackSmearer.cxx

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737
#include "ALICE3/Core/DelphesO2TrackSmearer.h"
3838

39+
#include "ALICE3/Core/GeometryContainer.h"
40+
3941
#include <CommonConstants/PhysicsConstants.h>
4042
#include <Framework/Logger.h>
4143

@@ -61,42 +63,13 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
6163
LOG(info) << " --- LUT table for PDG " << pdg << " has been already loaded with index " << ipdg << std::endl;
6264
return false;
6365
}
64-
if (strncmp(filename, "ccdb:", 5) == 0) { // Check if filename starts with "ccdb:"
65-
LOG(info) << " --- LUT file source identified as CCDB.";
66-
std::string path = std::string(filename).substr(5); // Remove "ccdb:" prefix
67-
filename = Form("%s/%s/snapshot.root", mOutPath.c_str(), path.c_str());
68-
LOG(info) << " --- Local LUT filename will be: " << filename;
69-
std::ifstream checkFile(filename); // Check if file already exists
70-
if (!checkFile.is_open()) { // File does not exist, retrieve from CCDB
71-
LOG(info) << " --- CCDB source detected for PDG " << pdg << ": " << path;
72-
if (!mCcdbManager) {
73-
LOG(fatal) << " --- CCDB manager not set. Please set it before loading LUT from CCDB.";
74-
}
75-
std::map<std::string, std::string> metadata;
76-
mCcdbManager->getCCDBAccessor().retrieveBlob(path, mOutPath, metadata, 1);
77-
// Add CCDB handling logic here if needed
78-
LOG(info) << " --- Now retrieving LUT file from CCDB to: " << filename;
79-
if (mCleanupDownloadedFile) { // Clean up the downloaded file if needed
80-
bool status = loadTable(pdg, filename, forceReload);
81-
if (std::remove(filename) != 0) {
82-
LOG(warn) << " --- Could not remove temporary LUT file: " << filename;
83-
} else {
84-
LOG(info) << " --- Removed temporary LUT file: " << filename;
85-
}
86-
return status;
87-
}
88-
} else { // File exists, proceed to load
89-
LOG(info) << " --- LUT file already exists: " << filename << ". Skipping download.";
90-
checkFile.close();
91-
}
92-
return loadTable(pdg, filename, forceReload);
93-
}
9466

67+
const std::string localFilename = o2::fastsim::GeometryEntry::accessFile(filename, "./.ALICE3/LUTs/", mCcdbManager, 10);
9568
mLUTHeader[ipdg] = new lutHeader_t;
9669

97-
std::ifstream lutFile(filename, std::ifstream::binary);
70+
std::ifstream lutFile(localFilename, std::ifstream::binary);
9871
if (!lutFile.is_open()) {
99-
LOG(info) << " --- cannot open covariance matrix file for PDG " << pdg << ": " << filename << std::endl;
72+
LOG(info) << " --- cannot open covariance matrix file for PDG " << pdg << ": " << localFilename << std::endl;
10073
delete mLUTHeader[ipdg];
10174
mLUTHeader[ipdg] = nullptr;
10275
return false;
@@ -147,7 +120,7 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
147120
mLUTEntry[ipdg][inch][irad][ieta][ipt] = new lutEntry_t;
148121
lutFile.read(reinterpret_cast<char*>(mLUTEntry[ipdg][inch][irad][ieta][ipt]), sizeof(lutEntry_t));
149122
if (lutFile.gcount() != sizeof(lutEntry_t)) {
150-
LOG(info) << " --- troubles reading covariance matrix entry for PDG " << pdg << ": " << filename << std::endl;
123+
LOG(info) << " --- troubles reading covariance matrix entry for PDG " << pdg << ": " << localFilename << std::endl;
151124
LOG(info) << " --- expected/detected " << sizeof(lutHeader_t) << "/" << lutFile.gcount() << std::endl;
152125
return false;
153126
}

ALICE3/Core/DelphesO2TrackSmearer.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,8 @@ class TrackSmearer
249249
return "pion"; // Default: pion
250250
}
251251
}
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; } //;
252+
void setdNdEta(float val) { mdNdEta = val; } //;
253+
void setCcdbManager(o2::ccdb::BasicCCDBManager* mgr) { mCcdbManager = mgr; } //;
256254

257255
protected:
258256
static constexpr unsigned int nLUTs = 9; // Number of LUT available
@@ -266,8 +264,6 @@ class TrackSmearer
266264

267265
private:
268266
o2::ccdb::BasicCCDBManager* mCcdbManager = nullptr;
269-
bool mCleanupDownloadedFile = true;
270-
std::string mOutPath = "/tmp/LUTs/";
271267
};
272268

273269
} // namespace delphes

0 commit comments

Comments
 (0)