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
58 changes: 32 additions & 26 deletions PWGLF/Tasks/Strangeness/lambdalambda.cxx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
Expand All @@ -9,7 +9,7 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

/// \author Junlee Kim (jikim1290@gmail.com)

Check warning on line 12 in PWGLF/Tasks/Strangeness/lambdalambda.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check warning on line 12 in PWGLF/Tasks/Strangeness/lambdalambda.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

#include <cmath>
#include <array>
Expand Down Expand Up @@ -118,11 +118,16 @@
Configurable<float> cfgV0V0RapMax{"cfgV0V0RapMax", 0.5, "rapidity selection for V0V0"};

Configurable<bool> cfgV0V0Sel{"cfgV0V0Sel", false, "application of V0V0 selections"};
Configurable<float> cfgV0V0Radius{"cfgV0V0Radius", 1.0, "maximum radius of v0v0"};
Configurable<float> cfgV0V0CPA{"cfgV0V0CPA", 0.6, "minimum CPA of v0v0"};
Configurable<float> cfgV0V0Distance{"cfgV0V0Distance", 1, "minimum distance of v0v0"};
Configurable<float> cfgV0V0DCAR{"cfgV0V0DCAR", 1.0, "maximum DCA of v0v0 R"};
Configurable<float> cfgV0V0DCAZ{"cfgV0V0DCAZ", 1.0, "maximum DCA of v0v0 Z"};

Configurable<float> cfgV0V0RadiusMin{"cfgV0V0RadiusMin", 1.0, "maximum radius of v0v0"};
Configurable<float> cfgV0V0CPAMin{"cfgV0V0CPAMin", 0.6, "minimum CPA of v0v0"};
Configurable<float> cfgV0V0DistanceMin{"cfgV0V0DistanceMin", 1, "minimum distance of v0v0"};
Configurable<float> cfgV0V0DCAMin{"cfgV0V0DCAMin", 1.0, "maximum DCA of v0v0 R"};

Configurable<float> cfgV0V0RadiusMax{"cfgV0V0RadiusMax", 1.0, "maximum radius of v0v0"};
Configurable<float> cfgV0V0CPAMax{"cfgV0V0CPAMax", 0.6, "maximum CPA of v0v0"};
Configurable<float> cfgV0V0DistanceMax{"cfgV0V0DistanceMax", 1, "maximum distance of v0v0"};
Configurable<float> cfgV0V0DCAMax{"cfgV0V0DCAMax", 1.0, "maximum DCA of v0v0 R"};

Configurable<bool> cfgEffCor{"cfgEffCor", false, "flag to apply efficiency correction"};
Configurable<std::string> cfgEffCorPath{"cfgEffCorPath", "", "path for pseudo efficiency correction"};
Expand All @@ -136,7 +141,7 @@
ConfigurableAxis centAxis{"centAxis", {VARIABLE_WIDTH, 0, 10, 20, 50, 100}, "Centrality interval"};
ConfigurableAxis vertexAxis{"vertexAxis", {10, -10, 10}, "vertex axis for mixing"};

ConfigurableAxis RadiusAxis{"RadiusAxis", {100, 0, 5}, "radius of v0v0"};

Check warning on line 144 in PWGLF/Tasks/Strangeness/lambdalambda.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
ConfigurableAxis CPAAxis{"CPAAxis", {102, -1.02, 1.02}, "CPA of v0v0"};
ConfigurableAxis DistanceAxis{"DistanceAxis", {100, 0, 10}, "distance of v0v0"};
ConfigurableAxis DCARAxis{"DCARAxis", {100, 0, 2}, "DCA of v0v0R"};
Expand Down Expand Up @@ -289,22 +294,28 @@
template <typename V01, typename V02>
bool isSelectedV0V0(V01 const& v01, V02 const& v02)
{
if (std::sqrt(getDCAofV0V0(v01, v02).perp2()) > cfgV0V0DCAR)
if (getDCAofV0V0(v01, v02) > cfgV0V0DCAMax)
return false;
if (getDCAofV0V0(v01, v02) < cfgV0V0DCAMin)
return false;
if (getDCAofV0V0(v01, v02).z() > cfgV0V0DCAZ)
if (getCPA(v01, v02) > cfgV0V0CPAMax)
return false;
if (getCPA(v01, v02) < cfgV0V0CPA)
if (getCPA(v01, v02) < cfgV0V0CPAMin)
return false;
if (getDistance(v01, v02) > cfgV0V0Distance)
if (getDistance(v01, v02) > cfgV0V0DistanceMax)
return false;
if (getRadius(v01, v02) > cfgV0V0Radius)
if (getDistance(v01, v02) < cfgV0V0DistanceMin)
return false;
if (getRadius(v01, v02) > cfgV0V0RadiusMax)
return false;
if (getRadius(v01, v02) < cfgV0V0RadiusMin)
return false;

return true;
}

