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
17 changes: 15 additions & 2 deletions PWGLF/TableProducer/Nuspex/he3HadronFemto.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 PWGLF/TableProducer/Nuspex/he3HadronFemto.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.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -49,7 +49,7 @@
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/Track.h"

#include <TDatabasePDG.h>

Check failure on line 52 in PWGLF/TableProducer/Nuspex/he3HadronFemto.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
#include <TDirectory.h>
#include <TFile.h>
#include <TH1F.h>
Expand Down Expand Up @@ -129,6 +129,8 @@
{0.0021, 1.1122, 0.0021} // Pr
};

std::array<float, 2> kHePidTrkParams = {0.1593, -0.0445};

} // namespace

struct He3HadCandidate {
Expand Down Expand Up @@ -472,6 +474,15 @@
return true;
}

template <typename Ttrack>
float correctPtHe3TrackedAsTriton(const Ttrack& candidate)
{
if (candidate.pt() < 2.5 && candidate.pidForTracking() == o2::track::PID::Triton)

Check failure on line 480 in PWGLF/TableProducer/Nuspex/he3HadronFemto.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.
return candidate.pt() * 2. * (1. - kHePidTrkParams[0] - kHePidTrkParams[1] * candidate.pt() * 2.);

return candidate.pt() * 2.;
}

float computeNsigmaDCA(const float pt, const float dca, const int iSpecies, const char* dcaType = "xy")
{

Expand Down Expand Up @@ -636,7 +647,7 @@
std::array<float, 3> collisionVertex = getCollisionVertex(collisions, collIdx);
const auto& pca = mFitter.getPCACandidate();
float distance = defaultTodistance;
for (int i = 0; i < 3; i++) {

Check failure on line 650 in PWGLF/TableProducer/Nuspex/he3HadronFemto.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.
distance += (pca[i] - collisionVertex[i]) * (pca[i] - collisionVertex[i]);
}
if (distanceMin < 0 || distance < distanceMin) {
Expand All @@ -658,7 +669,7 @@
std::array<float, 3> collisionVertex = getCollisionVertex(collisions, he3Hadcand.collisionID);

he3Hadcand.momHe3 = std::array{trackHe3.px(), trackHe3.py(), trackHe3.pz()};
for (int i = 0; i < 3; i++)

Check failure on line 672 in PWGLF/TableProducer/Nuspex/he3HadronFemto.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.
he3Hadcand.momHe3[i] = he3Hadcand.momHe3[i] * 2;
he3Hadcand.momHad = std::array{trackHad.px(), trackHad.py(), trackHad.pz()};
float invMass = CommonInite;
Expand Down Expand Up @@ -1337,7 +1348,9 @@
if (!selectTrack(track, Species::kHe3) || !selectDcaNsigmaCut(track, Species::kHe3))
continue;

mQaRegistry.fill(HIST("He3/hHe3Pt"), track.pt() * 2.f);
const float ptHe3Corrected = correctPtHe3TrackedAsTriton(track);

mQaRegistry.fill(HIST("He3/hHe3Pt"), ptHe3Corrected);
mQaRegistry.fill(HIST("He3/hDCAxyHe3"), track.dcaXY());
mQaRegistry.fill(HIST("He3/hDCAzHe3"), track.dcaZ());

Expand All @@ -1348,7 +1361,7 @@
}

const float nSigmaHe3 = computeNSigmaHe3(track);
mQaRegistry.fill(HIST("He3/h2NsigmaHe3TPC_preselection"), track.sign() * 2 * track.pt(), nSigmaHe3);
mQaRegistry.fill(HIST("He3/h2NsigmaHe3TPC_preselection"), track.sign() * ptHe3Corrected, nSigmaHe3);
}
}
PROCESS_SWITCH(he3HadronFemto, processPurity, "Process for purity studies", false);
Expand Down
Loading