Skip to content

Commit

Permalink
PWGHF: add histograms and variable, change filter-->testbit in toXiPi…
Browse files Browse the repository at this point in the history
… task (AliceO2Group#4056)

* More histo and filter-->testbit

* Fix typo

* Please consider the following formatting changes

* Add charm baryon pt gen level

* Update PWGHF/TableProducer/candidateCreatorToXiPi.cxx

Co-authored-by: Fabrizio <[email protected]>

* Update PWGHF/TableProducer/candidateCreatorToXiPi.cxx

Co-authored-by: Fabrizio <[email protected]>

---------

Co-authored-by: ALICE Action Bot <[email protected]>
Co-authored-by: Fabrizio <[email protected]>
  • Loading branch information
3 people authored Dec 4, 2023
1 parent ed579a5 commit 6685b5a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
3 changes: 2 additions & 1 deletion PWGHF/DataModel/CandidateReconstructionTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,7 @@ DECLARE_SOA_COLUMN(DebugGenXi, debugGenXi, int8_t);
DECLARE_SOA_COLUMN(DebugGenLambda, debugGenLambda, int8_t);
DECLARE_SOA_COLUMN(OriginRec, originRec, int8_t);
DECLARE_SOA_COLUMN(OriginGen, originGen, int8_t);
DECLARE_SOA_COLUMN(PtCharmBaryonGen, ptCharmBaryonGen, float);

// mapping of decay types
enum DecayType { DecayToXiPi = 0,
Expand Down Expand Up @@ -1121,7 +1122,7 @@ DECLARE_SOA_TABLE(HfToXiPiMCRec, "AOD", "HFTOXIPIMCREC", //!

// table with results of generator level MC matching
DECLARE_SOA_TABLE(HfToXiPiMCGen, "AOD", "HFTOXIPIMCGEN", //!
hf_cand_toxipi::FlagMcMatchGen, hf_cand_toxipi::DebugGenCharmBar, hf_cand_toxipi::DebugGenXi, hf_cand_toxipi::DebugGenLambda, hf_cand_toxipi::OriginGen);
hf_cand_toxipi::FlagMcMatchGen, hf_cand_toxipi::DebugGenCharmBar, hf_cand_toxipi::DebugGenXi, hf_cand_toxipi::DebugGenLambda, hf_cand_toxipi::PtCharmBaryonGen, hf_cand_toxipi::OriginGen);

// specific chic candidate properties
namespace hf_cand_chic
Expand Down
32 changes: 24 additions & 8 deletions PWGHF/TableProducer/candidateCreatorToXiPi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,18 @@ struct HfCandidateCreatorToXiPi {
using FilteredHfTrackAssocSel = soa::Filtered<soa::Join<aod::TrackAssoc, aod::HfSelTrack>>;
using MyCascTable = soa::Join<aod::CascDatas, aod::CascCovs>; // to use strangeness tracking, use aod::TraCascDatas instead of aod::CascDatas
using MyV0Table = soa::Join<aod::V0Datas, aod::V0Covs>;
using MySkimIdx = soa::Filtered<HfCascLf2Prongs>;
using MySkimIdx = HfCascLf2Prongs;

Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == 0); // filter to use only HF selected collisions
Filter filterSelectIndexes = (aod::hf_track_index::hfflag == static_cast<uint8_t>(1));
Filter filterSelectTrackIds = (aod::hf_sel_track::isSelProng > 0);

Preslice<FilteredHfTrackAssocSel> trackIndicesPerCollision = aod::track_association::collisionId; // aod::hf_track_association::collisionId
Preslice<MyCascTable> cascadesPerCollision = aod::cascdata::collisionId;
Preslice<MySkimIdx> candidatesPerCollision = hf_track_index::collisionId;

OutputObj<TH1F> hInvMassCharmBaryon{TH1F("hInvMassCharmBaryon", "Charm baryon invariant mass;inv mass;entries", 500, 2.2, 3.1)};
OutputObj<TH1F> hFitterExceptions{TH1F("hFitterExceptions", "Charm DCAFitter exceptions;status;entries", 3, 0.0, 3.0)};
OutputObj<TH1F> hFitterStatus{TH1F("hFitterStatus", "Charm DCAFitter status;status;entries", 3, -0.5, 2.5)}; // 0 --> vertex(es) found, 1 --> exception found, 2 --> no vertex found (but no exception)
OutputObj<TH1F> hCandidateCounter{TH1F("hCandidateCounter", "Candidate counter wrt derived data;status;entries", 4, -0.5, 3.5)}; // 0 --> candidates in derived data table, 1 --> candidates passing testbit selection, 2 --> candidates passing fitter step 3 --> candidates filled in new table

void init(InitContext const&)
{
Expand Down Expand Up @@ -272,13 +272,14 @@ struct HfCandidateCreatorToXiPi {
nVtxFromFitterCharmBaryon = df.process(trackCasc, trackParVarPi);
} catch (...) {
LOG(error) << "Exception caught in charm DCA fitter process call!";
hFitterExceptions->Fill(1);
hFitterStatus->Fill(1);
continue;
}
if (nVtxFromFitterCharmBaryon == 0) {
hFitterStatus->Fill(2);
continue;
}
hFitterExceptions->Fill(0);
hFitterStatus->Fill(0);
auto vertexCharmBaryonFromFitter = df.getPCACandidate();
auto chi2PCACharmBaryon = df.getChi2AtPCACandidate();
std::array<float, 3> pVecCascAsD;
Expand Down Expand Up @@ -466,6 +467,14 @@ struct HfCandidateCreatorToXiPi {

for (const auto& cand : groupedCandidates) {

hCandidateCounter->Fill(0);

if (!TESTBIT(cand.hfflag(), aod::hf_cand_casc_lf::DecayType2Prong::XiczeroOmegaczeroToXiPi)) {
continue;
}

hCandidateCounter->Fill(1);

auto casc = cand.cascade_as<MyCascTable>();
auto trackPion = cand.prong0_as<MyTracks>(); // pi <-- charm baryon
auto trackXiDauCharged = casc.bachelor_as<MyTracks>(); // pion <- xi track
Expand Down Expand Up @@ -527,13 +536,15 @@ struct HfCandidateCreatorToXiPi {
nVtxFromFitterCharmBaryon = df.process(trackCasc, trackParVarPi);
} catch (...) {
LOG(error) << "Exception caught in charm DCA fitter process call!";
hFitterExceptions->Fill(1);
hFitterStatus->Fill(1);
continue;
}
if (nVtxFromFitterCharmBaryon == 0) {
hFitterStatus->Fill(2);
continue;
}
hFitterExceptions->Fill(0);
hFitterStatus->Fill(0);
hCandidateCounter->Fill(2);
auto vertexCharmBaryonFromFitter = df.getPCACandidate();
auto chi2PCACharmBaryon = df.getChi2AtPCACandidate();
std::array<float, 3> pVecCascAsD;
Expand Down Expand Up @@ -643,6 +654,7 @@ struct HfCandidateCreatorToXiPi {

// fill test histograms
hInvMassCharmBaryon->Fill(mCharmBaryon);
hCandidateCounter->Fill(3);

// fill the table
rowCandidate(collision.globalIndex(),
Expand Down Expand Up @@ -702,6 +714,7 @@ struct HfCandidateCreatorToXiPiMc {
aod::TracksWMc const& tracks,
aod::McParticles const& mcParticles)
{
float ptCharmBaryonGen = -999.;
int indexRec = -1;
int indexRecCharmBaryon = -1;
int8_t sign = -9;
Expand Down Expand Up @@ -809,6 +822,7 @@ struct HfCandidateCreatorToXiPiMc {

// Match generated particles.
for (const auto& particle : mcParticles) {
ptCharmBaryonGen = -999.;
flag = 0;
sign = -9;
debugGenCharmBar = 0;
Expand All @@ -819,6 +833,7 @@ struct HfCandidateCreatorToXiPiMc {
// Omegac → Xi pi
if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdgCodeOmegac0, std::array{pdgCodeXiMinus, pdgCodePiPlus}, true, &sign)) {
debugGenCharmBar = 1;
ptCharmBaryonGen = particle.pt();
// Xi -> Lambda pi
auto cascMC = mcParticles.rawIteratorAt(particle.daughtersIds().front());
if (RecoDecay::isMatchedMCGen(mcParticles, cascMC, pdgCodeXiMinus, std::array{pdgCodeLambda, pdgCodePiMinus}, true)) {
Expand All @@ -840,6 +855,7 @@ struct HfCandidateCreatorToXiPiMc {
// Xic → Xi pi
if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdgCodeXic0, std::array{pdgCodeXiMinus, pdgCodePiPlus}, true, &sign)) {
debugGenCharmBar = 1;
ptCharmBaryonGen = particle.pt();
// Xi- -> Lambda pi
auto cascMC = mcParticles.rawIteratorAt(particle.daughtersIds().front());
if (RecoDecay::isMatchedMCGen(mcParticles, cascMC, pdgCodeXiMinus, std::array{pdgCodeLambda, pdgCodePiMinus}, true)) {
Expand All @@ -858,7 +874,7 @@ struct HfCandidateCreatorToXiPiMc {
}
}

rowMCMatchGen(flag, debugGenCharmBar, debugGenXi, debugGenLambda, origin);
rowMCMatchGen(flag, debugGenCharmBar, debugGenXi, debugGenLambda, ptCharmBaryonGen, origin);
}
} // close process
PROCESS_SWITCH(HfCandidateCreatorToXiPiMc, processMc, "Process MC", false);
Expand Down

0 comments on commit 6685b5a

Please sign in to comment.