Skip to content
Merged
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
8 changes: 6 additions & 2 deletions PWGJE/Core/JetV0Utilities.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGJE/Core/JetV0Utilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/file-cpp]

Use lowerCamelCase or UpperCamelCase for names of C++ files. See the O2 naming conventions for details.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -138,9 +138,13 @@
}

template <typename T, typename U>
bool isV0Particle(T const& particles, U const& particle)
bool isV0Particle(T const& particles, U const& particle, bool v0ChargedDecaysOnly)
{
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);
if (v0ChargedDecaysOnly) {
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);
} else {
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);
}
}

enum JV0ParticleDecays {
Expand Down
13 changes: 9 additions & 4 deletions PWGJE/JetFinders/jetFinderV0.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

Check failure on line 11 in PWGJE/JetFinders/jetFinderV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

Check failure on line 11 in PWGJE/JetFinders/jetFinderV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check failure on line 11 in PWGJE/JetFinders/jetFinderV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.
// jet finder V0 task
//
/// \author Nima Zardoshti <nima.zardoshti@cern.ch>
Expand Down Expand Up @@ -93,6 +93,7 @@
Configurable<bool> fillTHnSparse{"fillTHnSparse", true, "switch to fill the THnSparse"};
Configurable<double> jetExtraParam{"jetExtraParam", -99.0, "sets the _extra_param in fastjet"};
Configurable<bool> useV0SignalFlags{"useV0SignalFlags", true, "use V0 signal flags table"};
Configurable<bool> saveJetsWithCandidatesOnly{"saveJetsWithCandidatesOnly", true, "only save jets if they contain a V0"};

Service<o2::framework::O2DatabasePDG> pdgDatabase;
int trackSelection = -1;
Expand All @@ -119,7 +120,7 @@
jetFinder.jetPtMax = jetPtMax;
jetFinder.jetEtaMin = jetEtaMin;
jetFinder.jetEtaMax = jetEtaMax;
if (jetEtaMin < -98.0) {

Check failure on line 123 in PWGJE/JetFinders/jetFinderV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
jetFinder.jetEtaDefault = true;
}
jetFinder.algorithm = static_cast<fastjet::JetAlgorithm>(static_cast<int>(jetAlgorithm));
Expand All @@ -131,16 +132,16 @@
}
jetFinder.fastjetExtraParam = jetExtraParam;

if (candPDG == 310) {

Check failure on line 135 in PWGJE/JetFinders/jetFinderV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

Check failure on line 135 in PWGJE/JetFinders/jetFinderV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
candIndex = 0;
}
if (candPDG == 3122) {

Check failure on line 138 in PWGJE/JetFinders/jetFinderV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

Check failure on line 138 in PWGJE/JetFinders/jetFinderV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
candIndex = 1;
}

auto jetRadiiBins = (std::vector<double>)jetRadius;
if (jetRadiiBins.size() > 1) {
jetRadiiBins.push_back(jetRadiiBins[jetRadiiBins.size() - 1] + (TMath::Abs(jetRadiiBins[jetRadiiBins.size() - 1] - jetRadiiBins[jetRadiiBins.size() - 2])));

Check failure on line 144 in PWGJE/JetFinders/jetFinderV0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
} else {
jetRadiiBins.push_back(jetRadiiBins[jetRadiiBins.size() - 1] + 0.1);
}
Expand Down Expand Up @@ -171,7 +172,9 @@
}
inputParticles.clear();
if (!jetfindingutilities::analyseV0s(inputParticles, candidates, candPtMin, candPtMax, candYMin, candYMax, candIndex, useV0SignalFlags)) {
return;
if (saveJetsWithCandidatesOnly) {
return;
}
}

/*
Expand All @@ -183,7 +186,7 @@
*/
jetfindingutilities::analyseTracksMultipleCandidates(inputParticles, tracks, trackSelection, trackingEfficiency, candidates);

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

template <typename T, typename U, typename V>
Expand All @@ -192,10 +195,12 @@

inputParticles.clear();
if (!jetfindingutilities::analyseV0s(inputParticles, candidates, candPtMin, candPtMax, candYMin, candYMax, candIndex, useV0SignalFlags)) {
return;
if (saveJetsWithCandidatesOnly) {
return;
}
}
jetfindingutilities::analyseParticles<true>(inputParticles, particleSelection, jetTypeParticleLevel, particles, pdgDatabase, &candidates);
jetfindingutilities::findJets(jetFinder, inputParticles, minJetPt, maxJetPt, jetRadius, jetAreaFractionMin, collision, jetsTable, constituentsTable, registry.get<THn>(HIST("hJetMCP")), fillTHnSparse, true);
jetfindingutilities::findJets(jetFinder, inputParticles, minJetPt, maxJetPt, jetRadius, jetAreaFractionMin, collision, jetsTable, constituentsTable, registry.get<THn>(HIST("hJetMCP")), fillTHnSparse, saveJetsWithCandidatesOnly);
}

void processDummy(aod::JetCollisions const&)
Expand Down
3 changes: 2 additions & 1 deletion PWGJE/TableProducer/derivedDataProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ struct JetDerivedDataProducerTask {
Configurable<std::string> ccdbURL{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
Configurable<bool> includeTriggers{"includeTriggers", false, "fill the collision information with software trigger decisions"};
Configurable<bool> includeHadronicRate{"includeHadronicRate", true, "fill the collision information with the hadronic rate"};
Configurable<bool> v0ChargedDecaysOnly{"v0ChargedDecaysOnly", true, "store V0s (at particle-level) only if they decay to charged particles"};

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