Skip to content

Commit

Permalink
[PWGHF,PWGJE] Adding B+ to the jet framework and renaming 3P->Lc in D…
Browse files Browse the repository at this point in the history
…erived HF tables (AliceO2Group#8792)
  • Loading branch information
nzardosh authored and Wenhui Feng committed Dec 6, 2024
1 parent 856f1dd commit 5045716
Show file tree
Hide file tree
Showing 41 changed files with 933 additions and 312 deletions.
22 changes: 11 additions & 11 deletions PWGHF/DataModel/DerivedTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ DECLARE_SOA_COLUMN(FlagMcDecayChanGen, flagMcDecayChanGen, int8_t); //! resonant
DECLARE_CAND_3P_TABLES(_hf_type_, _hf_description_, _hf_namespace_)

DECLARE_2P_TABLES(D0, "D0", d0, 2);
DECLARE_3P_TABLES(3P, "3P", 3p, 3);
DECLARE_3P_TABLES(Lc, "LC", lc, 3);
DECLARE_3P_TABLES(Bplus, "BP", bplus, 4);

// ================
Expand Down Expand Up @@ -560,7 +560,7 @@ DECLARE_SOA_TABLE_STAGED(HfBplusMcs, "HFBPMC", //! Table with MC candidate info
// PxProng0, PyProng0, PzProng0,... (same for 1, 2), we can keep Pt, Eta, Phi instead
// XY: CpaXY, DecayLengthXY, ErrorDecayLengthXY
// normalised: DecayLengthNormalised, DecayLengthXYNormalised, ImpactParameterNormalised0
DECLARE_SOA_TABLE_STAGED(Hf3PPars, "HF3PPAR", //! Table with candidate properties used for selection
DECLARE_SOA_TABLE_STAGED(HfLcPars, "HFLCPAR", //! Table with candidate properties used for selection
hf_cand::Chi2PCA,
hf_cand::NProngsContributorsPV,
hf_cand_par::Cpa,
Expand Down Expand Up @@ -593,9 +593,9 @@ DECLARE_SOA_TABLE_STAGED(Hf3PPars, "HF3PPAR", //! Table with candidate propertie
hf_cand_par::NSigTofPr2,
hf_cand_par::NSigTpcTofPi2,
hf_cand_par::NSigTpcTofPr2,
o2::soa::Marker<Marker3P>);
o2::soa::Marker<MarkerLc>);

DECLARE_SOA_TABLE_STAGED(Hf3PParEs, "HF3PPARE", //! Table with additional candidate properties used for selection
DECLARE_SOA_TABLE_STAGED(HfLcParEs, "HFLCPARE", //! Table with additional candidate properties used for selection
hf_cand::XSecondaryVertex,
hf_cand::YSecondaryVertex,
hf_cand::ZSecondaryVertex,
Expand All @@ -618,21 +618,21 @@ DECLARE_SOA_TABLE_STAGED(Hf3PParEs, "HF3PPARE", //! Table with additional candid
hf_cand::ErrorImpactParameter1,
hf_cand::ErrorImpactParameter2,
hf_cand_par::Ct,
o2::soa::Marker<Marker3P>);
o2::soa::Marker<MarkerLc>);

DECLARE_SOA_TABLE_STAGED(Hf3PSels, "HF3PSEL", //! Table with candidate selection flags
DECLARE_SOA_TABLE_STAGED(HfLcSels, "HFLCSEL", //! Table with candidate selection flags
hf_cand_sel::CandidateSelFlag,
o2::soa::Marker<Marker3P>);
o2::soa::Marker<MarkerLc>);

DECLARE_SOA_TABLE_STAGED(Hf3PMls, "HF3PML", //! Table with candidate selection ML scores
DECLARE_SOA_TABLE_STAGED(HfLcMls, "HFLCML", //! Table with candidate selection ML scores
hf_cand_mc::MlScores,
o2::soa::Marker<Marker3P>);
o2::soa::Marker<MarkerLc>);

DECLARE_SOA_TABLE_STAGED(Hf3PMcs, "HF3PMC", //! Table with MC candidate info
DECLARE_SOA_TABLE_STAGED(HfLcMcs, "HFLCMC", //! Table with MC candidate info
hf_cand_mc::FlagMcMatchRec,
hf_cand_mc::OriginMcRec,
hf_cand_mc::IsCandidateSwapped,
o2::soa::Marker<Marker3P>);
o2::soa::Marker<MarkerLc>);

} // namespace o2::aod

Expand Down
28 changes: 14 additions & 14 deletions PWGHF/TableProducer/derivedDataCreatorLcToPKPi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ using namespace o2::analysis::hf_derived;
/// Writes the full information in an output TTree
struct HfDerivedDataCreatorLcToPKPi {
// Candidates
Produces<o2::aod::Hf3PBases> rowCandidateBase;
Produces<o2::aod::Hf3PPars> rowCandidatePar;
Produces<o2::aod::Hf3PParEs> rowCandidateParE;
Produces<o2::aod::Hf3PSels> rowCandidateSel;
Produces<o2::aod::Hf3PMls> rowCandidateMl;
Produces<o2::aod::Hf3PIds> rowCandidateId;
Produces<o2::aod::Hf3PMcs> rowCandidateMc;
Produces<o2::aod::HfLcBases> rowCandidateBase;
Produces<o2::aod::HfLcPars> rowCandidatePar;
Produces<o2::aod::HfLcParEs> rowCandidateParE;
Produces<o2::aod::HfLcSels> rowCandidateSel;
Produces<o2::aod::HfLcMls> rowCandidateMl;
Produces<o2::aod::HfLcIds> rowCandidateId;
Produces<o2::aod::HfLcMcs> rowCandidateMc;
// Collisions
Produces<o2::aod::Hf3PCollBases> rowCollBase;
Produces<o2::aod::Hf3PCollIds> rowCollId;
Produces<o2::aod::HfLcCollBases> rowCollBase;
Produces<o2::aod::HfLcCollIds> rowCollId;
// MC collisions
Produces<o2::aod::Hf3PMcCollBases> rowMcCollBase;
Produces<o2::aod::Hf3PMcCollIds> rowMcCollId;
Produces<o2::aod::Hf3PMcRCollIds> rowMcRCollId;
Produces<o2::aod::HfLcMcCollBases> rowMcCollBase;
Produces<o2::aod::HfLcMcCollIds> rowMcCollId;
Produces<o2::aod::HfLcMcRCollIds> rowMcRCollId;
// MC particles
Produces<o2::aod::Hf3PPBases> rowParticleBase;
Produces<o2::aod::Hf3PPIds> rowParticleId;
Produces<o2::aod::HfLcPBases> rowParticleBase;
Produces<o2::aod::HfLcPIds> rowParticleId;

// Switches for filling tables
Configurable<bool> fillCandidateBase{"fillCandidateBase", true, "Fill candidate base properties"};
Expand Down
14 changes: 7 additions & 7 deletions PWGJE/Core/JetCandidateUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,30 +373,30 @@ float getCandidateInvariantMass(T const& candidate)
}

template <typename T, typename U, typename V>
void fillCandidateCollisionTable(T const& collision, U const& candidates, V& CandiateCollisionTable, int32_t& CandidateCollisionTableIndex)
void fillCandidateCollisionTable(T const& collision, U const& /*candidates*/, V& CandiateCollisionTable, int32_t& CandidateCollisionTableIndex)
{
if constexpr (jethfutilities::isHFTable<U>()) {
jethfutilities::fillHFCollisionTable(collision, candidates, CandiateCollisionTable, CandidateCollisionTableIndex);
jethfutilities::fillHFCollisionTable(collision, CandiateCollisionTable, CandidateCollisionTableIndex);
} else if constexpr (jetdqutilities::isDielectronTable<U>()) {
jetdqutilities::fillDielectronCollisionTable(collision, CandiateCollisionTable, CandidateCollisionTableIndex); // if more dilepton tables are added we would need a fillDQCollisionTable
}
}

template <typename T, typename U, typename V>
void fillCandidateMcCollisionTable(T const& mcCollision, U const& candidates, V& CandiateMcCollisionTable, int32_t& CandidateMcCollisionTableIndex)
void fillCandidateMcCollisionTable(T const& mcCollision, U const& /*candidates*/, V& CandiateMcCollisionTable, int32_t& CandidateMcCollisionTableIndex)
{
if constexpr (jethfutilities::isHFMcTable<U>()) {
jethfutilities::fillHFMcCollisionTable(mcCollision, candidates, CandiateMcCollisionTable, CandidateMcCollisionTableIndex);
jethfutilities::fillHFMcCollisionTable(mcCollision, CandiateMcCollisionTable, CandidateMcCollisionTableIndex);
} else if constexpr (jetdqutilities::isDielectronMcTable<U>()) {
jetdqutilities::fillDielectronMcCollisionTable(mcCollision, CandiateMcCollisionTable, CandidateMcCollisionTableIndex);
}
}

template <bool isMc, typename T, typename U, typename V, typename M, typename N, typename O, typename P>
void fillCandidateTable(T const& candidate, int32_t collisionIndex, U& BaseTable, V& HFParTable, M& HFParETable, N& HFSelectionFlagTable, O& HFMlTable, P& HFMCDTable, int32_t& candidateTableIndex)
template <bool isMc, typename T, typename U, typename V, typename M, typename N, typename O, typename P, typename Q, typename S>
void fillCandidateTable(T const& candidate, int32_t collisionIndex, U& BaseTable, V& HFParTable, M& HFParETable, N& HFParDaughterTable, O& HFSelectionFlagTable, P& HFMlTable, Q& HFMlDaughterTable, S& HFMCDTable, int32_t& candidateTableIndex)
{
if constexpr (jethfutilities::isHFCandidate<T>()) {
jethfutilities::fillHFCandidateTable<isMc>(candidate, collisionIndex, BaseTable, HFParTable, HFParETable, HFSelectionFlagTable, HFMlTable, HFMCDTable, candidateTableIndex);
jethfutilities::fillHFCandidateTable<isMc>(candidate, collisionIndex, BaseTable, HFParTable, HFParETable, HFParDaughterTable, HFSelectionFlagTable, HFMlTable, HFMlDaughterTable, HFMCDTable, candidateTableIndex);
} else if constexpr (jetdqutilities::isDielectronCandidate<T>()) {
jetdqutilities::fillDielectronCandidateTable(candidate, collisionIndex, BaseTable, candidateTableIndex);
}
Expand Down
12 changes: 2 additions & 10 deletions PWGJE/Core/JetDQUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,7 @@ auto slicedPerDielectronCollision(T const& table, U const& /*candidates*/, V con
template <typename T>
int getDielectronCandidateCollisionId(T const& candidate)
{
if constexpr (isDielectronCandidate<T>()) {
return candidate.reducedeventId();
} else {
return -1;
}
return candidate.reducedeventId();
}

/**
Expand Down Expand Up @@ -275,11 +271,7 @@ float getDielectronTablePDGMass()
template <typename T>
float getDielectronCandidateInvariantMass(T const& candidate)
{
if constexpr (isDielectronCandidate<T>()) {
return candidate.mass();
} else {
return -1.0;
}
return candidate.mass();
}

template <typename T, typename U>
Expand Down
Loading

0 comments on commit 5045716

Please sign in to comment.