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
45 changes: 25 additions & 20 deletions ALICE3/Tasks/alice3-strangeness.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/Tasks/alice3-strangeness.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/Tasks/alice3-strangeness.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 @@ -46,7 +46,7 @@

#include <TGenPhaseSpace.h>
#include <TGeoGlobalMagField.h>
#include <TLorentzVector.h>

Check failure on line 49 in ALICE3/Tasks/alice3-strangeness.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.

Check failure on line 49 in ALICE3/Tasks/alice3-strangeness.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include <TPDGCode.h>
#include <TRandom3.h>

Expand All @@ -67,7 +67,7 @@
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};

Configurable<int> idGeometry{"idGeometry", 0, "geometry ID used for propagation"};
struct ConfigurableGroup {
struct : ConfigurableGroup {
ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "pt axis for QA histograms"};
ConfigurableAxis axisK0Mass{"axisK0Mass", {200, 0.4f, 0.6f}, ""};
ConfigurableAxis axisLambdaMass{"axisLambdaMass", {200, 1.08f, 1.2f}, ""};
Expand All @@ -77,10 +77,11 @@
ConfigurableAxis axisDCAV0Daughters{"axisDCAV0Daughters", {20, 0, 5}, "DCA V0 daughters"};
ConfigurableAxis axisPointingAngle{"axisPointingAngle", {40, 0.0f, 0.4f}, "pointing angle "};
ConfigurableAxis axisProperLifeTime{"axisProperLifeTime", {100, 0.0f, 100.0f}, "proper lifetime (cm)"};

ConfigurableAxis axisEta{"axisEta", {100, -5.0f, 5.0f}, "eta"};
} histAxes;

struct : ConfigurableGroup {
std::string prefix = "selectionFlags";
Configurable<bool> applyRapiditySelection{"applyRapiditySelection", true, "apply rapidity selection"};
Configurable<bool> applyDCAdaughterSelection{"applyDCADaughterSelection", true, "apply DCA daughter selection"};
Configurable<bool> applyCosOfPAngleSelection{"applyCosOfPAngleSelection", true, "apply cosine of pointing angle selection"};
Expand All @@ -94,6 +95,7 @@
} selectionFlags;

