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
5 changes: 4 additions & 1 deletion PWGJE/Core/JetFindingUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
template <typename T, typename U>
void analyseTracks(std::vector<fastjet::PseudoJet>& inputParticles, T const& tracks, int trackSelection, double trackingEfficinecy, const U* candidate = nullptr)
{
for (auto& track : tracks) {

Check failure on line 103 in PWGJE/Core/JetFindingUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!jetderiveddatautilities::selectTrack(track, trackSelection)) {
continue;
}
Expand All @@ -109,7 +109,7 @@
continue;
}
}
if (trackingEfficinecy < 0.999) { // this code is a bit ugly but it stops us needing to do the random generation unless asked for

Check failure on line 112 in PWGJE/Core/JetFindingUtilities.h

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.
TRandom3 randomNumber(0);
if (randomNumber.Rndm() > trackingEfficinecy) { // Is Rndm ok to use?
continue;
Expand All @@ -131,16 +131,16 @@
template <typename T, typename U>
void analyseTracksMultipleCandidates(std::vector<fastjet::PseudoJet>& inputParticles, T const& tracks, int trackSelection, double trackingEfficinecy, U const& candidates)
{
for (auto& track : tracks) {

Check failure on line 134 in PWGJE/Core/JetFindingUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (!jetderiveddatautilities::selectTrack(track, trackSelection)) {
continue;
}
for (auto& candidate : candidates) {

Check failure on line 138 in PWGJE/Core/JetFindingUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (jetcandidateutilities::isDaughterTrack(track, candidate, tracks)) {
continue;
}
}
if (trackingEfficinecy < 0.999) { // this code is a bit ugly but it stops us needing to do the random generation unless asked for

Check failure on line 143 in PWGJE/Core/JetFindingUtilities.h

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.
TRandom3 randomNumber(0);
if (randomNumber.Rndm() > trackingEfficinecy) { // Is Rndm ok to use?
continue;
Expand All @@ -159,7 +159,7 @@
template <typename T>
void analyseClusters(std::vector<fastjet::PseudoJet>& inputParticles, T const& clusters, int hadronicCorrectionType = 0)
{
for (auto& cluster : *clusters) {

Check failure on line 162 in PWGJE/Core/JetFindingUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
// add cluster selections
fastjetutilities::fillClusters(cluster, inputParticles, cluster.globalIndex(), hadronicCorrectionType);
}
Expand Down Expand Up @@ -224,7 +224,7 @@
* @param v0s V0 candidates
*/
template <typename T>
bool analyseV0s(std::vector<fastjet::PseudoJet>& inputParticles, T const& v0s, float v0PtMin, float v0PtMax, float v0YMin, float v0YMax, int v0Index)
bool analyseV0s(std::vector<fastjet::PseudoJet>& inputParticles, T const& v0s, float v0PtMin, float v0PtMax, float v0YMin, float v0YMax, int v0Index, bool useV0SignalFlags)
{
float v0Mass = 0;
float v0Y = -10.0;
Expand All @@ -235,6 +235,9 @@
v0Mass = v0.m();
v0Y = v0.y();
} else {
if (useV0SignalFlags && v0.isRejectedCandidate()) {
continue;
}
if (v0Index == 0) {
v0Mass = o2::constants::physics::MassKaonNeutral;
}
Expand Down Expand Up @@ -279,12 +282,12 @@
auto jetRValues = static_cast<std::vector<double>>(jetRadius);
jetFinder.jetPtMin = jetPtMin;
jetFinder.jetPtMax = jetPtMax;
for (auto R : jetRValues) {

Check failure on line 285 in PWGJE/Core/JetFindingUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
jetFinder.jetR = R;
std::vector<fastjet::PseudoJet> jets;
fastjet::ClusterSequenceArea clusterSeq(jetFinder.findJets(inputParticles, jets));
for (const auto& jet : jets) {
if (jet.has_area() && jet.area() < jetAreaFractionMin * M_PI * R * R) {

Check failure on line 290 in PWGJE/Core/JetFindingUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
continue;
}
if (fillThnSparse) {
Expand Down Expand Up @@ -337,7 +340,7 @@
template <bool checkIsDaughter, typename T, typename U>
void analyseParticles(std::vector<fastjet::PseudoJet>& inputParticles, std::string particleSelection, int jetTypeParticleLevel, T const& particles, o2::framework::Service<o2::framework::O2DatabasePDG> pdgDatabase, const U* candidate = nullptr)
{
for (auto& particle : particles) {

Check failure on line 343 in PWGJE/Core/JetFindingUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
if (particleSelection == "PhysicalPrimary" && !particle.isPhysicalPrimary()) { // CHECK : Does this exclude the HF hadron?
continue;
} else if (particleSelection == "HepMCStatus" && particle.getHepMCStatusCode() != 1) { // do we need isPhysicalPrimary as well? Note: Might give unforseen results if the generator isnt PYTHIA
Expand All @@ -352,7 +355,7 @@
}
auto pdgParticle = pdgDatabase->GetParticle(particle.pdgCode());
auto pdgCharge = pdgParticle ? std::abs(pdgParticle->Charge()) : -1.0;
if (jetTypeParticleLevel == static_cast<int>(JetType::charged) && pdgCharge < 3.0) {

Check failure on line 358 in PWGJE/Core/JetFindingUtilities.h

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.
continue;
}
if (jetTypeParticleLevel == static_cast<int>(JetType::neutral) && pdgCharge != 0.0) {
Expand Down
5 changes: 3 additions & 2 deletions PWGJE/DataModel/Jet.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "PWGHF/DataModel/DerivedTables.h"
#include "PWGHF/DataModel/CandidateSelectionTables.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"
#include "PWGLF/DataModel/V0SelectorTables.h"
#include "PWGDQ/DataModel/ReducedInfoTables.h"

namespace o2::aod
Expand Down Expand Up @@ -244,8 +245,8 @@ using JetParticlesSubBplus = JMcParticleBplusSubs;
using McCollisionsBplus = o2::soa::Join<HfBplusMcCollBases, JBplusMcCollisionIds>;
using CandidatesBplusMCP = o2::soa::Join<HfBplusPBases, JBplusPIds>;

using CandidatesV0Data = o2::soa::Join<V0Cores, JV0Ids>;
using CandidatesV0MCD = o2::soa::Join<V0Cores, V0MCCores, JV0Ids>;
using CandidatesV0Data = o2::soa::Join<V0Cores, JV0Ids, V0SignalFlags>;
using CandidatesV0MCD = o2::soa::Join<V0Cores, V0MCCores, JV0Ids, V0SignalFlags>;
// using V0Daughters = DauTrackExtras;
using McCollisionsV0 = o2::soa::Join<JV0McCollisions, JV0McCollisionIds>;
using CandidatesV0MCP = o2::soa::Join<JV0Mcs, JV0McIds>;
Expand Down
7 changes: 4 additions & 3 deletions PWGJE/JetFinders/jetFinderV0.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "PWGJE/Core/JetFindingUtilities.h"
#include "PWGJE/DataModel/Jet.h"
#include "PWGJE/DataModel/JetReducedData.h"
#include "PWGLF/DataModel/V0SelectorTables.h"

using namespace o2;
using namespace o2::framework;
Expand Down Expand Up @@ -93,6 +94,7 @@ struct JetFinderV0Task {
Configurable<int> jetPtBinWidth{"jetPtBinWidth", 5, "used to define the width of the jetPt bins for the THnSparse"};
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"};

Service<o2::framework::O2DatabasePDG> pdgDatabase;
int trackSelection = -1;
Expand Down Expand Up @@ -161,7 +163,6 @@ struct JetFinderV0Task {
Filter mcCollisionFilter = ((skipMBGapEvents.node() == false) || (aod::jmccollision::subGeneratorId != static_cast<int>(jetderiveddatautilities::JCollisionSubGeneratorId::mbGap))); // should we add a posZ vtx cut here or leave it to analysers?
Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta >= trackEtaMin && aod::jtrack::eta <= trackEtaMax && aod::jtrack::phi >= trackPhiMin && aod::jtrack::phi <= trackPhiMax);
Filter partCuts = (aod::jmcparticle::pt >= trackPtMin && aod::jmcparticle::pt < trackPtMax && aod::jmcparticle::eta >= trackEtaMin && aod::jmcparticle::eta <= trackEtaMax && aod::jmcparticle::phi >= trackPhiMin && aod::jmcparticle::phi <= trackPhiMax);
// Filter candidateCuts = (aod::hfcand::pt >= candPtMin && aod::hfcand::pt < candPtMax && aod::hfcand::y >= candYMin && aod::hfcand::y < candYMax);

// function that generalically processes Data and reco level events
template <typename T, typename U, typename V, typename M, typename N>
Expand All @@ -171,7 +172,7 @@ struct JetFinderV0Task {
return;
}
inputParticles.clear();
if (!jetfindingutilities::analyseV0s(inputParticles, candidates, candPtMin, candPtMax, candYMin, candYMax, candIndex)) {
if (!jetfindingutilities::analyseV0s(inputParticles, candidates, candPtMin, candPtMax, candYMin, candYMax, candIndex, useV0SignalFlags)) {
return;
}

Expand All @@ -192,7 +193,7 @@ struct JetFinderV0Task {
{

inputParticles.clear();
if (!jetfindingutilities::analyseV0s(inputParticles, candidates, candPtMin, candPtMax, candYMin, candYMax, candIndex)) {
if (!jetfindingutilities::analyseV0s(inputParticles, candidates, candPtMin, candPtMax, candYMin, candYMax, candIndex, useV0SignalFlags)) {
return;
}
jetfindingutilities::analyseParticles<true>(inputParticles, particleSelection, jetTypeParticleLevel, particles, pdgDatabase, &candidates);
Expand Down
4 changes: 2 additions & 2 deletions PWGJE/Tasks/jetFragmentation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ using MatchedMCPJetsWithConstituents = soa::Join<MCPJets, aod::ChargedMCParticle

// V0 jets
using DataV0JetsWithConstituents = soa::Join<aod::V0ChargedJets, aod::V0ChargedJetConstituents>;
using CandidatesV0DataWithFlags = soa::Join<aod::CandidatesV0Data, aod::V0SignalFlags>;
using CandidatesV0DataWithFlags = aod::CandidatesV0Data;

using CandidatesV0MCDWithLabelsAndFlags = soa::Join<aod::CandidatesV0MCD, aod::McV0Labels, aod::V0SignalFlags>;
using CandidatesV0MCDWithLabelsAndFlags = soa::Join<aod::CandidatesV0MCD, aod::McV0Labels>;
using MCDV0Jets = aod::V0ChargedMCDetectorLevelJets;
using MCDV0JetsWithConstituents = soa::Join<MCDV0Jets, aod::V0ChargedMCDetectorLevelJetConstituents>;
using MatchedMCDV0Jets = soa::Join<MCDV0Jets, aod::V0ChargedMCDetectorLevelJetsMatchedToV0ChargedMCParticleLevelJets>;
Expand Down
4 changes: 2 additions & 2 deletions PWGJE/Tasks/v0QA.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ using MCDV0JetsWithConstituents = soa::Join<MCDV0Jets, aod::V0ChargedMCDetectorL
using MatchedMCDV0Jets = soa::Join<MCDV0Jets, aod::V0ChargedMCDetectorLevelJetsMatchedToV0ChargedMCParticleLevelJets>;
using MatchedMCDV0JetsWithConstituents = soa::Join<MCDV0Jets, aod::V0ChargedMCDetectorLevelJetConstituents, aod::V0ChargedMCDetectorLevelJetsMatchedToV0ChargedMCParticleLevelJets>;

using CandidatesV0MCDWithFlags = soa::Join<aod::CandidatesV0MCD, aod::McV0Labels, aod::V0SignalFlags>;
using CandidatesV0MCDWithFlags = soa::Join<aod::CandidatesV0MCD, aod::McV0Labels>;

using MCPV0Jets = aod::V0ChargedMCParticleLevelJets;
using MCPV0JetsWithConstituents = soa::Join<MCPV0Jets, aod::V0ChargedMCParticleLevelJetConstituents>;
Expand Down Expand Up @@ -1221,7 +1221,7 @@ struct V0QA {

using DaughterJTracks = soa::Join<aod::JetTracks, aod::JTrackPIs>;
using DaughterTracks = soa::Join<aod::FullTracks, aod::TracksDCA, aod::TrackSelection, aod::TracksCov>;
void processV0TrackQA(aod::JetCollision const& /*jcoll*/, soa::Join<aod::CandidatesV0Data, aod::V0SignalFlags> const& v0s, DaughterJTracks const&, DaughterTracks const&)
void processV0TrackQA(aod::JetCollision const& /*jcoll*/, aod::CandidatesV0Data const& v0s, DaughterJTracks const&, DaughterTracks const&)
{
// if (!jetderiveddatautilities::selectCollision(jcoll, eventSelectionBits)) {
// return;
Expand Down
Loading