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
5 changes: 2 additions & 3 deletions Common/Core/fwdtrackUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@
using SMatrix5 = ROOT::Math::SVector<double, 5>;

template <typename T>
concept is_fwd_track = requires (T t) {
concept is_fwd_track = requires(T t) {
{ t.rAtAbsorberEnd() } -> std::same_as<float>;
};

template <typename T>
concept is_fwd_cov = requires (T t)
{
concept is_fwd_cov = requires(T t) {
{ t.sigmaX() } -> std::same_as<float>;
};

Expand Down Expand Up @@ -154,7 +153,7 @@
o2::dataformats::GlobalFwdTrack propmuon;
o2::globaltracking::MatchGlobalFwd mMatching;

if (trackType > 2) { // MCH-MID or MCH standalone

Check failure on line 156 in Common/Core/fwdtrackUtilities.h

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.
o2::dataformats::GlobalFwdTrack track;
track.setParameters(fwdtrack.getParameters());
track.setZ(fwdtrack.getZ());
Expand All @@ -175,7 +174,7 @@
propmuon.setParameters(proptrack.getParameters());
propmuon.setZ(proptrack.getZ());
propmuon.setCovariances(proptrack.getCovariances());
} else if (trackType < 2) { // MFT-MCH-MID

Check failure on line 177 in Common/Core/fwdtrackUtilities.h

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.
// const double centerMFT[3] = {0, 0, -61.4};
// o2::field::MagneticField* field = static_cast<o2::field::MagneticField*>(TGeoGlobalMagField::Instance()->GetField());
// auto Bz = field->getBz(centerMFT); // Get field at centre of MFT in kG.
Expand Down
6 changes: 3 additions & 3 deletions PWGEM/Dilepton/DataModel/dileptonTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

#include "Common/CCDB/EventSelectionParams.h"
#include "Common/Core/RecoDecay.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/PIDResponseTOF.h"
#include "Common/DataModel/PIDResponseTPC.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include <Common/DataModel/Centrality.h>
#include <Common/DataModel/EventSelection.h>
#include <Common/DataModel/Multiplicity.h>

#include <CommonConstants/MathConstants.h>
#include <Framework/AnalysisDataModel.h>
Expand Down Expand Up @@ -235,11 +235,11 @@
namespace emeventnorm
{
DECLARE_SOA_DYNAMIC_COLUMN(PosZ, posZ, [](int8_t posZint8) -> float { return (posZint8 < 0 ? std::nextafter(posZint8 * 0.5f, -std::numeric_limits<float>::infinity()) : std::nextafter(posZint8 * 0.5f, std::numeric_limits<float>::infinity())); }); //! posZ is multiplied by 2 in createEMEventDileton.cxx
DECLARE_SOA_DYNAMIC_COLUMN(CentFT0M, centFT0M, [](uint8_t centuint8) -> float { return centuint8 < 100 ? std::nextafter(centuint8 * 0.01f, std::numeric_limits<float>::infinity()) : std::nextafter(centuint8 - 110.f, std::numeric_limits<float>::infinity()); }); //! centrality is multiplied by 100 in createEMEventDilepton.cxx

Check failure on line 238 in PWGEM/Dilepton/DataModel/dileptonTables.h

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.
DECLARE_SOA_DYNAMIC_COLUMN(CentFT0A, centFT0A, [](uint8_t centuint8) -> float { return centuint8 < 100 ? std::nextafter(centuint8 * 0.01f, std::numeric_limits<float>::infinity()) : std::nextafter(centuint8 - 110.f, std::numeric_limits<float>::infinity()); }); //! centrality is multiplied by 100 in createEMEventDilepton.cxx

Check failure on line 239 in PWGEM/Dilepton/DataModel/dileptonTables.h

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.
DECLARE_SOA_DYNAMIC_COLUMN(CentFT0C, centFT0C, [](uint8_t centuint8) -> float { return centuint8 < 100 ? std::nextafter(centuint8 * 0.01f, std::numeric_limits<float>::infinity()) : std::nextafter(centuint8 - 110.f, std::numeric_limits<float>::infinity()); }); //! centrality is multiplied by 100 in createEMEventDilepton.cxx

Check failure on line 240 in PWGEM/Dilepton/DataModel/dileptonTables.h

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.
DECLARE_SOA_DYNAMIC_COLUMN(CentNTPV, centNTPV, [](uint8_t centuint8) -> float { return centuint8 < 100 ? std::nextafter(centuint8 * 0.01f, std::numeric_limits<float>::infinity()) : std::nextafter(centuint8 - 110.f, std::numeric_limits<float>::infinity()); }); //! centrality is multiplied by 100 in createEMEventDilepton.cxx

Check failure on line 241 in PWGEM/Dilepton/DataModel/dileptonTables.h

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.
DECLARE_SOA_DYNAMIC_COLUMN(CentNGlobal, centNGlobal, [](uint8_t centuint8) -> float { return centuint8 < 100 ? std::nextafter(centuint8 * 0.01f, std::numeric_limits<float>::infinity()) : std::nextafter(centuint8 - 110.f, std::numeric_limits<float>::infinity()); }); //! centrality is multiplied by 100 in createEMEventDilepton.cxx

Check failure on line 242 in PWGEM/Dilepton/DataModel/dileptonTables.h

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.
} // namespace emeventnorm

// namespace emcent
Expand Down Expand Up @@ -703,7 +703,7 @@
DECLARE_SOA_DYNAMIC_COLUMN(Tgl, tgl, [](float eta) -> float { return std::tan(o2::constants::math::PIHalf - 2 * std::atan(std::exp(-eta))); });
DECLARE_SOA_DYNAMIC_COLUMN(MeanClusterSizeITS, meanClusterSizeITS, [](uint32_t itsClusterSizes) -> float {
int total_cluster_size = 0, nl = 0;
for (unsigned int layer = 0; layer < 7; layer++) {

Check failure on line 706 in PWGEM/Dilepton/DataModel/dileptonTables.h

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.
int cluster_size_per_layer = (itsClusterSizes >> (layer * 4)) & 0xf;
if (cluster_size_per_layer > 0) {
nl++;
Expand All @@ -718,7 +718,7 @@
});
DECLARE_SOA_DYNAMIC_COLUMN(MeanClusterSizeITSib, meanClusterSizeITSib, [](uint32_t itsClusterSizes) -> float {
int total_cluster_size = 0, nl = 0;
for (unsigned int layer = 0; layer < 3; layer++) {

Check failure on line 721 in PWGEM/Dilepton/DataModel/dileptonTables.h

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.
int cluster_size_per_layer = (itsClusterSizes >> (layer * 4)) & 0xf;
if (cluster_size_per_layer > 0) {
nl++;
Expand All @@ -733,7 +733,7 @@
});
DECLARE_SOA_DYNAMIC_COLUMN(MeanClusterSizeITSob, meanClusterSizeITSob, [](uint32_t itsClusterSizes) -> float {
int total_cluster_size = 0, nl = 0;
for (unsigned int layer = 3; layer < 7; layer++) {

Check failure on line 736 in PWGEM/Dilepton/DataModel/dileptonTables.h

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.
int cluster_size_per_layer = (itsClusterSizes >> (layer * 4)) & 0xf;
if (cluster_size_per_layer > 0) {
nl++;
Expand Down
2 changes: 2 additions & 0 deletions PWGEM/PhotonMeson/Core/PHOSPhotonCut.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
#define PWGEM_PHOTONMESON_CORE_PHOSPHOTONCUT_H_

#include "PWGEM/PhotonMeson/Utils/TrackSelection.h"

#include <TNamed.h>

#include <Rtypes.h>

class PHOSPhotonCut : public TNamed
Expand Down
5 changes: 2 additions & 3 deletions PWGEM/PhotonMeson/Core/V0PhotonCut.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,8 @@ concept IsNonLinIterator = requires(T t) {
} // namespace o2::analysis::em::v0

template <typename T>
concept is_table = requires(T t)
{
{ t.begin() } ->std::same_as<typename std::decay_t<T>::iterator>;
concept is_table = requires(T t) {
{ t.begin() } -> std::same_as<typename std::decay_t<T>::iterator>;
};

class V0PhotonCut : public TNamed
Expand Down
9 changes: 3 additions & 6 deletions PWGEM/PhotonMeson/Utils/TrackSelection.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
#include <cstdint>

template <typename T>
concept is_iterator = requires (T t)
{
concept is_iterator = requires(T t) {
typename std::decay_t<T>::policy_t;
typename std::decay_t<T>::all_columns;
t.getIndexBindings();
Expand All @@ -36,15 +35,13 @@ concept is_sentinel = requires(T t) {
};

template <typename T>
concept is_track_with_extra = requires (T t)
{
concept is_track_with_extra = requires(T t) {
{ t.hasITS() } -> std::same_as<bool>;
{ t.hasTPC() } -> std::same_as<bool>;
};

template <typename T>
concept is_mc_particle = requires (T t)
{
concept is_mc_particle = requires(T t) {
{ t.pdgCode() } -> std::same_as<const int&>;
};

Expand Down
30 changes: 15 additions & 15 deletions PWGUD/Core/decayTree.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ void decayTree::createHistograms(o2::framework::HistogramRegistry& registry)
auto max = o2::framework::AxisSpec(res->nmassBins(), res->massHistRange()[0], res->massHistRange()[1]);
auto momax = o2::framework::AxisSpec(res->nmomBins(), res->momHistRange()[0], res->momHistRange()[1]);

// M-pT, M-eta, pT-eta
// M-pT, M-eta, pT-eta
for (const auto& cc : fccs) {
base = cc;
base.append("/").append(res->name()).append("/");
Expand All @@ -1262,20 +1262,20 @@ void decayTree::createHistograms(o2::framework::HistogramRegistry& registry)
annot = "pT versus eta; pT (" + res->name() + ") GeV/c; eta (" + res->name() + ")";
fhistPointers.insert({hname, registry.add(hname.c_str(), annot.c_str(), {o2::framework::HistType::kTH2F, {momax, etax}})});

// M versus daughters
// M versus daughters
auto daughs = res->getDaughters();
auto ndaughs = daughs.size();
for (auto i = 0; i < static_cast<int>(ndaughs); i++) {
auto d1 = getResonance(daughs[i]);

// M vs pT daughter
// M vs pT daughter
hname = base;
hname.append("MvspT_").append(res->name()).append(d1->name());
annot = "M versus pT; M (" + res->name() + ") GeV/c^{2}; pT (" + d1->name() + ") GeV/c";
auto momax1 = o2::framework::AxisSpec(d1->nmomBins(), d1->momHistRange()[0], d1->momHistRange()[1]);
fhistPointers.insert({hname, registry.add(hname.c_str(), annot.c_str(), {o2::framework::HistType::kTH2F, {max, momax1}})});

// M vs eta daughter
// M vs eta daughter
hname = base;
hname.append("Mvseta_").append(res->name()).append(d1->name());
annot = "M versus eta; M (" + res->name() + ") GeV/c^{2}; eta (" + d1->name() + ")";
Expand All @@ -1292,19 +1292,19 @@ void decayTree::createHistograms(o2::framework::HistogramRegistry& registry)
annot = "M versus dcaZ; M (" + res->name() + ") GeV/c^{2}; dca_{Z} (" + d1->name() + ") #mu m";
fhistPointers.insert({hname, registry.add(hname.c_str(), annot.c_str(), {o2::framework::HistType::kTH2F, {max, dcazax}})});

// M vs chi2 track
// M vs chi2 track
hname = base;
hname.append("Mvschi2_").append(res->name()).append(d1->name());
annot = "M versus chi2; M (" + res->name() + ") GeV/c^{2}; chi2 (" + d1->name() + ")";
fhistPointers.insert({hname, registry.add(hname.c_str(), annot.c_str(), {o2::framework::HistType::kTH2F, {max, chi2ax}})});

// M vs nCl track
// M vs nCl track
hname = base;
hname.append("MvsnCl_").append(res->name()).append(d1->name());
annot = "M versus nCl; M (" + res->name() + ") GeV/c^{2}; nCl (" + d1->name() + ")";
fhistPointers.insert({hname, registry.add(hname.c_str(), annot.c_str(), {o2::framework::HistType::kTH2F, {max, nClax}})});

// M versus detector hits
// M versus detector hits
hname = base;
hname.append("MvsdetHits_").append(res->name()).append(d1->name());
annot = "M versus detector hits; M (" + res->name() + ") GeV/c^{2}; ITS + 2*TPC + 4*TRD + 8*TOF (" + d1->name() + ")";
Expand All @@ -1319,33 +1319,33 @@ void decayTree::createHistograms(o2::framework::HistogramRegistry& registry)
}
}

// daughters vs daughters
// daughters vs daughters
for (auto i = 0; i < static_cast<int>(ndaughs - 1); i++) {
auto d1 = getResonance(daughs[i]);
auto max1 = o2::framework::AxisSpec(d1->nmassBins(), d1->massHistRange()[0], d1->massHistRange()[1]);
for (auto j = i + 1; j < static_cast<int>(ndaughs); j++) {
auto d2 = getResonance(daughs[j]);
auto max2 = o2::framework::AxisSpec(d2->nmassBins(), d2->massHistRange()[0], d2->massHistRange()[1]);

// M1 vs M2
// M1 vs M2
hname = base;
hname.append("MvsM_").append(d1->name()).append(d2->name());
annot = std::string("M versus M; M (").append(d1->name()).append(") GeV/c^{2}; M (").append(d2->name()).append(") GeV/c^{2}");
fhistPointers.insert({hname, registry.add(hname.c_str(), annot.c_str(), {o2::framework::HistType::kTH2F, {max1, max2}})});

// angle(d1, d2)
// angle(d1, d2)
hname = base;
hname.append("angle_").append(d1->name()).append(d2->name());
annot = std::string("angle; Angle (").append(d1->name()).append(", ").append(d2->name()).append(")");
fhistPointers.insert({hname, registry.add(hname.c_str(), annot.c_str(), {o2::framework::HistType::kTH1F, {angax}})});

// M vs angle(d1, d2)
// M vs angle(d1, d2)
hname = base;
hname.append("Mvsangle_").append(d1->name()).append(d2->name());
annot = std::string("M versus angle; M (").append(res->name()).append(") GeV/c^{2}; Angle (").append(d1->name()).append(", ").append(d2->name()).append(")");
fhistPointers.insert({hname, registry.add(hname.c_str(), annot.c_str(), {o2::framework::HistType::kTH2F, {max, angax}})});

// both daughters are finals
// both daughters are finals
if (d1->isFinal() && d2->isFinal()) {
hname = base;
hname.append("TPCsignal_").append(d1->name()).append(d2->name());
Expand All @@ -1355,7 +1355,7 @@ void decayTree::createHistograms(o2::framework::HistogramRegistry& registry)
}
}

// for finals only
// for finals only
if (res->isFinal()) {
// dca
hname = base;
Expand All @@ -1367,7 +1367,7 @@ void decayTree::createHistograms(o2::framework::HistogramRegistry& registry)
annot = std::string("dcaZ; dca_{Z}(").append(res->name()).append(")");
fhistPointers.insert({hname, registry.add(hname.c_str(), annot.c_str(), {o2::framework::HistType::kTH1F, {dcazax}})});

// nSIgma[TPC, TOF] vs pT
// nSIgma[TPC, TOF] vs pT
for (const auto& det : fdets) {
for (const auto& part : fparts) {
hname = base;
Expand All @@ -1377,7 +1377,7 @@ void decayTree::createHistograms(o2::framework::HistogramRegistry& registry)
}
}

// detector hits
// detector hits
hname = base;
hname.append("detectorHits");
annot = std::string("detectorHits; Detector(").append(res->name()).append(")");
Expand Down
Loading