Skip to content

Commit ae16a09

Browse files
authored
Merge branch 'master' into feature-antin-cex-output-variables
2 parents 18714b3 + 2e7f88a commit ae16a09

945 files changed

Lines changed: 194703 additions & 71154 deletions

File tree

Some content is hidden

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

.clang-format

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ IncludeCategories:
4747
Priority: 2
4848
CaseSensitive: true
4949
# O2Physics, non-PWG
50-
- Regex: ^(<|")(Common|ALICE3|DPG|EventFiltering|Tools|Tutorials)/.*\.h
50+
- Regex: ^(<|")(Common|ALICE3|DPG|EventFiltering|PID|Tools|Tutorials)/.*\.h
5151
Priority: 3
5252
CaseSensitive: true
5353
# O2
54-
- Regex: ^(<|")(Algorithm|CCDB|Common[A-Z]|DataFormats|DCAFitter|Detectors|EMCAL|FDD|Field|Framework|FT0|FV0|GlobalTracking|GPU|ITS|MathUtils|MCH|MFT|MID|PHOS|PID|ReconstructionDataFormats|SimulationDataFormat|TOF|TPC|ZDC).*/.*\.h
54+
- Regex: ^(<|")(Algorithm|CCDB|Common[A-Z]|DataFormats|DCAFitter|Detectors|EMCAL|FDD|Field|Framework|FT0|FV0|GlobalTracking|GPU|ITS|MathUtils|MCH|MFT|MID|PHOS|ReconstructionDataFormats|SimulationDataFormat|TOF|TPC|ZDC).*/.*\.h
5555
Priority: 4
5656
CaseSensitive: true
5757
# ROOT
@@ -93,6 +93,7 @@ IncludeCategories:
9393
# rest
9494
- Regex: .*
9595
Priority: 100
96+
CaseSensitive: true
9697
SpaceBeforeAssignmentOperators: true
9798
SpaceBeforeParens: ControlStatements
9899
SpaceInEmptyParentheses: false

.clang-tidy

Lines changed: 144 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,146 @@
1+
---
2+
Checks:
3+
# - clang-analyzer-* # enabled by default
4+
# - clang-diagnostic-* # enabled by default
5+
- -clang-diagnostic-unknown-pragmas
6+
- bugprone-*
7+
- -bugprone-assert-side-effect
8+
- -bugprone-bad-signal-to-kill-thread
9+
- -bugprone-bitwise-pointer-cast
10+
- -bugprone-bool-pointer-implicit-conversion
11+
- -bugprone-compare-pointer-to-member-virtual-function
12+
- -bugprone-crtp-constructor-accessibility
13+
- -bugprone-easily-swappable-parameters # Too sensitive
14+
- -bugprone-forwarding-reference-overload
15+
- -bugprone-implicit-widening-of-multiplication-result # Specific cases irrelevant in this repo
16+
- -bugprone-lambda-function-name
17+
- -bugprone-no-escape
18+
- -bugprone-posix-return
19+
- -bugprone-signal-handler
20+
- -bugprone-signed-char-misuse # Specific use cases. Probably very rare.
21+
- -bugprone-spuriously-wake-up-functions
22+
- -bugprone-suspicious-stringview-data-usage # Probably harmless in this repo
23+
- -bugprone-unused-raii
24+
- cppcoreguidelines-avoid-const-or-ref-data-members
25+
- cppcoreguidelines-avoid-goto
26+
- cppcoreguidelines-avoid-non-const-global-variables
27+
- cppcoreguidelines-init-variables
28+
- cppcoreguidelines-macro-usage
29+
- cppcoreguidelines-misleading-capture-default-by-value
30+
- cppcoreguidelines-missing-std-forward
31+
- cppcoreguidelines-prefer-member-initializer
32+
- cppcoreguidelines-pro-bounds-array-to-pointer-decay
33+
- cppcoreguidelines-pro-type-const-cast
34+
- cppcoreguidelines-pro-type-cstyle-cast
35+
- cppcoreguidelines-pro-type-member-init
36+
- cppcoreguidelines-pro-type-reinterpret-cast
37+
- cppcoreguidelines-pro-type-static-cast-downcast
38+
- cppcoreguidelines-pro-type-union-access
39+
- cppcoreguidelines-rvalue-reference-param-not-moved
40+
- cppcoreguidelines-slicing
41+
- cppcoreguidelines-virtual-class-destructor
42+
- google-default-arguments
43+
# - google-explicit-constructor # triggered for O2 columns
44+
- google-global-names-in-headers
45+
# - misc-const-correctness # to be checked
46+
- misc-header-include-cycle
47+
- misc-include-cleaner
48+
- misc-misplaced-const
49+
- misc-redundant-expression
50+
- misc-unconventional-assign-operator
51+
- misc-unused-alias-decls
52+
- misc-unused-parameters
53+
- misc-unused-using-decls
54+
- modernize-avoid-bind
55+
- modernize-avoid-c-arrays
56+
- modernize-concat-nested-namespaces
57+
- modernize-deprecated-headers
58+
- modernize-make-shared
59+
- modernize-make-unique
60+
- modernize-redundant-void-arg
61+
- modernize-return-braced-init-list
62+
- modernize-use-auto
63+
- modernize-use-default-member-init
64+
- modernize-use-designated-initializers
65+
- modernize-use-equals-default
66+
- modernize-use-equals-delete
67+
- modernize-use-nodiscard
68+
- modernize-use-nullptr
69+
- modernize-use-override
70+
- modernize-use-starts-ends-with
71+
- performance-for-range-copy
72+
- performance-implicit-conversion-in-loop
73+
- performance-inefficient-algorithm
74+
- performance-inefficient-string-concatenation
75+
- performance-inefficient-vector-operation
76+
- performance-move-const-arg
77+
- performance-no-automatic-move
78+
- performance-trivially-destructible
79+
- performance-type-promotion-in-math-fn
80+
- performance-unnecessary-copy-initialization
81+
- performance-unnecessary-value-param # slow
82+
- readability-avoid-unconditional-preprocessor-if
83+
- readability-braces-around-statements
84+
- readability-const-return-type
85+
- readability-container-contains
86+
- readability-container-data-pointer
87+
- readability-container-size-empty
88+
- readability-delete-null-pointer
89+
- readability-duplicate-include
90+
- readability-else-after-return
91+
- readability-enum-initial-value
92+
- readability-implicit-bool-conversion
93+
- readability-inconsistent-declaration-parameter-name
94+
- readability-misplaced-array-index
95+
- readability-non-const-parameter
96+
- readability-redundant-access-specifiers
97+
- readability-redundant-casting
98+
- readability-redundant-control-flow
99+
- readability-redundant-declaration
100+
- readability-redundant-member-init
101+
- readability-redundant-preprocessor
102+
- readability-redundant-string-cstr
103+
- readability-redundant-string-init
104+
- readability-reference-to-constructed-temporary
105+
- readability-simplify-boolean-expr
106+
- readability-static-definition-in-anonymous-namespace
107+
- readability-string-compare
108+
- readability-suspicious-call-argument
109+
# Select which of the enabled checks should be reported as errors instead of warnings.
110+
WarningsAsErrors: >-
111+
*,
112+
-readability-braces-around-statements,
113+
-readability-suspicious-call-argument,
114+
-modernize-*,
115+
-readability-*,
1116
CheckOptions:
117+
modernize-avoid-c-arrays.AllowStringArrays: true
118+
# Common tolerated conversions
119+
bugprone-narrowing-conversions.WarnOnFloatingPointNarrowingConversion: false
120+
bugprone-narrowing-conversions.WarnOnIntegerNarrowingConversion: false
121+
bugprone-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion: false
122+
readability-implicit-bool-conversion.AllowLogicalOperatorConversion: true
123+
readability-implicit-bool-conversion.AllowPointerConditions: true
124+
# Some data model structs are missing some special functions by design.
125+
cppcoreguidelines-special-member-functions.AllowMissingMoveFunctions: true
2126
# Naming conventions
3-
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
4-
- { key: readability-identifier-naming.ClassMemberPrefix, value: m }
5-
- { key: readability-identifier-naming.ConceptCase, value: CamelCase }
6-
- { key: readability-identifier-naming.ConstexprVariableCase, value: CamelCase }
7-
- { key: readability-identifier-naming.EnumCase, value: CamelCase }
8-
- { key: readability-identifier-naming.EnumConstantCase, value: CamelCase }
9-
- { key: readability-identifier-naming.EnumConstantIgnoredRegexp, value: "^k?[A-Z][a-zA-Z0-9_]*$" } # Allow "k" prefix and non-trailing underscores in PDG names.
10-
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
11-
- { key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }
12-
- { key: readability-identifier-naming.MacroDefinitionIgnoredRegexp, value: "^[A-Z][A-Z0-9_]*_$" } # Allow the trailing underscore in header guards.
13-
- { key: readability-identifier-naming.MemberCase, value: camelBack }
14-
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
15-
- { key: readability-identifier-naming.ParameterCase, value: camelBack }
16-
- { key: readability-identifier-naming.StructCase, value: CamelCase }
17-
- { key: readability-identifier-naming.TemplateParameterCase, value: CamelCase }
18-
- { key: readability-identifier-naming.TypeAliasCase, value: CamelCase }
19-
- { key: readability-identifier-naming.TypedefCase, value: CamelCase }
20-
- { key: readability-identifier-naming.TypeTemplateParameterCase, value: CamelCase }
21-
- { key: readability-identifier-naming.VariableCase, value: camelBack }
127+
readability-identifier-naming.ClassCase: CamelCase
128+
readability-identifier-naming.ClassMemberPrefix: m
129+
readability-identifier-naming.ConceptCase: CamelCase
130+
readability-identifier-naming.ConstexprVariableCase: CamelCase
131+
readability-identifier-naming.EnumCase: CamelCase
132+
readability-identifier-naming.EnumConstantCase: CamelCase
133+
readability-identifier-naming.EnumConstantIgnoredRegexp: "^k?[A-Z][a-zA-Z0-9_]*$" # Allow "k" prefix and non-trailing underscores in PDG names.
134+
readability-identifier-naming.FunctionCase: camelBack
135+
readability-identifier-naming.MacroDefinitionCase: UPPER_CASE
136+
readability-identifier-naming.MacroDefinitionIgnoredRegexp: "^[A-Z][A-Z0-9_]*_$" # Allow the trailing underscore in header guards.
137+
readability-identifier-naming.MemberCase: camelBack
138+
readability-identifier-naming.NamespaceCase: lower_case
139+
readability-identifier-naming.ParameterCase: camelBack
140+
readability-identifier-naming.StructCase: CamelCase
141+
readability-identifier-naming.TemplateParameterCase: CamelCase
142+
readability-identifier-naming.TypeAliasCase: CamelCase
143+
readability-identifier-naming.TypedefCase: CamelCase
144+
readability-identifier-naming.TypeTemplateParameterCase: CamelCase
145+
readability-identifier-naming.VariableCase: camelBack
146+
...

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- name: Label the PR
1818
id: labeler
19-
uses: actions/labeler@v6
19+
uses: actions/labeler@v7
2020
with:
2121
repo-token: ${{ secrets.GITHUB_TOKEN }}
2222
sync-labels: true

.github/workflows/mega-linter.yml

Lines changed: 3 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@v6
26+
uses: actions/checkout@v7
2727
with:
2828
# Checkout the HEAD of the PR instead of the merge commit.
2929
ref: ${{ github.event.pull_request.head.sha }}
@@ -32,13 +32,14 @@ jobs:
3232
fetch-depth: 0
3333
# So we can use secrets.ALIBUILD_GITHUB_TOKEN to push later.
3434
persist-credentials: false
35+
allow-unsafe-pr-checkout: true # needed for pull_request_target
3536

3637
# MegaLinter
3738
- name: MegaLinter
3839
id: ml
3940
# You can override MegaLinter flavor used to have faster performances
4041
# More info at https://megalinter.io/flavors/
41-
uses: oxsecurity/megalinter@v9.4.0
42+
uses: oxsecurity/megalinter@v10.0.0
4243
env:
4344
# All available variables are described in documentation:
4445
# https://megalinter.io/configuration/

.github/workflows/o2-linter.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ 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@v6
33+
uses: actions/checkout@v7
3434
with:
3535
ref: ${{ env.BRANCH_HEAD }}
3636
fetch-depth: 0 # needed to get the full history
37+
allow-unsafe-pr-checkout: true # needed for pull_request_target
3738
- name: Run tests
3839
id: linter
3940
run: |

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
stale:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/stale@v10
16+
- uses: actions/stale@v11
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.'

.mega-linter.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ DISABLE_LINTERS:
1919
- PYTHON_FLAKE8
2020
- PYTHON_ISORT
2121
- REPOSITORY_DEVSKIM
22-
- REPOSITORY_GITLEAKS
23-
- REPOSITORY_KICS
22+
- REPOSITORY_OSV_SCANNER
2423
- REPOSITORY_SECRETLINT
2524
- REPOSITORY_TRIVY
2625
- YAML_PRETTIER
2726
- YAML_V8R
2827
DISABLE_ERRORS_LINTERS: # If errors are found by these linters, they will be considered as non blocking.
28+
- ACTION_ZIZMOR
2929
- PYTHON_BANDIT # The bandit check is overly broad and complains about subprocess usage.
3030
SHOW_ELAPSED_TIME: true
3131
FILEIO_REPORTER: false
@@ -40,5 +40,5 @@ PYTHON_RUFF_CONFIG_FILE: pyproject.toml
4040
CPP_CPPLINT_FILE_EXTENSIONS: [".C", ".c", ".c++", ".cc", ".cl", ".cpp", ".cu", ".cuh", ".cxx", ".cxx.in", ".h", ".h++", ".hh", ".h.in", ".hpp", ".hxx", ".inc", ".inl", ".macro"]
4141
CPP_CLANG_FORMAT_FILE_EXTENSIONS: [".C", ".c", ".c++", ".cc", ".cl", ".cpp", ".cu", ".cuh", ".cxx", ".cxx.in", ".h", ".h++", ".hh", ".h.in", ".hpp", ".hxx", ".inc", ".inl", ".macro"]
4242
CPP_CPPCHECK_FILE_EXTENSIONS: [".C", ".c", ".c++", ".cc", ".cl", ".cpp", ".cu", ".cuh", ".cxx", ".cxx.in", ".h", ".h++", ".hh", ".h.in", ".hpp", ".hxx", ".inc", ".inl", ".macro"]
43-
CPP_CPPCHECK_ARGUMENTS: --language=c++ --std=c++20 --check-level=exhaustive --suppressions-list=cppcheck_config
44-
REPOSITORY_GITLEAKS_PR_COMMITS_SCAN: true
43+
CPP_CPPCHECK_ARGUMENTS: --language=c++ --std=c++20 --enable=style --check-level=exhaustive --suppressions-list=cppcheck_suppressions --inline-suppr --force
44+
ACTION_ZIZMOR_UNSECURED_ENV_VARIABLES: [GITHUB_TOKEN]

ALICE3/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
add_subdirectory(Core)
1414
# add_subdirectory(DataModel)
15+
add_subdirectory(ML)
1516
add_subdirectory(Tasks)
1617
add_subdirectory(TableProducer)
1718
add_subdirectory(Macros)

ALICE3/Core/Decayer.h

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#ifndef ALICE3_CORE_DECAYER_H_
2020
#define ALICE3_CORE_DECAYER_H_
2121

22+
#include "ALICE3/Core/OTFParticle.h"
2223
#include "ALICE3/Core/TrackUtilities.h"
2324

2425
#include <CommonConstants/PhysicsConstants.h>
@@ -60,28 +61,27 @@ class Decayer
6061
const double ctau = o2::constants::physics::LightSpeedCm2S * particleInfo->Lifetime(); // cm
6162
const double betaGamma = particle.p() / mass;
6263
const double rxyz = -betaGamma * ctau * std::log(1 - u);
63-
double vx, vy, vz;
6464
double px, py, e;
6565

6666
if (!charge) {
67-
vx = particle.vx() + rxyz * (particle.px() / particle.p());
68-
vy = particle.vy() + rxyz * (particle.py() / particle.p());
69-
vz = particle.vz() + rxyz * (particle.pz() / particle.p());
67+
mVx = particle.vx() + rxyz * (particle.px() / particle.p());
68+
mVy = particle.vy() + rxyz * (particle.py() / particle.p());
69+
mVz = particle.vz() + rxyz * (particle.pz() / particle.p());
7070
px = particle.px();
7171
py = particle.py();
7272
} else {
7373
o2::track::TrackParCov track;
7474
o2::math_utils::CircleXYf_t circle;
7575
o2::upgrade::convertOTFParticleToO2Track(particle, track, pdgDB);
7676

77-
float sna, csa;
77+
float sna{}, csa{};
7878
track.getCircleParams(mBz, circle, sna, csa);
7979
const double rxy = rxyz / std::sqrt(1. + track.getTgl() * track.getTgl());
8080
const double theta = rxy / circle.rC;
8181

82-
vx = ((particle.vx() - circle.xC) * std::cos(theta) - (particle.vy() - circle.yC) * std::sin(theta)) + circle.xC;
83-
vy = ((particle.vy() - circle.yC) * std::cos(theta) + (particle.vx() - circle.xC) * std::sin(theta)) + circle.yC;
84-
vz = particle.vz() + rxyz * (particle.pz() / track.getP());
82+
mVx = ((particle.vx() - circle.xC) * std::cos(theta) - (particle.vy() - circle.yC) * std::sin(theta)) + circle.xC;
83+
mVy = ((particle.vy() - circle.yC) * std::cos(theta) + (particle.vx() - circle.xC) * std::sin(theta)) + circle.yC;
84+
mVz = particle.vz() + rxyz * (particle.pz() / track.getP());
8585

8686
px = particle.px() * std::cos(theta) - particle.py() * std::sin(theta);
8787
py = particle.py() * std::cos(theta) + particle.px() * std::sin(theta);
@@ -124,25 +124,33 @@ class Decayer
124124
o2::upgrade::OTFParticle particle;
125125
TLorentzVector dau = *decay.GetDecay(i);
126126
particle.setPDG(pdgCodesDaughters[i]);
127-
particle.setVxVyVz(vx, vy, vz);
127+
particle.setVxVyVz(mVx, mVy, mVz);
128128
particle.setPxPyPzE(dau.Px(), dau.Py(), dau.Pz(), dau.E());
129+
particle.setBitOn(o2::upgrade::DecayerBits::ProducedByDecayer);
129130
decayProducts.push_back(particle);
130131
}
131132

132133
return decayProducts;
133134
}
134135

136+
// Setters
137+
void setBField(const double b) { mBz = b; }
135138
void setSeed(const int seed)
136139
{
137140
mRand3.SetSeed(seed); // For decay length sampling
138141
gRandom->SetSeed(seed); // For TGenPhaseSpace
139142
}
140143

141-
void setBField(const double b) { mBz = b; }
144+
// Getters
145+
float getSecondaryVertexX() const { return static_cast<float>(mVx); }
146+
float getSecondaryVertexY() const { return static_cast<float>(mVy); }
147+
float getSecondaryVertexZ() const { return static_cast<float>(mVz); }
148+
float getDecayRadius() const { return static_cast<float>(std::hypot(mVx, mVy)); }
142149

143150
private:
144-
TRandom3 mRand3;
145-
double mBz;
151+
double mBz{20.}; // kG
152+
double mVx{-1.}, mVy{-1.}, mVz{-1.};
153+
TRandom3 mRand3{};
146154
};
147155

148156
} // namespace upgrade

0 commit comments

Comments
 (0)