Skip to content

Commit 763c0b3

Browse files
committed
[WIP] Implement Fabrizio comments
1 parent 02434ac commit 763c0b3

7 files changed

Lines changed: 2879 additions & 74 deletions

File tree

‎PWGHF/D2H/TableProducer/CMakeLists.txt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ o2physics_add_dpl_workflow(data-creator-hidden-charm-reduced
102102
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils
103103
COMPONENT_NAME Analysis)
104104

105+
o2physics_add_dpl_workflow(dplus-combinatorics
106+
SOURCES dplusCombinatorics.cxx
107+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::EventFilteringUtils O2Physics::AnalysisCore O2Physics::MLCore
108+
COMPONENT_NAME Analysis)
109+
105110
# Converters
106111

107112
o2physics_add_dpl_workflow(converter-reduced-3-prongs-ml

‎PWGHF/D2H/TableProducer/dplusCombinatorics.cxx‎

Lines changed: 2644 additions & 0 deletions
Large diffs are not rendered by default.

‎PWGHF/D2H/TableProducer/mlBasedTrackSelector.cxx‎

Lines changed: 118 additions & 55 deletions
Large diffs are not rendered by default.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
/// \file CharmTrackScoreScanTables.h
13+
/// \brief Per-candidate ML scores, so a track-level working-point scan can be redone offline
14+
///
15+
/// Written by dplusCombinatorics.cxx and consumed by dplusCombinatoricsQa.cxx. It lives in a
16+
/// header rather than being declared twice because the two declarations must not drift: a
17+
/// mismatch would be read back as silently reinterpreted columns, not as an error.
18+
///
19+
/// The point of the table is that one *loose* run gives the whole scan. A candidate is built iff
20+
/// every prong clears its role's threshold, and thresholds only rise as the working point
21+
/// tightens, so the candidate set at any tighter point is a strict subset of the loose one. Given
22+
/// the per-role minimum score each candidate was built from, membership at a tighter point is a
23+
/// comparison, not another run.
24+
///
25+
/// Scores are per *role*, not one global minimum: the pion and kaon thresholds sit at different
26+
/// absolute values (0.027 vs 0.032 at the 90% working point), so a single minimum over all three
27+
/// prongs could not be compared against either of them.
28+
///
29+
/// \author Fabrizio Chinu <fabrizio.chinu@cern.ch>, Universita and INFN Torino
30+
31+
#ifndef PWGHF_DATAMODEL_CHARMTRACKSCORESCANTABLES_H_
32+
#define PWGHF_DATAMODEL_CHARMTRACKSCORESCANTABLES_H_
33+
34+
#include <Framework/ASoA.h>
35+
#include <Framework/AnalysisDataModel.h>
36+
37+
namespace o2::aod
38+
{
39+
/// Score written for a hypothesis a candidate does not have. Below every real score (which lie in
40+
/// [0, 1]) and below every threshold, so such a hypothesis never survives a scan point.
41+
constexpr float kScoreScanNone = -1.f;
42+
43+
namespace hf_cand_score_scan
44+
{
45+
DECLARE_SOA_COLUMN(PtCand, ptCand, float); //! pT of the candidate
46+
DECLARE_SOA_COLUMN(MinScorePionDplus, minScorePionDplus, float); //! D+: min pion score over the two pion prongs
47+
DECLARE_SOA_COLUMN(ScoreKaonDplus, scoreKaonDplus, float); //! D+: kaon score of the opposite-sign prong
48+
DECLARE_SOA_COLUMN(MinScoreKaonDsHypo0, minScoreKaonDsHypo0, float); //! Ds (K K pi): min kaon score over the two kaon prongs
49+
DECLARE_SOA_COLUMN(ScorePionDsHypo0, scorePionDsHypo0, float); //! Ds (K K pi): pion score of the pion prong
50+
DECLARE_SOA_COLUMN(MinScoreKaonDsHypo1, minScoreKaonDsHypo1, float); //! Ds (pi K K): min kaon score over the two kaon prongs
51+
DECLARE_SOA_COLUMN(ScorePionDsHypo1, scorePionDsHypo1, float); //! Ds (pi K K): pion score of the pion prong
52+
} // namespace hf_cand_score_scan
53+
54+
DECLARE_SOA_TABLE(HfCandScoreScans, "AOD", "HFCANDSCORE", //! One row per aod::Hf3Prongs row, in the same order
55+
hf_cand_score_scan::PtCand,
56+
hf_cand_score_scan::MinScorePionDplus,
57+
hf_cand_score_scan::ScoreKaonDplus,
58+
hf_cand_score_scan::MinScoreKaonDsHypo0,
59+
hf_cand_score_scan::ScorePionDsHypo0,
60+
hf_cand_score_scan::MinScoreKaonDsHypo1,
61+
hf_cand_score_scan::ScorePionDsHypo1);
62+
} // namespace o2::aod
63+
64+
#endif // PWGHF_DATAMODEL_CHARMTRACKSCORESCANTABLES_H_

‎PWGHF/TableProducer/candidateCreatorDstar.cxx‎

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ struct HfCandidateCreatorDstar {
117117

118118
using TracksWCovExtraPidPiKa = soa::Join<aod::TracksWCovExtra, aod::TracksPidPi, aod::PidTpcTofFullPi, aod::TracksPidKa, aod::PidTpcTofFullKa>;
119119

120-
AxisSpec ptAxis = {100, 0., 2.0, "#it{p}_{T} (GeV/#it{c}"};
120+
AxisSpec massAxis = {130, 0.135, 0.2, "Mass (GeV/#it{c}^{2})"};
121+
AxisSpec ptAxis = {50, 0., 25.0, "#it{p}_{T} (GeV/#it{c}"};
121122
AxisSpec dcaAxis = {200, -500., 500., "#it{d}_{xy,z} (#mum)"};
122123

123124
std::shared_ptr<TH1> hCandidates;
@@ -137,6 +138,7 @@ struct HfCandidateCreatorDstar {
137138
{"QA/hDCAXYPi", "DCAxy of Soft Pi;#it{p}_{T} (GeV/#it{c};#it{d}_{xy}) (#mum);entries", {HistType::kTH2F, {ptAxis, dcaAxis}}},
138139
{"QA/hDCAZPi", "DCAz of Soft Pi;#it{p}_{T} (GeV/#it{c};#it{d}_{z}) (#mum);entries", {HistType::kTH2F, {ptAxis, dcaAxis}}},
139140

141+
{"QA/hDeltaMassDStar", "D* candidates", {HistType::kTH1F, {massAxis}}},
140142
{"QA/hPtPi", "#pi candidates", {HistType::kTH1F, {ptAxis}}},
141143
{"QA/hPtD0Prong0", "D^{0} candidates' prong0", {HistType::kTH1F, {ptAxis}}},
142144
{"QA/hPtD0Prong1", "D^{0} candidates' prong1", {HistType::kTH1F, {ptAxis}}},
@@ -387,6 +389,32 @@ struct HfCandidateCreatorDstar {
387389
fillProngPid<HfProngSpecies::Kaon>(trackPi, rowProngSoftPiPidKa);
388390

389391
if (fillHistograms) {
392+
float massDstar{}, massD0{};
393+
if (signSoftPi > 0) {
394+
massDstar = RecoDecay::m(std::array{std::array{pVecSoftPi[0], pVecSoftPi[1], pVecSoftPi[2]},
395+
std::array{pVecD0Prong0[0], pVecD0Prong0[1], pVecD0Prong0[2]},
396+
std::array{pVecD0Prong1[0], pVecD0Prong1[1], pVecD0Prong1[2]}},
397+
std::array{constants::physics::MassPiPlus,
398+
constants::physics::MassPiPlus,
399+
constants::physics::MassKPlus});
400+
massD0 = RecoDecay::m(std::array{std::array{pVecD0Prong0[0], pVecD0Prong0[1], pVecD0Prong0[2]},
401+
std::array{pVecD0Prong1[0], pVecD0Prong1[1], pVecD0Prong1[2]}},
402+
std::array{constants::physics::MassPiPlus,
403+
constants::physics::MassKPlus});
404+
} else {
405+
massDstar = RecoDecay::m(std::array{std::array{pVecSoftPi[0], pVecSoftPi[1], pVecSoftPi[2]},
406+
std::array{pVecD0Prong0[0], pVecD0Prong0[1], pVecD0Prong0[2]},
407+
std::array{pVecD0Prong1[0], pVecD0Prong1[1], pVecD0Prong1[2]}},
408+
std::array{constants::physics::MassPiPlus,
409+
constants::physics::MassKPlus,
410+
constants::physics::MassPiPlus});
411+
massD0 = RecoDecay::m(std::array{std::array{pVecD0Prong0[0], pVecD0Prong0[1], pVecD0Prong0[2]},
412+
std::array{pVecD0Prong1[0], pVecD0Prong1[1], pVecD0Prong1[2]}},
413+
std::array{constants::physics::MassKPlus,
414+
constants::physics::MassPiPlus});
415+
}
416+
auto deltaMass = std::abs(massDstar - massD0);
417+
registry.fill(HIST("QA/hDeltaMassDStar"), deltaMass);
390418
registry.fill(HIST("QA/hPtD0"), ptD0);
391419
registry.fill(HIST("QA/hPtPi"), RecoDecay::pt(pVecSoftPi));
392420
registry.fill(HIST("QA/hPtD0Prong0"), RecoDecay::pt(pVecD0Prong0));
@@ -661,6 +689,7 @@ struct HfCandidateCreatorDstarExpressions {
661689
}
662690

663691
if (indexRecDstar > -1) {
692+
LOG(info) << "Matched D* with index: " << rowCandidateDstar.globalIndex() << " matched with MC index: " << indexRecDstar;
664693
flagDstar = signDstar * hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi;
665694
}
666695
if (indexRecD0 > -1) {

‎PWGLF/TableProducer/Resonances/CMakeLists.txt‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ o2physics_add_dpl_workflow(resonance-initializer
3535
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsBase
3636
COMPONENT_NAME Analysis)
3737

38-
o2physics_add_dpl_workflow(resonance-module-initializer
39-
SOURCES resonanceModuleInitializer.cxx
40-
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsBase
41-
COMPONENT_NAME Analysis)
38+
# o2physics_add_dpl_workflow(resonance-module-initializer
39+
# SOURCES resonanceModuleInitializer.cxx
40+
# PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsBase
41+
# COMPONENT_NAME Analysis)
4242

4343
o2physics_add_dpl_workflow(resonance-merge-df
4444
SOURCES resonanceMergeDF.cxx

‎PWGLF/Tasks/Resonances/CMakeLists.txt‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -194,20 +194,20 @@ o2physics_add_dpl_workflow(xi1530analysisqa
194194
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
195195
COMPONENT_NAME Analysis)
196196

197-
o2physics_add_dpl_workflow(omega2012analysis
198-
SOURCES omega2012Analysis.cxx
199-
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
200-
COMPONENT_NAME Analysis)
201-
202-
o2physics_add_dpl_workflow(omega2012-training-table
203-
SOURCES omega2012TrainingTable.cxx
204-
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
205-
COMPONENT_NAME Analysis)
206-
207-
o2physics_add_dpl_workflow(xi1820analysis
208-
SOURCES xi1820Analysis.cxx
209-
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
210-
COMPONENT_NAME Analysis)
197+
# o2physics_add_dpl_workflow(omega2012analysis
198+
# SOURCES omega2012Analysis.cxx
199+
# PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
200+
# COMPONENT_NAME Analysis)
201+
202+
# o2physics_add_dpl_workflow(omega2012-training-table
203+
# SOURCES omega2012TrainingTable.cxx
204+
# PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
205+
# COMPONENT_NAME Analysis)
206+
#
207+
# o2physics_add_dpl_workflow(xi1820analysis
208+
# SOURCES xi1820Analysis.cxx
209+
# PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
210+
# COMPONENT_NAME Analysis)
211211

212212
o2physics_add_dpl_workflow(initializereventqa
213213
SOURCES initializereventqa.cxx

0 commit comments

Comments
 (0)