Skip to content

Commit 1b07b1d

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents 337dd6a + b15420a commit 1b07b1d

File tree

459 files changed

+64303
-26091
lines changed

Some content is hidden

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

459 files changed

+64303
-26091
lines changed

.github/labeler.yml

Lines changed: 51 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,89 @@
11
---
2-
alice3:
2+
infrastructure:
33
- changed-files:
4-
- any-glob-to-any-file: ['ALICE3/**']
4+
- any-glob-to-any-file:
5+
- ".checkov.yml"
6+
- ".clang-format"
7+
- ".clang-tidy"
8+
- ".flake8"
9+
- ".git-blame-ignore-revs"
10+
- ".github/**"
11+
- ".gitignore"
12+
- ".mega-linter.yml"
13+
- ".pre-commit-config.yaml"
14+
- "cmake/**"
15+
- "CMakeLists.txt"
16+
- "CODEOWNERS"
17+
- "COPYING"
18+
- "cppcheck_config"
19+
- "CPPLINT.cfg"
20+
- "dependencies/**"
21+
- "o2linter_config"
22+
- "packaging/**"
23+
- "pyproject.toml"
24+
- "README.md"
525

6-
common:
26+
datamodel:
727
- changed-files:
8-
- any-glob-to-any-file: ['Common/**']
28+
- any-glob-to-any-file: ["DataModel/**", "**/DataModel/**"]
929

10-
infrastructure:
30+
alice3:
1131
- changed-files:
12-
- any-glob-to-any-file:
13-
- '.clang-format'
14-
- '.clang-tidy'
15-
- '.flake8'
16-
- '.github/**'
17-
- '.checkov.yml'
18-
- '.mega-linter.yml'
19-
- '.pre-commit-config.yaml'
20-
- 'cmake/**'
21-
- 'CODEOWNERS'
22-
- 'CPPLINT.cfg'
23-
- 'dependencies/**'
24-
- 'packaging/**'
25-
- 'pyproject.toml'
32+
- any-glob-to-any-file: ["ALICE3/**"]
2633

27-
datamodel:
34+
common:
2835
- changed-files:
29-
- any-glob-to-any-file: ['DataModel/**', '**/DataModel/**']
36+
- any-glob-to-any-file: ["Common/**"]
3037

3138
dpg:
3239
- changed-files:
33-
- any-glob-to-any-file: ['DPG/**']
40+
- any-glob-to-any-file: ["DPG/**"]
3441

3542
pwgcf:
3643
- changed-files:
37-
- any-glob-to-any-file: ['PWGCF/**', '*/PWGCF/**']
44+
- any-glob-to-any-file: ["PWGCF/**", "*/PWGCF/**"]
3845

3946
pwgdq:
4047
- changed-files:
41-
- any-glob-to-any-file: ['PWGDQ/**', '*/PWGDQ/**']
48+
- any-glob-to-any-file: ["PWGDQ/**", "*/PWGDQ/**"]
4249

4350
pwgem:
4451
- changed-files:
45-
- any-glob-to-any-file: ['PWGEM/**', '*/PWGEM/**']
52+
- any-glob-to-any-file: ["PWGEM/**", "*/PWGEM/**"]
4653

4754
pwghf:
4855
- changed-files:
49-
- any-glob-to-any-file: ['PWGHF/**', '*/PWGHF/**']
56+
- any-glob-to-any-file: ["PWGHF/**", "*/PWGHF/**"]
5057

5158
pwgje:
5259
- changed-files:
53-
- any-glob-to-any-file: ['PWGJE/**', '*/PWGJE/**']
60+
- any-glob-to-any-file: ["PWGJE/**", "*/PWGJE/**"]
5461

5562
pwglf:
5663
- changed-files:
57-
- any-glob-to-any-file: ['PWGLF/**', '*/PWGLF/**', 'PWGMM/**', '*/PWGMM/**']
64+
- any-glob-to-any-file:
65+
["PWGLF/**", "*/PWGLF/**", "PWGMM/**", "*/PWGMM/**"]
66+
67+
pwgmm:
68+
- changed-files:
69+
- any-glob-to-any-file: ["PWGMM/**", "*/PWGMM/**"]
5870

5971
pwgud:
6072
- changed-files:
61-
- any-glob-to-any-file: ['PWGUD/**', '*/PWGUD/**']
73+
- any-glob-to-any-file: ["PWGUD/**", "*/PWGUD/**"]
74+
75+
scripts:
76+
- changed-files:
77+
- any-glob-to-any-file: ["Scripts/**"]
78+
79+
tools:
80+
- changed-files:
81+
- any-glob-to-any-file: ["Tools/**"]
6282

