Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions PWGJE/DataModel/GammaJetAnalysisTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,21 +136,20 @@ DECLARE_SOA_COLUMN(LeadingTrackPt, leadingtrackpt, float);
DECLARE_SOA_COLUMN(PerpConeRho, perpconerho, float);
DECLARE_SOA_COLUMN(NConstituents, nConstituents, ushort);
} // namespace gjchjet
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)
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)

using GjChargedJet = GjChargedJets::iterator;

// Jet substructure information (vectors stored per jet)
namespace gjjetsubstructure
{
DECLARE_SOA_INDEX_COLUMN(GjChargedJet, gjchargedjet); //! jet index
DECLARE_SOA_COLUMN(EnergyMother, energyMother, std::vector<float>); //! energy of mother subjet at each splitting
DECLARE_SOA_COLUMN(PtLeading, ptLeading, std::vector<float>); //! pt of leading subjet at each splitting
DECLARE_SOA_COLUMN(PtSubLeading, ptSubLeading, std::vector<float>); //! pt of subleading subjet at each splitting
DECLARE_SOA_COLUMN(Theta, theta, std::vector<float>); //! opening angle theta at each splitting
} // namespace gjjetsubstructure
DECLARE_SOA_TABLE(GjJetSubstructures, "AOD", "GJJETSUBSTR",
gjjetsubstructure::GjChargedJetId,
gjgamma::GjEventId,
gjjetsubstructure::EnergyMother,
gjjetsubstructure::PtLeading,
gjjetsubstructure::PtSubLeading,
Expand Down
24 changes: 11 additions & 13 deletions PWGJE/Tasks/gammaJetTreeProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1159,12 +1159,11 @@ struct GammaJetTreeProducer {
/// \param storedColIndex The stored collision index
/// \param jet The jet to process
/// \param tracks The tracks collection
/// \return The global index of the stored jet, or -1 if jet was not stored (below pT threshold)
template <typename T, typename U>
int64_t fillChargedJetTable(int32_t storedColIndex, T const& jet, U const& /*tracks*/)
void fillChargedJetTable(int32_t storedColIndex, T const& jet, U const& /*tracks*/)
{
if (jet.pt() < jetPtMin) {
return -1;
return;
}
ushort nconst = 0;
float leadingTrackPt = 0;
Expand All @@ -1179,15 +1178,14 @@ struct GammaJetTreeProducer {
chargedJetsTable(storedColIndex, jet.pt(), jet.eta(), jet.phi(), jet.r(), jet.energy(), jet.mass(), jet.area(), leadingTrackPt, perpconerho, nconst);
mHistograms.fill(HIST("chjetPtEtaPhi"), jet.pt(), jet.eta(), jet.phi());
mHistograms.fill(HIST("chjetPt"), jet.pt());
return chargedJetsTable.lastIndex();
}

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

if (jet.pt() < jetPtMin || jetGlobalIndex < 0) {
if (jet.pt() < jetPtMin) {
return;
}
for (auto& jetConstituent : jet.template tracks_as<U>()) {
Expand Down Expand Up @@ -1234,7 +1232,7 @@ struct GammaJetTreeProducer {

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

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

// Fill substructure table if enabled and jet was stored
if (calculateJetSubstructure && jetGlobalIndex >= 0) {
fillSubstructureTable(jetGlobalIndex, jet, tracks);
if (calculateJetSubstructure) {
fillSubstructureTable(storedColIndex, jet, tracks);
}
}
}
Expand Down Expand Up @@ -1398,11 +1396,11 @@ struct GammaJetTreeProducer {
// loop over charged jets
for (const auto& jet : chargedJets) {
// Fill jet table and get the stored jet's global index
int64_t jetGlobalIndex = fillChargedJetTable(storedColIndex, jet, tracks);
fillChargedJetTable(storedColIndex, jet, tracks);

// Fill substructure table if enabled and jet was stored
if (calculateJetSubstructure && jetGlobalIndex >= 0) {
fillSubstructureTable(jetGlobalIndex, jet, tracks);
if (calculateJetSubstructure) {
fillSubstructureTable(storedColIndex, jet, tracks);
}

// Fill Matching information
Expand Down
Loading