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: 12 additions & 5 deletions PWGLF/TableProducer/Strangeness/v0selector.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/Strangeness/v0selector.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 @@ -11,7 +11,7 @@

/// \brief Task to select V0s based on cuts
///
/// \author Gijs van Weelden <g.van.weelden@cern.ch>

Check failure on line 14 in PWGLF/TableProducer/Strangeness/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

#include <vector>
#include <string>
Expand All @@ -36,9 +36,13 @@
struct V0SelectorTask {
Produces<aod::V0SignalFlags> v0FlagTable;

Configurable<bool> selectK0S{"selectK0S", true, "Check V0s for K0S cuts"};
Configurable<bool> selectLambda{"selectLambda", true, "Check V0s for Lambda cuts"};
Configurable<bool> selectAntiLambda{"selectAntiLambda", true, "Check V0s for AntiLambda cuts"};

Configurable<std::vector<float>> K0SPtBins{"K0SPtBins", {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 10.0, 15.0, 20.0, 25.0, 30.0}, "K0S pt Vals"};

Check failure on line 43 in PWGLF/TableProducer/Strangeness/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
Configurable<std::vector<float>> K0SRminVals{"K0SRminVals", {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}, "K0S min R values"};

Check failure on line 44 in PWGLF/TableProducer/Strangeness/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
Configurable<std::vector<float>> K0SRmaxVals{"K0SRmaxVals", {40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0}, "K0S max R values"};

Check failure on line 45 in PWGLF/TableProducer/Strangeness/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
Configurable<std::vector<float>> K0SCtauminVals{"K0SCtauminVals", {-1e3, -1e3, -1e3, -1e3, -1e3, -1e3, -1e3, -1e3, -1e3, -1e3}, "K0S min ctau values"};
Configurable<std::vector<float>> K0SCtaumaxVals{"K0SCtaumaxVals", {20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0}, "K0S max ctau values"};
Configurable<std::vector<float>> K0SCosPAminVals{"K0SCosPAminVals", {0.997, 0.997, 0.997, 0.997, 0.997, 0.997, 0.997, 0.997, 0.997, 0.997}, "K0S min cosPA values"};
Expand Down Expand Up @@ -85,7 +89,7 @@
Configurable<std::vector<float>> AntiLambdaMassLowVals{"AntiLambdaMassLowVals", {1.08, 1.08, 1.08, 1.08, 1.08, 1.08, 1.08, 1.08}, "AntiLambda mass cut lower values (MeV)"};
Configurable<std::vector<float>> AntiLambdaMassHighVals{"AntiLambdaMassHighVals", {1.125, 1.125, 1.125, 1.125, 1.125, 1.125, 1.125, 1.125}, "AntiLambda mass cut upper values (MeV)"};

Configurable<bool> randomSelection{"randomSelection", true, "Randomly select V0s"};
Configurable<bool> randomSelection{"randomSelection", false, "Randomly select V0s"};
Configurable<std::vector<float>> K0SFraction{"K0SFraction", {2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0}, "Fraction of K0S to randomly select"};
Configurable<std::vector<float>> LambdaFraction{"LambdaFraction", {2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0}, "Fraction of Lambda to randomly select"};
Configurable<std::vector<float>> AntiLambdaFraction{"AntiLambdaFraction", {2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0}, "Fraction of AntiLambda to randomly select"};
Expand Down Expand Up @@ -115,9 +119,9 @@
float min = mincuts.at(i);
float max = maxcuts.at(i);

if (val < min && min > -1e2)

Check failure on line 122 in PWGLF/TableProducer/Strangeness/v0selector.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 false;
if (val > max && max > -1e2)

Check failure on line 124 in PWGLF/TableProducer/Strangeness/v0selector.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 false;
}
return true;
Expand Down Expand Up @@ -160,7 +164,7 @@
float dcadmax = K0SDCAdmaxVals->at(ptBin);

float ctau = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short;
std::vector<float> vals = {v0.v0radius(), ctau, v0.v0cosPA(), v0.dcaV0daughters(), TMath::Abs(v0.dcapostopv()), TMath::Abs(v0.dcanegtopv())};

Check failure on line 167 in PWGLF/TableProducer/Strangeness/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
std::vector<float> mincuts = {rmin, ctaumin, cospamin, dcadmin, dcapmin, dcanmin};
std::vector<float> maxcuts = {rmax, ctaumax, cospamax, dcadmax, dcapmax, dcanmax};

Expand Down Expand Up @@ -201,7 +205,7 @@
float dcadmax = LambdaDCAdmaxVals->at(ptBin);

float ctau = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0;
std::vector<float> vals = {v0.v0radius(), ctau, v0.v0cosPA(), v0.dcaV0daughters(), TMath::Abs(v0.dcapostopv()), TMath::Abs(v0.dcanegtopv())};

Check failure on line 208 in PWGLF/TableProducer/Strangeness/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
std::vector<float> mincuts = {rmin, ctaumin, cospamin, dcadmin, dcapmin, dcanmin};
std::vector<float> maxcuts = {rmax, ctaumax, cospamax, dcadmax, dcapmax, dcanmax};

Expand Down Expand Up @@ -241,7 +245,7 @@
float dcadmax = AntiLambdaDCAdmaxVals->at(ptBin);

float ctau = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0;
std::vector<float> vals = {v0.v0radius(), ctau, v0.v0cosPA(), v0.dcaV0daughters(), TMath::Abs(v0.dcapostopv()), TMath::Abs(v0.dcanegtopv())};

Check failure on line 248 in PWGLF/TableProducer/Strangeness/v0selector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
std::vector<float> mincuts = {rmin, ctaumin, cospamin, dcadmin, dcapmin, dcanmin};
std::vector<float> maxcuts = {rmax, ctaumax, cospamax, dcadmax, dcapmax, dcanmax};

Expand Down Expand Up @@ -277,13 +281,16 @@
{
for (const auto& v0 : v0s) {
uint8_t flag = 0;
flag += K0SCuts(collision, v0) * aod::v0flags::FK0S;
flag += LambdaCuts(collision, v0) * aod::v0flags::FLAMBDA;
flag += AntiLambdaCuts(collision, v0) * aod::v0flags::FANTILAMBDA;
if (selectK0S)
flag += K0SCuts(collision, v0) * aod::v0flags::FK0S;
if (selectLambda)
flag += LambdaCuts(collision, v0) * aod::v0flags::FLAMBDA;
if (selectAntiLambda)
flag += AntiLambdaCuts(collision, v0) * aod::v0flags::FANTILAMBDA;

if (flag == 0)
flag += aod::v0flags::FREJECTED;
else
else if (randomSelection)
flag += RandomlyReject(v0, flag) * aod::v0flags::FREJECTED;

v0FlagTable(flag);
Expand Down
Loading