6383
trigger:
6484
- changed-files:
65-
- any-glob-to-any-file: ['EventFiltering/**']
85+
- any-glob-to-any-file: ["EventFiltering/**"]
6686

6787
tutorial:
6888
- changed-files:
69-
- any-glob-to-any-file: ['Tutorials/**']
89+
- any-glob-to-any-file: ["Tutorials/**"]

.github/workflows/mega-linter.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
steps:
2424
# Git Checkout
2525
- name: Checkout Code
26-
uses: actions/checkout@v5
26+
uses: actions/checkout@v6
2727
with:
2828
# Checkout the HEAD of the PR instead of the merge commit.
2929
ref: ${{ github.event.pull_request.head.sha }}
@@ -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.1.0
41+
uses: oxsecurity/megalinter@v9.2.0
4242
env:
4343
# All available variables are described in documentation:
4444
# https://megalinter.io/configuration/

.github/workflows/o2-linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
echo BRANCH_HEAD="$branch_head" >> "$GITHUB_ENV"
3131
echo BRANCH_BASE="$branch_base" >> "$GITHUB_ENV"
3232
- name: Checkout Code
33-
uses: actions/checkout@v5
33+
uses: actions/checkout@v6
3434
with:
3535
ref: ${{ env.BRANCH_HEAD }}
3636
fetch-depth: 0 # needed to get the full history

.github/workflows/stale.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
with:
1818
repo-token: ${{ secrets.GITHUB_TOKEN }}
1919
stale-pr-message: 'This PR has not been updated in the last 30 days. Is it still needed? Unless further action is taken, it will be closed in 5 days.'
20+
stale-issue-message: 'This issue has not been updated in the last 30 days. Is it still needed? Unless further action is taken, it will be closed in 5 days.'
2021
stale-pr-label: stale
2122
days-before-stale: 30
2223
days-before-close: 5
24+
exempt-issue-labels: bug,enhancement

