diff --git a/PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h b/PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h index 1a28c7a60fa..4203f842f2b 100644 --- a/PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h +++ b/PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h @@ -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<>, @@ -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 diff --git a/PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx b/PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx index 1b2804cbb32..fc2d43e5442 100644 --- a/PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx +++ b/PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx @@ -93,10 +93,10 @@ struct HfCorrelatorFlowCharmHadrons { 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"; } } @@ -143,7 +143,7 @@ struct HfCorrelatorFlowCharmHadrons { 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); } } } @@ -151,8 +151,9 @@ struct HfCorrelatorFlowCharmHadrons { /// Get charm candidate or hadron track pT /// \param track is the candidate - template - double getPt(const TTrack& track) { + template + double getPt(const TTrack& track) + { if constexpr (requires { track.ptAssocTrack(); }) { return track.ptAssocTrack(); } else { @@ -163,8 +164,9 @@ struct HfCorrelatorFlowCharmHadrons { /// Get charm candidate or hadron track eta /// \param track is the candidate - template - double getEta(const TTrack& track) { + template + double getEta(const TTrack& track) + { if constexpr (requires { track.etaAssocTrack(); }) { return track.etaAssocTrack(); } else { @@ -175,8 +177,9 @@ struct HfCorrelatorFlowCharmHadrons { /// Get charm candidate or hadron track phi /// \param track is the candidate - template - double getPhi(const TTrack& track) { + template + double getPhi(const TTrack& track) + { if constexpr (requires { track.phiAssocTrack(); }) { return track.phiAssocTrack(); } else { @@ -188,8 +191,9 @@ struct HfCorrelatorFlowCharmHadrons { /// Get the binning pool associated to the collision /// \param collision is the collision /// \param corrBinning is the binning policy for the correlation - template - int getPoolBin(const TColl& collision, const TBinningType& corrBinning) { + template + int getPoolBin(const TColl& collision, const TBinningType& corrBinning) + { int poolBin{0}; if constexpr (std::is_same_v) { poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.centrality())); @@ -208,8 +212,9 @@ struct HfCorrelatorFlowCharmHadrons { /// Reject daughter-track pairs and same-track pairs /// \param cand is the trigger candidate /// \param track is the associated track - template - bool rejSameEvtPair(const TTrigPart& cand, const TTrack& track) { + template + 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()); @@ -226,8 +231,9 @@ struct HfCorrelatorFlowCharmHadrons { /// Slice trigger candidates by collision /// \param cands are the trigger candidates /// \param collId is the collision index - template - auto sliceTrigCands(TTrigCands const& cands, const int collId) { + template + auto sliceTrigCands(TTrigCands const& cands, const int collId) + { if constexpr (std::is_same_v>) { return cands.sliceBy(tracksPerCol, collId); } else { @@ -239,10 +245,11 @@ struct HfCorrelatorFlowCharmHadrons { /// \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 + template 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); @@ -250,14 +257,14 @@ struct HfCorrelatorFlowCharmHadrons { 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()); } } } @@ -266,10 +273,11 @@ struct HfCorrelatorFlowCharmHadrons { /// \param trigCand is the trigger hadron candidate /// \param assocTrack is the associated hadron track /// \param poolBin is the pool bin of the collision - template + template 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); @@ -288,7 +296,7 @@ struct HfCorrelatorFlowCharmHadrons { /// \param trigCands are the selected trigger candidates /// \param assocTracks are the selected associated tracks /// \param corrBinning is the binning policy for the correlation - template + template void fillSameEvent(aod::HfcRedFlowColls const& collisions, TTrigCands const& trigCands, TAssocTracks const& assocTracks, @@ -298,7 +306,7 @@ struct HfCorrelatorFlowCharmHadrons { int poolBin = getPoolBin(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); @@ -330,7 +338,7 @@ struct HfCorrelatorFlowCharmHadrons { /// \param trigCands are the selected trigger candidates /// \param assocTracks are the selected associated tracks /// \param corrBinning is the binning policy for the correlation - template + template void fillMixedEvent(aod::HfcRedFlowColls const& collisions, TTrigCands const& trigCands, TAssocTracks const& assocTracks, @@ -388,7 +396,7 @@ struct HfCorrelatorFlowCharmHadrons { 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 const& candidates, soa::Join const& tracks) @@ -447,7 +455,6 @@ struct HfCorrelatorFlowCharmHadrons { fillMixedEvent(collisions, tracks, tracks, corrBinningMult); } PROCESS_SWITCH(HfCorrelatorFlowCharmHadrons, processMixedEventHadHadWMultMix, "Process Mixed Event for Had-Had with multiplicity pools", false); - }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)