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
7 changes: 4 additions & 3 deletions PWGDQ/Tasks/taskJpsiHf.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 PWGDQ/Tasks/taskJpsiHf.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 PWGDQ/Tasks/taskJpsiHf.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -12,7 +12,7 @@
/// \file taskJPsiHf.cxx
/// \brief Task for the analysis of J/psi - open HF associate production
/// \author Luca Micheletti <luca.micheletti@to.infn.it>, INFN
/// \author Fabrizio Grosa <fabrizio.grosa@cern.ch>, CERN

Check failure on line 15 in PWGDQ/Tasks/taskJpsiHf.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

#include <string>

Expand All @@ -38,9 +38,9 @@
// pT differential BDT cuts
namespace bdtcuts
{
static constexpr int nBinsPt = 14;

Check failure on line 41 in PWGDQ/Tasks/taskJpsiHf.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/constexpr-constant]

Use UpperCamelCase for names of constexpr constants. Names of special constants may be prefixed with "k".
constexpr float binsPt[nBinsPt + 1] = {0.0f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 10.0f, 12.0f, 16.0f, 24.0f, 36.0f, 1000.0f};

Check failure on line 42 in PWGDQ/Tasks/taskJpsiHf.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/constexpr-constant]

Use UpperCamelCase for names of constexpr constants. Names of special constants may be prefixed with "k".
constexpr float bdtCuts[nBinsPt][3] = {{1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}, {1., 0., 0.}};

Check failure on line 43 in PWGDQ/Tasks/taskJpsiHf.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/constexpr-constant]

Use UpperCamelCase for names of constexpr constants. Names of special constants may be prefixed with "k".
static const std::vector<std::string> labelsPt{};
static const std::vector<std::string> labelsCutsBdt = {"BDT background", "BDT prompt", "BDT nonprompt"};
} // namespace bdtcuts
Expand All @@ -50,7 +50,7 @@
using MyRedPairCandidatesSelected = aod::RedJpDmDileptons;
using MyRedD0CandidatesSelected = soa::Join<aod::RedJpDmDmesons, aod::RedJpDmD0Masss, aod::RedJpDmDmesBdts, aod::RedJpDmDmDau0s, aod::RedJpDmDmDau1s>;

struct taskJPsiHf {

Check failure on line 53 in PWGDQ/Tasks/taskJpsiHf.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/struct]

Use UpperCamelCase for names of structs.
//
// This task combines dilepton candidates with a open charm hadron
//
Expand Down Expand Up @@ -97,15 +97,16 @@
float deltaRap = -999;
float deltaPhi = -999;

for (auto& dilepton : dileptons) {
for (auto const& dilepton : dileptons) {
ptDilepton = RecoDecay::pt(dilepton.px(), dilepton.py());
rapDilepton = RecoDecay::y(std::array{dilepton.px(), dilepton.py(), dilepton.pz()}, constants::physics::MassJPsi);
phiDilepton = RecoDecay::phi(dilepton.px(), dilepton.py());

for (auto& dmeson : dmesons) {
for (auto const& dmeson : dmesons) {
ptDmeson = RecoDecay::pt(dmeson.px(), dmeson.py());
phiDmeson = RecoDecay::phi(dmeson.px(), dmeson.py());
deltaPhi = RecoDecay::constrainAngle(phiDilepton - phiDmeson, -o2::constants::math::PIHalf);
float absDeltaPhiRaw = std::abs(phiDilepton - phiDmeson);
deltaPhi = (absDeltaPhiRaw < o2::constants::math::PI) ? absDeltaPhiRaw : o2::constants::math::TwoPI - absDeltaPhiRaw;

auto ptBinDmesForBdt = findBin(binsPtDmesForBdt, ptDmeson);
if (ptBinDmesForBdt == -1) {
Expand Down Expand Up @@ -144,7 +145,7 @@
void processRedJspiD0(MyRedEvents const& events, MyRedPairCandidatesSelected const& dileptons, MyRedD0CandidatesSelected const& dmesons)
{
// Fill the column of collisions with pairs
for (auto& event : events) {

Check failure on line 148 in PWGDQ/Tasks/taskJpsiHf.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
hCollisions->Fill(1.f);
auto groupedDileptonCandidates = dileptons.sliceBy(perCollisionDilepton, event.index());
auto groupedDmesonCandidates = dmesons.sliceBy(perCollisionDmeson, event.index());
Expand Down
Loading