Skip to content

Commit 8b678f7

Browse files
Merge branch 'AliceO2Group:master' into master
2 parents 96e8aa2 + 7c0fd4c commit 8b678f7

File tree

1,167 files changed

+137839
-48330
lines changed

Some content is hidden

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

1,167 files changed

+137839
-48330
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

.github/workflows/o2-linter.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020
steps:
2121
- name: Set branches
2222
run: |
23-
if [[ "${{ github.event_name }}" == "push" ]]; then
23+
if [[ "${{ github.event_name }}" == "push" || "${{ github.event_name }}" == "pull_request" ]]; then
2424
branch_head="${{ github.ref }}"
25-
branch_base="${{ env.BRANCH_MAIN }}"
25+
branch_base="origin/${{ env.BRANCH_MAIN }}"
2626
else
2727
branch_head="refs/pull/${{ github.event.pull_request.number }}/merge"
28-
branch_base="${{ github.event.pull_request.base.ref }}"
28+
branch_base="origin/${{ github.event.pull_request.base.ref }}"
2929
fi
3030
echo BRANCH_HEAD="$branch_head" >> "$GITHUB_ENV"
3131
echo BRANCH_BASE="$branch_base" >> "$GITHUB_ENV"
@@ -37,16 +37,19 @@ jobs:
3737
- name: Run tests
3838
id: linter
3939
run: |
40+
git log -n 1 --pretty='format:%ci %h %s %d%n'
4041
# Diff against the common ancestor of the source (head) branch and the target (base) branch.
4142
echo "Diffing ${{ env.BRANCH_HEAD }} against ${{ env.BRANCH_BASE }}."
42-
readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.BRANCH_BASE }}...)
43+
readarray -t files < <(git diff --diff-filter d --name-only ${{ env.BRANCH_BASE }}...)
4344
if [ ${#files[@]} -eq 0 ]; then
4445
echo "::notice::No files to lint."
4546
echo "linter_ran=0" >> "$GITHUB_OUTPUT"
4647
exit 0
4748
fi
4849
echo "linter_ran=1" >> "$GITHUB_OUTPUT"
4950
[[ "${{ github.event_name }}" == "pull_request_target" ]] && options="-g"
51+
# Checkout the script from the base branch to prevent execution of arbitrary code in the head branch.
52+
git checkout ${{ env.BRANCH_BASE }} -- Scripts/o2_linter.py
5053
# shellcheck disable=SC2086 # Ignore unquoted options.
5154
python3 Scripts/o2_linter.py $options "${files[@]}"
5255
echo "Tip: If you allow actions in your fork repository, O2 linter will run when you push commits."

.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/Decayer.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@
2121

2222
#include "ALICE3/Core/TrackUtilities.h"
2323

24-
#include "ReconstructionDataFormats/Track.h"
24+
#include <CommonConstants/PhysicsConstants.h>
25+
#include <MathUtils/Primitive2D.h>
26+
#include <ReconstructionDataFormats/Track.h>
2527

26-
#include <TDatabasePDG.h>
27-
#include <TDecayChannel.h>
28+
#include <TDecayChannel.h> // IWYU pragma: keep
2829
#include <TGenPhaseSpace.h>
2930
#include <TLorentzVector.h>
30-
#include <TParticlePDG.h>
3131
#include <TRandom3.h>
3232

3333
#include <array>
3434
#include <cmath>
35-
#include <string>
35+
#include <cstddef>
3636
#include <vector>
3737

3838
namespace o2

ALICE3/Core/DelphesO2LutWriter.cxx

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,27 @@
2525
#include "ALICE3/Core/FastTracker.h"
2626
#include "ALICE3/Core/TrackUtilities.h"
2727

28-
#include "TAxis.h"
29-
#include "TDatabasePDG.h"
30-
#include "TLorentzVector.h"
31-
#include "TMatrixD.h"
32-
#include "TMatrixDSymEigen.h"
33-
#include "TVectorD.h"
34-
28+
#include <Framework/Logger.h>
29+
#include <ReconstructionDataFormats/Track.h>
30+
31+
#include <TAxis.h>
32+
#include <TDatabasePDG.h>
33+
#include <TGraph.h>
34+
#include <TLorentzVector.h>
35+
#include <TMatrixD.h> // IWYU pragma: keep (do not replace with TMatrixDfwd.h)
36+
#include <TMatrixDSymEigen.h>
37+
#include <TMatrixDSymfwd.h>
38+
#include <TMatrixDfwd.h>
39+
#include <TParticlePDG.h>
40+
#include <TString.h>
41+
#include <TVectorDfwd.h>
42+
43+
#include <Rtypes.h>
44+
45+
#include <cmath>
3546
#include <cstdio>
47+
#include <cstdlib>
48+
#include <fstream>
3649
#include <string>
3750

3851
// #define USE_FWD_PARAM

ALICE3/Core/DelphesO2LutWriter.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@
2323
#include "ALICE3/Core/DelphesO2TrackSmearer.h"
2424
#include "ALICE3/Core/FastTracker.h"
2525

26-
#include "ReconstructionDataFormats/PID.h"
26+
#include <ReconstructionDataFormats/PID.h>
2727

28-
#include "TGraph.h"
28+
#include <TGraph.h>
2929

30+
#include <Rtypes.h>
31+
32+
#include <cstddef>
3033
#include <string>
3134

3235
namespace o2::fastsim

ALICE3/Core/DelphesO2TrackSmearer.cxx

Lines changed: 13 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@
2828
/// @author: Roberto Preghenella
2929
/// @email: preghenella@bo.infn.it
3030

31-
// #include "TrackSmearer.hh"
32-
// #include "TrackUtils.hh"
33-
// #include "TRandom.h"
34-
// #include <iostream>
35-
// #include <fstream>
36-
3731
#include "ALICE3/Core/DelphesO2TrackSmearer.h"
3832

33+
#include "ALICE3/Core/GeometryContainer.h"
34+
3935
#include <CommonConstants/PhysicsConstants.h>
4036
#include <Framework/Logger.h>
4137

42-
#include <map>
38+
#include <TRandom.h>
39+
40+
#include <cmath>
41+
#include <fstream>
42+
#include <ostream>
4343
#include <string>
4444

4545
namespace o2
@@ -61,50 +61,21 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
6161
LOG(info) << " --- LUT table for PDG " << pdg << " has been already loaded with index " << ipdg << std::endl;
6262
return false;
6363
}
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-
const std::string outPath = "/tmp/LUTs/";
68-
filename = Form("%s/%s/snapshot.root", outPath.c_str(), path.c_str());
69-
LOG(info) << " --- Local LUT filename will be: " << filename;
70-
std::ifstream checkFile(filename); // Check if file already exists
71-
if (!checkFile.is_open()) { // File does not exist, retrieve from CCDB
72-
LOG(info) << " --- CCDB source detected for PDG " << pdg << ": " << path;
73-
if (!mCcdbManager) {
74-
LOG(fatal) << " --- CCDB manager not set. Please set it before loading LUT from CCDB.";
75-
}
76-
std::map<std::string, std::string> metadata;
77-
mCcdbManager->getCCDBAccessor().retrieveBlob(path, outPath, metadata, 1);
78-
// Add CCDB handling logic here if needed
79-
LOG(info) << " --- Now retrieving LUT file from CCDB to: " << filename;
80-
if (mCleanupDownloadedFile) { // Clean up the downloaded file if needed
81-
bool status = loadTable(pdg, filename, forceReload);
82-
if (std::remove(filename) != 0) {
83-
LOG(warn) << " --- Could not remove temporary LUT file: " << filename;
84-
} else {
85-
LOG(info) << " --- Removed temporary LUT file: " << filename;
86-
}
87-
return status;
88-
}
89-
} else { // File exists, proceed to load
90-
LOG(info) << " --- LUT file already exists: " << filename << ". Skipping download.";
91-
checkFile.close();
92-
}
93-
return loadTable(pdg, filename, forceReload);
94-
}
9564

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

