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
40 changes: 20 additions & 20 deletions PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ using HfcRedCollision = HfcRedCollisions::iterator;

namespace hf_candidate_reduced
{
DECLARE_SOA_INDEX_COLUMN(HfcRedCollision, hfcRedCollision); //! ReducedCollision index
DECLARE_SOA_INDEX_COLUMN(HfcRedFlowColl, hfcRedFlowColl); //! ReducedCollision index
DECLARE_SOA_COLUMN(Prong0Id, prong0Id, int); //! Prong 0 index
DECLARE_SOA_COLUMN(Prong1Id, prong1Id, int); //! Prong 1 index
DECLARE_SOA_COLUMN(Prong2Id, prong2Id, int); //! Prong2 index
DECLARE_SOA_COLUMN(PhiCand, phiCand, float); //! Phi of the candidate
DECLARE_SOA_COLUMN(EtaCand, etaCand, float); //! Eta of the candidate
DECLARE_SOA_COLUMN(PtCand, ptCand, float); //! Pt of the candidate
DECLARE_SOA_COLUMN(InvMassDs, invMassDs, float); //! Invariant mass of Ds candidate
DECLARE_SOA_COLUMN(InvMassCand, invMassCand, float); //! Invariant mass of Charm candidate
DECLARE_SOA_COLUMN(BdtScorePrompt, bdtScorePrompt, float); //! BDT output score for prompt hypothesis
DECLARE_SOA_COLUMN(BdtScoreBkg, bdtScoreBkg, float); //! BDT output score for background hypothesis
DECLARE_SOA_COLUMN(BdtScore0, bdtScore0, float); //! First BDT output score
DECLARE_SOA_COLUMN(BdtScore1, bdtScore1, float); //! Second BDT output score
DECLARE_SOA_INDEX_COLUMN(HfcRedCollision, hfcRedCollision); //! ReducedCollision index
DECLARE_SOA_INDEX_COLUMN(HfcRedFlowColl, hfcRedFlowColl); //! ReducedCollision index
DECLARE_SOA_COLUMN(Prong0Id, prong0Id, int); //! Prong 0 index
DECLARE_SOA_COLUMN(Prong1Id, prong1Id, int); //! Prong 1 index
DECLARE_SOA_COLUMN(Prong2Id, prong2Id, int); //! Prong2 index
DECLARE_SOA_COLUMN(PhiCand, phiCand, float); //! Phi of the candidate
DECLARE_SOA_COLUMN(EtaCand, etaCand, float); //! Eta of the candidate
DECLARE_SOA_COLUMN(PtCand, ptCand, float); //! Pt of the candidate
DECLARE_SOA_COLUMN(InvMassDs, invMassDs, float); //! Invariant mass of Ds candidate
DECLARE_SOA_COLUMN(InvMassCand, invMassCand, float); //! Invariant mass of Charm candidate
DECLARE_SOA_COLUMN(BdtScorePrompt, bdtScorePrompt, float); //! BDT output score for prompt hypothesis
DECLARE_SOA_COLUMN(BdtScoreBkg, bdtScoreBkg, float); //! BDT output score for background hypothesis
DECLARE_SOA_COLUMN(BdtScore0, bdtScore0, float); //! First BDT output score
DECLARE_SOA_COLUMN(BdtScore1, bdtScore1, float); //! Second BDT output score
} // namespace hf_candidate_reduced
DECLARE_SOA_TABLE(DsCandReduceds, "AOD", "DSCANDREDUCED", //! Table with Ds candidate info
soa::Index<>,
Expand Down Expand Up @@ -147,12 +147,12 @@ DECLARE_SOA_TABLE(HfcRedTrkSels, "AOD", "HFCREDTRKSEL", //! Table with associate
// definition of columns and tables for Charm-Hadron and Hadron-Hadron correlation pairs
namespace hf_correlation_charm_hadron_reduced
{
DECLARE_SOA_INDEX_COLUMN_FULL(CharmTrig, charmTrig, int, HfcRedCharmTrigs, "_0"); //! Reduced charm trigger candidate index
DECLARE_SOA_INDEX_COLUMN_FULL(HadTrig, hadTrig, int, HfcRedTrkAssocs, "_1"); //! Reduced hadron trigger candidate index
DECLARE_SOA_INDEX_COLUMN_FULL(TrkAssoc, trkAssoc, int, HfcRedTrkAssocs, "_2"); //! Reduced associated track index
DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between charm hadron and Hadrons
DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between charm hadron and Hadrons
DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin for the MixedEvent
DECLARE_SOA_INDEX_COLUMN_FULL(CharmTrig, charmTrig, int, HfcRedCharmTrigs, "_0"); //! Reduced charm trigger candidate index
DECLARE_SOA_INDEX_COLUMN_FULL(HadTrig, hadTrig, int, HfcRedTrkAssocs, "_1"); //! Reduced hadron trigger candidate index
DECLARE_SOA_INDEX_COLUMN_FULL(TrkAssoc, trkAssoc, int, HfcRedTrkAssocs, "_2"); //! Reduced associated track index
DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between charm hadron and Hadrons
DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between charm hadron and Hadrons
DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin for the MixedEvent
} // namespace hf_correlation_charm_hadron_reduced

DECLARE_SOA_TABLE(HfcRedChHads, "AOD", "HFCREDCHHAD", //! Charm-Hadron pairs information
Expand Down
67 changes: 37 additions & 30 deletions PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx
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 PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)

Check failure on line 1 in PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -11,7 +11,7 @@

/// \file correlatorFlowCharmHadrons.cxx
/// \brief CharmHadrons-Hadrons correlator tree creator for data and MC-reco analyses
/// \author Marcello Di Costanzo <marcello.di.costanzo@cern.ch>, Politecnico and INFN Torino

Check failure on line 14 in PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

#include "PWGHF/Core/HfHelper.h"
#include "PWGHF/DataModel/CandidateReconstructionTables.h"
Expand Down Expand Up @@ -93,10 +93,10 @@
doprocessSameEventHadHadWCentMix, doprocessSameEventHadHadWMultMix, doprocessMixedEventHadHadWCentMix, doprocessMixedEventHadHadWMultMix};
if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) > 1) {
LOGP(fatal, "Only one process function should be enabled! Please check your configuration!");
if ( !((doprocessSameEventCharmHadWCentMix && doprocessMixedEventCharmHadWCentMix) || (doprocessSameEventCharmHadWMultMix && doprocessMixedEventCharmHadWMultMix)) ){
if (!((doprocessSameEventCharmHadWCentMix && doprocessMixedEventCharmHadWCentMix) || (doprocessSameEventCharmHadWMultMix && doprocessMixedEventCharmHadWMultMix))) {
LOG(fatal) << "Different binning policies between Same Event and Mixed Event";
}
if ( !((doprocessSameEventHadHadWCentMix && doprocessMixedEventHadHadWCentMix) || (doprocessSameEventHadHadWMultMix && doprocessMixedEventHadHadWMultMix)) ){
if (!((doprocessSameEventHadHadWCentMix && doprocessMixedEventHadHadWCentMix) || (doprocessSameEventHadHadWMultMix && doprocessMixedEventHadHadWMultMix))) {
LOG(fatal) << "Different binning policies between Same Event and Mixed Event";
}
}
Expand Down Expand Up @@ -143,16 +143,17 @@
if (doprocessSameEventCharmHadWCentMix || doprocessSameEventCharmHadWMultMix) {
registry.add("hSparseCorrelationsSECharmHad", "THn for SE Charm-Had correlations", HistType::kTHnSparseF, axes);
} else if (doprocessMixedEventCharmHadWCentMix || doprocessMixedEventCharmHadWMultMix) {
registry.add("hSparseCorrelationsMECharmHad", "THn for ME Charm-Had correlations", HistType::kTHnSparseF, axes);
registry.add("hSparseCorrelationsMECharmHad", "THn for ME Charm-Had correlations", HistType::kTHnSparseF, axes);
}
}
}
}

