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
31 changes: 29 additions & 2 deletions PWGHF/TableProducer/candidateCreator2Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/runDataProcessing.h"
#include "Framework/RunningWorkflowInfo.h"
#include "ReconstructionDataFormats/DCA.h"

#include "Common/Core/trackUtilities.h"
Expand Down Expand Up @@ -665,11 +666,29 @@ struct HfCandidateCreator2ProngExpressions {
Produces<aod::HfCand2ProngMcRec> rowMcMatchRec;
Produces<aod::HfCand2ProngMcGen> rowMcMatchGen;

void init(InitContext const&) {}
float zPvPosMax{1000.f};

// inspect for which zPvPosMax cut was set for reconstructed
void init(InitContext& initContext)
{
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
for (const DeviceSpec& device : workflows.devices) {
if (device.name.compare("hf-candidate-creator-2prong") == 0) {
for (const auto& option : device.options) {
if (option.name.compare("zPvPosMax") == 0) {
zPvPosMax = option.defaultValue.get<float>();
break;
}
}
break;
}
}
}

/// Performs MC matching.
void processMc(aod::TracksWMc const& tracks,
aod::McParticles const& mcParticles)
aod::McParticles const& mcParticles,
aod::McCollisions const&)
{
rowCandidateProng2->bindExternalIndices(&tracks);

Expand All @@ -681,6 +700,7 @@ struct HfCandidateCreator2ProngExpressions {
// Match reconstructed candidates.
// Spawned table can be used directly
for (const auto& candidate : *rowCandidateProng2) {

flag = 0;
origin = 0;
auto arrayDaughters = std::array{candidate.prong0_as<aod::TracksWMc>(), candidate.prong1_as<aod::TracksWMc>()};
Expand Down Expand Up @@ -721,6 +741,13 @@ struct HfCandidateCreator2ProngExpressions {
flag = 0;
origin = 0;

auto mcCollision = particle.mcCollision();
float zPv = mcCollision.posZ();
if (zPv < -zPvPosMax || zPv > zPvPosMax) { // to avoid counting particles in collisions with Zvtx larger than the maximum, we do not match them
rowMcMatchGen(flag, origin);
continue;
}

// D0(bar) → π± K∓
if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign)) {
flag = sign * (1 << DecayType::D0ToPiK);
Expand Down
18 changes: 15 additions & 3 deletions PWGHF/TableProducer/candidateCreator3Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,13 @@ struct HfCandidateCreator3ProngExpressions {
bool createDs{false};
bool createLc{false};
bool createXic{false};
float zPvPosMax{1000.f};

void init(InitContext& initContext)
{

// inspect for which particle species the candidates were created
auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
// inspect for which particle species the candidates were created and which zPvPosMax cut was set for reconstructed
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
for (const DeviceSpec& device : workflows.devices) {
if (device.name.compare("hf-candidate-creator-3prong") == 0) {
for (const auto& option : device.options) {
Expand All @@ -487,8 +488,11 @@ struct HfCandidateCreator3ProngExpressions {
createLc = option.defaultValue.get<bool>();
} else if (option.name.compare("createXic") == 0) {
createXic = option.defaultValue.get<bool>();
} else if (option.name.compare("zPvPosMax") == 0) {
zPvPosMax = option.defaultValue.get<float>();
Comment thread
vkucera marked this conversation as resolved.
}
}
break;
}
}

Expand All @@ -501,7 +505,8 @@ struct HfCandidateCreator3ProngExpressions {

/// Performs MC matching.
void processMc(aod::TracksWMc const& tracks,
aod::McParticles const& mcParticles)
aod::McParticles const& mcParticles,
aod::McCollisions const&)
{
rowCandidateProng3->bindExternalIndices(&tracks);

Expand Down Expand Up @@ -618,6 +623,13 @@ struct HfCandidateCreator3ProngExpressions {
channel = 0;
arrDaughIndex.clear();

auto mcCollision = particle.mcCollision();
float zPv = mcCollision.posZ();
if (zPv < -zPvPosMax || zPv > zPvPosMax) { // to avoid counting particles in collisions with Zvtx larger than the maximum, we do not match them
rowMcMatchGen(flag, origin, channel);
continue;
}

// D± → π± K∓ π±
if (createDplus) {
if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDPlus, std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 2)) {
Expand Down
31 changes: 30 additions & 1 deletion PWGHF/TableProducer/candidateCreatorCascade.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/runDataProcessing.h"
#include "Framework/RunningWorkflowInfo.h"
#include "ReconstructionDataFormats/DCA.h"
#include "ReconstructionDataFormats/V0.h"

Expand Down Expand Up @@ -445,8 +446,28 @@ struct HfCandidateCreatorCascadeMc {

using MyTracksWMc = soa::Join<aod::TracksWCov, aod::McTrackLabels>;

float zPvPosMax{1000.f};

// inspect for which zPvPosMax cut was set for reconstructed
void init(InitContext& initContext)
{
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
for (const DeviceSpec& device : workflows.devices) {
if (device.name.compare("hf-candidate-creator-cascade") == 0) {
for (const auto& option : device.options) {
if (option.name.compare("zPvPosMax") == 0) {
zPvPosMax = option.defaultValue.get<float>();
break;
}
}
break;
}
}
}

void processMc(MyTracksWMc const& tracks,
aod::McParticles const& mcParticles)
aod::McParticles const& mcParticles,
aod::McCollisions const&)
{
int8_t sign = 0;
int8_t origin = 0;
Expand Down Expand Up @@ -493,6 +514,14 @@ struct HfCandidateCreatorCascadeMc {
// Match generated particles.
for (const auto& particle : mcParticles) {
origin = 0;

auto mcCollision = particle.mcCollision();
float zPv = mcCollision.posZ();
if (zPv < -zPvPosMax || zPv > zPvPosMax) { // to avoid counting particles in collisions with Zvtx larger than the maximum, we do not match them
rowMcMatchGen(sign, origin);
continue;
}

// checking if I have a Lc --> K0S + p
RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kLambdaCPlus, std::array{+kProton, +kK0Short}, false, &sign, 2);
if (sign == 0) { // now check for anti-Lc
Expand Down
31 changes: 29 additions & 2 deletions PWGHF/TableProducer/candidateCreatorDstar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/runDataProcessing.h"
#include "Framework/RunningWorkflowInfo.h"
// O2Physics
#include "Common/Core/trackUtilities.h"
// PWGHF
Expand Down Expand Up @@ -516,11 +517,29 @@ struct HfCandidateCreatorDstarExpressions {
Produces<aod::HfCandDstarMcRec> rowsMcMatchRecDstar;
Produces<aod::HfCandDstarMcGen> rowsMcMatchGenDstar;

void init(InitContext const&) {}
float zPvPosMax{1000.f};

// inspect for which zPvPosMax cut was set for reconstructed
void init(InitContext& initContext)
{
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
for (const DeviceSpec& device : workflows.devices) {
if (device.name.compare("hf-candidate-creator-dstar") == 0) {
for (const auto& option : device.options) {
if (option.name.compare("zPvPosMax") == 0) {
zPvPosMax = option.defaultValue.get<float>();
break;
}
}
break;
}
}
}

/// Perform MC Matching.
void processMc(aod::TracksWMc const& tracks,
aod::McParticles const& mcParticles)
aod::McParticles const& mcParticles,
aod::McCollisions const&)
{
rowsCandidateD0->bindExternalIndices(&tracks);
rowsCandidateDstar->bindExternalIndices(&tracks);
Expand Down Expand Up @@ -576,6 +595,14 @@ struct HfCandidateCreatorDstarExpressions {
originDstar = 0;
originD0 = 0;

auto mcCollision = particle.mcCollision();
float zPv = mcCollision.posZ();
if (zPv < -zPvPosMax || zPv > zPvPosMax) { // to avoid counting particles in collisions with Zvtx larger than the maximum, we do not match them
rowsMcMatchGenDstar(flagDstar, originDstar);
rowsMcMatchGenD0(flagD0, originD0);
continue;
}

// D*± → D0(bar) π±
if (RecoDecay::isMatchedMCGen(mcParticles, particle, Pdg::kDStar, std::array{+kPiPlus, +kPiPlus, -kKPlus}, true, &signDstar, 2)) {
flagDstar = signDstar * (BIT(aod::hf_cand_dstar::DecayType::DstarToD0Pi));
Expand Down
29 changes: 27 additions & 2 deletions PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "DetectorsVertexing/PVertexer.h" // for dca recalculation
#include "Framework/AnalysisTask.h"
#include "Framework/runDataProcessing.h"
#include "Framework/RunningWorkflowInfo.h"

#include "Common/Core/TrackSelection.h"
#include "Common/Core/trackUtilities.h"
Expand Down Expand Up @@ -385,8 +386,24 @@ struct HfCandidateSigmac0plusplusMc {
using LambdacMc = soa::Join<aod::HfCand3Prong, aod::HfSelLc, aod::HfCand3ProngMcRec>;
// using LambdacMcGen = soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>;

float zPvPosMax{1000.f};

/// @brief init function
void init(InitContext const&) {}
void init(InitContext& initContext)
{
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
for (const DeviceSpec& device : workflows.devices) {
if (device.name.compare("hf-candidate-creator-3prong") == 0) { // here we assume that the hf-candidate-creator-3prong is in the workflow
for (const auto& option : device.options) {
if (option.name.compare("zPvPosMax") == 0) {
zPvPosMax = option.defaultValue.get<float>();
break;
}
}
break;
}
}
}

/// @brief dummy process function, to be run on data
/// @param
Expand All @@ -397,7 +414,8 @@ struct HfCandidateSigmac0plusplusMc {
/// @param mcParticles table of generated particles
void processMc(aod::McParticles const& mcParticles,
aod::TracksWMc const& tracks,
LambdacMc const& candsLc /*, const LambdacMcGen&*/)
LambdacMc const& candsLc /*, const LambdacMcGen&*/,
aod::McCollisions const&)
{

// Match reconstructed candidates.
Expand Down Expand Up @@ -469,6 +487,13 @@ struct HfCandidateSigmac0plusplusMc {
flag = 0;
origin = 0;

auto mcCollision = particle.mcCollision();
float zPv = mcCollision.posZ();
if (zPv < -zPvPosMax || zPv > zPvPosMax) { // to avoid counting particles in collisions with Zvtx larger than the maximum, we do not match them
rowMCMatchScGen(flag, origin);
continue;
}

/// 3 levels:
/// 1. Σc0 → Λc+ π-,+
/// 2. Λc+ → pK-π+ direct (i) or Λc+ → resonant channel Λc± → p± K*, Λc± → Δ(1232)±± K∓ or Λc± → Λ(1520) π± (ii)
Expand Down