Skip to content

Commit 6479f96

Browse files
committed
DPl Analysis: avoid including ASoA.h in dictionary generation
Various PWG create ROOT dictionaries for some of their classes, that, unfortunately, through their inclusion chains pull ASoA.h and expose it to rootcling. ROOT's internal llvm is outdated and thus each time we need to update ASoA.h with new code, we have to employ workarounds in oder to keep O2Physics functional. This is highly inconvenient, and thus there will be an update in O2 that will explicitly forbid exposing ASoA.h to cling - the compilation will fail with an error. This PR removes all the instances of ASoA.h inclusion in dictionaries, that have been exposed by the upcoming O2 change. This is a suggested change, the final fix may be different. Preferrably, the dictionaries that are not required should be simply removed from CMakeLists.txt. From the codeowners, we request reviewing these changes, suggesting different changes, if needed, and validating that the updated code does not affect the analysis.
1 parent bbf97ee commit 6479f96

25 files changed

Lines changed: 1987 additions & 1833 deletions

Common/Core/fwdtrackUtilities.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#ifndef COMMON_CORE_FWDTRACKUTILITIES_H_
1919
#define COMMON_CORE_FWDTRACKUTILITIES_H_
2020

21-
#include <Framework/AnalysisDataModel.h>
2221
#include <Framework/DataTypes.h>
2322
#include <GlobalTracking/MatchGlobalFwd.h>
2423
#include <MCHTracking/TrackExtrap.h>
@@ -48,22 +47,33 @@ using SMatrix55 = ROOT::Math::SMatrix<double, 5, 5, ROOT::Math::MatRepSym<double
4847
using SMatrix55Std = ROOT::Math::SMatrix<double, 5>;
4948
using SMatrix5 = ROOT::Math::SVector<double, 5>;
5049

50+
template <typename T>
51+
concept is_fwd_track = requires (T t) {
52+
{ t.rAtAbsorberEnd() } -> std::same_as<float>;
53+
};
54+
55+
template <typename T>
56+
concept is_fwd_cov = requires (T t)
57+
{
58+
{ t.sigmaX() } -> std::same_as<float>;
59+
};
60+
5161
/// Produce TrackParCovFwds for MFT and FwdTracks, w/ or w/o cov, with z shift
5262
template <typename TFwdTrack, typename... TCovariance>
5363
o2::track::TrackParCovFwd getTrackParCovFwdShift(TFwdTrack const& track, float zshift, TCovariance const&... covOpt)
5464
{
5565
double chi2 = track.chi2();
5666
if constexpr (sizeof...(covOpt) == 0) {
5767
// No covariance passed
58-
if constexpr (std::is_same_v<std::decay_t<TFwdTrack>, aod::FwdTracks::iterator>) {
68+
if constexpr (is_fwd_track<TFwdTrack>) {
5969
if (track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) {
6070
chi2 = track.chi2() * (2.f * track.nClusters() - 5.f);
6171
}
6272
}
6373
} else {
6474
// Covariance passed
6575
using TCov = std::decay_t<decltype((covOpt, ...))>;
66-
if constexpr (std::is_same_v<TCov, aod::FwdTracksCov::iterator>) {
76+
if constexpr (is_fwd_cov<TCov>) {
6777
if (track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) {
6878
chi2 = track.chi2() * (2.f * track.nClusters() - 5.f);
6979
}

PWGDQ/Core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ o2physics_add_library(PWGDQCore
2626
o2physics_target_root_dictionary(PWGDQCore
2727
HEADERS AnalysisCut.h
2828
AnalysisCompositeCut.h
29-
VarManager.h
29+
VarManagerCore.h
3030
HistogramManager.h
3131
CutsLibrary.h
3232
MixingHandler.h

PWGDQ/Core/CutsLibrary.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include "AnalysisCompositeCut.h"
1919
#include "AnalysisCut.h"
20-
#include "VarManager.h"
20+
#include "VarManagerCore.h"
2121

2222
#include <Framework/Array2D.h>
2323
#include <Framework/Logger.h>

PWGDQ/Core/DQMlResponse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#ifndef PWGDQ_CORE_DQMLRESPONSE_H_
1818
#define PWGDQ_CORE_DQMLRESPONSE_H_
1919

20-
#include "PWGDQ/Core/VarManager.h"
20+
#include "PWGDQ/Core/VarManagerCore.h"
2121

2222
#include "Tools/ML/MlResponse.h"
2323

PWGDQ/Core/HistogramsLibrary.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "PWGDQ/Core/HistogramsLibrary.h"
1515

1616
#include "HistogramManager.h"
17-
#include "VarManager.h"
17+
#include "VarManagerCore.h"
1818

1919
#include <CommonConstants/MathConstants.h>
2020
#include <Framework/Logger.h>

PWGDQ/Core/MixingHandler.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include "PWGDQ/Core/MixingHandler.h"
1313

14-
#include "PWGDQ/Core/VarManager.h"
14+
#include "PWGDQ/Core/VarManagerCore.h"
1515

1616
#include <TArrayF.h>
1717
#include <TMathBase.h>

PWGDQ/Core/MixingHandler.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717
#ifndef PWGDQ_CORE_MIXINGHANDLER_H_
1818
#define PWGDQ_CORE_MIXINGHANDLER_H_
1919

20-
#include "PWGDQ/Core/VarManager.h"
20+
#include "PWGDQ/Core/VarManagerCore.h"
2121

2222
#include <TArrayF.h>
2323
#include <TNamed.h>
2424

2525
#include <Rtypes.h>
2626

27-
#include <algorithm>
2827
#include <array>
2928
#include <iostream>
3029
#include <map>

PWGDQ/Core/MixingLibrary.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "PWGDQ/Core/MixingLibrary.h"
1515

1616
#include "PWGDQ/Core/MixingHandler.h"
17-
#include "PWGDQ/Core/VarManager.h"
17+
#include "PWGDQ/Core/VarManagerCore.h"
1818

1919
#include <Framework/Logger.h>
2020

0 commit comments

Comments
 (0)