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
4 changes: 4 additions & 0 deletions PWGHF/DataModel/DerivedTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
{ \
namespace der_##_hf_namespace_ \
{ \
DECLARE_SOA_ARRAY_INDEX_COLUMN_CUSTOM(Hf##_hf_type_##CollBase, hfCollBases, "HF" _hf_description_ "COLLBASES"); \

Check failure on line 95 in PWGHF/DataModel/DerivedTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
} \
} \
DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##McCollBases, "HF" _hf_description_ "MCCOLLBASE", \
Expand Down Expand Up @@ -169,7 +169,7 @@
{ \
namespace der_##_hf_namespace_ \
{ \
DECLARE_SOA_INDEX_COLUMN_CUSTOM(Hf##_hf_type_##CollBase, hfCollBase, "HF" _hf_description_ "COLLBASES"); \

Check failure on line 172 in PWGHF/DataModel/DerivedTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
} \
} \
\
Expand Down Expand Up @@ -230,7 +230,7 @@
{ \
namespace der_##_hf_namespace_ \
{ \
DECLARE_SOA_INDEX_COLUMN_CUSTOM(Hf##_hf_type_##McCollBase, hfMcCollBase, "HF" _hf_description_ "MCCOLLBASES"); \

Check failure on line 233 in PWGHF/DataModel/DerivedTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
} \
} \
DECLARE_SOA_TABLE_STAGED(Hf##_hf_type_##PBases, "HF" _hf_description_ "PBASE", \
Expand Down Expand Up @@ -899,7 +899,11 @@

DECLARE_SOA_TABLE_STAGED(HfDstarMcs, "HFDSTMC", //! Table with MC candidate info
hf_cand_mc::FlagMcMatchRec,
hf_cand_mc_charm::FlagMcMatchRecCharm,
hf_cand_mc::OriginMcRec,
hf_cand::PtBhadMotherPart,
hf_cand::PdgBhadMotherPart,
hf_cand::NTracksDecayed,
o2::soa::Marker<MarkerDstar>);
} // namespace o2::aod

Expand Down
2 changes: 1 addition & 1 deletion PWGHF/HFJ/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
#
# 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.
# or submit itself to any jurisdiction.
51 changes: 35 additions & 16 deletions PWGHF/TableProducer/derivedDataCreatorDstarToD0Pi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct HfDerivedDataCreatorDstarToD0Pi {
Configurable<float> ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"};

SliceCache cache;
static constexpr double mass{o2::constants::physics::MassDStar};
static constexpr double Mass{o2::constants::physics::MassDStar};

using CollisionsWCentMult = soa::Join<aod::Collisions, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::PVMultZeqs>;
using CollisionsWMcCentMult = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::CentFV0As, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::PVMultZeqs>;
Expand Down Expand Up @@ -126,8 +126,8 @@ struct HfDerivedDataCreatorDstarToD0Pi {
}

template <typename T, typename U>
void fillTablesCandidate(const T& candidate, const U& prong0, const U& prong1, const U& prongSoftPi, int candFlag, double invMass,
double y, int8_t flagMc, int8_t origin, const std::vector<float>& mlScores)
void fillTablesCandidate(const T& candidate, const U& prong0, const U& prong1, const U& prongSoftPi, int candFlag, double invMass, double invMassD0,
double y, int8_t flagMc, int8_t flagMcD0, int8_t origin, int8_t nTracksDecayed, double ptBhad, int pdgBhad, const std::vector<float>& mlScores)
{
rowsCommon.fillTablesCandidate(candidate, invMass, y);
if (fillCandidatePar) {
Expand Down Expand Up @@ -160,7 +160,7 @@ struct HfDerivedDataCreatorDstarToD0Pi {
candidate.pxProng1(),
candidate.pyProng1(),
candidate.pzProng1(),
candidate.invMassD0(),
invMassD0,
candidate.impactParameter0(),
candidate.impactParameter1(),
candidate.impactParameterNormalised0(),
Expand Down Expand Up @@ -196,7 +196,11 @@ struct HfDerivedDataCreatorDstarToD0Pi {
if (fillCandidateMc) {
rowCandidateMc(
flagMc,
origin);
flagMcD0,
origin,
ptBhad,
pdgBhad,
nTracksDecayed);
}
}

Expand Down Expand Up @@ -242,7 +246,9 @@ struct HfDerivedDataCreatorDstarToD0Pi {
if constexpr (isMc) {
reserveTable(rowCandidateMc, fillCandidateMc, sizeTableCand);
}
int8_t flagMcRec = 0, origin = 0;
int8_t flagMcRec = 0, flagMcRecD0 = 0, origin = 0, nTracksDecayed = 0;
double ptBhadMotherPart = 0;
int pdgBhadMotherPart = 0;
for (const auto& candidate : candidatesThisColl) {
if constexpr (isMl) {
if (!TESTBIT(candidate.isSelDstarToD0Pi(), aod::SelectionStep::RecoMl)) {
Expand All @@ -251,7 +257,11 @@ struct HfDerivedDataCreatorDstarToD0Pi {
}
if constexpr (isMc) {
flagMcRec = candidate.flagMcMatchRec();
flagMcRecD0 = candidate.flagMcMatchRecD0();
origin = candidate.originMcRec();
nTracksDecayed = candidate.nTracksDecayed();
ptBhadMotherPart = candidate.ptBhadMotherPart();
pdgBhadMotherPart = candidate.pdgBhadMotherPart();
if constexpr (onlyBkg) {
if (std::abs(flagMcRec) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi) {
continue;
Expand All @@ -273,13 +283,22 @@ struct HfDerivedDataCreatorDstarToD0Pi {
auto prong1 = candidate.template prong1_as<TracksWPid>();
auto prongSoftPi = candidate.template prongPi_as<TracksWPid>();
double y = candidate.y(o2::constants::physics::MassDStar);
double massDstar = candidate.invMassDstar();
int flagSign = -1;
double massDstar = 0, invMassD0 = 0;
std::vector<float> mlScoresDstarToD0Pi;
bool isD0 = prongSoftPi.sign() < 0;
if constexpr (isMl) {
std::copy(candidate.mlProbDstarToD0Pi().begin(), candidate.mlProbDstarToD0Pi().end(), std::back_inserter(mlScoresDstarToD0Pi));
}
fillTablesCandidate(candidate, prong0, prong1, prongSoftPi, isD0 ? 0 : 1, y, massDstar, flagMcRec, origin, mlScoresDstarToD0Pi);
if (candidate.signSoftPi() > 0) {
massDstar = candidate.invMassDstar();
invMassD0 = candidate.invMassD0();
flagSign = 0;
} else {
massDstar = candidate.invMassAntiDstar();
invMassD0 = candidate.invMassD0Bar();
flagSign = 1;
}
fillTablesCandidate(candidate, prong0, prong1, prongSoftPi, flagSign, massDstar, invMassD0, y, flagMcRec, flagMcRecD0, origin, nTracksDecayed, ptBhadMotherPart, pdgBhadMotherPart, mlScoresDstarToD0Pi);
}
}
}
Expand All @@ -302,7 +321,7 @@ struct HfDerivedDataCreatorDstarToD0Pi {
{
rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles);
processCandidates<false, true, false, true>(collisions, candidatesMcSig, tracks, bcs);
rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass);
rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass);
}
PROCESS_SWITCH(HfDerivedDataCreatorDstarToD0Pi, processMcSig, "Process MC only for signals", false);

Expand All @@ -315,7 +334,7 @@ struct HfDerivedDataCreatorDstarToD0Pi {
{
rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles);
processCandidates<false, true, true, false>(collisions, candidatesMcBkg, tracks, bcs);
rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass);
rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass);
}
PROCESS_SWITCH(HfDerivedDataCreatorDstarToD0Pi, processMcBkg, "Process MC only for background", false);

Expand All @@ -328,7 +347,7 @@ struct HfDerivedDataCreatorDstarToD0Pi {
{
rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles);
processCandidates<false, true, false, false>(collisions, candidatesMcAll, tracks, bcs);
rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass);
rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass);
}
PROCESS_SWITCH(HfDerivedDataCreatorDstarToD0Pi, processMcAll, "Process MC", false);

Expand All @@ -352,7 +371,7 @@ struct HfDerivedDataCreatorDstarToD0Pi {
{
rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles);
processCandidates<true, true, false, true>(collisions, candidatesMcMlSig, tracks, bcs);
rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass);
rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass);
}
PROCESS_SWITCH(HfDerivedDataCreatorDstarToD0Pi, processMcMlSig, "Process MC with ML only for signals", false);

Expand All @@ -365,7 +384,7 @@ struct HfDerivedDataCreatorDstarToD0Pi {
{
rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles);
processCandidates<true, true, true, false>(collisions, candidatesMcMlBkg, tracks, bcs);
rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass);
rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass);
}
PROCESS_SWITCH(HfDerivedDataCreatorDstarToD0Pi, processMcMlBkg, "Process MC with ML only for background", false);

Expand All @@ -378,14 +397,14 @@ struct HfDerivedDataCreatorDstarToD0Pi {
{
rowsCommon.preProcessMcCollisions(mcCollisions, mcParticlesPerMcCollision, mcParticles);
processCandidates<true, true, false, false>(collisions, candidatesMcMlAll, tracks, bcs);
rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass);
rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass);
}
PROCESS_SWITCH(HfDerivedDataCreatorDstarToD0Pi, processMcMlAll, "Process MC with ML", false);

void processMcGenOnly(TypeMcCollisions const& mcCollisions,
MatchedGenCandidatesMc const& mcParticles)
{
rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, mass);
rowsCommon.processMcParticles(mcCollisions, mcParticlesPerMcCollision, mcParticles, Mass);
}
PROCESS_SWITCH(HfDerivedDataCreatorDstarToD0Pi, processMcGenOnly, "Process MC gen. only", false);
};
Expand Down
8 changes: 7 additions & 1 deletion PWGJE/Core/JetHFUtilities.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/JetHFUtilities.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 @@ -885,7 +885,13 @@
DstarMlTable(mlScoresVector);

if constexpr (isMc) {
DstarMCDTable(candidate.flagMcMatchRec(), candidate.originMcRec());
DstarMCDTable(
candidate.flagMcMatchRec(),
candidate.flagMcMatchRecCharm(),
candidate.originMcRec(),
candidate.ptBhadMotherPart(),
candidate.pdgBhadMotherPart(),
candidate.nTracksDecayed());
}
}

Expand Down
Loading