template <typename V01, typename V02>
ROOT::Math::XYZVector getDCAofV0V0(V01 const& v01, V02 const& v02)
float getDCAofV0V0(V01 const& v01, V02 const& v02)
{
ROOT::Math::XYZVector v01pos, v02pos, v01mom, v02mom;
v01pos.SetXYZ(v01.x(), v01.y(), v01.z());
Expand All @@ -315,7 +326,7 @@
ROOT::Math::XYZVector posdiff = v02pos - v01pos;
ROOT::Math::XYZVector cross = v01mom.Cross(v02mom);
ROOT::Math::XYZVector dcaVec = (posdiff.Dot(cross) / cross.Mag2()) * cross;
return dcaVec;
return std::sqrt(dcaVec.Mag2());
}

template <typename V01, typename V02>
Expand Down Expand Up @@ -347,7 +358,7 @@
v02mom.SetXYZ(v02.px() / v02.p(), v02.py() / v02.p(), v02.pz() / v02.p());
ROOT::Math::XYZVector posdiff = v02pos - v01pos;

float d = 1. - TMath::Power(v01mom.Dot(v02mom), 2);

Check warning on line 361 in PWGLF/Tasks/Strangeness/lambdalambda.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root-entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
if (d < 1e-5)
return 999;
float t = posdiff.Dot(v01mom - v01mom.Dot(v02mom) * v02mom) / d;
Expand All @@ -363,7 +374,7 @@
IsTriggered = false;
IsSelected = false;

for (auto& v01 : V01s) {

Check warning on line 377 in PWGLF/Tasks/Strangeness/lambdalambda.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.
auto postrack_v01 = v01.template posTrack_as<TrackCandidates>();
auto negtrack_v01 = v01.template negTrack_as<TrackCandidates>();

Expand Down Expand Up @@ -396,7 +407,7 @@
RecoV01 = ROOT::Math::PxPyPzMVector(v01.px(), v01.py(), v01.pz(), v01.mAntiLambda());
}

