Skip to content
Merged
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
38 changes: 27 additions & 11 deletions ALICE3/TableProducer/alice3-correlatorDDbar.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 ALICE3/TableProducer/alice3-correlatorDDbar.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 ALICE3/TableProducer/alice3-correlatorDDbar.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/file-cpp]

Use lowerCamelCase or UpperCamelCase for names of C++ files. See the O2 naming conventions for details.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -14,23 +14,20 @@
///
/// \author Fabio Colamaria <fabio.colamaria@ba.infn.it>, INFN Bari

#include <vector>
#include "PWGHF/Core/HfHelper.h"
#include "PWGHF/Core/SelectorCuts.h"
#include "PWGHF/HFC/DataModel/CorrelationTables.h"

#include "ALICE3/DataModel/A3DecayFinderTables.h"
#include "Common/Core/TrackSelection.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include "CommonConstants/PhysicsConstants.h"
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/runDataProcessing.h"

#include "Common/Core/TrackSelection.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include "ALICE3/DataModel/A3DecayFinderTables.h"

#include "PWGHF/Core/HfHelper.h"
#include "PWGHF/Core/SelectorCuts.h"
#include "PWGHF/HFC/DataModel/CorrelationTables.h"
// #include "PWGHF/DataModel/CandidateReconstructionTables.h"
// #include "PWGHF/DataModel/CandidateSelectionTables.h"
#include <vector>

using namespace o2;
using namespace o2::analysis;
Expand All @@ -55,7 +52,7 @@

const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_d0_to_pi_k::NBinsPt;
const double efficiencyDmesonDefault[npTBinsMassAndEfficiency] = {};
auto efficiencyDmeson_v = std::vector<double>{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency};

Check failure on line 55 in ALICE3/TableProducer/alice3-correlatorDDbar.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.

// histogram binning definition
const int massAxisBins = 120;
Expand All @@ -71,7 +68,7 @@
const double ptDAxisMin = 0.;
const double ptDAxisMax = 36.;

struct alice3correlatorddbar {

Check failure on line 71 in ALICE3/TableProducer/alice3-correlatorDDbar.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/struct]

Use UpperCamelCase for names of structs.
SliceCache cache;
Preslice<aod::Alice3D0Meson> perCol = aod::a3D0meson::collisionId;
Produces<aod::DDbarPair> entryD0D0barPair;
Expand Down Expand Up @@ -121,6 +118,15 @@
registry.add("hMassD0barMCRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hMassD0barMCRecRefl", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hMassD0barMCRecBkg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hMass_NoEff", "D0,D0bar candidates (wo efficiency);inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hMassD0_NoEff", "D0,D0bar candidates (wo efficiency);inv. mass D0 only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hMassD0bar_NoEff", "D0,D0bar candidates (wo efficiency);inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hMassD0MCRecSig_NoEff", "D0 signal candidates - MC reco (wo efficiency);inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hMassD0MCRecRefl_NoEff", "D0 reflection candidates - MC reco (wo efficiency);inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hMassD0MCRecBkg_NoEff", "D0 background candidates - MC reco (wo efficiency);inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hMassD0barMCRecSig_NoEff", "D0bar signal candidates - MC reco (wo efficiency);inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hMassD0barMCRecRefl_NoEff", "D0bar reflection candidates - MC reco (wo efficiency);inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}});
registry.add("hMassD0barMCRecBkg_NoEff", "D0bar background candidates - MC reco (wo efficiency);inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}});
}

