Skip to content
Merged
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
20 changes: 12 additions & 8 deletions PWGLF/Tasks/Nuspex/antinucleiInJets.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1626,6 +1626,10 @@ struct AntinucleiInJets {
// Event counter
int eventCounter = 0;

// Jet and area definitions
fastjet::JetDefinition jetDef(fastjet::antikt_algorithm, rJet);
fastjet::AreaDefinition areaDef(fastjet::active_area, fastjet::GhostedAreaSpec(1.0));

// Loop over all simulated collisions
for (const auto& collision : collisions) {

Expand Down Expand Up @@ -1675,8 +1679,6 @@ struct AntinucleiInJets {
registryMC.fill(HIST("genEvents"), 2.5);

// Cluster MC particles into jets using anti-kt algorithm
fastjet::JetDefinition jetDef(fastjet::antikt_algorithm, rJet);
fastjet::AreaDefinition areaDef(fastjet::active_area, fastjet::GhostedAreaSpec(1.0));
fastjet::ClusterSequenceArea cs(fjParticles, jetDef, areaDef);
std::vector<fastjet::PseudoJet> jets = fastjet::sorted_by_pt(cs.inclusive_jets());
auto [rhoPerp, rhoMPerp] = backgroundSub.estimateRhoPerpCone(fjParticles, jets);
Expand Down Expand Up @@ -1772,8 +1774,8 @@ struct AntinucleiInJets {

// Shrink large vectors
if (eventCounter % shrinkInterval == 0) {
fjParticles.shrink_to_fit();
protonMomentum.shrink_to_fit();
std::vector<fastjet::PseudoJet>().swap(fjParticles);
std::vector<TVector3>().swap(protonMomentum);
}
}
}
Expand All @@ -1786,6 +1788,10 @@ struct AntinucleiInJets {
std::vector<fastjet::PseudoJet> fjParticles;
std::vector<int> antiprotonTrackIndex;

// Jet and area definitions
fastjet::JetDefinition jetDef(fastjet::antikt_algorithm, rJet);
fastjet::AreaDefinition areaDef(fastjet::active_area, fastjet::GhostedAreaSpec(1.0));

// Event counter
int eventCounter = 0;

Expand Down Expand Up @@ -1870,8 +1876,6 @@ struct AntinucleiInJets {
registryMC.fill(HIST("recEvents"), 8.5);

// Cluster particles using the anti-kt algorithm
fastjet::JetDefinition jetDef(fastjet::antikt_algorithm, rJet);
fastjet::AreaDefinition areaDef(fastjet::active_area, fastjet::GhostedAreaSpec(1.0));
fastjet::ClusterSequenceArea cs(fjParticles, jetDef, areaDef);
std::vector<fastjet::PseudoJet> jets = fastjet::sorted_by_pt(cs.inclusive_jets());
auto [rhoPerp, rhoMPerp] = backgroundSub.estimateRhoPerpCone(fjParticles, jets);
Expand Down Expand Up @@ -2064,8 +2068,8 @@ struct AntinucleiInJets {

// Shrink large vectors
if (eventCounter % shrinkInterval == 0) {
fjParticles.shrink_to_fit();
antiprotonTrackIndex.shrink_to_fit();
std::vector<fastjet::PseudoJet>().swap(fjParticles);
std::vector<int>().swap(antiprotonTrackIndex);
}
}
}
Expand Down
Loading