/// Get charm candidate or hadron track pT
/// \param track is the candidate
template<typename TTrack>
double getPt(const TTrack& track) {
template <typename TTrack>
double getPt(const TTrack& track)
{
if constexpr (requires { track.ptAssocTrack(); }) {
return track.ptAssocTrack();
} else {
Expand All @@ -163,8 +164,9 @@

/// Get charm candidate or hadron track eta
/// \param track is the candidate
template<typename TTrack>
double getEta(const TTrack& track) {
template <typename TTrack>
double getEta(const TTrack& track)
{
if constexpr (requires { track.etaAssocTrack(); }) {
return track.etaAssocTrack();
} else {
Expand All @@ -175,8 +177,9 @@

/// Get charm candidate or hadron track phi
/// \param track is the candidate
template<typename TTrack>
double getPhi(const TTrack& track) {
template <typename TTrack>
double getPhi(const TTrack& track)
{
if constexpr (requires { track.phiAssocTrack(); }) {
return track.phiAssocTrack();
} else {
Expand All @@ -188,8 +191,9 @@
/// Get the binning pool associated to the collision
/// \param collision is the collision
/// \param corrBinning is the binning policy for the correlation
template<bool fillHistos, typename TColl, typename TBinningType>
int getPoolBin(const TColl& collision, const TBinningType& corrBinning) {
template <bool fillHistos, typename TColl, typename TBinningType>
int getPoolBin(const TColl& collision, const TBinningType& corrBinning)
{
int poolBin{0};
if constexpr (std::is_same_v<TBinningType, BinningTypeDerivedCent>) {
poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.centrality()));
Expand All @@ -208,8 +212,9 @@
/// Reject daughter-track pairs and same-track pairs
/// \param cand is the trigger candidate
/// \param track is the associated track
template<typename TTrigPart, typename TTrack>
bool rejSameEvtPair(const TTrigPart& cand, const TTrack& track) {
template <typename TTrigPart, typename TTrack>
bool rejSameEvtPair(const TTrigPart& cand, const TTrack& track)
{
if constexpr (requires { cand.originTrackId(); }) {
// Remove same track pairs for Had-Had correlations
return (cand.originTrackId() == track.originTrackId());
Expand All @@ -226,8 +231,9 @@
/// Slice trigger candidates by collision
/// \param cands are the trigger candidates
/// \param collId is the collision index
template<typename TTrigCands>
auto sliceTrigCands(TTrigCands const& cands, const int collId) {
template <typename TTrigCands>
auto sliceTrigCands(TTrigCands const& cands, const int collId)
{
if constexpr (std::is_same_v<TTrigCands, soa::Join<aod::HfcRedTrkAssocs, aod::HfcRedTrkSels>>) {
return cands.sliceBy(tracksPerCol, collId);
} else {
Expand All @@ -239,25 +245,26 @@
/// \param trigCand is the trigger charm hadron candidate
/// \param assocTrack is the associated hadron track
/// \param poolBin is the pool bin of the collision
template<bool isMixedEvent, typename TTrigCand, typename TTrack>
template <bool isMixedEvent, typename TTrigCand, typename TTrack>
void fillCharmHadInfo(TTrigCand const& trigCand,
TTrack const& assocTrack,
const int poolBin) {
const int poolBin)
{
double deltaPhi = RecoDecay::constrainAngle(getPhi(assocTrack), getPhi(trigCand), -o2::constants::math::PIHalf);
if (fillTables) {
entryCharmHadPair(trigCand.globalIndex(), assocTrack.globalIndex(), deltaPhi, getEta(assocTrack) - getEta(trigCand), poolBin);
}
if (fillSparses) {
if constexpr (isMixedEvent) {
registry.fill(HIST("hSparseCorrelationsMECharmHad"), getPt(trigCand), getPt(assocTrack),
getEta(trigCand) - getEta(assocTrack),
deltaPhi, poolBin, trigCand.bdtScore0(),
trigCand.bdtScore1(), trigCand.invMassCand());
getEta(trigCand) - getEta(assocTrack),
deltaPhi, poolBin, trigCand.bdtScore0(),
trigCand.bdtScore1(), trigCand.invMassCand());
} else {
registry.fill(HIST("hSparseCorrelationsSECharmHad"), getPt(trigCand), getPt(assocTrack),
getEta(trigCand) - getEta(assocTrack),
deltaPhi, poolBin, trigCand.bdtScore0(),
trigCand.bdtScore1(), trigCand.invMassCand());
getEta(trigCand) - getEta(assocTrack),
deltaPhi, poolBin, trigCand.bdtScore0(),
trigCand.bdtScore1(), trigCand.invMassCand());
}
}
}
Expand All @@ -266,10 +273,11 @@
/// \param trigCand is the trigger hadron candidate
/// \param assocTrack is the associated hadron track
/// \param poolBin is the pool bin of the collision
template<bool isMixedEvent, typename TCand>
template <bool isMixedEvent, typename TCand>
void fillHadHadInfo(TCand const& trigCand,
TCand const& assocTrack,
const int poolBin) {
const int poolBin)
{
double deltaPhi = RecoDecay::constrainAngle(getPhi(assocTrack), getPhi(trigCand), -o2::constants::math::PIHalf);
if (fillTables) {
entryHadHadPair(trigCand.globalIndex(), assocTrack.globalIndex(), deltaPhi, getEta(assocTrack) - getEta(trigCand), poolBin);
Expand All @@ -288,7 +296,7 @@
/// \param trigCands are the selected trigger candidates
/// \param assocTracks are the selected associated tracks
/// \param corrBinning is the binning policy for the correlation
template<typename TTrigCands, typename TAssocTracks, typename TBinningType>
template <typename TTrigCands, typename TAssocTracks, typename TBinningType>
void fillSameEvent(aod::HfcRedFlowColls const& collisions,
TTrigCands const& trigCands,
TAssocTracks const& assocTracks,
Expand All @@ -298,7 +306,7 @@
int poolBin = getPoolBin<true>(collision, corrBinning);
registry.fill(HIST("hCollisionPoolBin"), poolBin);
registry.fill(HIST("hZVtx"), collision.posZ(), poolBin);

auto thisCollId = collision.globalIndex();
auto trigCandsThisColl = sliceTrigCands(trigCands, thisCollId);
auto assocCandsThisColl = assocTracks.sliceBy(tracksPerCol, thisCollId);
Expand Down Expand Up @@ -330,7 +338,7 @@
/// \param trigCands are the selected trigger candidates
/// \param assocTracks are the selected associated tracks
/// \param corrBinning is the binning policy for the correlation
template<typename TTrigCands, typename TAssocTracks, typename TBinningType>
template <typename TTrigCands, typename TAssocTracks, typename TBinningType>
void fillMixedEvent(aod::HfcRedFlowColls const& collisions,
TTrigCands const& trigCands,
TAssocTracks const& assocTracks,
Expand Down Expand Up @@ -388,7 +396,7 @@
fillSameEvent(collisions, candidates, tracks, corrBinningCent);
}
PROCESS_SWITCH(HfCorrelatorFlowCharmHadrons, processSameEventCharmHadWCentMix, "Process Same Event for Charm-Had with centrality pools", true);

void processSameEventCharmHadWMultMix(aod::HfcRedFlowColls const& collisions,
soa::Join<aod::HfcRedCharmTrigs, aod::HfcRedCharmMls> const& candidates,
soa::Join<aod::HfcRedTrkAssocs, aod::HfcRedTrkSels> const& tracks)
Expand Down Expand Up @@ -447,7 +455,6 @@
fillMixedEvent(collisions, tracks, tracks, corrBinningMult);
}
PROCESS_SWITCH(HfCorrelatorFlowCharmHadrons, processMixedEventHadHadWMultMix, "Process Mixed Event for Had-Had with multiplicity pools", false);

};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
Expand Down
Loading