@@ -94,6 +94,7 @@ struct HfTaskCorrelationDsHadrons {
9494 HfHelper hfHelper;
9595 SliceCache cache;
9696
97+ using DsHadronPair = soa::Join<aod::DsHadronPair, aod::DsHadronRecoInfo>;
9798 using DsHadronPairFull = soa::Join<aod::DsHadronPair, aod::DsHadronRecoInfo, aod::DsHadronGenInfo>;
9899 using DsHadronPairWithMl = soa::Join<aod::DsHadronPair, aod::DsHadronRecoInfo, aod::DsHadronMlInfo, aod::TrackRecoInfo>;
99100 using DsHadronPairFullWithMl = soa::Join<aod::DsHadronPair, aod::DsHadronRecoInfo, aod::DsHadronGenInfo, aod::DsHadronMlInfo, aod::TrackRecoInfo>;
@@ -471,6 +472,45 @@ struct HfTaskCorrelationDsHadrons {
471472 }
472473 PROCESS_SWITCH (HfTaskCorrelationDsHadrons, processDataME, " Process data ME" , false );
473474
475+ void processDerivedDataME (DsHadronPair const & pairEntries)
476+ {
477+ for (const auto & pairEntry : pairEntries) {
478+ // define variables for widely used quantities
479+ float deltaPhi = pairEntry.deltaPhi ();
480+ float deltaEta = pairEntry.deltaEta ();
481+ float ptD = pairEntry.ptD ();
482+ float ptHadron = pairEntry.ptHadron ();
483+ float massD = pairEntry.mD ();
484+ int poolBin = pairEntry.poolBin ();
485+ int ptBinD = o2::analysis::findBin (binsPtD, ptD);
486+
487+ double efficiencyWeight = 1 .;
488+ if (applyEfficiency) {
489+ efficiencyWeight = 1 . / (efficiencyD->at (o2::analysis::findBin (binsPtEfficiencyD, ptD)) * efficiencyHad->at (o2::analysis::findBin (binsPtEfficiencyHad, ptHadron)));
490+ }
491+
492+ // in signal region
493+ if (massD > signalRegionInner->at (ptBinD) && massD < signalRegionOuter->at (ptBinD)) {
494+ registry.fill (HIST (" hCorrel2DVsPtSignalRegion" ), deltaPhi, deltaEta, ptD, ptHadron, poolBin, efficiencyWeight);
495+ registry.fill (HIST (" hDeltaEtaPtIntSignalRegion" ), deltaEta, efficiencyWeight);
496+ registry.fill (HIST (" hDeltaPhiPtIntSignalRegion" ), deltaPhi, efficiencyWeight);
497+ }
498+ // in sideband left region
499+ if (massD > sidebandLeftOuter->at (ptBinD) && massD < sidebandLeftInner->at (ptBinD)) {
500+ registry.fill (HIST (" hCorrel2DVsPtSidebandLeft" ), deltaPhi, deltaEta, ptD, ptHadron, poolBin, efficiencyWeight);
501+ registry.fill (HIST (" hDeltaEtaPtIntSidebandLeft" ), deltaEta, efficiencyWeight);
502+ registry.fill (HIST (" hDeltaPhiPtIntSidebandLeft" ), deltaPhi, efficiencyWeight);
503+ }
504+ // in sideband right region
505+ if (massD > sidebandRightInner->at (ptBinD) && massD < sidebandRightOuter->at (ptBinD)) {
506+ registry.fill (HIST (" hCorrel2DVsPtSidebandRight" ), deltaPhi, deltaEta, ptD, ptHadron, poolBin, efficiencyWeight);
507+ registry.fill (HIST (" hDeltaEtaPtIntSidebandRight" ), deltaEta, efficiencyWeight);
508+ registry.fill (HIST (" hDeltaPhiPtIntSidebandRight" ), deltaPhi, efficiencyWeight);
509+ }
510+ }
511+ }
512+ PROCESS_SWITCH (HfTaskCorrelationDsHadrons, processDerivedDataME, " Process derived data ME" , false );
513+
474514 // / D-Hadron correlation pair filling task, from pair tables - for MC reco-level analysis (candidates matched to true signal only, but also bkg sources are studied)
475515 void processMcRecME (DsHadronPairFullWithMl const & pairEntries)
476516 {
0 commit comments