Skip to content

Commit 0d6accd

Browse files
Merge branch 'AliceO2Group:master' into debadatta
2 parents 7dfab4d + e9304f1 commit 0d6accd

File tree

378 files changed

+39062
-17253
lines changed

Some content is hidden

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

378 files changed

+39062
-17253
lines changed

.github/workflows/mega-linter.yml

Lines changed: 1 addition & 1 deletion
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@v8.5.0
41+
uses: oxsecurity/megalinter@v8.7.0
4242
env:
4343
# All available variables are described in documentation:
4444
# https://megalinter.io/configuration/

.github/workflows/o2-linter.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# Find issues in O2 code
33
name: O2 linter
44

5-
'on': [pull_request, push]
5+
"on": [pull_request_target, push]
66
permissions: {}
77
env:
8-
MAIN_BRANCH: master
8+
BRANCH_MAIN: master
99

1010
concurrency:
1111
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
@@ -15,20 +15,47 @@ jobs:
1515
o2-linter:
1616
name: O2 linter
1717
runs-on: ubuntu-24.04
18+
permissions:
19+
pull-requests: write
1820
steps:
21+
- name: Set branches
22+
run: |
23+
if [[ "${{ github.event_name }}" == "push" ]]; then
24+
branch_head="${{ github.ref }}"
25+
branch_base="${{ env.BRANCH_MAIN }}"
26+
else
27+
branch_head="refs/pull/${{ github.event.pull_request.number }}/merge"
28+
branch_base="${{ github.event.pull_request.base.ref }}"
29+
fi
30+
echo BRANCH_HEAD="$branch_head" >> "$GITHUB_ENV"
31+
echo BRANCH_BASE="$branch_base" >> "$GITHUB_ENV"
1932
- name: Checkout Code
2033
uses: actions/checkout@v4
2134
with:
35+
ref: ${{ env.BRANCH_HEAD }}
2236
fetch-depth: 0 # needed to get the full history
2337
- name: Run tests
38+
id: linter
2439
run: |
25-
# Diff against the common ancestor of the source branch and the main branch.
26-
readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.MAIN_BRANCH }}...)
40+
# Diff against the common ancestor of the source (head) branch and the target (base) branch.
41+
echo "Diffing ${{ env.BRANCH_HEAD }} against ${{ env.BRANCH_BASE }}."
42+
readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.BRANCH_BASE }}...)
2743
if [ ${#files[@]} -eq 0 ]; then
2844
echo "::notice::No files to lint."
45+
echo "linter_ran=0" >> "$GITHUB_OUTPUT"
2946
exit 0
3047
fi
31-
[ ${{ github.event_name }} == 'pull_request' ] && options="-g"
48+
echo "linter_ran=1" >> "$GITHUB_OUTPUT"
49+
[[ "${{ github.event_name }}" == "pull_request_target" ]] && options="-g"
3250
# shellcheck disable=SC2086 # Ignore unquoted options.
3351
python3 Scripts/o2_linter.py $options "${files[@]}"
3452
echo "Tip: If you allow actions in your fork repository, O2 linter will run when you push commits."
53+
- name: Comment PR
54+
if: (success() || failure()) && (github.event_name == 'pull_request_target' && steps.linter.outputs.linter_ran == 1)
55+
uses: thollander/actions-comment-pull-request@v3
56+
with:
57+
comment-tag: o2-linter
58+
message: "**O2 linter results:**
59+
❌ ${{ steps.linter.outputs.n_issues }} errors,
60+
⚠️ ${{ steps.linter.outputs.n_tolerated }} warnings,
61+
🔕 ${{ steps.linter.outputs.n_disabled }} disabled"

ALICE3/DataModel/OTFRICH.h

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,42 @@ DECLARE_SOA_COLUMN(NSigmaMuonRich, nSigmaMuonRich, float); //! NSigma mu
3131
DECLARE_SOA_COLUMN(NSigmaPionRich, nSigmaPionRich, float); //! NSigma pion BarrelRich
3232
DECLARE_SOA_COLUMN(NSigmaKaonRich, nSigmaKaonRich, float); //! NSigma kaon BarrelRich
3333
DECLARE_SOA_COLUMN(NSigmaProtonRich, nSigmaProtonRich, float); //! NSigma proton BarrelRich
34+
DECLARE_SOA_DYNAMIC_COLUMN(NSigmaRich, nSigmaRich, //! General function to get the nSigma for the RICH
35+
[](const float el,
36+
const float mu,
37+
const float pi,
38+
const float ka,
39+
const float pr,
40+
const int id) -> float {
41+
switch (std::abs(id)) {
42+
case 0:
43+
return el;
44+
case 1:
45+
return mu;
46+
case 2:
47+
return pi;
48+
case 3:
49+
return ka;
50+
case 4:
51+
return pr;
52+
default:
53+
LOG(fatal) << "Unrecognized PDG code for RICH";
54+
return 999.f;
55+
}
56+
});
57+
3458
} // namespace upgrade_rich
3559
DECLARE_SOA_TABLE(UpgradeRichs, "AOD", "UPGRADERICH",
3660
upgrade_rich::NSigmaElectronRich,
3761
upgrade_rich::NSigmaMuonRich,
3862
upgrade_rich::NSigmaPionRich,
3963
upgrade_rich::NSigmaKaonRich,
40-
upgrade_rich::NSigmaProtonRich);
64+
upgrade_rich::NSigmaProtonRich,
65+
upgrade_rich::NSigmaRich<upgrade_rich::NSigmaElectronRich,
66+
upgrade_rich::NSigmaMuonRich,
67+
upgrade_rich::NSigmaPionRich,
68+
upgrade_rich::NSigmaKaonRich,
69+
upgrade_rich::NSigmaProtonRich>);
4170

