Skip to content
Merged
Show file tree
Hide file tree
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
19 changes: 5 additions & 14 deletions PWGEM/Dilepton/Tasks/dileptonPolarization.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 PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Specify task name only when it cannot be derived from the struct name. Only append to the default name.
// 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 @@ -60,7 +60,7 @@

struct DileptonPolarization {
// Configurables
Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};

Check failure on line 63 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
// Configurable<std::string> grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"};
// Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
// Configurable<bool> skipGRPOquery{"skipGRPOquery", true, "skip grpo query"};
Expand All @@ -70,9 +70,9 @@
Configurable<int> cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"};
Configurable<bool> cfgDoMix{"cfgDoMix", true, "flag for event mixing"};
Configurable<int> ndepth{"ndepth", 10000, "depth for event mixing"};
Configurable<uint64_t> ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"};

Check failure on line 73 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"};

Check failure on line 74 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
ConfigurableAxis ConfCentBins{"ConfCentBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f, 999.f}, "Mixing bins - centrality"};

Check failure on line 75 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
ConfigurableAxis ConfEPBins{"ConfEPBins", {1, -M_PI / 2, +M_PI / 2}, "Mixing bins - event plane angle"};
ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"};
Configurable<int> cfgPolarizationFrame{"cfgPolarizationFrame", 0, "frame of polarization. 0:CS, 1:HX, else:FATAL"};
Expand Down Expand Up @@ -127,9 +127,9 @@
struct : ConfigurableGroup {
std::string prefix = "accBins";
Configurable<float> cfgRelDM{"cfgRelDM", 0.01, "rel. dm for lorentz boost"};
Configurable<float> cfgRelDPx{"cfgRelDPx", 0.01, "rel. dpx for lorentz boost"};
Configurable<float> cfgRelDPy{"cfgRelDPy", 0.01, "rel. dpy for lorentz boost"};
Configurable<float> cfgRelDPz{"cfgRelDPz", 0.01, "rel. dpz for lorentz boost"};
Configurable<float> cfgRelDPt{"cfgRelDPt", 0.1, "rel. dpT for lorentz boost"};
Configurable<float> cfgDEta{"cfgDEta", 0.1, "deta for lorentz boost"};
Configurable<float> cfgDPhi{"cfgDPhi", 0.087, "dphi (rad.) for lorentz boost"};
} accBins;

Service<o2::ccdb::BasicCCDBManager> ccdb;
Expand Down Expand Up @@ -382,9 +382,6 @@
fRegistry.addClone("Pair/same/", "Pair/mix/");
fRegistry.add("Pair/same/uls/hEta", "#eta_{ll}", kTH1D, {{2000, -10, 10}}, true);
fRegistry.add("Pair/mix/uls/hBeta", "#beta for Lorentz boost;#beta^{same};(#beta^{mix} - #beta^{same})/#beta^{same}", kTH2D, {{100, 0, 1}, {400, -0.2, 0.2}}, true);
fRegistry.add("Pair/mix/uls/hBetaX", "#beta_{X} for Lorentz boost;#beta_{x}^{same};(#beta_{x}^{mix} - #beta_{x}^{same})/#beta_{x}^{same}", kTH2D, {{100, 0, 1}, {400, -0.2, 0.2}}, true);
fRegistry.add("Pair/mix/uls/hBetaY", "#beta_{Y} for Lorentz boost;#beta_{y}^{same};(#beta_{y}^{mix} - #beta_{y}^{same})/#beta_{y}^{same}", kTH2D, {{100, 0, 1}, {400, -0.2, 0.2}}, true);
fRegistry.add("Pair/mix/uls/hBetaZ", "#beta_{Z} for Lorentz boost;#beta_{z}^{same};(#beta_{z}^{mix} - #beta_{z}^{same})/#beta_{z}^{same}", kTH2D, {{100, 0, 1}, {400, -0.2, 0.2}}, true);
}

template <int ev_id, typename TCollision, typename TDilepton>
Expand Down Expand Up @@ -481,7 +478,7 @@
auto v_pos = empair1.getPositiveLeg(); // pt, eta, phi, M
auto arrD = std::array<float, 4>{static_cast<float>(v_pos.Px()), static_cast<float>(v_pos.Py()), static_cast<float>(v_pos.Pz()), leptonM1};