98-
std::ifstream lutFile(filename, std::ifstream::binary);
68+
std::ifstream lutFile(localFilename, std::ifstream::binary);
9969
if (!lutFile.is_open()) {
100-
LOG(info) << " --- cannot open covariance matrix file for PDG " << pdg << ": " << filename << std::endl;
70+
LOG(info) << " --- cannot open covariance matrix file for PDG " << pdg << ": " << localFilename << std::endl;
10171
delete mLUTHeader[ipdg];
10272
mLUTHeader[ipdg] = nullptr;
10373
return false;
10474
}
10575
lutFile.read(reinterpret_cast<char*>(mLUTHeader[ipdg]), sizeof(lutHeader_t));
10676
if (lutFile.gcount() != sizeof(lutHeader_t)) {
10777
LOG(info) << " --- troubles reading covariance matrix header for PDG " << pdg << ": " << filename << std::endl;
78+
LOG(info) << " --- expected/detected " << sizeof(lutHeader_t) << "/" << lutFile.gcount() << std::endl;
10879
delete mLUTHeader[ipdg];
10980
mLUTHeader[ipdg] = nullptr;
11081
return false;
@@ -147,7 +118,8 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
147118
mLUTEntry[ipdg][inch][irad][ieta][ipt] = new lutEntry_t;
148119
lutFile.read(reinterpret_cast<char*>(mLUTEntry[ipdg][inch][irad][ieta][ipt]), sizeof(lutEntry_t));
149120
if (lutFile.gcount() != sizeof(lutEntry_t)) {
150-
LOG(info) << " --- troubles reading covariance matrix entry for PDG " << pdg << ": " << filename << std::endl;
121+
LOG(info) << " --- troubles reading covariance matrix entry for PDG " << pdg << ": " << localFilename << std::endl;
122+
LOG(info) << " --- expected/detected " << sizeof(lutHeader_t) << "/" << lutFile.gcount() << std::endl;
151123
return false;
152124
}
153125
}

0 commit comments

Comments
 (0)