Skip to content

Commit cd8778c

Browse files
authored
Merge branch 'AliceO2Group:master' into MlData
2 parents cbadc90 + 2a9803e commit cd8778c

File tree

202 files changed

+16957
-6853
lines changed

Some content is hidden

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

202 files changed

+16957
-6853
lines changed

.github/workflows/o2-linter.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
# Find issues in O2 code
3+
name: O2 linter
4+
5+
'on': [pull_request, push]
6+
permissions: {}
7+
env:
8+
MAIN_BRANCH: master
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
o2-linter:
16+
name: O2 linter
17+
runs-on: ubuntu-24.04
18+
steps:
19+
- name: Checkout Code
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0 # needed to get the full history
23+
- name: Run tests
24+
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 }}...)
27+
if [ ${#files[@]} -eq 0 ]; then
28+
echo "::notice::No files to lint."
29+
exit 0
30+
fi
31+
[ ${{ github.event_name }} == 'pull_request' ] && options="-g"
32+
# shellcheck disable=SC2086 # Ignore unquoted options.
33+
python3 Scripts/o2_linter.py $options "${files[@]}"
34+
echo "Tip: If you allow actions in your fork repository, O2 linter will run when you push commits."

CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
/PWGLF/TableProducer/GlobalEventProperties @alibuild @njacazio @skundu692 @gbencedi @omvazque
4444
/PWGLF/Tasks/Nuspex @alibuild @njacazio @skundu692 @fmazzasc @chiarapinto @maciacco
4545
/PWGLF/TableProducer/Nuspex @alibuild @njacazio @skundu692 @fmazzasc @chiarapinto @maciacco
46-
/PWGLF/Tasks/Resonances @alibuild @njacazio @skundu692 @BongHwi @smaff92
47-
/PWGLF/TableProducer/Resonances @alibuild @njacazio @skundu692 @BongHwi @smaff92
46+
/PWGLF/Tasks/Resonances @alibuild @njacazio @skundu692 @dmallick2 @smaff92
47+
/PWGLF/TableProducer/Resonances @alibuild @njacazio @skundu692 @dmallick2 @smaff92
4848
/PWGLF/Tasks/Strangeness @alibuild @njacazio @skundu692 @ercolessi @ChiaraDeMartin95
4949
/PWGLF/TableProducer/Strangeness @alibuild @njacazio @skundu692 @ercolessi @ChiaraDeMartin95
5050

Common/Core/RecoDecay.h

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,18 +208,23 @@ struct RecoDecay {
208208
/// Constrains angle to be within a range.
209209
/// \note Inspired by TVector2::Phi_0_2pi in ROOT.
210210
/// \param angle angle
211-
/// \param min minimum of the range
212-
/// \return value within [min, min + 2π).
211+
/// \param minimum minimum of the range
212+
/// \param harmonic harmonic number
213+
/// \return value of angle within [minimum, minimum + 2π / harmonic).
213214
template <typename T, typename U = float>
214-
static T constrainAngle(T angle, U min = 0.)
215+
static T constrainAngle(T angle, U minimum = 0.0F, unsigned int harmonic = 1U)
215216
{
216-
while (angle < min) {
217-
angle += o2::constants::math::TwoPI;
217+
auto period = o2::constants::math::TwoPI;
218+
if (harmonic != 1U) {
219+
period /= harmonic;
218220
}
219-
while (angle >= min + o2::constants::math::TwoPI) {
220-
angle -= o2::constants::math::TwoPI;
221+
while (angle < minimum) {
222+
angle += period;
221223
}
222-
return (T)angle;
224+
while (angle >= minimum + period) {
225+
angle -= period;
226+
}
227+
return angle;
223228
}
224229

225230
/// Calculates cosine of pointing angle.

Common/DataModel/Multiplicity.h

Lines changed: 40 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ DECLARE_SOA_DYNAMIC_COLUMN(IsInelGt0, isInelGt0, //! is INEL > 0
4545
[](int multPveta1) -> bool { return multPveta1 > 0; });
4646
DECLARE_SOA_DYNAMIC_COLUMN(IsInelGt1, isInelGt1, //! is INEL > 1
4747
[](int multPveta1) -> bool { return multPveta1 > 1; });
48+
49+
// forward track counters
50+
DECLARE_SOA_COLUMN(MFTNtracks, mftNtracks, int); //!
51+
4852
// MC
4953
DECLARE_SOA_COLUMN(MultMCFT0A, multMCFT0A, int); //!
5054
DECLARE_SOA_COLUMN(MultMCFT0C, multMCFT0C, int); //!
@@ -108,9 +112,12 @@ DECLARE_SOA_TABLE(PVMults, "AOD", "PVMULT", //! Multiplicity from the PV contrib
108112
mult::MultNTracksPVetaHalf,
109113
mult::IsInelGt0<mult::MultNTracksPVeta1>,
110114
mult::IsInelGt1<mult::MultNTracksPVeta1>);
115+
DECLARE_SOA_TABLE(MFTMults, "AOD", "MFTMULT", //! Multiplicity with MFT
116+
mult::MFTNtracks);
111117
using BarrelMults = soa::Join<TrackletMults, TPCMults, PVMults>;
112118
using Mults = soa::Join<BarrelMults, FV0Mults, FT0Mults, FDDMults, ZDCMults>;
113119
using FT0Mult = FT0Mults::iterator;
120+
using MFTMult = MFTMults::iterator;
114121
using Mult = Mults::iterator;
115122

116123
DECLARE_SOA_TABLE(MultsExtra_000, "AOD", "MULTEXTRA", //!
@@ -206,54 +213,42 @@ DECLARE_SOA_TABLE(PVMultZeqs, "AOD", "PVMULTZEQ", //! Multiplicity equalized for
206213
using MultZeqs = soa::Join<FV0MultZeqs, FT0MultZeqs, FDDMultZeqs, PVMultZeqs>;
207214
using MultZeq = MultZeqs::iterator;
208215

209-
namespace multBC
216+
namespace mult
210217
{
211-
DECLARE_SOA_COLUMN(MultBCFT0A, multBCFT0A, float); //!
212-
DECLARE_SOA_COLUMN(MultBCFT0C, multBCFT0C, float); //!
213-
DECLARE_SOA_COLUMN(MultBCFV0A, multBCFV0A, float); //!
214-
DECLARE_SOA_COLUMN(MultBCFDDA, multBCFDDA, float); //!
215-
DECLARE_SOA_COLUMN(MultBCFDDC, multBCFDDC, float); //!
218+
// extra BC information
219+
DECLARE_SOA_COLUMN(MultTVX, multTVX, bool); //!
220+
DECLARE_SOA_COLUMN(MultFV0OrA, multFV0OrA, bool); //!
221+
DECLARE_SOA_COLUMN(MultV0triggerBits, multV0triggerBits, uint8_t); //!
222+
DECLARE_SOA_COLUMN(MultT0triggerBits, multT0triggerBits, uint8_t); //!
223+
DECLARE_SOA_COLUMN(MultFDDtriggerBits, multFDDtriggerBits, uint8_t); //!
224+
DECLARE_SOA_COLUMN(MultTriggerMask, multTriggerMask, uint64_t); //! CTP trigger mask
225+
DECLARE_SOA_COLUMN(MultCollidingBC, multCollidingBC, bool); //! CTP trigger mask
216226

217-
DECLARE_SOA_COLUMN(MultBCZNA, multBCZNA, float); //!
218-
DECLARE_SOA_COLUMN(MultBCZNC, multBCZNC, float); //!
219-
DECLARE_SOA_COLUMN(MultBCZEM1, multBCZEM1, float); //!
220-
DECLARE_SOA_COLUMN(MultBCZEM2, multBCZEM2, float); //!
221-
DECLARE_SOA_COLUMN(MultBCZPA, multBCZPA, float); //!
222-
DECLARE_SOA_COLUMN(MultBCZPC, multBCZPC, float); //!
223-
224-
DECLARE_SOA_COLUMN(MultBCTVX, multBCTVX, bool); //!
225-
DECLARE_SOA_COLUMN(MultBCFV0OrA, multBCFV0OrA, bool); //!
226-
DECLARE_SOA_COLUMN(MultBCV0triggerBits, multBCV0triggerBits, uint8_t); //!
227-
DECLARE_SOA_COLUMN(MultBCT0triggerBits, multBCT0triggerBits, uint8_t); //!
228-
DECLARE_SOA_COLUMN(MultBCFDDtriggerBits, multBCFDDtriggerBits, uint8_t); //!
229-
DECLARE_SOA_COLUMN(MultBCTriggerMask, multBCTriggerMask, uint64_t); //! CTP trigger mask
230-
DECLARE_SOA_COLUMN(MultBCColliding, multBCColliding, bool); //! CTP trigger mask
231-
232-
DECLARE_SOA_COLUMN(MultBCFT0PosZ, multBCFT0PosZ, float); //! Position along Z computed with the FT0 information within the BC
233-
DECLARE_SOA_COLUMN(MultBCFT0PosZValid, multBCFT0PosZValid, bool); //! Validity of the position along Z computed with the FT0 information within the BC
234-
235-
} // namespace multBC
227+
DECLARE_SOA_COLUMN(MultFT0PosZ, multFT0PosZ, float); //! Position along Z computed with the FT0 information within the BC
228+
DECLARE_SOA_COLUMN(MultFT0PosZValid, multFT0PosZValid, bool); //! Validity of the position along Z computed with the FT0 information
229+
} // namespace mult
236230
DECLARE_SOA_TABLE(MultBCs, "AOD", "MULTBC", //!
237-
multBC::MultBCFT0A,
238-
multBC::MultBCFT0C,
239-
multBC::MultBCFT0PosZ,
240-
multBC::MultBCFT0PosZValid,
241-
multBC::MultBCFV0A,
242-
multBC::MultBCFDDA,
243-
multBC::MultBCFDDC,
244-
multBC::MultBCZNA,
245-
multBC::MultBCZNC,
246-
multBC::MultBCZEM1,
247-
multBC::MultBCZEM2,
248-
multBC::MultBCZPA,
249-
multBC::MultBCZPC,
250-
multBC::MultBCTVX,
251-
multBC::MultBCFV0OrA,
252-
multBC::MultBCV0triggerBits,
253-
multBC::MultBCT0triggerBits,
254-
multBC::MultBCFDDtriggerBits,
255-
multBC::MultBCTriggerMask,
256-
multBC::MultBCColliding,
231+
mult::MultFT0A,
232+
mult::MultFT0C,
233+
mult::MultFT0PosZ,
234+
mult::MultFT0PosZValid,
235+
mult::MultFV0A,
236+
mult::MultFDDA,
237+
mult::MultFDDC,
238+
mult::MultZNA,
239+
mult::MultZNC,
240+
mult::MultZEM1,
241+
mult::MultZEM2,
242+
mult::MultZPA,
243+
mult::MultZPC,
244+
mult::MultTVX,
245+
mult::MultFV0OrA,
246+
mult::MultV0triggerBits,
247+
mult::MultT0triggerBits,
248+
mult::MultFDDtriggerBits,
249+
mult::MultTriggerMask,
250+
mult::MultCollidingBC,
251+
timestamp::Timestamp,
257252
bc::Flags);
258253
using MultBC = MultBCs::iterator;
259254

Common/DataModel/PIDResponseITS.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ struct ITSResponse {
8181
return (average * coslInv - exp) / resolution;
8282
};
8383

84+
template <o2::track::PID::ID id, typename T>
85+
static float nSigmaITS(const T& track)
86+
{
87+
return nSigmaITS<id>(track.itsClusterSizes(), track.p(), track.eta());
88+
}
89+
8490
static void setParameters(float p0, float p1, float p2, float p0_Z2, float p1_Z2, float p2_Z2, float p0_res, float p1_res, float p2_res)
8591
{
8692
if (mIsInitialized) {

Common/TableProducer/Converters/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,8 @@ o2physics_add_dpl_workflow(multmcextras-converter
8383
SOURCES multMCExtrasConverter.cxx
8484
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
8585
COMPONENT_NAME Analysis)
86+
87+
o2physics_add_dpl_workflow(trackqa-converter
88+
SOURCES trackQAConverter.cxx
89+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
90+
COMPONENT_NAME Analysis)
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
#include <limits>
12+
13+
#include "Framework/runDataProcessing.h"
14+
#include "Framework/AnalysisTask.h"
15+
#include "Framework/AnalysisDataModel.h"
16+
17+
using namespace o2;
18+
using namespace o2::framework;
19+
20+
struct trackQAConverter {
21+
Produces<aod::TracksQA_001> tracksQA_001;
22+
23+
void process(aod::TracksQA_000 const& tracksQA_000)
24+
{
25+
for (const auto& trackQA : tracksQA_000) {
26+
tracksQA_001(
27+
trackQA.trackId(),
28+
trackQA.tpcTime0(),
29+
trackQA.tpcdcaR(),
30+
trackQA.tpcdcaZ(),
31+
trackQA.tpcClusterByteMask(),
32+
trackQA.tpcdEdxMax0R(),
33+
trackQA.tpcdEdxMax1R(),
34+
trackQA.tpcdEdxMax2R(),
35+
trackQA.tpcdEdxMax3R(),
36+
trackQA.tpcdEdxTot0R(),
37+
trackQA.tpcdEdxTot1R(),
38+
trackQA.tpcdEdxTot2R(),
39+
trackQA.tpcdEdxTot3R(),
40+
// dummy values, not available in _000
41+
std::numeric_limits<int8_t>::min(), // deltaRefContParamY
42+
std::numeric_limits<int8_t>::min(), // deltaRefContParamZ
43+
std::numeric_limits<int8_t>::min(), // deltaRefContParamSnp
44+
std::numeric_limits<int8_t>::min(), // deltaRefContParamTgl
45+
std::numeric_limits<int8_t>::min(), // deltaRefContParamQ2Pt
46+
std::numeric_limits<int8_t>::min(), // deltaRefGloParamY
47+
std::numeric_limits<int8_t>::min(), // deltaRefGloParamZ
48+
std::numeric_limits<int8_t>::min(), // deltaRefGloParamSnp
49+
std::numeric_limits<int8_t>::min(), // deltaRefGloParamTgl
50+
std::numeric_limits<int8_t>::min()); // deltaRefGloParamQ2Pt
51+
}
52+
}
53+
};
54+
55+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
56+
{
57+
return WorkflowSpec{
58+
adaptAnalysisTask<trackQAConverter>(cfgc),
59+
};
60+
}

Common/TableProducer/PID/pidTOFMerge.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ struct TOFCalibConfig {
206206
const std::string nameShiftPos = metadataInfo.isMC() ? mTimeShiftCCDBPathPosMC : mTimeShiftCCDBPathPos;
207207
updateTimeShift(nameShiftPos, true);
208208
const std::string nameShiftNeg = metadataInfo.isMC() ? mTimeShiftCCDBPathNegMC : mTimeShiftCCDBPathNeg;
209-
updateTimeShift(nameShiftNeg, true);
209+
updateTimeShift(nameShiftNeg, false);
210210

211211
// Calibration object is defined
212212
LOG(info) << "Parametrization at init time:";
@@ -690,7 +690,7 @@ struct tofEventTime {
690690
if constexpr (removeTOFEvTimeBias) {
691691
evTimeMakerTOF.removeBias<Run3TrksWtof::iterator, filterForTOFEventTime>(trk, nGoodTracksForTOF, t0TOF[0], t0TOF[1], 2);
692692
}
693-
if (t0TOF[1] < errDiamond && (maxEvTimeTOF <= 0 || abs(t0TOF[0]) < maxEvTimeTOF)) {
693+
if (t0TOF[1] < errDiamond && (maxEvTimeTOF <= 0 || std::abs(t0TOF[0]) < maxEvTimeTOF)) {
694694
flags |= o2::aod::pidflags::enums::PIDFlags::EvTimeTOF;
695695

696696
weight = 1.f / (t0TOF[1] * t0TOF[1]);
@@ -754,7 +754,7 @@ struct tofEventTime {
754754
evTimeMakerTOF.removeBias<Run3TrksWtof::iterator, filterForTOFEventTime>(trk, nGoodTracksForTOF, et, erret, 2);
755755
}
756756
uint8_t flags = 0;
757-
if (erret < errDiamond && (maxEvTimeTOF <= 0.f || abs(et) < maxEvTimeTOF)) {
757+
if (erret < errDiamond && (maxEvTimeTOF <= 0.f || std::abs(et) < maxEvTimeTOF)) {
758758
flags |= o2::aod::pidflags::enums::PIDFlags::EvTimeTOF;
759759
} else {
760760
et = 0.f;

0 commit comments

Comments
 (0)