Skip to content

Commit 05600e8

Browse files
authored
PWGJE: Generalize jet matching (AliceO2Group#2488)
* Generalize jet matching * Update * Add matching for charged jets * Fix formatting * Fix jet matching * Update jet matching * Fix jet matching and add inclusive case * Fix geometric jet matching
1 parent 6c404bd commit 05600e8

4 files changed

Lines changed: 191 additions & 145 deletions

File tree

PWGJE/Core/JetUtilities.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ std::tuple<std::vector<int>, std::vector<int>> MatchJetsGeometricallyImpl(
122122
const std::size_t nJetsBase = jetsBaseEta.size();
123123
const std::size_t nJetsTag = jetsTagEta.size();
124124
if (!(nJetsBase && nJetsTag)) {
125-
return std::make_tuple(std::vector<int>(nJetsBase), std::vector<int>(nJetsTag));
125+
return std::make_tuple(std::vector<int>(nJetsBase, -1), std::vector<int>(nJetsTag, -1));
126126
}
127127
// Require that the comparison vectors are greater than or equal to the standard collections.
128128
if (jetsBasePhiForMatching.size() < jetsBasePhi.size()) {
@@ -253,7 +253,7 @@ std::tuple<std::vector<int>, std::vector<int>> MatchJetsGeometrically(
253253
const std::size_t nJetsTag = jetsTagEta.size();
254254
if (!(nJetsBase && nJetsTag)) {
255255
// There are no jets, so nothing to be done.
256-
return std::make_tuple(std::vector<int>(nJetsBase), std::vector<int>(nJetsTag));
256+
return std::make_tuple(std::vector<int>(nJetsBase, -1), std::vector<int>(nJetsTag, -1));
257257
}
258258
// Input sizes must match
259259
if (jetsBasePhi.size() != jetsBaseEta.size()) {

PWGJE/DataModel/Jet.h

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -73,34 +73,34 @@ DECLARE_SOA_DYNAMIC_COLUMN(P, p,
7373
} // namespace o2::aod
7474

7575
// Defines the jet table definition
76-
#define DECLARE_JET_TABLE(_collision_name_, _jet_type_, _name_, _description_) \
77-
namespace _name_##util \
78-
{ \
79-
DECLARE_SOA_DYNAMIC_COLUMN(Dummy##_jet_type_##s, dummy##_jet_type##s, \
80-
[]() -> int { return 0; }); \
81-
} \
82-
DECLARE_SOA_TABLE(_jet_type_##s, "AOD", _description_, \
83-
o2::soa::Index<>, \
84-
jet::_collision_name_##Id, \
85-
jet::Pt, \
86-
jet::Eta, \
87-
jet::Phi, \
88-
jet::Energy, \
89-
jet::Mass, \
90-
jet::Area, \
91-
jet::R, \
92-
jet::Px<jet::Pt, jet::Phi>, \
93-
jet::Py<jet::Pt, jet::Phi>, \
94-
jet::Pz<jet::Pt, jet::Eta>, \
95-
jet::P<jet::Pt, jet::Eta>, \
96-
_name_##util::Dummy##_jet_type_##s<>); \
97-
namespace _name_##matchingGeo \
98-
{ \
99-
DECLARE_SOA_INDEX_COLUMN(_jet_type_, matchedJetGeo); \
100-
} \
101-
namespace _name_##matchingCand \
102-
{ \
103-
DECLARE_SOA_INDEX_COLUMN(_jet_type_, matchedJetCand); \
76+
#define DECLARE_JET_TABLE(_collision_name_, _jet_type_, _name_, _description_) \
77+
namespace _name_##util \
78+
{ \
79+
DECLARE_SOA_DYNAMIC_COLUMN(Dummy##_jet_type_##s, dummy##_jet_type##s, \
80+
[]() -> int { return 0; }); \
81+
} \
82+
DECLARE_SOA_TABLE(_jet_type_##s, "AOD", _description_, \
83+
o2::soa::Index<>, \
84+
jet::_collision_name_##Id, \
85+
jet::Pt, \
86+
jet::Eta, \
87+
jet::Phi, \
88+
jet::Energy, \
89+
jet::Mass, \
90+
jet::Area, \
91+
jet::R, \
92+
jet::Px<jet::Pt, jet::Phi>, \
93+
jet::Py<jet::Pt, jet::Phi>, \
94+
jet::Pz<jet::Pt, jet::Eta>, \
95+
jet::P<jet::Pt, jet::Eta>, \
96+
_name_##util::Dummy##_jet_type_##s<>); \
97+
namespace _name_##matchingGeo \
98+
{ \
99+
DECLARE_SOA_INDEX_COLUMN_FULL(_jet_type_, matchedJetGeo, int32_t, _jet_type_##s, "_geo"); \
100+
} \
101+
namespace _name_##matchingCand \
102+
{ \
103+
DECLARE_SOA_INDEX_COLUMN_FULL(_jet_type_, matchedJetCand, int32_t, _jet_type_##s, "_hf"); \
104104
}
105105

106106
#define DECLARE_CONSTITUENTS_TABLE(_jet_type_, _name_, _Description_, _track_type_, _cand_type_) \
@@ -159,7 +159,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(P, p,
159159

160160
namespace o2::aod
161161
{
162-
DECLARE_JET_TABLES_LEVELS(Charged, HfCand2Prong, "");
162+
DECLARE_JET_TABLES_LEVELS(Charged, HfCand2Prong, "C");
163163
DECLARE_JET_TABLES_LEVELS(Full, HfCand2Prong, "F");
164164
DECLARE_JET_TABLES_LEVELS(Neutral, HfCand2Prong, "N");
165165
DECLARE_JET_TABLES_LEVELS(D0Charged, HfCand2Prong, "D0");

0 commit comments

Comments
 (0)