struct : ConfigurableGroup {
std::string prefix = "selectionValues";
Configurable<float> yK0Selection{"yK0Selection", 0.5f, "rapidity selection for K0"};
Configurable<float> yLambdaSelection{"yLambdaSelection", 0.5f, "rapidity selection for Lambda"};
Configurable<float> dcaDaughterSelection{"dcaDaughterSelection", 1.0f, "DCA daughter selection"};
Expand Down Expand Up @@ -122,8 +124,9 @@
histos.add("K0/hDCAPosDaughter", "", kTH1D, {{200, -5, 5}});
histos.add("hPVz", "hPVz", kTH1F, {histAxes.axisVertexZ});
histos.add("hV0CandidateCounter", "hV0CandidateCounter", kTH1F, {{11, 0, 11}});
histos.add("reconstructedCandidates/K0/hMass", "hMass", kTH2D, {histAxes.axisK0Mass, histAxes.axisPt});
histos.add("reconstructedCandidates/Lambda/hMass", "hMass", kTH2D, {histAxes.axisLambdaMass, histAxes.axisPt});
histos.add("reconstructedCandidates/hEtaDaughters", "hEtaDaughters", kTH1F, {histAxes.axisEta});
histos.add("reconstructedCandidates/K0/hMass", "hMass", kTH3D, {histAxes.axisK0Mass, histAxes.axisPt, histAxes.axisEta});
histos.add("reconstructedCandidates/Lambda/hMass", "hMass", kTH3D, {histAxes.axisLambdaMass, histAxes.axisPt, histAxes.axisEta});
histos.add("reconstructedCandidates/hArmeterosBeforeAllSelections", "hArmeterosBeforeAllSelections", kTH2D, {{100, -1.0f, 1.0f}, {100, 0.0f, 0.25f}});
histos.add("reconstructedCandidates/hArmeterosAfterAllSelections", "hArmeterosAfterAllSelections", kTH2D, {{100, -1.0f, 1.0f}, {100, 0.0f, 0.25f}});
if (selectionFlags.doQAforSelectionVariables) {
Expand Down Expand Up @@ -185,19 +188,19 @@
histos.fill(HIST("K0/hSelections"), 0); // all candidates
histos.fill(HIST("K0/hDCANegDaughter"), negV0Daughter.dcaXY());
histos.fill(HIST("K0/hDCAPosDaughter"), posV0Daughter.dcaXY());
if (std::abs(negV0Daughter.dcaXY()) < 0.05)

Check failure on line 191 in ALICE3/Tasks/alice3-strangeness.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.

Check failure on line 191 in ALICE3/Tasks/alice3-strangeness.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;
histos.fill(HIST("K0/hSelections"), 1); // dcaXY cut
if (std::abs(posV0Daughter.dcaXY()) < 0.05)

Check failure on line 194 in ALICE3/Tasks/alice3-strangeness.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.

Check failure on line 194 in ALICE3/Tasks/alice3-strangeness.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;
histos.fill(HIST("K0/hSelections"), 2); // dcaXY cut
if (v0Cand.dcaV0Daughters() > 1.0)
continue;
histos.fill(HIST("K0/hSelections"), 3); // dca between daughters
if (v0Cand.v0Radius() < 0.5)

Check failure on line 200 in ALICE3/Tasks/alice3-strangeness.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.

Check failure on line 200 in ALICE3/Tasks/alice3-strangeness.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;
histos.fill(HIST("K0/hSelections"), 4); // radius cut
if (std::abs(negV0Daughter.eta()) > 0.8 || std::abs(posV0Daughter.eta()) > 0.8)

Check failure on line 203 in ALICE3/Tasks/alice3-strangeness.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.

Check failure on line 203 in ALICE3/Tasks/alice3-strangeness.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;
histos.fill(HIST("K0/hSelections"), 5); // eta cut
histos.fill(HIST("K0/hMassSelected"), v0Cand.mK0(), v0Cand.pt());
Expand All @@ -210,33 +213,33 @@
// if(collision.lutConfigId()!=idGeometry)
// return;
for (auto const& v0 : v0Candidates) {
bool isK0 = (v0.mK0Short() - o2::constants::physics::MassK0Short) < 0.3;

Check failure on line 216 in ALICE3/Tasks/alice3-strangeness.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.

Check failure on line 216 in ALICE3/Tasks/alice3-strangeness.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.
bool isLambda = (v0.mLambda() - o2::constants::physics::MassLambda0) < 0.2;

Check failure on line 217 in ALICE3/Tasks/alice3-strangeness.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.

Check failure on line 217 in ALICE3/Tasks/alice3-strangeness.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.
bool isAntiLambda = (v0.mAntiLambda() - o2::constants::physics::MassLambda0) < 0.2;

Check failure on line 218 in ALICE3/Tasks/alice3-strangeness.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.

Check failure on line 218 in ALICE3/Tasks/alice3-strangeness.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.

histos.fill(HIST("reconstructedCandidates/hArmeterosBeforeAllSelections"), v0.alpha(), v0.qtarm());
histos.fill(HIST("hV0CandidateCounter"), 1);
histos.fill(HIST("hV0CandidateCounter"), 0.5);
if (selectionFlags.applyRapiditySelection) {
if (isK0 && std::abs(v0.yK0Short()) < selectionValues.yK0Selection)
if (isK0 && std::abs(v0.yK0Short()) > selectionValues.yK0Selection)
continue;
if ((isLambda || isAntiLambda) && std::abs(v0.yLambda()) < selectionValues.yLambdaSelection)
continue;
}
histos.fill(HIST("hV0CandidateCounter"), 2);
histos.fill(HIST("hV0CandidateCounter"), 1.5);
if (selectionFlags.applyDCAdaughterSelection) {
if (std::abs(v0.dcaV0Daughters()) > selectionValues.dcaDaughterSelection)
continue;
} else {
selectionCheck = v0.dcaV0Daughters();
}
histos.fill(HIST("hV0CandidateCounter"), 3);
histos.fill(HIST("hV0CandidateCounter"), 2.5);
if (selectionFlags.applyCosOfPAngleSelection) {
if (v0.cosPA() < selectionValues.cosPAngleSelection)
continue;
} else {
selectionCheck = std::acos(v0.cosPA());
}
histos.fill(HIST("hV0CandidateCounter"), 4);
histos.fill(HIST("hV0CandidateCounter"), 3.5);
if (selectionFlags.applyDCAdaughtersToPVSelection) {
if ((std::abs(v0.dcaNegToPV()) < selectionValues.dcaDaughtersToPVSelection) ||
(std::abs(v0.dcaPosToPV()) < selectionValues.dcaDaughtersToPVSelection))
Expand All @@ -245,21 +248,21 @@
selectionCheckPos = std::abs(v0.dcaPosToPV());
selectionCheck = std::abs(v0.dcaNegToPV());
}
histos.fill(HIST("hV0CandidateCounter"), 5);
histos.fill(HIST("hV0CandidateCounter"), 4.5);
if (selectionFlags.applyV0RadiusSelection) {
if (v0.v0radius() < selectionValues.v0RadiusSelection)
continue;
} else {
selectionCheck = v0.v0radius();
}
histos.fill(HIST("hV0CandidateCounter"), 6);
histos.fill(HIST("hV0CandidateCounter"), 5.5);
if (isK0) {
if (selectionFlags.applyArmenterosSelection) {
if (v0.qtarm() < selectionValues.armenterosSelection * std::abs(v0.alpha()))
continue;
}
}
histos.fill(HIST("hV0CandidateCounter"), 7);
histos.fill(HIST("hV0CandidateCounter"), 6.5);
if (isK0 && selectionFlags.applyCompetingMassRejection) {
if (std::abs(v0.mLambda() - o2::constants::physics::MassLambda0) < selectionValues.competingMassRejectionK0)
continue;
Expand All @@ -270,7 +273,7 @@
if (std::abs(v0.mK0Short() - o2::constants::physics::MassK0Short) < selectionValues.competingMassRejectionLambda)
continue;
}
histos.fill(HIST("hV0CandidateCounter"), 8);
histos.fill(HIST("hV0CandidateCounter"), 7.5);
if (selectionFlags.applyLifetimeSelection) {
if (isK0 && v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short < selectionValues.lifetimecutak0)
continue;
Expand All @@ -282,21 +285,23 @@
else
selectionCheck = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0;
}
histos.fill(HIST("hV0CandidateCounter"), 9);
histos.fill(HIST("hV0CandidateCounter"), 8.5);
auto posTrack = v0.template posTrack_as<alice3tracks>();
auto negTrack = v0.template negTrack_as<alice3tracks>();
if (selectionFlags.applyEtaDaughterSelection) {
auto posTrack = v0.template posTrack_as<alice3tracks>();
auto negTrack = v0.template negTrack_as<alice3tracks>();
if (std::abs(posTrack.eta()) > selectionValues.etaDaughterSelection || std::abs(negTrack.eta()) > selectionValues.etaDaughterSelection)
continue;
}
histos.fill(HIST("hV0CandidateCounter"), 10);
histos.fill(HIST("reconstructedCandidates/hEtaDaughters"), posTrack.eta());
histos.fill(HIST("reconstructedCandidates/hEtaDaughters"), negTrack.eta());
histos.fill(HIST("hV0CandidateCounter"), 9.5);

histos.fill(HIST("reconstructedCandidates/hArmeterosAfterAllSelections"), v0.alpha(), v0.qtarm());
if (selectionFlags.doQAforSelectionVariables) {
static_for<0, 5>([&](auto i) {
constexpr int In = i.value;
if (TESTBIT(AppliedSelectionCheckMask, In)) {
if (In == 3)

Check failure on line 304 in ALICE3/Tasks/alice3-strangeness.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.

Check failure on line 304 in ALICE3/Tasks/alice3-strangeness.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.
selectionCheck = selectionCheckPos;
if (isK0)
histos.fill(HIST("reconstructedCandidates/K0/h") + HIST(kSelectionNames[In]), v0.mK0Short(), v0.pt(), selectionCheck);
Expand All @@ -308,11 +313,11 @@
});
}
if (isK0)
histos.fill(HIST("reconstructedCandidates/K0/hMass"), v0.mK0Short(), v0.pt());
histos.fill(HIST("reconstructedCandidates/K0/hMass"), v0.mK0Short(), v0.pt(), v0.eta());
if (isLambda)
histos.fill(HIST("reconstructedCandidates/Lambda/hMass"), v0.mLambda(), v0.pt());
histos.fill(HIST("reconstructedCandidates/Lambda/hMass"), v0.mLambda(), v0.pt(), v0.eta());
if (isAntiLambda)
histos.fill(HIST("reconstructedCandidates/AntiLambda/hMass"), v0.mAntiLambda(), v0.pt());
histos.fill(HIST("reconstructedCandidates/AntiLambda/hMass"), v0.mAntiLambda(), v0.pt(), v0.eta());
}
}
PROCESS_SWITCH(alice3strangeness, processAllFindableCandidates, "", false);
Expand Down
Loading