for (auto& v02 : V02s) {

Check warning on line 410 in PWGLF/Tasks/Strangeness/lambdalambda.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.
if (v01.v0Id() <= v02.v0Id() && doprocessDataSame)
continue;
auto postrack_v02 = v02.template posTrack_as<TrackCandidates>();
Expand Down Expand Up @@ -445,32 +456,27 @@
histos.fill(HIST("Radius_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getRadius(v01, v02), V01Tag + V02Tag);
histos.fill(HIST("CPA_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getCPA(v01, v02), V01Tag + V02Tag);
histos.fill(HIST("Distance_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getDistance(v01, v02), V01Tag + V02Tag);
histos.fill(HIST("DCAR_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), std::sqrt(getDCAofV0V0(v01, v02).perp2()), V01Tag + V02Tag);
histos.fill(HIST("DCAZ_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getDCAofV0V0(v01, v02).z(), V01Tag + V02Tag);
histos.fill(HIST("DCA_V0V0_full"), RecoV0V0.M(), RecoV0V0.Pt(), getDCAofV0V0(v01, v02), V01Tag + V02Tag);

if (isSelectedV0V0(v01, v02)) {
histos.fill(HIST("Radius_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getRadius(v01, v02), V01Tag + V02Tag);
histos.fill(HIST("CPA_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getCPA(v01, v02), V01Tag + V02Tag);
histos.fill(HIST("Distance_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getDistance(v01, v02), V01Tag + V02Tag);
histos.fill(HIST("DCAR_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), std::sqrt(getDCAofV0V0(v01, v02).perp2()), V01Tag + V02Tag);
histos.fill(HIST("DCAZ_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getDCAofV0V0(v01, v02).z(), V01Tag + V02Tag);
histos.fill(HIST("DCA_V0V0_sel"), RecoV0V0.M(), RecoV0V0.Pt(), getDCAofV0V0(v01, v02), V01Tag + V02Tag);
IsSelected = true;
}

if (doprocessDataSame) {
histos.fill(HIST("h_InvMass_same"), RecoV0V0.M(), RecoV0V0.Pt(), centrality, V01Tag + V02Tag);
if (cfgV0V0Sel && isSelectedV0V0(v01, v02)) {
histos.fill(HIST("h_InvMass_same_sel"), RecoV0V0.M(), RecoV0V0.Pt(), centrality, V01Tag + V02Tag);
}
if (cfgRotBkg) {
for (int nr = 0; nr < cfgNRotBkg; nr++) {
auto RanPhi = rn->Uniform(o2::constants::math::PI * 5.0 / 6.0, o2::constants::math::PI * 7.0 / 6.0);
RanPhi += RecoV02.Phi();
RecoV02Rot = ROOT::Math::PxPyPzMVector(RecoV02.Pt() * std::cos(RanPhi), RecoV02.Pt() * std::sin(RanPhi), RecoV02.Pz(), RecoV02.M());
RecoV0V0Rot = RecoV01 + RecoV02Rot;
histos.fill(HIST("h_InvMass_rot"), RecoV0V0Rot.M(), RecoV0V0Rot.Pt(), centrality, V01Tag + V02Tag);
if (cfgV0V0Sel && isSelectedV0V0(v01, v02)) {
histos.fill(HIST("h_InvMass_rot_sel"), RecoV0V0Rot.M(), RecoV0V0Rot.Pt(), centrality, V01Tag + V02Tag);
if (cfgRotBkg) {
for (int nr = 0; nr < cfgNRotBkg; nr++) {
auto RanPhi = rn->Uniform(o2::constants::math::PI * 5.0 / 6.0, o2::constants::math::PI * 7.0 / 6.0);
RanPhi += RecoV02.Phi();
RecoV02Rot = ROOT::Math::PxPyPzMVector(RecoV02.Pt() * std::cos(RanPhi), RecoV02.Pt() * std::sin(RanPhi), RecoV02.Pz(), RecoV02.M());
RecoV0V0Rot = RecoV01 + RecoV02Rot;
histos.fill(HIST("h_InvMass_rot"), RecoV0V0Rot.M(), RecoV0V0Rot.Pt(), centrality, V01Tag + V02Tag);
}
}
}
Expand All @@ -491,7 +497,7 @@
{
if (cfgCentEst == 1) {
centrality = collision.centFT0C();
} else if (cfgCentEst == 2) {

Check warning on line 500 in PWGLF/Tasks/Strangeness/lambdalambda.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.
centrality = collision.centFT0M();
}
histos.fill(HIST("hEventstat"), 0.5);
Expand Down Expand Up @@ -525,10 +531,10 @@
auto tracksTuple = std::make_tuple(V0s);
BinningTypeVertexContributor binningOnPositions{{vertexAxis, centAxis}, true};
SameKindPair<EventCandidates, V0TrackCandidate, BinningTypeVertexContributor> pair{binningOnPositions, cfgNoMixedEvents, -1, collisions, tracksTuple, &cache};
for (auto& [c1, tracks1, c2, tracks2] : pair) {

Check warning on line 534 in PWGLF/Tasks/Strangeness/lambdalambda.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.
if (cfgCentEst == 1) {
centrality = c1.centFT0C();
} else if (cfgCentEst == 2) {

Check warning on line 537 in PWGLF/Tasks/Strangeness/lambdalambda.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.
centrality = c1.centFT0M();
}
if (!eventSelected(c1))
Expand Down
Loading