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
73 changes: 34 additions & 39 deletions PWGLF/Tasks/Strangeness/lambdaTwoPartPolarization.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/Tasks/Strangeness/lambdaTwoPartPolarization.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 @@ -9,53 +9,48 @@
// 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 failure on line 12 in PWGLF/Tasks/Strangeness/lambdaTwoPartPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check failure on line 12 in PWGLF/Tasks/Strangeness/lambdaTwoPartPolarization.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>
#include <cstdlib>
#include <chrono>
#include <string>
#include <vector>
#include "PWGLF/DataModel/LFStrangenessTables.h"

#include "TLorentzVector.h"
#include "TRandom3.h"
#include "TF1.h"
#include "TVector3.h"
#include "Math/Vector3D.h"
#include "Math/Vector4D.h"
#include "Math/GenVector/Boost.h"
#include <TMath.h>
#include "Common/Core/TrackSelection.h"
#include "Common/Core/trackUtilities.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/PIDResponse.h"
#include "Common/DataModel/TrackSelectionTables.h"

#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "CCDB/BasicCCDBManager.h"
#include "CCDB/CcdbApi.h"
#include "CommonConstants/PhysicsConstants.h"
#include "DataFormatsParameters/GRPMagField.h"
#include "DataFormatsParameters/GRPObject.h"
#include "Framework/ASoAHelpers.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/StepTHn.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "Framework/ASoAHelpers.h"
#include "Framework/StaticFor.h"

#include "Common/DataModel/PIDResponse.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/DataModel/EventSelection.h"

#include "Common/Core/trackUtilities.h"
#include "Common/Core/TrackSelection.h"

#include "CommonConstants/PhysicsConstants.h"

#include "Framework/StepTHn.h"
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/Track.h"

#include "DataFormatsParameters/GRPObject.h"
#include "DataFormatsParameters/GRPMagField.h"

#include "CCDB/CcdbApi.h"
#include "CCDB/BasicCCDBManager.h"
#include "Math/GenVector/Boost.h"
#include "Math/Vector3D.h"
#include "Math/Vector4D.h"
#include "TF1.h"
#include "TLorentzVector.h"

Check failure on line 43 in PWGLF/Tasks/Strangeness/lambdaTwoPartPolarization.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 "TRandom3.h"
#include "TVector3.h"
#include <TMath.h>

#include "PWGLF/DataModel/LFStrangenessTables.h"
#include <array>
#include <chrono>
#include <cmath>
#include <cstdlib>
#include <string>
#include <vector>

using namespace o2;
using namespace o2::framework;
Expand Down Expand Up @@ -128,7 +123,7 @@

ConfigurableAxis ptAxis{"ptAxis", {VARIABLE_WIDTH, 0.2, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.5, 8.0, 10.0, 100.0}, "Transverse momentum bins"};
ConfigurableAxis centAxis{"centAxis", {VARIABLE_WIDTH, 0, 10, 20, 30, 40, 50, 60, 70, 100}, "Centrality interval"};
ConfigurableAxis RapAxis{"RapAxis", {10, -0.5, 0.5}, "Rapidity axis"};

Check failure on line 126 in PWGLF/Tasks/Strangeness/lambdaTwoPartPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
ConfigurableAxis detaAxis{"dyAxis", {20, -1, 1}, "relative rapidity axis"};
ConfigurableAxis dphiAxis{"dphiAxis", {20, -constants::math::PI * 0.5, constants::math::PI * 1.5}, "relative azimuth axis"};

Expand All @@ -139,14 +134,14 @@
float dphi;
float weight;

TProfile2D* EffMap = nullptr;

Check failure on line 137 in PWGLF/Tasks/Strangeness/lambdaTwoPartPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
TProfile2D* AccMap = nullptr;

void init(o2::framework::InitContext&)
{
AxisSpec centQaAxis = {100, 0.0, 100.0};
AxisSpec PVzQaAxis = {300, -15.0, 15.0};
AxisSpec epAxis = {6, 0.0, 2.0 * constants::math::PI};

Check failure on line 144 in PWGLF/Tasks/Strangeness/lambdaTwoPartPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pi-multiple-fraction]

Use multiples/fractions of PI defined in o2::constants::math.

AxisSpec pidAxis = {100, -10, 10};

Expand Down Expand Up @@ -271,7 +266,7 @@
template <typename C1, typename C2, typename V01, typename V02>
void FillHistograms(C1 const& c1, C2 const& c2, V01 const& V01s, V02 const& V02s)
{
for (auto& v01 : V01s) {

Check failure on line 269 in PWGLF/Tasks/Strangeness/lambdaTwoPartPolarization.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 @@ -309,7 +304,7 @@

histos.fill(HIST("Ana/Acceptance"), v01.pt(), centrality, v01.yLambda(), costhetastar1 * costhetastar1);

for (auto& v02 : V02s) {

Check failure on line 307 in PWGLF/Tasks/Strangeness/lambdaTwoPartPolarization.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 All @@ -335,7 +330,7 @@
if (postrack_v01.globalIndex() == postrack_v02.globalIndex() || postrack_v01.globalIndex() == negtrack_v02.globalIndex() || negtrack_v01.globalIndex() == postrack_v02.globalIndex() || negtrack_v01.globalIndex() == negtrack_v02.globalIndex())
continue; // no shared decay products
}

if (LambdaTag) {
ProtonVec2 = ROOT::Math::PxPyPzMVector(v02.pxpos(), v02.pypos(), v02.pzpos(), massPr);
PionVec2 = ROOT::Math::PxPyPzMVector(v02.pxneg(), v02.pyneg(), v02.pzneg(), massPi);
Expand All @@ -346,10 +341,10 @@
}
LambdaVec2 = ProtonVec2 + PionVec2;
LambdaVec2.SetM(massLambda);

ROOT::Math::Boost boost2{LambdaVec2.BoostToCM()};
ProtonBoostedVec2 = boost2(ProtonVec2);

costhetastar2 = ProtonBoostedVec2.Pz() / ProtonBoostedVec2.P();

weight = 1.0;
Expand All @@ -374,7 +369,7 @@
{
if (cfgCentEst == 1) {
centrality = collision.centFT0C();
} else if (cfgCentEst == 2) {

Check failure on line 372 in PWGLF/Tasks/Strangeness/lambdaTwoPartPolarization.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();
}
if (!eventSelected(collision) && cfgEvtSel) {
Expand Down
Loading