4271
using UpgradeRich = UpgradeRichs::iterator;
4372

ALICE3/DataModel/OTFTOF.h

Lines changed: 116 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,42 +27,138 @@ namespace o2::aod
2727
{
2828
namespace upgrade_tof
2929
{
30-
DECLARE_SOA_COLUMN(NSigmaElectronInnerTOF, nSigmaElectronInnerTOF, float); //! NSigma electron InnerTOF
31-
DECLARE_SOA_COLUMN(NSigmaMuonInnerTOF, nSigmaMuonInnerTOF, float); //! NSigma muon InnerTOF
32-
DECLARE_SOA_COLUMN(NSigmaPionInnerTOF, nSigmaPionInnerTOF, float); //! NSigma pion InnerTOF
33-
DECLARE_SOA_COLUMN(NSigmaKaonInnerTOF, nSigmaKaonInnerTOF, float); //! NSigma kaon InnerTOF
34-
DECLARE_SOA_COLUMN(NSigmaProtonInnerTOF, nSigmaProtonInnerTOF, float); //! NSigma proton InnerTOF
35-
DECLARE_SOA_COLUMN(InnerTOFTrackLength, innerTOFTrackLength, float); //! track length for calculation of InnerTOF
36-
DECLARE_SOA_COLUMN(InnerTOFTrackLengthReco, innerTOFTrackLengthReco, float); //! track length for calculation of InnerTOF
37-
DECLARE_SOA_COLUMN(DeltaTrackLengthInnerTOF, deltaTrackLengthInnerTOF, float); //! track length for calculation of InnerTOF
38-
DECLARE_SOA_COLUMN(NSigmaElectronOuterTOF, nSigmaElectronOuterTOF, float); //! NSigma electron OuterTOF
39-
DECLARE_SOA_COLUMN(NSigmaMuonOuterTOF, nSigmaMuonOuterTOF, float); //! NSigma muon OuterTOF
40-
DECLARE_SOA_COLUMN(NSigmaPionOuterTOF, nSigmaPionOuterTOF, float); //! NSigma pion OuterTOF
41-
DECLARE_SOA_COLUMN(NSigmaKaonOuterTOF, nSigmaKaonOuterTOF, float); //! NSigma kaon OuterTOF
42-
DECLARE_SOA_COLUMN(NSigmaProtonOuterTOF, nSigmaProtonOuterTOF, float); //! NSigma proton OuterTOF
43-
DECLARE_SOA_COLUMN(OuterTOFTrackLength, outerTOFTrackLength, float); //! track length for calculation of OuterTOF
44-
DECLARE_SOA_COLUMN(OuterTOFTrackLengthReco, outerTOFTrackLengthReco, float); //! track length for calculation of OuterTOF
45-
DECLARE_SOA_COLUMN(DeltaTrackLengthOuterTOF, deltaTrackLengthOuterTOF, float); //! track length for calculation of InnerTOF
30+
DECLARE_SOA_COLUMN(InnerTOFTrackTime, innerTOFTrackTime, float); //! Track time generated at the InnerTOF
31+
DECLARE_SOA_COLUMN(InnerTOFTrackLength, innerTOFTrackLength, float); //! track length for calculation of InnerTOF (generated)
32+
DECLARE_SOA_COLUMN(OuterTOFTrackTime, outerTOFTrackTime, float); //! Track time generated at the OuterTOF
33+
DECLARE_SOA_COLUMN(OuterTOFTrackLength, outerTOFTrackLength, float); //! track length for calculation of OuterTOF (generated)
34+
35+
DECLARE_SOA_COLUMN(TOFEventTime, tofEventTime, float); //! Event time reconstructed with the TOF
36+
DECLARE_SOA_COLUMN(TOFEventTimeErr, tofEventTimeErr, float); //! Uncertainty on the event time reconstructed with the TOF
37+
DECLARE_SOA_COLUMN(NSigmaElectronInnerTOF, nSigmaElectronInnerTOF, float); //! NSigma electron InnerTOF
38+
DECLARE_SOA_COLUMN(NSigmaMuonInnerTOF, nSigmaMuonInnerTOF, float); //! NSigma muon InnerTOF
39+
DECLARE_SOA_COLUMN(NSigmaPionInnerTOF, nSigmaPionInnerTOF, float); //! NSigma pion InnerTOF
40+
DECLARE_SOA_COLUMN(NSigmaKaonInnerTOF, nSigmaKaonInnerTOF, float); //! NSigma kaon InnerTOF
41+
DECLARE_SOA_COLUMN(NSigmaProtonInnerTOF, nSigmaProtonInnerTOF, float); //! NSigma proton InnerTOF
42+
DECLARE_SOA_COLUMN(InnerTOFTrackTimeReco, innerTOFTrackTimeReco, float); //! Track time measured at the InnerTOF
43+
DECLARE_SOA_COLUMN(InnerTOFTrackLengthReco, innerTOFTrackLengthReco, float); //! track length for calculation of InnerTOF (reconstructed)
44+
45+
DECLARE_SOA_COLUMN(InnerTOFExpectedTimeEl, innerTOFExpectedTimeEl, float); //! Reconstructed expected time at the InnerTOF for the Electron mass hypotheses
46+
DECLARE_SOA_COLUMN(InnerTOFExpectedTimeMu, innerTOFExpectedTimeMu, float); //! Reconstructed expected time at the InnerTOF for the Muon mass hypotheses
47+
DECLARE_SOA_COLUMN(InnerTOFExpectedTimePi, innerTOFExpectedTimePi, float); //! Reconstructed expected time at the InnerTOF for the Pion mass hypotheses
48+
DECLARE_SOA_COLUMN(InnerTOFExpectedTimeKa, innerTOFExpectedTimeKa, float); //! Reconstructed expected time at the InnerTOF for the Kaon mass hypotheses
49+
DECLARE_SOA_COLUMN(InnerTOFExpectedTimePr, innerTOFExpectedTimePr, float); //! Reconstructed expected time at the InnerTOF for the Proton mass hypotheses
50+
51+
DECLARE_SOA_COLUMN(NSigmaElectronOuterTOF, nSigmaElectronOuterTOF, float); //! NSigma electron OuterTOF
52+
DECLARE_SOA_COLUMN(NSigmaMuonOuterTOF, nSigmaMuonOuterTOF, float); //! NSigma muon OuterTOF
53+
DECLARE_SOA_COLUMN(NSigmaPionOuterTOF, nSigmaPionOuterTOF, float); //! NSigma pion OuterTOF
54+
DECLARE_SOA_COLUMN(NSigmaKaonOuterTOF, nSigmaKaonOuterTOF, float); //! NSigma kaon OuterTOF
55+
DECLARE_SOA_COLUMN(NSigmaProtonOuterTOF, nSigmaProtonOuterTOF, float); //! NSigma proton OuterTOF
56+
DECLARE_SOA_COLUMN(OuterTOFTrackTimeReco, outerTOFTrackTimeReco, float); //! Track time measured at the OuterTOF
57+
DECLARE_SOA_COLUMN(OuterTOFTrackLengthReco, outerTOFTrackLengthReco, float); //! track length for calculation of OuterTOF (reconstructed)
58+
59+
DECLARE_SOA_COLUMN(OuterTOFExpectedTimeEl, outerTOFExpectedTimeEl, float); //! Reconstructed expected time at the OuterTOF for the Electron mass hypotheses
60+
DECLARE_SOA_COLUMN(OuterTOFExpectedTimeMu, outerTOFExpectedTimeMu, float); //! Reconstructed expected time at the OuterTOF for the Muon mass hypotheses
61+
DECLARE_SOA_COLUMN(OuterTOFExpectedTimePi, outerTOFExpectedTimePi, float); //! Reconstructed expected time at the OuterTOF for the Pion mass hypotheses
62+
DECLARE_SOA_COLUMN(OuterTOFExpectedTimeKa, outerTOFExpectedTimeKa, float); //! Reconstructed expected time at the OuterTOF for the Kaon mass hypotheses
63+
DECLARE_SOA_COLUMN(OuterTOFExpectedTimePr, outerTOFExpectedTimePr, float); //! Reconstructed expected time at the OuterTOF for the Proton mass hypotheses
64+
DECLARE_SOA_DYNAMIC_COLUMN(NSigmaInnerTOF, nSigmaInnerTOF, //! General function to get the nSigma for the InnerTOF
65+
[](const float el,
66+
const float mu,
67+
const float pi,
68+
const float ka,
69+
const float pr,
70+
const int id) -> float {
71+
switch (std::abs(id)) {
72+
case 0:
73+
return el;
74+
case 1:
75+
return mu;
76+
case 2:
77+
return pi;
78+
case 3:
79+
return ka;
80+
case 4:
81+
return pr;
82+
default:
83+
LOG(fatal) << "Unrecognized PDG code for InnerTOF";
84+
return 999.f;
85+
}
86+
});
87+
DECLARE_SOA_DYNAMIC_COLUMN(NSigmaOuterTOF, nSigmaOuterTOF, //! General function to get the nSigma for the OuterTOF
88+
[](const float el,
89+
const float mu,
90+
const float pi,
91+
const float ka,
92+
const float pr,
93+
const int id) -> float {
94+
switch (std::abs(id)) {
95+
case 0:
96+
return el;
97+
case 1:
98+
return mu;
99+
case 2:
100+
return pi;
101+
case 3:
102+
return ka;
103+
case 4:
104+
return pr;
105+
default:
106+
LOG(fatal) << "Unrecognized PDG code for InnerTOF";
107+
return 999.f;
108+
}
109+
});
110+
46111
} // namespace upgrade_tof
112+
113+
DECLARE_SOA_TABLE(UpgradeTofMCs, "AOD", "UPGRADETOFMC",
114+
upgrade_tof::InnerTOFTrackTime,
115+
upgrade_tof::InnerTOFTrackLength,
116+
upgrade_tof::OuterTOFTrackTime,
117+
upgrade_tof::OuterTOFTrackLength);
118+
47119
DECLARE_SOA_TABLE(UpgradeTofs, "AOD", "UPGRADETOF",
120+
upgrade_tof::TOFEventTime,
121+
upgrade_tof::TOFEventTimeErr,
48122
upgrade_tof::NSigmaElectronInnerTOF,
49123
upgrade_tof::NSigmaMuonInnerTOF,
50124
upgrade_tof::NSigmaPionInnerTOF,
51125
upgrade_tof::NSigmaKaonInnerTOF,
52126
upgrade_tof::NSigmaProtonInnerTOF,
53-
upgrade_tof::InnerTOFTrackLength,
127+
upgrade_tof::InnerTOFTrackTimeReco,
54128
upgrade_tof::InnerTOFTrackLengthReco,
55-
upgrade_tof::DeltaTrackLengthInnerTOF,
56129
upgrade_tof::NSigmaElectronOuterTOF,
57130
upgrade_tof::NSigmaMuonOuterTOF,
58131
upgrade_tof::NSigmaPionOuterTOF,
59132
upgrade_tof::NSigmaKaonOuterTOF,
60133
upgrade_tof::NSigmaProtonOuterTOF,
61-
upgrade_tof::OuterTOFTrackLength,
134+
upgrade_tof::OuterTOFTrackTimeReco,
62135
upgrade_tof::OuterTOFTrackLengthReco,
63-
upgrade_tof::DeltaTrackLengthOuterTOF);
136+
upgrade_tof::NSigmaInnerTOF<upgrade_tof::NSigmaElectronInnerTOF,
137+
upgrade_tof::NSigmaMuonInnerTOF,
138+
upgrade_tof::NSigmaPionInnerTOF,
139+
upgrade_tof::NSigmaKaonInnerTOF,
140+
upgrade_tof::NSigmaProtonInnerTOF>,
141+
upgrade_tof::NSigmaOuterTOF<upgrade_tof::NSigmaElectronOuterTOF,
142+
upgrade_tof::NSigmaMuonOuterTOF,
143+
upgrade_tof::NSigmaPionOuterTOF,
144+
upgrade_tof::NSigmaKaonOuterTOF,
145+
upgrade_tof::NSigmaProtonOuterTOF>);
146+
147+
DECLARE_SOA_TABLE(UpgradeTofExpectedTimes, "AOD", "UPGRADETOFEXPT",
148+
upgrade_tof::InnerTOFExpectedTimeEl,
149+
upgrade_tof::InnerTOFExpectedTimeMu,
150+
upgrade_tof::InnerTOFExpectedTimePi,
151+
upgrade_tof::InnerTOFExpectedTimeKa,
152+
upgrade_tof::InnerTOFExpectedTimePr,
153+
upgrade_tof::OuterTOFExpectedTimeEl,
154+
upgrade_tof::OuterTOFExpectedTimeMu,
155+
upgrade_tof::OuterTOFExpectedTimePi,
156+
upgrade_tof::OuterTOFExpectedTimeKa,
157+
upgrade_tof::OuterTOFExpectedTimePr);
64158

159+
using UpgradeTofMC = UpgradeTofMCs::iterator;
65160
using UpgradeTof = UpgradeTofs::iterator;
161+
using UpgradeTofExpectedTime = UpgradeTofExpectedTimes::iterator;
66162

67163
} // namespace o2::aod
68164

ALICE3/TableProducer/OTF/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ o2physics_add_dpl_workflow(onthefly-tracker
1515
COMPONENT_NAME Analysis)
1616

1717
o2physics_add_dpl_workflow(onthefly-tofpid
18-
SOURCES onTheFlyTOFPID.cxx
18+
SOURCES onTheFlyTofPid.cxx
1919
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsCommonDataFormats O2Physics::ALICE3Core
2020
COMPONENT_NAME Analysis)
2121

2222
o2physics_add_dpl_workflow(onthefly-richpid
23-
SOURCES onTheFlyRICHPID.cxx
23+
SOURCES onTheFlyRichPid.cxx
2424
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsCommonDataFormats O2Physics::ALICE3Core
2525
COMPONENT_NAME Analysis)

0 commit comments

Comments
 (0)