forked from AliceO2Group/O2Physics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PWGHF] Ds-h correlation, fix bug in ME derived data (AliceO2Group#9086)
Co-authored-by: ALICE Action Bot <[email protected]>
- Loading branch information
Showing
3 changed files
with
36 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,8 @@ | |
/// \author Grazia Luparello <[email protected]> | ||
/// \author Samuele Cattaruzzi <[email protected]> | ||
|
||
#include <vector> | ||
|
||
#include "Framework/AnalysisTask.h" | ||
#include "Framework/HistogramRegistry.h" | ||
#include "Framework/runDataProcessing.h" | ||
|
@@ -59,8 +61,8 @@ struct HfTaskCorrelationDsHadrons { | |
Configurable<std::vector<int>> classMl{"classMl", {0, 1, 2}, "Indexes of ML scores to be stored. Three indexes max."}; | ||
Configurable<std::vector<double>> binsPtD{"binsPtD", std::vector<double>{o2::analysis::hf_cuts_ds_to_k_k_pi::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"}; | ||
Configurable<std::vector<double>> binsPtHadron{"binsPtHadron", std::vector<double>{0.3, 2., 4., 8., 12., 50.}, "pT bin limits for assoc particle efficiency"}; | ||
Configurable<std::vector<double>> mlOutputPrompt{"mlScorePrompt", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for prompt"}; | ||
Configurable<std::vector<double>> mlOutputBkg{"mlScoreBkg", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for bkg"}; | ||
Configurable<std::vector<double>> mlOutputPrompt{"mlOutputPrompt", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for prompt"}; | ||
Configurable<std::vector<double>> mlOutputBkg{"mlOutputBkg", {0.5, 0.5, 0.5, 0.5}, "Machine learning scores for bkg"}; | ||
Configurable<std::vector<double>> binsPtEfficiencyD{"binsPtEfficiencyD", std::vector<double>{o2::analysis::hf_cuts_ds_to_k_k_pi::vecBinsPt}, "pT bin limits for D-meson efficiency"}; | ||
Configurable<std::vector<double>> binsPtEfficiencyHad{"binsPtEfficiencyHad", std::vector<double>{0.3, 2., 4., 8., 12., 50.}, "pT bin limits for associated particle efficiency"}; | ||
Configurable<std::vector<double>> efficiencyD{"efficiencyD", {1., 1., 1., 1., 1., 1.}, "efficiency values for Ds meson"}; | ||
|
@@ -71,15 +73,6 @@ struct HfTaskCorrelationDsHadrons { | |
Configurable<std::vector<double>> sidebandLeftOuter{"sidebandLeftOuter", {1.9040, 1.9040, 1.9040, 1.9040, 1.9040, 1.9040, 1.9040, 1.9040}, "Outer values of left sideband vs pT"}; | ||
Configurable<std::vector<double>> sidebandRightInner{"sidebandRightInner", {2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000, 2.0000}, "Inner values of right sideband vs pT"}; | ||
Configurable<std::vector<double>> sidebandRightOuter{"sidebandRightOuter", {2.0320, 2.0320, 2.0320, 2.0320, 2.0320, 2.0320, 2.0320, 2.0320}, "Outer values of right sideband vs pT"}; | ||
ConfigurableAxis binsMassD{"binsMassD", {200, 1.7, 2.25}, "inv. mass (K^{#pm}K^{-}#pi^{+}) (GeV/#it{c}^{2})"}; | ||
ConfigurableAxis binsBdtScore{"binsBdtScore", {100, 0., 1.}, "Bdt output scores"}; | ||
ConfigurableAxis binsEta{"binsEta", {100, -2., 2.}, "#it{#eta}"}; | ||
ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"}; | ||
ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 8000.}, "Multiplicity as FT0M signal amplitude"}; | ||
ConfigurableAxis binsPosZ{"binsPosZ", {100, -10., 10.}, "primary vertex z coordinate"}; | ||
ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; | ||
|
||
HfHelper hfHelper; | ||
|
||
enum CandidateStep { | ||
kCandidateStepMcGenDsToKKPi = 0, | ||
|
@@ -98,7 +91,11 @@ struct HfTaskCorrelationDsHadrons { | |
kAssocTrackStepRecoSpecies, | ||
kAssocTrackNSteps }; | ||
|
||
HfHelper hfHelper; | ||
SliceCache cache; | ||
|
||
using DsHadronPairFull = soa::Join<aod::DsHadronPair, aod::DsHadronRecoInfo, aod::DsHadronGenInfo>; | ||
using DsHadronPairWithMl = soa::Join<aod::DsHadronPair, aod::DsHadronRecoInfo, aod::DsHadronMlInfo, aod::TrackRecoInfo>; | ||
using DsHadronPairFullWithMl = soa::Join<aod::DsHadronPair, aod::DsHadronRecoInfo, aod::DsHadronGenInfo, aod::DsHadronMlInfo, aod::TrackRecoInfo>; | ||
using CandDsMcReco = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDsToKKPi, aod::HfMlDsToKKPi, aod::HfCand3ProngMcRec>>; // flagDsFilter applied | ||
using CandDsMcGen = soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>; // flagDsFilter applied | ||
|
@@ -107,6 +104,20 @@ struct HfTaskCorrelationDsHadrons { | |
Filter flagDsFilter = ((o2::aod::hf_track_index::hfflag & static_cast<uint8_t>(1 << aod::hf_cand_3prong::DecayType::DsToKKPi)) != static_cast<uint8_t>(0)) && (aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlagDs || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlagDs); | ||
Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (aod::track::pt > ptTrackMin) && (aod::track::pt < ptTrackMax) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); | ||
|
||
Preslice<CandDsMcReco> perCollisionCand = o2::aod::hf_cand::collisionId; | ||
Preslice<CandDsMcGen> perCollisionCandMc = o2::aod::mcparticle::mcCollisionId; | ||
Preslice<TracksWithMc> perCollision = o2::aod::track::collisionId; | ||
Preslice<o2::aod::McParticles> perCollisionMc = o2::aod::mcparticle::mcCollisionId; | ||
PresliceUnsorted<soa::Join<aod::Collisions, aod::FT0Mults, aod::EvSels, aod::McCollisionLabels>> collPerCollMc = o2::aod::mccollisionlabel::mcCollisionId; | ||
|
||
ConfigurableAxis binsMassD{"binsMassD", {200, 1.7, 2.25}, "inv. mass (K^{#pm}K^{-}#pi^{+}) (GeV/#it{c}^{2})"}; | ||
ConfigurableAxis binsBdtScore{"binsBdtScore", {100, 0., 1.}, "Bdt output scores"}; | ||
ConfigurableAxis binsEta{"binsEta", {100, -2., 2.}, "#it{#eta}"}; | ||
ConfigurableAxis binsPhi{"binsPhi", {64, -PIHalf, 3. * PIHalf}, "#it{#varphi}"}; | ||
ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 8000.}, "Multiplicity as FT0M signal amplitude"}; | ||
ConfigurableAxis binsPosZ{"binsPosZ", {100, -10., 10.}, "primary vertex z coordinate"}; | ||
ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; | ||
|
||
HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject}; | ||
|
||
void init(InitContext&) | ||
|
@@ -218,7 +229,7 @@ struct HfTaskCorrelationDsHadrons { | |
} | ||
} | ||
|
||
void processData(DsHadronPairFullWithMl const& pairEntries, | ||
void processData(DsHadronPairWithMl const& pairEntries, | ||
aod::DsCandRecoInfo const& candidates) | ||
{ | ||
for (const auto& candidate : candidates) { | ||
|
@@ -410,7 +421,7 @@ struct HfTaskCorrelationDsHadrons { | |
} | ||
PROCESS_SWITCH(HfTaskCorrelationDsHadrons, processMcGen, "Process MC Gen mode", false); | ||
|
||
void processDataME(DsHadronPairFullWithMl const& pairEntries) | ||
void processDataME(DsHadronPairWithMl const& pairEntries) | ||
{ | ||
for (const auto& pairEntry : pairEntries) { | ||
// define variables for widely used quantities | ||
|
@@ -524,11 +535,6 @@ struct HfTaskCorrelationDsHadrons { | |
} | ||
PROCESS_SWITCH(HfTaskCorrelationDsHadrons, processMcRecME, "Process MC Reco ME", false); | ||
|
||
SliceCache cache; | ||
Preslice<CandDsMcReco> perCollisionCand = o2::aod::hf_cand::collisionId; | ||
Preslice<CandDsMcGen> perCollisionCandMc = o2::aod::mcparticle::mcCollisionId; | ||
PresliceUnsorted<soa::Join<aod::Collisions, aod::FT0Mults, aod::EvSels, aod::McCollisionLabels>> collPerCollMc = o2::aod::mccollisionlabel::mcCollisionId; | ||
|
||
/// Ds-Hadron correlation - for calculating candidate reconstruction efficiency using MC reco-level analysis | ||
void processMcCandEfficiency(soa::Join<aod::Collisions, aod::FT0Mults, aod::EvSels, aod::McCollisionLabels> const& collisions, | ||
soa::Join<aod::McCollisions, aod::MultsExtraMC> const& mcCollisions, | ||
|
@@ -727,9 +733,6 @@ struct HfTaskCorrelationDsHadrons { | |
} | ||
PROCESS_SWITCH(HfTaskCorrelationDsHadrons, processMcCandEfficiencyWoColl, "Process MC for calculating candidate reconstruction efficiency", false); | ||
|
||
Preslice<TracksWithMc> perCollision = o2::aod::track::collisionId; | ||
Preslice<o2::aod::McParticles> perCollisionMc = o2::aod::mcparticle::mcCollisionId; | ||
|
||
/// Ds-Hadron correlation - for calculating associated particle tracking efficiency using MC reco-level analysis | ||
void processMcTrackEfficiency(soa::Join<aod::Collisions, aod::FT0Mults, aod::EvSels, aod::McCollisionLabels> const& collisions, | ||
soa::Join<aod::McCollisions, aod::MultsExtraMC> const& mcCollisions, | ||
|