Skip to content

Commit dfaa78d

Browse files
authored
[PWGEM,PWGEM-36] Improve emcalQA task (#14694)
1 parent cc62032 commit dfaa78d

File tree

3 files changed

+318
-110
lines changed

3 files changed

+318
-110
lines changed

PWGEM/PhotonMeson/Core/EMCPhotonCut.h

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@
3131
#include <string>
3232
#include <vector>
3333

34+
template <typename T>
35+
concept is_optional_table = o2::soa::is_table<T> || std::is_same_v<T, std::nullptr_t>;
36+
37+
template <typename TPrimaries>
38+
static constexpr bool HasPrimaries = !std::is_same_v<TPrimaries, std::nullptr_t>;
39+
40+
template <typename TSecondaries>
41+
static constexpr bool HasSecondaries = !std::is_same_v<TSecondaries, std::nullptr_t>;
42+
3443
template <typename T>
3544
concept IsTrackIterator = o2::soa::is_iterator<T> && requires(T t) {
3645
// Check that the *elements* of the container have the required methods:
@@ -50,22 +59,26 @@ concept IsTrackContainer = o2::soa::is_table<T> && requires(T t) {
5059
};
5160

5261
template <typename Cluster>
53-
concept HasTrackMatching = requires(Cluster cluster) {
54-
// requires that the following are valid calls:
55-
{ cluster.deltaEta() } -> std::convertible_to<std::vector<float>>;
56-
{ cluster.deltaPhi() } -> std::convertible_to<std::vector<float>>;
57-
{ cluster.trackpt() } -> std::convertible_to<std::vector<float>>;
58-
{ cluster.trackp() } -> std::convertible_to<std::vector<float>>;
59-
};
62+
concept HasTrackMatching =
63+
o2::soa::is_iterator<Cluster> &&
64+
requires(Cluster cluster) {
65+
// requires that the following are valid calls:
66+
{ cluster.deltaEta() } -> std::convertible_to<std::vector<float>>;
67+
{ cluster.deltaPhi() } -> std::convertible_to<std::vector<float>>;
68+
{ cluster.trackpt() } -> std::convertible_to<std::vector<float>>;
69+
{ cluster.trackp() } -> std::convertible_to<std::vector<float>>;
70+
};
6071

6172
template <typename Cluster>
62-
concept HasSecondaryMatching = requires(Cluster cluster) {
63-
// requires that the following are valid calls:
64-
{ cluster.deltaEtaSec() } -> std::convertible_to<std::vector<float>>;
65-
{ cluster.deltaPhiSec() } -> std::convertible_to<std::vector<float>>;
66-
{ cluster.trackptSec() } -> std::convertible_to<std::vector<float>>;
67-
{ cluster.trackpSec() } -> std::convertible_to<std::vector<float>>;
68-
};
73+
concept HasSecondaryMatching =
74+
o2::soa::is_iterator<Cluster> &&
75+
requires(Cluster cluster) {
76+
// requires that the following are valid calls:
77+
{ cluster.deltaEtaSec() } -> std::convertible_to<std::vector<float>>;
78+
{ cluster.deltaPhiSec() } -> std::convertible_to<std::vector<float>>;
79+
{ cluster.trackptSec() } -> std::convertible_to<std::vector<float>>;
80+
{ cluster.trackpSec() } -> std::convertible_to<std::vector<float>>;
81+
};
6982

7083
struct TrackMatchingParams {
7184
float a{0.01f};

0 commit comments

Comments
 (0)