auto pairs_from_col2_sliced = std::views::filter(pairs_from_col2, [&](EMPair t) { return std::fabs(t.mass() - empair1.mass()) / empair1.mass() < accBins.cfgRelDM && std::fabs((t.px() - empair1.px()) / empair1.px()) < accBins.cfgRelDPx && std::fabs((t.py() - empair1.py()) / empair1.py()) < accBins.cfgRelDPy && std::fabs((t.pz() - empair1.pz()) / empair1.pz()) < accBins.cfgRelDPz; });
auto pairs_from_col2_sliced = std::views::filter(pairs_from_col2, [&](EMPair t) { return std::fabs(t.mass() - empair1.mass()) / empair1.mass() < accBins.cfgRelDM && std::fabs(t.pt() - empair1.pt()) / empair1.pt() < accBins.cfgRelDPt && std::fabs(t.eta() - empair1.eta()) < accBins.cfgDEta && std::fabs(RecoDecay::constrainAngle(t.phi() - empair1.phi(), -o2::constants::math::PI, 1U)) < accBins.cfgDPhi; });
for (const auto& empair2 : pairs_from_col2_sliced) {
auto arrM = std::array<float, 4>{static_cast<float>(empair2.px()), static_cast<float>(empair2.py()), static_cast<float>(empair2.pz()), static_cast<float>(empair2.mass())};
// LOGF(info, "[col1, col2] : empair1.mass() = %f, empair1.pt() = %f, empair1.eta() = %f, empair1.phi() = %f, empair2.mass() = %f, empair2.pt() = %f, empair2.eta() = %f, empair2.phi() = %f", empair1.mass(), empair1.pt(), empair1.eta(), empair1.phi(), empair2.mass(), empair2.pt(), empair2.eta(), empair2.phi());
Expand All @@ -500,17 +497,14 @@
}
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hs"), empair1.mass(), empair1.pt(), empair1.getPairDCA(), empair1.rapidity(), cos_thetaPol, phiPol, quadmom, weight);
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBeta"), empair1.p() / empair1.e(), (empair2.p() / empair2.e() - empair1.p() / empair1.e()) / (empair1.p() / empair1.e()));
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBetaX"), empair1.px() / empair1.e(), (empair2.px() / empair2.e() - empair1.px() / empair1.e()) / (empair1.px() / empair1.e()));
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBetaY"), empair1.py() / empair1.e(), (empair2.py() / empair2.e() - empair1.py() / empair1.e()) / (empair1.py() / empair1.e()));
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBetaZ"), empair1.pz() / empair1.e(), (empair2.pz() / empair2.e() - empair1.pz() / empair1.e()) / (empair1.pz() / empair1.e()));
}
}

for (const auto& empair2 : pairs_from_col2) {
auto v_pos = empair2.getPositiveLeg(); // pt, eta, phi, M
auto arrD = std::array<float, 4>{static_cast<float>(v_pos.Px()), static_cast<float>(v_pos.Py()), static_cast<float>(v_pos.Pz()), leptonM2};

auto pairs_from_col1_sliced = std::views::filter(pairs_from_col1, [&](EMPair t) { return std::fabs(t.mass() - empair2.mass()) / empair2.mass() < accBins.cfgRelDM && std::fabs((t.px() - empair2.px()) / empair2.px()) < accBins.cfgRelDPx && std::fabs((t.py() - empair2.py()) / empair2.py()) < accBins.cfgRelDPy && std::fabs((t.pz() - empair2.pz()) / empair2.pz()) < accBins.cfgRelDPz; });
auto pairs_from_col1_sliced = std::views::filter(pairs_from_col1, [&](EMPair t) { return std::fabs(t.mass() - empair2.mass()) / empair2.mass() < accBins.cfgRelDM && std::fabs(t.pt() - empair2.pt()) / empair2.pt() < accBins.cfgRelDPt && std::fabs(t.eta() - empair2.eta()) < accBins.cfgDEta && std::fabs(RecoDecay::constrainAngle(t.phi() - empair2.phi(), -o2::constants::math::PI, 1U)) < accBins.cfgDPhi; });
for (const auto& empair1 : pairs_from_col1_sliced) {
auto arrM = std::array<float, 4>{static_cast<float>(empair1.px()), static_cast<float>(empair1.py()), static_cast<float>(empair1.pz()), static_cast<float>(empair2.mass())};
// LOGF(info, "[col2, col1] : empair2.mass() = %f, empair2.pt() = %f, empair2.eta() = %f, empair2.phi() = %f, empair1.mass() = %f, empair1.pt() = %f, empair1.eta() = %f, empair1.phi() = %f", empair2.mass(), empair2.pt(), empair2.eta(), empair2.phi(), empair1.mass(), empair1.pt(), empair1.eta(), empair1.phi());
Expand All @@ -529,9 +523,6 @@
}
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hs"), empair2.mass(), empair2.pt(), empair2.getPairDCA(), empair2.rapidity(), cos_thetaPol, phiPol, quadmom, weight);
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBeta"), empair2.p() / empair2.e(), (empair1.p() / empair1.e() - empair2.p() / empair2.e()) / (empair2.p() / empair2.e()));
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBetaX"), empair2.px() / empair2.e(), (empair1.px() / empair1.e() - empair2.px() / empair2.e()) / (empair2.px() / empair2.e()));
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBetaY"), empair2.py() / empair2.e(), (empair1.py() / empair1.e() - empair2.py() / empair2.e()) / (empair2.py() / empair2.e()));
fRegistry.fill(HIST("Pair/mix/") + HIST(pair_sign_types[signType]) + HIST("hBetaZ"), empair2.pz() / empair2.e(), (empair1.pz() / empair1.e() - empair2.pz() / empair2.e()) / (empair2.pz() / empair2.e()));
}
}

