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: 2 additions & 2 deletions Common/Tools/aodDataModelGraph.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ int main(int, char**)

displayEntities<MFTTracks, FwdTracks, FwdTracksCov>();

displayEntities<HfTrackIndexProng2, HfCandProng2>();
displayEntities<HfTrackIndexProng3, HfCandProng3>();
displayEntities<Hf2Prong, HfCandProng2>();
displayEntities<Hf3Prong, HfCandProng3>();

graphFooter();
return 0;
Expand Down
18 changes: 9 additions & 9 deletions EventFiltering/PWGHF/HFFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ struct AddCollisionId {
Produces<o2::aod::Colls2Prong> colls2Prong;
Produces<o2::aod::Colls3Prong> colls3Prong;

void process(aod::HfTrackIndexProng2 const& cand2Prongs,
aod::HfTrackIndexProng3 const& cand3Prongs,
void process(aod::Hf2Prong const& cand2Prongs,
aod::Hf3Prong const& cand3Prongs,
aod::Tracks const&)
{
for (const auto& cand2Prong : cand2Prongs) {
Expand Down Expand Up @@ -572,7 +572,7 @@ struct HfFilter { // Main struct for HF triggers
/// \param CharmCandMomentum is the three momentum of a charm candidate
/// \param CharmMass is the mass of the charm hadron
/// \return relative momentum of pair
template <typename T> //template <typename T, typename C>
template <typename T> // template <typename T, typename C>
float computeRelativeMomentum(const T& track, const std::array<float, 3>& CharmCandMomentum, const float& CharmMass)
{
ROOT::Math::PxPyPzMVector part1(track.px(), track.py(), track.pz(), massProton);
Expand All @@ -586,10 +586,10 @@ struct HfFilter { // Main struct for HF triggers

float kStar = 0.5 * trackRelK.P();
return kStar;
} //float computeRelativeMomentum(const T& track, const std::array<float, 3>& CharmCandMomentum, const float& CharmMass)
} // float computeRelativeMomentum(const T& track, const std::array<float, 3>& CharmCandMomentum, const float& CharmMass)

using HfTrackIndexProng2withColl = soa::Join<aod::HfTrackIndexProng2, aod::Colls2Prong>;
using HfTrackIndexProng3withColl = soa::Join<aod::HfTrackIndexProng3, aod::Colls3Prong>;
using HfTrackIndexProng2withColl = soa::Join<aod::Hf2Prong, aod::Colls2Prong>;
using HfTrackIndexProng3withColl = soa::Join<aod::Hf3Prong, aod::Colls3Prong>;
using BigTracksWithProtonPID = soa::Join<aod::BigTracksExtended, aod::TrackSelection, aod::pidTPCFullPr, aod::pidTOFFullPr>;
using BigTracksMCPID = soa::Join<aod::BigTracksExtended, aod::pidTPCFullPi, aod::pidTOFFullPi, aod::pidTPCFullKa, aod::pidTOFFullKa, aod::pidTPCFullPr, aod::pidTOFFullPr, aod::BigTracksMC>;

Expand Down Expand Up @@ -863,8 +863,8 @@ struct HfFilter { // Main struct for HF triggers
}
}

void processTraining(aod::HfTrackIndexProng2 const& cand2Prongs,
aod::HfTrackIndexProng3 const& cand3Prongs,
void processTraining(aod::Hf2Prong const& cand2Prongs,
aod::Hf3Prong const& cand3Prongs,
aod::McParticles_000 const& particlesMC,
BigTracksMCPID const&)
{
Expand Down Expand Up @@ -918,7 +918,7 @@ struct HfFilter { // Main struct for HF triggers
}
if (indexRec < 0) {
// Ds± → K± K∓ π±
indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, 431, array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign); //TODO: replace hard coded pdg code
indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, 431, array{+kKPlus, -kKPlus, +kPiPlus}, true, &sign); // TODO: replace hard coded pdg code
if (indexRec >= 0) {
channel = kDs;
}
Expand Down
54 changes: 33 additions & 21 deletions PWGHF/DataModel/HFSecondaryVertex.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,11 @@ using BigTracksPIDExtended = soa::Join<BigTracksPID, aod::TracksExtended>;

namespace hf_track_index
{
DECLARE_SOA_INDEX_COLUMN_FULL(Index0, index0, int, Tracks, "_0"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(Index1, index1, int, Tracks, "_1"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(Index2, index2, int, Tracks, "_2"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(Index3, index3, int, Tracks, "_3"); //!
DECLARE_SOA_INDEX_COLUMN_FULL(IndexV0, indexV0, int, aod::V0Datas, "_V0"); //!
DECLARE_SOA_COLUMN(HFflag, hfflag, uint8_t); //!
DECLARE_SOA_INDEX_COLUMN_FULL(Index0, index0, int, Tracks, "_0"); //! Index to first prong
DECLARE_SOA_INDEX_COLUMN_FULL(Index1, index1, int, Tracks, "_1"); //! Index to second prong
DECLARE_SOA_INDEX_COLUMN_FULL(Index2, index2, int, Tracks, "_2"); //! Index to third prong
DECLARE_SOA_INDEX_COLUMN(V0, v0); //! Index to V0 prong
Comment on lines +67 to +70

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the names of index columns inconsistent as only the track column names start with Index.
Actually, I would suggest to rename Index to Prong because when the column getter is called, one gets the prong table row itself, not its index (which is returned by Id). So my proposal is: Prong0,..., ProngV0.
@jgrosseo @ginnocen What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with your proposal, as long as the branch names in the tree stay as they are (which they do with your proposal).

As you see I didn't touch the names of the track columns, they were like this already before.

Is it OK if we merge this and you make the modifications of the names in a subsequent PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw. the AliPhysics PR has been merged, so if you update the validation fw will produce the HF tables already. You have to add the wagon HFCandidateCreator before the converter, see https://alimonitor.cern.ch/trains/train.jsp?train_id=132

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with your proposal, as long as the branch names in the tree stay as they are (which they do with your proposal).

As you see I didn't touch the names of the track columns, they were like this already before.

Is it OK if we merge this and you make the modifications of the names in a subsequent PR?

Yes, it is fine.

@jgrosseo jgrosseo Feb 4, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Merged.
DECLARE_SOA_INDEX_COLUMN(V0, v0); will then become DECLARE_SOA_INDEX_COLUMN_FULL(ProngV0, prongV0, int, V0, "");
(note the empty argument)
You may consider also making prongD0 for the D*

DECLARE_SOA_COLUMN(HFflag, hfflag, uint8_t); //!

DECLARE_SOA_COLUMN(D0ToKPiFlag, d0ToKPiFlag, uint8_t); //!
DECLARE_SOA_COLUMN(JpsiToEEFlag, jpsiToEEFlag, uint8_t); //!
Expand All @@ -81,27 +80,40 @@ DECLARE_SOA_COLUMN(DsKKPiFlag, dsKKPiFlag, uint8_t); //!
DECLARE_SOA_COLUMN(XicToPKPiFlag, xicToPKPiFlag, uint8_t); //!
} // namespace hf_track_index

DECLARE_SOA_TABLE(HfTrackIndexProng2, "AOD", "HFTRACKIDXP2", //!
DECLARE_SOA_TABLE(Hf2Prong, "AOD", "HF2PRONG", //! Table for HF 2 prong candidates
o2::soa::Index<>,
hf_track_index::Index0Id,
hf_track_index::Index1Id,
hf_track_index::HFflag);

DECLARE_SOA_TABLE(HfTrackIndexCasc, "AOD", "HFTRACKIDXCASC", //!
DECLARE_SOA_TABLE(HfCascade, "AOD", "HFCASCADE", //! Table for HF candidates with a V0
o2::soa::Index<>,
hf_track_index::Index0Id,
hf_track_index::IndexV0Id,
hf_track_index::V0Id,
hf_track_index::HFflag);

DECLARE_SOA_TABLE(HfCutStatusProng2, "AOD", "HFCUTSTATUSP2", //!
hf_track_index::D0ToKPiFlag,
hf_track_index::JpsiToEEFlag,
hf_track_index::JpsiToMuMuFlag);

DECLARE_SOA_TABLE(HfTrackIndexProng3, "AOD", "HFTRACKIDXP3", //!
DECLARE_SOA_TABLE(Hf3Prong, "AOD", "HF3PRONG", //! Table for HF 3 prong candidates
o2::soa::Index<>,
hf_track_index::Index0Id,
hf_track_index::Index1Id,
hf_track_index::Index2Id,
hf_track_index::HFflag);

namespace hf_track_index
{
DECLARE_SOA_INDEX_COLUMN_FULL(IndexD0, indexD0, int, Hf2Prong, ""); //! Index to a D0 prong
} // namespace hf_track_index

DECLARE_SOA_TABLE(HfDStar, "AOD", "HFDSTAR", //! D* -> D0pi candidates
o2::soa::Index<>,
hf_track_index::Index0Id,
hf_track_index::IndexD0Id);

DECLARE_SOA_TABLE(HfCutStatusProng2, "AOD", "HFCUTSTATUSP2", //!
hf_track_index::D0ToKPiFlag,
hf_track_index::JpsiToEEFlag,
hf_track_index::JpsiToMuMuFlag);

DECLARE_SOA_TABLE(HfCutStatusProng3, "AOD", "HFCUTSTATUSP3", //!
hf_track_index::DPlusPiKPiFlag,
hf_track_index::LcPKPiFlag,
Expand Down Expand Up @@ -236,7 +248,7 @@ DECLARE_SOA_COLUMN(OriginMCGen, originMCGen, int8_t); //! particle origin,
enum DecayType { D0ToPiK = 0,
JpsiToEE,
JpsiToMuMu,
N2ProngDecays }; //always keep N2ProngDecays at the end
N2ProngDecays }; // always keep N2ProngDecays at the end

// functions for specific particles

Expand Down Expand Up @@ -402,7 +414,7 @@ DECLARE_SOA_EXPRESSION_COLUMN(Py, py, //!
float, 1.f * aod::hf_cand::pyProng0 + 1.f * aod::hf_cand::pyProng1);
DECLARE_SOA_EXPRESSION_COLUMN(Pz, pz, //!
float, 1.f * aod::hf_cand::pzProng0 + 1.f * aod::hf_cand::pzProng1);
//DECLARE_SOA_DYNAMIC_COLUMN(M, m, [](float px0, float py0, float pz0, float px1, float py1, float pz1, const array<double, 2>& m) { return RecoDecay::M(array{array{px0, py0, pz0}, array{px1, py1, pz1}}, m); });
// DECLARE_SOA_DYNAMIC_COLUMN(M, m, [](float px0, float py0, float pz0, float px1, float py1, float pz1, const array<double, 2>& m) { return RecoDecay::M(array{array{px0, py0, pz0}, array{px1, py1, pz1}}, m); });
DECLARE_SOA_DYNAMIC_COLUMN(PtV0Pos, ptV0Pos, //!
[](float px, float py) { return RecoDecay::Pt(px, py); });
DECLARE_SOA_DYNAMIC_COLUMN(PtV0Neg, ptV0Neg, //!
Expand All @@ -425,15 +437,15 @@ auto InvMassGamma(const T& candidate)
} // namespace hf_cand_casc

DECLARE_SOA_TABLE(HfCandCascBase, "AOD", "HFCANDCASCBASE", //!
// general columns
// general columns
HFCAND_COLUMNS,
// cascade specific columns
hf_cand::PxProng0, hf_cand::PyProng0, hf_cand::PzProng0,
hf_cand::PxProng1, hf_cand::PyProng1, hf_cand::PzProng1,
hf_cand::ImpactParameter0, hf_cand::ImpactParameter1,
hf_cand::ErrorImpactParameter0, hf_cand::ErrorImpactParameter1,
hf_track_index::Index0Id,
hf_track_index::IndexV0Id, // V0 index
hf_track_index::V0Id, // V0 index
hf_track_index::HFflag,
// V0
v0data::X, v0data::Y, v0data::Z,
Expand Down Expand Up @@ -613,7 +625,7 @@ enum DecayType { DPlusToPiKPi = 0,
LcToPKPi,
DsToPiKK,
XicToPKPi,
N3ProngDecays }; //always keep N3ProngDecays at the end
N3ProngDecays }; // always keep N3ProngDecays at the end

// functions for specific particles

Expand Down Expand Up @@ -1132,7 +1144,7 @@ DECLARE_SOA_COLUMN(DebugMCRec, debugMCRec, int8_t); // debug flag for mi
enum DecayType { LbToLcPi }; // move this to a dedicated cascade namespace in the future?

// Λb → Λc+ π- → p K- π+ π-
//float massLb = RecoDecay::getMassPDG(pdg::Code::kLambdaB0);
// float massLb = RecoDecay::getMassPDG(pdg::Code::kLambdaB0);
template <typename T>
auto CtLb(const T& candidate)
{
Expand Down
18 changes: 9 additions & 9 deletions PWGHF/TableProducer/HFCandidateCreator2Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct HFCandidateCreator2Prong {
double massKPi{0.};

void process(aod::Collisions const& collisions,
aod::HfTrackIndexProng2 const& rowsTrackIndexProng2,
aod::Hf2Prong const& rowsTrackIndexProng2,
aod::BigTracks const& tracks)
{
// 2-prong vertex fitter
Expand Down Expand Up @@ -152,21 +152,21 @@ struct HFCandidateCreator2ProngExpressions {
// Match reconstructed candidates.
// Spawned table can be used directly
for (auto& candidate : *rowCandidateProng2) {
//Printf("New rec. candidate");
// Printf("New rec. candidate");
flag = 0;
origin = 0;
auto arrayDaughters = array{candidate.index0_as<aod::BigTracksMC>(), candidate.index1_as<aod::BigTracksMC>()};

// D0(bar) → π± K∓
//Printf("Checking D0(bar) → π± K∓");
// Printf("Checking D0(bar) → π± K∓");
indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kD0, array{+kPiPlus, -kKPlus}, true, &sign);
if (indexRec > -1) {
flag = sign * (1 << DecayType::D0ToPiK);
}

// J/ψ → e+ e−
if (flag == 0) {
//Printf("Checking J/ψ → e+ e−");
// Printf("Checking J/ψ → e+ e−");
indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kJpsi, array{+kElectron, -kElectron}, true);
if (indexRec > -1) {
flag = 1 << DecayType::JpsiToEE;
Expand All @@ -175,7 +175,7 @@ struct HFCandidateCreator2ProngExpressions {

// J/ψ → μ+ μ−
if (flag == 0) {
//Printf("Checking J/ψ → μ+ μ−");
// Printf("Checking J/ψ → μ+ μ−");
indexRec = RecoDecay::getMatchedMCRec(particlesMC, arrayDaughters, pdg::Code::kJpsi, array{+kMuonPlus, -kMuonPlus}, true);
if (indexRec > -1) {
flag = 1 << DecayType::JpsiToMuMu;
Expand All @@ -193,27 +193,27 @@ struct HFCandidateCreator2ProngExpressions {

// Match generated particles.
for (auto& particle : particlesMC) {
//Printf("New gen. candidate");
// Printf("New gen. candidate");
flag = 0;
origin = 0;

// D0(bar) → π± K∓
//Printf("Checking D0(bar) → π± K∓");
// Printf("Checking D0(bar) → π± K∓");
if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kD0, array{+kPiPlus, -kKPlus}, true, &sign)) {
flag = sign * (1 << DecayType::D0ToPiK);
}

// J/ψ → e+ e−
if (flag == 0) {
//Printf("Checking J/ψ → e+ e−");
// Printf("Checking J/ψ → e+ e−");
if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kJpsi, array{+kElectron, -kElectron}, true)) {
flag = 1 << DecayType::JpsiToEE;
}
}

// J/ψ → μ+ μ−
if (flag == 0) {
//Printf("Checking J/ψ → μ+ μ−");
// Printf("Checking J/ψ → μ+ μ−");
if (RecoDecay::isMatchedMCGen(particlesMC, particle, pdg::Code::kJpsi, array{+kMuonPlus, -kMuonPlus}, true)) {
flag = 1 << DecayType::JpsiToMuMu;
}
Expand Down
2 changes: 1 addition & 1 deletion PWGHF/TableProducer/HFCandidateCreator3Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct HFCandidateCreator3Prong {
double massPiKPi{0.};

void process(aod::Collisions const& collisions,
aod::HfTrackIndexProng3 const& rowsTrackIndexProng3,
aod::Hf3Prong const& rowsTrackIndexProng3,
aod::BigTracks const& tracks)
{
// 3-prong vertex fitter
Expand Down
17 changes: 11 additions & 6 deletions PWGHF/TableProducer/HFCandidateCreatorCascade.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ struct HFCandidateCreatorCascade {
double massLc = RecoDecay::getMassPDG(pdg::Code::kLambdaCPlus);
double mass2K0sP{0.};

void process(aod::Collisions const& collisions,
aod::HfTrackIndexCasc const& rowsTrackIndexCasc,
MyBigTracks const& tracks,
aod::V0Datas const& V0s
void process(aod::Collisions const&,
aod::HfCascade const& rowsTrackIndexCasc,
MyBigTracks const&,
aod::V0sLinked const&,
aod::V0Datas const&
#ifdef MY_DEBUG
,
aod::McParticles_000& mcParticles
Expand All @@ -99,7 +100,11 @@ struct HFCandidateCreatorCascade {
for (const auto& casc : rowsTrackIndexCasc) {

const auto& bach = casc.index0_as<MyBigTracks>();
const auto& v0 = casc.indexV0_as<o2::aod::V0Datas>();
if (!casc.v0_as<aod::V0sLinked>().has_v0Data()) {
LOGF(warning, "V0Data not there for V0 %d in HF cascade %d. Skipping candidate.", casc.v0Id(), casc.globalIndex());
continue;
}
const auto& v0 = casc.v0_as<aod::V0sLinked>().v0Data();
const auto& trackV0DaughPos = v0.posTrack_as<MyBigTracks>();
const auto& trackV0DaughNeg = v0.negTrack_as<MyBigTracks>();

Expand Down Expand Up @@ -176,7 +181,7 @@ struct HFCandidateCreatorCascade {
pVecV0[0], pVecV0[1], pVecV0[2],
impactParameterBach.getY(), impactParameterV0.getY(),
std::sqrt(impactParameterBach.getSigmaY2()), std::sqrt(impactParameterV0.getSigmaY2()),
casc.index0Id(), casc.indexV0Id(),
casc.index0Id(), casc.v0Id(),
casc.hfflag(),
v0.x(), v0.y(), v0.z(),
//v0.posTrack(), v0.negTrack(), // why this was not fine?
Expand Down
10 changes: 5 additions & 5 deletions PWGHF/TableProducer/HFTrackIndexSkimsCreator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,9 @@ struct HfTagSelTracks {

/// Pre-selection of 2-prong and 3-prong secondary vertices
struct HfTrackIndexSkimsCreator {
Produces<aod::HfTrackIndexProng2> rowTrackIndexProng2;
Produces<aod::Hf2Prong> rowTrackIndexProng2;
Produces<aod::HfCutStatusProng2> rowProng2CutStatus;
Produces<aod::HfTrackIndexProng3> rowTrackIndexProng3;
Produces<aod::Hf3Prong> rowTrackIndexProng3;
Produces<aod::HfCutStatusProng3> rowProng3CutStatus;

//Configurable<int> nCollsMax{"nCollsMax", -1, "Max collisions per file"}; //can be added to run over limited collisions per file - for tesing purposes
Expand Down Expand Up @@ -1323,15 +1323,15 @@ struct HfTrackIndexSkimsCreator {
//________________________________________________________________________________________________________________________

/// Pre-selection of cascade secondary vertices
/// It will produce in any case a HfTrackIndexProng2 object, but mixing a V0
/// It will produce in any case a Hf2Prong object, but mixing a V0
/// with a track, instead of 2 tracks

/// to run: o2-analysis-weak-decay-indices --aod-file AO2D.root -b | o2-analysis-lambdakzerobuilder -b |
/// o2-analysis-trackextension -b | o2-analysis-hf-track-index-skims-creator -b

struct HfTrackIndexSkimsCreatorCascades {
Produces<aod::HfTrackIndexCasc> rowTrackIndexCasc;
// Produces<aod::HfTrackIndexProng2> rowTrackIndexCasc;
Produces<aod::HfCascade> rowTrackIndexCasc;
// Produces<aod::Hf2Prong> rowTrackIndexCasc;

// whether to do or not validation plots
Configurable<bool> doValPlots{"doValPlots", true, "fill histograms"};
Expand Down
6 changes: 5 additions & 1 deletion PWGLF/TableProducer/lambdakzerofinder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ struct lambdakzeroprefilter {

struct lambdakzerofinder {
Produces<aod::StoredV0Datas> v0data;
Produces<aod::V0s> v0;
Produces<aod::V0DataLink> v0datalink;

HistogramRegistry registry{
"registry",
Expand Down Expand Up @@ -155,7 +157,7 @@ struct lambdakzerofinder {

Long_t lNCand = 0;

for (auto& t0id : ptracks) { //FIXME: turn into combination(...)
for (auto& t0id : ptracks) { // FIXME: turn into combination(...)
auto t0 = t0id.goodTrack_as<soa::Join<aod::FullTracks, aod::TracksCov>>();
auto Track1 = getTrackParCov(t0);
for (auto& t1id : ntracks) {
Expand Down Expand Up @@ -197,13 +199,15 @@ struct lambdakzerofinder {
}

lNCand++;
v0(t0.collisionId(), t0.globalIndex(), t1.globalIndex());
v0data(t0.globalIndex(), t1.globalIndex(), t0.collisionId(),
fitter.getTrack(0).getX(), fitter.getTrack(1).getX(), 0,
pos[0], pos[1], pos[2],
pvec0[0], pvec0[1], pvec0[2],
pvec1[0], pvec1[1], pvec1[2],
fitter.getChi2AtPCACandidate(),
t0id.dcaXY(), t1id.dcaXY());
v0datalink(v0data.lastIndex());
}
}
registry.fill(HIST("hCandPerEvent"), lNCand);
Expand Down