/// D0-D0bar correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth)
Expand All @@ -139,10 +145,14 @@
if (candidate1.isSelD0() >= selectionFlagD0) {
registry.fill(HIST("hMass"), candidate1.m(), candidate1.pt(), efficiencyWeight);
registry.fill(HIST("hMassD0"), candidate1.m(), candidate1.pt(), efficiencyWeight);
registry.fill(HIST("hMass_NoEff"), candidate1.m(), candidate1.pt());
registry.fill(HIST("hMassD0_NoEff"), candidate1.m(), candidate1.pt());
}
if (candidate1.isSelD0bar() >= selectionFlagD0bar) {
registry.fill(HIST("hMass"), candidate1.m(), candidate1.pt(), efficiencyWeight);
registry.fill(HIST("hMassD0bar"), candidate1.m(), candidate1.pt(), efficiencyWeight);
registry.fill(HIST("hMass_NoEff"), candidate1.m(), candidate1.pt());
registry.fill(HIST("hMassD0bar_NoEff"), candidate1.m(), candidate1.pt());
}
registry.fill(HIST("hPtCand"), candidate1.pt());
registry.fill(HIST("hPtProng0"), candidate1.ptProng0());
Expand All @@ -166,7 +176,7 @@
if (candidate1.mRowIndex == candidate2.mRowIndex) { // this by definition should never happen, since each candidate is either D0 or D0bar
continue;
}
if ((candidate1.pt() - candidate2.pt()) < 1e-5 && (candidate1.eta() - candidate2.eta()) < 1e-5 && (candidate1.phi() - candidate2.phi()) < 1e-5) { // revised, temporary condition to avoid self-correlations (the best would be check the daughterIDs, but we don't store them at the moment)

Check failure on line 179 in ALICE3/TableProducer/alice3-correlatorDDbar.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;
}
entryD0D0barPair(getDeltaPhi(candidate2.phi(), candidate1.phi()),
Expand Down Expand Up @@ -229,19 +239,25 @@
if (candidate1.isSelD0() >= selectionFlagD0) { // only reco as D0
if (candidate1.mcTruthInfo() == 1) { // also matched as D0
registry.fill(HIST("hMassD0MCRecSig"), candidate1.m(), candidate1.pt(), efficiencyWeight); // here m is univoque, since a given candidate passes the selection with only a single mass option
registry.fill(HIST("hMassD0MCRecSig_NoEff"), candidate1.m(), candidate1.pt());
} else if (candidate1.mcTruthInfo() == 2) {

Check failure on line 243 in ALICE3/TableProducer/alice3-correlatorDDbar.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
registry.fill(HIST("hMassD0MCRecRefl"), candidate1.m(), candidate1.pt(), efficiencyWeight);
registry.fill(HIST("hMassD0MCRecRefl_NoEff"), candidate1.m(), candidate1.pt());
} else {
registry.fill(HIST("hMassD0MCRecBkg"), candidate1.m(), candidate1.pt(), efficiencyWeight);
registry.fill(HIST("hMassD0MCRecBkg_NoEff"), candidate1.m(), candidate1.pt());
}
}
if (candidate1.isSelD0bar() >= selectionFlagD0bar) { // only reco as D0bar
if (candidate1.mcTruthInfo() == 2) { // also matched as D0bar

Check failure on line 252 in ALICE3/TableProducer/alice3-correlatorDDbar.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
registry.fill(HIST("hMassD0barMCRecSig"), candidate1.m(), candidate1.pt(), efficiencyWeight); // here m is univoque, since a given candidate passes the selection with only a single mass option
registry.fill(HIST("hMassD0barMCRecSig_NoEff"), candidate1.m(), candidate1.pt());
} else if (candidate1.mcTruthInfo() == 1) {
registry.fill(HIST("hMassD0barMCRecRefl"), candidate1.m(), candidate1.pt(), efficiencyWeight);
registry.fill(HIST("hMassD0barMCRecRefl_NoEff"), candidate1.m(), candidate1.pt());
} else {
registry.fill(HIST("hMassD0barMCRecBkg"), candidate1.m(), candidate1.pt(), efficiencyWeight);
registry.fill(HIST("hMassD0barMCRecBkg_NoEff"), candidate1.m(), candidate1.pt());
}
}

Expand All @@ -252,20 +268,20 @@
}

flagD0Signal = candidate1.mcTruthInfo() == 1; // flagD0Signal 'true' if candidate1 matched to D0 (particle)
flagD0Reflection = candidate1.mcTruthInfo() == 2; // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle)

Check failure on line 271 in ALICE3/TableProducer/alice3-correlatorDDbar.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

for (const auto& candidate2 : selectedCandidatesGroupedMC) {
if (candidate2.isSelD0bar() < selectionFlagD0bar) { // discard candidates not selected as D0bar in inner loop
continue;
}
flagD0barSignal = candidate2.mcTruthInfo() == 2; // flagD0barSignal 'true' if candidate2 matched to D0bar (antiparticle)

Check failure on line 277 in ALICE3/TableProducer/alice3-correlatorDDbar.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
flagD0barReflection = candidate2.mcTruthInfo() == 1; // flagD0barReflection 'true' if candidate2, selected as D0bar (antiparticle), is matched to D0 (particle)

// Excluding trigger self-correlations (possible in case of both mass hypotheses of the same real particle, reconstructed as candidate1 for D0 and candidate2 for D0bar)
if (candidate1.mRowIndex == candidate2.mRowIndex) { // this by definition should never happen, since each candidate is either D0 or D0bar
continue;
}
if ((candidate1.pt() - candidate2.pt()) < 1e-5 && (candidate1.eta() - candidate2.eta()) < 1e-5 && (candidate1.phi() - candidate2.phi()) < 1e-5) { // revised, temporary condition to avoid self-correlations (the best would be check the daughterIDs, but we don't store them at the moment)

Check failure on line 284 in ALICE3/TableProducer/alice3-correlatorDDbar.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;
}
// choice of options (D0/D0bar signal/bkg)
Expand Down
Loading