Expand Down Expand Up @@ -587,21 +578,21 @@
int zbin = lower_bound(zvtx_bin_edges.begin(), zvtx_bin_edges.end(), collision.posZ()) - zvtx_bin_edges.begin() - 1;
if (zbin < 0) {
zbin = 0;
} else if (static_cast<int>(zvtx_bin_edges.size()) - 2 < zbin) {

Check failure on line 581 in PWGEM/Dilepton/Tasks/dileptonPolarization.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.
zbin = static_cast<int>(zvtx_bin_edges.size()) - 2;
}

int centbin = lower_bound(cent_bin_edges.begin(), cent_bin_edges.end(), centrality) - cent_bin_edges.begin() - 1;
if (centbin < 0) {
centbin = 0;
} else if (static_cast<int>(cent_bin_edges.size()) - 2 < centbin) {

Check failure on line 588 in PWGEM/Dilepton/Tasks/dileptonPolarization.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.
centbin = static_cast<int>(cent_bin_edges.size()) - 2;
}

int epbin = lower_bound(ep_bin_edges.begin(), ep_bin_edges.end(), ep2) - ep_bin_edges.begin() - 1;
if (epbin < 0) {
epbin = 0;
} else if (static_cast<int>(ep_bin_edges.size()) - 2 < epbin) {

Check failure on line 595 in PWGEM/Dilepton/Tasks/dileptonPolarization.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.
epbin = static_cast<int>(ep_bin_edges.size()) - 2;
}

Expand All @@ -616,7 +607,7 @@

if (occbin < 0) {
occbin = 0;
} else if (static_cast<int>(occ_bin_edges.size()) - 2 < occbin) {

Check failure on line 610 in PWGEM/Dilepton/Tasks/dileptonPolarization.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.
occbin = static_cast<int>(occ_bin_edges.size()) - 2;
}

Expand Down Expand Up @@ -707,5 +698,5 @@
};
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{adaptAnalysisTask<DileptonPolarization>(cfgc, TaskName{"dilepton-polarization"})};

Check failure on line 701 in PWGEM/Dilepton/Tasks/dileptonPolarization.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Specified task name dilepton-polarization and the struct name DileptonPolarization produce the same device name dilepton-polarization. TaskName is redundant.
}
4 changes: 1 addition & 3 deletions PWGEM/Dilepton/Utils/EMFwdTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#ifndef PWGEM_DILEPTON_UTILS_EMFWDTRACK_H_
#define PWGEM_DILEPTON_UTILS_EMFWDTRACK_H_

#include <vector>

namespace o2::aod::pwgem::dilepton::utils
{
class EMFwdTrack
Expand All @@ -31,7 +29,6 @@ class EMFwdTrack
fCharge = charge;
fDCAx = dcaX;
fDCAy = dcaY;

fCXX = cXX;
fCXY = cXY;
fCYY = cYY;
Expand All @@ -51,6 +48,7 @@ class EMFwdTrack
float px() const { return fPt * std::cos(fPhi); }
float py() const { return fPt * std::sin(fPhi); }
float pz() const { return fPt * std::sinh(fEta); }
float e() const { return std::hypot(fPt * std::cosh(fEta), fMass); } // e2 = p2 + m2
float signed1Pt() const { return fCharge * 1.f / fPt; }

float cXXatDCA() const { return fCXX; }
Expand Down
4 changes: 1 addition & 3 deletions PWGEM/Dilepton/Utils/EMTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

#include "Math/Vector4D.h"

#include <vector>

namespace o2::aod::pwgem::dilepton::utils
{
class EMTrack
Expand Down Expand Up @@ -57,7 +55,7 @@ class EMTrack
float px() const { return fPt * std::cos(fPhi); }
float py() const { return fPt * std::sin(fPhi); }
float pz() const { return fPt * std::sinh(fEta); }
float e() const { return std::sqrt(std::pow(fPt * std::cosh(fEta), 2) + std::pow(fMass, 2)); } // e2 = p2 + m2
float e() const { return std::hypot(fPt * std::cosh(fEta), fMass); } // e2 = p2 + m2
float signed1Pt() const { return fCharge * 1.f / fPt; }

protected:
Expand Down
Loading