Skip to content

Commit eb2e639

Browse files
authored
[PWGJE] gammaJetTreeProducer updated substructure tables (#14700)
1 parent 3c86513 commit eb2e639

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

PWGJE/DataModel/GammaJetAnalysisTree.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,21 +136,20 @@ DECLARE_SOA_COLUMN(LeadingTrackPt, leadingtrackpt, float);
136136
DECLARE_SOA_COLUMN(PerpConeRho, perpconerho, float);
137137
DECLARE_SOA_COLUMN(NConstituents, nConstituents, ushort);
138138
} // namespace gjchjet
139-
DECLARE_SOA_TABLE(GjChargedJets, "AOD", "GJCHJET", o2::soa::Index<>, gjgamma::GjEventId, gjchjet::Pt, gjchjet::Eta, gjchjet::Phi, gjchjet::Radius, gjchjet::Energy, gjchjet::Mass, gjchjet::Area, gjchjet::LeadingTrackPt, gjchjet::PerpConeRho, gjchjet::NConstituents)
139+
DECLARE_SOA_TABLE(GjChargedJets, "AOD", "GJCHJET", gjgamma::GjEventId, gjchjet::Pt, gjchjet::Eta, gjchjet::Phi, gjchjet::Radius, gjchjet::Energy, gjchjet::Mass, gjchjet::Area, gjchjet::LeadingTrackPt, gjchjet::PerpConeRho, gjchjet::NConstituents)
140140

141141
using GjChargedJet = GjChargedJets::iterator;
142142

143143
// Jet substructure information (vectors stored per jet)
144144
namespace gjjetsubstructure
145145
{
146-
DECLARE_SOA_INDEX_COLUMN(GjChargedJet, gjchargedjet); //! jet index
147146
DECLARE_SOA_COLUMN(EnergyMother, energyMother, std::vector<float>); //! energy of mother subjet at each splitting
148147
DECLARE_SOA_COLUMN(PtLeading, ptLeading, std::vector<float>); //! pt of leading subjet at each splitting
149148
DECLARE_SOA_COLUMN(PtSubLeading, ptSubLeading, std::vector<float>); //! pt of subleading subjet at each splitting
150149
DECLARE_SOA_COLUMN(Theta, theta, std::vector<float>); //! opening angle theta at each splitting
151150
} // namespace gjjetsubstructure
152151
DECLARE_SOA_TABLE(GjJetSubstructures, "AOD", "GJJETSUBSTR",
153-
gjjetsubstructure::GjChargedJetId,
152+
gjgamma::GjEventId,
154153
gjjetsubstructure::EnergyMother,
155154
gjjetsubstructure::PtLeading,
156155
gjjetsubstructure::PtSubLeading,

PWGJE/Tasks/gammaJetTreeProducer.cxx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,12 +1159,11 @@ struct GammaJetTreeProducer {
11591159
/// \param storedColIndex The stored collision index
11601160
/// \param jet The jet to process
11611161
/// \param tracks The tracks collection
1162-
/// \return The global index of the stored jet, or -1 if jet was not stored (below pT threshold)
11631162
template <typename T, typename U>
1164-
int64_t fillChargedJetTable(int32_t storedColIndex, T const& jet, U const& /*tracks*/)
1163+
void fillChargedJetTable(int32_t storedColIndex, T const& jet, U const& /*tracks*/)
11651164
{
11661165
if (jet.pt() < jetPtMin) {
1167-
return -1;
1166+
return;
11681167
}
11691168
ushort nconst = 0;
11701169
float leadingTrackPt = 0;
@@ -1179,15 +1178,14 @@ struct GammaJetTreeProducer {
11791178
chargedJetsTable(storedColIndex, jet.pt(), jet.eta(), jet.phi(), jet.r(), jet.energy(), jet.mass(), jet.area(), leadingTrackPt, perpconerho, nconst);
11801179
mHistograms.fill(HIST("chjetPtEtaPhi"), jet.pt(), jet.eta(), jet.phi());
11811180
mHistograms.fill(HIST("chjetPt"), jet.pt());
1182-
return chargedJetsTable.lastIndex();
11831181
}
11841182

11851183
/// \brief Fills the substructure table with z and theta values for each splitting in the jet
11861184
/// \param jetGlobalIndex The global index of the stored jet in the GjChargedJets table
11871185
/// \param jet The jet to process
11881186
/// \param tracks The tracks collection
11891187
template <typename T, typename U>
1190-
void fillSubstructureTable(int64_t jetGlobalIndex, T const& jet, U const& /*tracks*/)
1188+
void fillSubstructureTable(int32_t storedColIndex, T const& jet, U const& /*tracks*/)
11911189
{
11921190
// adjust settings according to the jet radius
11931191
jetReclusterer.jetR = jet.r() / 100.0;
@@ -1199,7 +1197,7 @@ struct GammaJetTreeProducer {
11991197
jetReclustered.clear();
12001198
jetConstituents.clear();
12011199

1202-
if (jet.pt() < jetPtMin || jetGlobalIndex < 0) {
1200+
if (jet.pt() < jetPtMin) {
12031201
return;
12041202
}
12051203
for (auto& jetConstituent : jet.template tracks_as<U>()) {
@@ -1234,7 +1232,7 @@ struct GammaJetTreeProducer {
12341232

12351233
// Fill one row per jet with all splittings stored as vectors
12361234
// Pass the jet's global index to associate this substructure entry with the jet
1237-
jetSubstructuresTable(jetGlobalIndex, energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec);
1235+
jetSubstructuresTable(storedColIndex, energyMotherVec, ptLeadingVec, ptSubLeadingVec, thetaVec);
12381236
}
12391237

12401238
Filter jetCuts = aod::jet::pt > jetPtMin;
@@ -1255,11 +1253,11 @@ struct GammaJetTreeProducer {
12551253
// loop over charged jets
12561254
for (const auto& jet : chargedJets) {
12571255
// Fill jet table and get the stored jet's global index
1258-
int64_t jetGlobalIndex = fillChargedJetTable(storedColIndex, jet, tracks);
1256+
fillChargedJetTable(storedColIndex, jet, tracks);
12591257

12601258
// Fill substructure table if enabled and jet was stored
1261-
if (calculateJetSubstructure && jetGlobalIndex >= 0) {
1262-
fillSubstructureTable(jetGlobalIndex, jet, tracks);
1259+
if (calculateJetSubstructure) {
1260+
fillSubstructureTable(storedColIndex, jet, tracks);
12631261
}
12641262
}
12651263
}
@@ -1398,11 +1396,11 @@ struct GammaJetTreeProducer {
13981396
// loop over charged jets
13991397
for (const auto& jet : chargedJets) {
14001398
// Fill jet table and get the stored jet's global index
1401-
int64_t jetGlobalIndex = fillChargedJetTable(storedColIndex, jet, tracks);
1399+
fillChargedJetTable(storedColIndex, jet, tracks);
14021400

14031401
// Fill substructure table if enabled and jet was stored
1404-
if (calculateJetSubstructure && jetGlobalIndex >= 0) {
1405-
fillSubstructureTable(jetGlobalIndex, jet, tracks);
1402+
if (calculateJetSubstructure) {
1403+
fillSubstructureTable(storedColIndex, jet, tracks);
14061404
}
14071405

14081406
// Fill Matching information

0 commit comments

Comments
 (0)