ALICE3/Core/DelphesO2TrackSmearer.cxx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ bool TrackSmearer::loadTable(int pdg, const char* filename, bool forceReload)
7676
mCcdbManager->getCCDBAccessor().retrieveBlob(path, outPath, metadata, 1);
7777
// Add CCDB handling logic here if needed
7878
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+
}
7988
} else { // File exists, proceed to load
8089
LOG(info) << " --- LUT file already exists: " << filename << ". Skipping download.";
8190
checkFile.close();
@@ -157,9 +166,9 @@ lutEntry_t* TrackSmearer::getLUTEntry(const int pdg, const float nch, const floa
157166
{
158167
const int ipdg = getIndexPDG(pdg);
159168
if (!mLUTHeader[ipdg]) {
160-
LOG(error) << " --- getLUTEntry: LUT header not loaded for pdg=" << pdg << ". Returning nullptr.";
161169
return nullptr;
162170
}
171+
163172
auto inch = mLUTHeader[ipdg]->nchmap.find(nch);
164173
auto irad = mLUTHeader[ipdg]->radmap.find(radius);
165174
auto ieta = mLUTHeader[ipdg]->etamap.find(eta);
@@ -281,7 +290,6 @@ bool TrackSmearer::smearTrack(O2Track& o2track, lutEntry_t* lutEntry, float inte
281290

282291
bool TrackSmearer::smearTrack(O2Track& o2track, int pdg, float nch)
283292
{
284-
285293
auto pt = o2track.getPt();
286294
switch (pdg) {
287295
case o2::constants::physics::kHelium3:

ALICE3/Core/DelphesO2TrackSmearer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ class TrackSmearer
250250
}
251251
void setdNdEta(float val) { mdNdEta = val; } //;
252252
void setCcdbManager(o2::ccdb::BasicCCDBManager* mgr) { mCcdbManager = mgr; } //;
253+
void setCleanupDownloadedFile(bool val) { mCleanupDownloadedFile = val; } //;
253254

254255
protected:
255256
static constexpr unsigned int nLUTs = 9; // Number of LUT available
@@ -263,6 +264,7 @@ class TrackSmearer
263264

264265
private:
265266
o2::ccdb::BasicCCDBManager* mCcdbManager = nullptr;
267+
bool mCleanupDownloadedFile = true;
266268
};
267269

268270
} // namespace delphes

ALICE3/Core/DetLayer.cxx

Lines changed: 57 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -28,63 +28,63 @@ namespace o2::fastsim
2828
{
2929

3030
// Parametric constructor
31-
DetLayer::DetLayer(const TString& name_,
32-
float r_,
33-
float z_,
34-
float x0_,
35-
float xrho_,
36-
float resRPhi_,
37-
float resZ_,
38-
float eff_,
39-
int type_)
40-
: name(name_),
41-
r(r_),
42-
z(z_),
43-
x0(x0_),
44-
xrho(xrho_),
45-
resRPhi(resRPhi_),
46-
resZ(resZ_),
47-
eff(eff_),
48-
type(type_)
31+
DetLayer::DetLayer(const TString& name,
32+
float r,
33+
float z,
34+
float x0,
35+
float xrho,
36+
float resRPhi,
37+
float resZ,
38+
float eff,
39+
int type)
40+
: mName(name),
41+
mR(r),
42+
mZ(z),
43+
mX0(x0),
44+
mXrho(xrho),
45+
mResRPhi(resRPhi),
46+
mResZ(resZ),
47+
mEff(eff),
48+
mType(type)
4949
{
5050
}
5151

5252
DetLayer::DetLayer(const DetLayer& other)
53-
: name(other.name), r(other.r), z(other.z), x0(other.x0), xrho(other.xrho), resRPhi(other.resRPhi), resZ(other.resZ), eff(other.eff), type(other.type)
53+
: mName(other.mName), mR(other.mR), mZ(other.mZ), mX0(other.mX0), mXrho(other.mXrho), mResRPhi(other.mResRPhi), mResZ(other.mResZ), mEff(other.mEff), mType(other.mType)
5454
{
5555
}
5656

5757
void DetLayer::addDeadPhiRegion(float phiStart, float phiEnd)
5858
{
59-
static constexpr float kDefaultValue = 2.f;
60-
static constexpr float kPhiTolerance = 1e-4f;
59+
static constexpr float DefaultValue = 2.f;
60+
static constexpr float PhiTolerance = 1e-4f;
6161
if (mDeadPhiRegions == nullptr) {
6262
mDeadPhiRegions = new TGraph();
63-
mDeadPhiRegions->SetNameTitle(Form("deadPhiRegions_%s", name.Data()), Form("Dead phi regions for layer %s", name.Data()));
64-
mDeadPhiRegions->AddPoint(0, kDefaultValue);
65-
mDeadPhiRegions->AddPoint(o2::constants::math::TwoPI, kDefaultValue);
63+
mDeadPhiRegions->SetNameTitle(Form("deadPhiRegions_%s", mName.Data()), Form("Dead phi regions for layer %s", mName.Data()));
64+
mDeadPhiRegions->AddPoint(0, DefaultValue);
65+
mDeadPhiRegions->AddPoint(o2::constants::math::TwoPI, DefaultValue);
6666
}
6767
if (phiStart < 0 || phiStart >= o2::constants::math::TwoPI || phiEnd < 0 || phiEnd >= o2::constants::math::TwoPI) {
68-
LOG(fatal) << "Cannot add dead phi region with invalid range [" << phiStart << ", " << phiEnd << "] to layer " << name;
68+
LOG(fatal) << "Cannot add dead phi region with invalid range [" << phiStart << ", " << phiEnd << "] to layer " << mName;
6969
return;
7070
}
71-
mDeadPhiRegions->AddPoint(phiStart, kDefaultValue);
72-
mDeadPhiRegions->AddPoint(phiEnd, kDefaultValue);
73-
mDeadPhiRegions->AddPoint(phiStart + kPhiTolerance, 0.f);
74-
mDeadPhiRegions->AddPoint(phiEnd - kPhiTolerance, 0.f);
71+
mDeadPhiRegions->AddPoint(phiStart, DefaultValue);
72+
mDeadPhiRegions->AddPoint(phiEnd, DefaultValue);
73+
mDeadPhiRegions->AddPoint(phiStart + PhiTolerance, 0.f);
74+
mDeadPhiRegions->AddPoint(phiEnd - PhiTolerance, 0.f);
7575
mDeadPhiRegions->Sort();
7676
}
7777

7878
void DetLayer::setDeadPhiRegions(TGraph* graph)
7979
{
80-
LOG(debug) << "Setting dead phi regions for layer " << name << " with graph " << (graph ? graph->GetName() : "nullptr");
80+
LOG(debug) << "Setting dead phi regions for layer " << mName << " with graph " << (graph ? graph->GetName() : "nullptr");
8181
if (mDeadPhiRegions != nullptr) {
82-
LOG(warning) << "Overriding existing dead phi regions for layer " << name;
82+
LOG(warning) << "Overriding existing dead phi regions for layer " << mName;
8383
delete mDeadPhiRegions;
8484
}
8585
mDeadPhiRegions = graph;
8686
if (mDeadPhiRegions->GetN() == 0) {
87-
LOG(warning) << "Dead phi regions graph for layer " << name << " is empty, clearing dead regions";
87+
LOG(warning) << "Dead phi regions graph for layer " << mName << " is empty, clearing dead regions";
8888
mDeadPhiRegions = nullptr;
8989
return; // cleared the dead regions
9090
}
@@ -95,51 +95,59 @@ void DetLayer::setDeadPhiRegions(TGraph* graph)
9595
const float y = mDeadPhiRegions->GetY()[i];
9696
// First point has to be at 0, last point has to be at 2PI
9797
if ((i == 0 && x != 0.f) || (i == mDeadPhiRegions->GetN() - 1 && x != o2::constants::math::TwoPI)) {
98-
LOG(fatal) << "Dead phi regions graph for layer " << name << " has invalid x value " << x << " at point " << i << ", first point should be 0 and last point should be 2PI";
98+
LOG(fatal) << "Dead phi regions graph for layer " << mName << " has invalid x value " << x << " at point " << i << ", first point should be 0 and last point should be 2PI";
9999
}
100100
LOG(debug) << "Point " << i << ": (" << x << ", " << y << ")";
101101
if (x < 0 || x > o2::constants::math::TwoPI) {
102-
LOG(fatal) << "Dead phi regions graph for layer " << name << " has invalid x value " << x << " at point " << i;
102+
LOG(fatal) << "Dead phi regions graph for layer " << mName << " has invalid x value " << x << " at point " << i;
103103
}
104-
if (y != 0.f && y != 2.f) {
105-
LOG(fatal) << "Dead phi regions graph for layer " << name << " has invalid y value " << y << " at point " << i << ", should be 0 or 2";
104+
static constexpr float EffValidLowValue = 0.f;
105+
static constexpr float EffValidHighValue = 2.f;
106+
if (y != EffValidLowValue && y != EffValidHighValue) {
107+
LOG(fatal) << "Dead phi regions graph for layer " << mName << " has invalid y value " << y << " at point " << i << ", should be 0 or 2";
106108
}
107109
}
108110
} else {
109-
LOG(info) << "Cleared dead phi regions for layer " << name;
111+
LOG(info) << "Cleared dead phi regions for layer " << mName;
110112
}
111113
}
112114

113115
std::string DetLayer::toString() const
114116
{
115117
std::string out = "";
116118
out.append("DetLayer: ");
117-
out.append(name.Data());
119+
out.append(mName.Data());
118120
out.append(" | r: ");
119-
out.append(std::to_string(r));
121+
out.append(std::to_string(mR));
120122
out.append(" cm | z: ");
121-
out.append(std::to_string(z));
123+
out.append(std::to_string(mZ));
122124
out.append(" cm | x0: ");
123-
out.append(std::to_string(x0));
125+
out.append(std::to_string(mX0));
124126
out.append(" cm | xrho: ");
125-
out.append(std::to_string(xrho));
127+
out.append(std::to_string(mXrho));
126128
out.append(" g/cm^3 | resRPhi: ");
127-
out.append(std::to_string(resRPhi));
129+
out.append(std::to_string(mResRPhi));
128130
out.append(" cm | resZ: ");
129-
out.append(std::to_string(resZ));
131+
out.append(std::to_string(mResZ));
130132
out.append(" cm | eff: ");
131-
out.append(std::to_string(eff));
133+
out.append(std::to_string(mEff));
132134
out.append(" | type: ");
133-
switch (type) {
134-
case layerInert:
135+
switch (mType) {
136+
case kLayerInert:
135137
out.append("Inert");
136138
break;
137-
case layerSilicon:
139+
case kLayerSilicon:
138140
out.append("Silicon");
139141
break;
140-
case layerGas:
142+
case kLayerGas:
141143
out.append("Gas/TPC");
142144
break;
145+
case kLayerTOF:
146+
out.append("TOF");
147+
break;
148+
case kLayerVertex:
149+
out.append("Vertex");
150+
break;
143151
default:
144152
out.append("Unknown");
145153
break;

0 commit comments

Comments
 (0)