Skip to content

Commit 4487003

Browse files
authored
[PWGJE] V0 Jet Framework update (#13063)
1 parent 5c4a66d commit 4487003

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

PWGJE/Core/JetV0Utilities.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,13 @@ auto slicedPerV0Candidate(T const& table, U const& candidate, V const& perV0Cand
138138
}
139139

140140
template <typename T, typename U>
141-
bool isV0Particle(T const& particles, U const& particle)
141+
bool isV0Particle(T const& particles, U const& particle, bool v0ChargedDecaysOnly)
142142
{
143-
return RecoDecay::isMatchedMCGen(particles, particle, +kK0Short, std::array{+kPiPlus, -kPiPlus}, true) || RecoDecay::isMatchedMCGen(particles, particle, +kLambda0, std::array{+kProton, -kPiPlus}, true) || RecoDecay::isMatchedMCGen(particles, particle, -kLambda0, std::array{-kProton, +kPiPlus}, true);
143+
if (v0ChargedDecaysOnly) {
144+
return RecoDecay::isMatchedMCGen(particles, particle, +kK0Short, std::array{+kPiPlus, -kPiPlus}, true) || RecoDecay::isMatchedMCGen(particles, particle, +kLambda0, std::array{+kProton, -kPiPlus}, true) || RecoDecay::isMatchedMCGen(particles, particle, -kLambda0, std::array{-kProton, +kPiPlus}, true);
145+
} else {
146+
return RecoDecay::isMatchedMCGen(particles, particle, +kK0Short, std::array{+kPiPlus, -kPiPlus}, true) || RecoDecay::isMatchedMCGen(particles, particle, +kK0Short, std::array{+kPi0, +kPi0}, true) || RecoDecay::isMatchedMCGen(particles, particle, +kLambda0, std::array{+kProton, -kPiPlus}, true) || RecoDecay::isMatchedMCGen(particles, particle, +kLambda0, std::array{+kNeutron, +kPi0}, true) || RecoDecay::isMatchedMCGen(particles, particle, -kLambda0, std::array{-kProton, +kPiPlus}, true) || RecoDecay::isMatchedMCGen(particles, particle, -kLambda0, std::array{+kNeutron, +kPi0}, true);
147+
}
144148
}
145149

146150
enum JV0ParticleDecays {

PWGJE/JetFinders/jetFinderV0.cxx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ struct JetFinderV0Task {
9393
Configurable<bool> fillTHnSparse{"fillTHnSparse", true, "switch to fill the THnSparse"};
9494
Configurable<double> jetExtraParam{"jetExtraParam", -99.0, "sets the _extra_param in fastjet"};
9595
Configurable<bool> useV0SignalFlags{"useV0SignalFlags", true, "use V0 signal flags table"};
96+
Configurable<bool> saveJetsWithCandidatesOnly{"saveJetsWithCandidatesOnly", true, "only save jets if they contain a V0"};
9697

9798
Service<o2::framework::O2DatabasePDG> pdgDatabase;
9899
int trackSelection = -1;
@@ -171,7 +172,9 @@ struct JetFinderV0Task {
171172
}
172173
inputParticles.clear();
173174
if (!jetfindingutilities::analyseV0s(inputParticles, candidates, candPtMin, candPtMax, candYMin, candYMax, candIndex, useV0SignalFlags)) {
174-
return;
175+
if (saveJetsWithCandidatesOnly) {
176+
return;
177+
}
175178
}
176179

177180
/*
@@ -183,7 +186,7 @@ struct JetFinderV0Task {
183186
*/
184187
jetfindingutilities::analyseTracksMultipleCandidates(inputParticles, tracks, trackSelection, trackingEfficiency, candidates);
185188

186-
jetfindingutilities::findJets(jetFinder, inputParticles, minJetPt, maxJetPt, jetRadius, jetAreaFractionMin, collision, jetsTableInput, constituentsTableInput, registry.get<THn>(HIST("hJet")), fillTHnSparse, true);
189+
jetfindingutilities::findJets(jetFinder, inputParticles, minJetPt, maxJetPt, jetRadius, jetAreaFractionMin, collision, jetsTableInput, constituentsTableInput, registry.get<THn>(HIST("hJet")), fillTHnSparse, saveJetsWithCandidatesOnly);
187190
}
188191

189192
template <typename T, typename U, typename V>
@@ -192,10 +195,12 @@ struct JetFinderV0Task {
192195

193196
inputParticles.clear();
194197
if (!jetfindingutilities::analyseV0s(inputParticles, candidates, candPtMin, candPtMax, candYMin, candYMax, candIndex, useV0SignalFlags)) {
195-
return;
198+
if (saveJetsWithCandidatesOnly) {
199+
return;
200+
}
196201
}
197202
jetfindingutilities::analyseParticles<true>(inputParticles, particleSelection, jetTypeParticleLevel, particles, pdgDatabase, &candidates);
198-
jetfindingutilities::findJets(jetFinder, inputParticles, minJetPt, maxJetPt, jetRadius, jetAreaFractionMin, collision, jetsTable, constituentsTable, registry.get<THn>(HIST("hJetMCP")), fillTHnSparse, true);
203+
jetfindingutilities::findJets(jetFinder, inputParticles, minJetPt, maxJetPt, jetRadius, jetAreaFractionMin, collision, jetsTable, constituentsTable, registry.get<THn>(HIST("hJetMCP")), fillTHnSparse, saveJetsWithCandidatesOnly);
199204
}
200205

201206
void processDummy(aod::JetCollisions const&)

PWGJE/TableProducer/derivedDataProducer.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ struct JetDerivedDataProducerTask {
147147
Configurable<std::string> ccdbURL{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
148148
Configurable<bool> includeTriggers{"includeTriggers", false, "fill the collision information with software trigger decisions"};
149149
Configurable<bool> includeHadronicRate{"includeHadronicRate", true, "fill the collision information with the hadronic rate"};
150+
Configurable<bool> v0ChargedDecaysOnly{"v0ChargedDecaysOnly", true, "store V0s (at particle-level) only if they decay to charged particles"};
150151

151152
Preslice<aod::EMCALClusterCells> perClusterCells = aod::emcalclustercell::emcalclusterId;
152153
Preslice<aod::EMCALMatchedTracks> perClusterTracks = aod::emcalclustercell::emcalclusterId;
@@ -764,7 +765,7 @@ struct JetDerivedDataProducerTask {
764765
{ // can loop over McV0Labels tables if we want to only store matched V0Particles
765766
bool filledV0McCollisionTable = false;
766767
for (auto const& particle : particles) {
767-
if (jetv0utilities::isV0Particle(particles, particle)) {
768+
if (jetv0utilities::isV0Particle(particles, particle, v0ChargedDecaysOnly)) {
768769
if (!filledV0McCollisionTable) {
769770
products.jV0McCollisionsTable(mcCollision.posX(), mcCollision.posY(), mcCollision.posZ());
770771
products.jV0McCollisionIdsTable(mcCollision.globalIndex());

0 commit comments

Comments
 (0)