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
18 changes: 9 additions & 9 deletions PWGDQ/Core/VarManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@
// TO Do: add more systems

// set the beam 4-momentum vectors
float beamAEnergy = energy / 2.0 * sqrt(NumberOfProtonsA * NumberOfProtonsC / NumberOfProtonsC / NumberOfProtonsA); // GeV

Check failure on line 196 in PWGDQ/Core/VarManager.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
float beamCEnergy = energy / 2.0 * sqrt(NumberOfProtonsC * NumberOfProtonsA / NumberOfProtonsA / NumberOfProtonsC); // GeV

Check failure on line 197 in PWGDQ/Core/VarManager.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
float beamAMomentum = std::sqrt(beamAEnergy * beamAEnergy - NumberOfNucleonsA * NumberOfNucleonsA * MassProton * MassProton);
float beamCMomentum = std::sqrt(beamCEnergy * beamCEnergy - NumberOfNucleonsC * NumberOfNucleonsC * MassProton * MassProton);
fgBeamA.SetPxPyPzE(0, 0, beamAMomentum, beamAEnergy);
Expand Down Expand Up @@ -293,7 +293,7 @@
double mean = calibMeanHist->GetBinContent(binTPCncls, binPin, binEta);
double sigma = calibSigmaHist->GetBinContent(binTPCncls, binPin, binEta);
return (nSigmaValue - mean) / sigma; // Return the calibrated nSigma value
} else if (fgCalibrationType == 2) {

Check failure on line 296 in PWGDQ/Core/VarManager.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.
// get the calibration histograms
CalibObjects calibMean, calibSigma, calibStatus;
switch (species) {
Expand Down Expand Up @@ -467,7 +467,7 @@

float m2 = 0.0, m3 = 0.0, m4 = 0.0;
float diff, diff2;
for (float x : data) {

Check failure on line 470 in PWGDQ/Core/VarManager.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.
diff = x - mean;
diff2 = diff * diff;
m2 += diff2;
Expand Down Expand Up @@ -506,7 +506,7 @@
int nBins = static_cast<int>((max - min) / binWidth);
std::vector<int> counts(nBins, 0.0);

for (float x : data) {

Check failure on line 509 in PWGDQ/Core/VarManager.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 (x < min || x >= max) {
continue; // skip out-of-range values
}
Expand Down Expand Up @@ -661,7 +661,7 @@

void VarManager::SetUseVars(const std::vector<int> usedVars)
{
for (auto& var : usedVars) {

Check failure on line 664 in PWGDQ/Core/VarManager.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.
fgUsedVars[var] = true;
}
}
Expand All @@ -673,7 +673,7 @@
return false;
}

// Flag to set PV recalculation via KF
// Flag to set PV recalculation via KF
void VarManager::SetPVrecalculationKF(const bool pvRecalKF)
{
fgPVrecalKF = pvRecalKF;
Expand All @@ -684,7 +684,7 @@
fgMagField = magField;
}

// Setup plane position for MFT-MCH matching
// Setup plane position for MFT-MCH matching
void VarManager::SetMatchingPlane(float z)
{
fgzMatching = z;
Expand All @@ -695,13 +695,13 @@
return fgzMatching;
}

// Set z shift for forward tracks
// Set z shift for forward tracks
void VarManager::SetZShift(float z)
{
fgzShiftFwd = z;
}

// Setup the 2 prong KFParticle
// Setup the 2 prong KFParticle
void VarManager::SetupTwoProngKFParticle(float magField)
{
KFParticle::SetField(magField);
Expand All @@ -713,7 +713,7 @@
o2::mch::TrackExtrap::setField();
}

// Setup the 2 prong DCAFitterN
// Setup the 2 prong DCAFitterN
void VarManager::SetupTwoProngDCAFitter(float magField, bool propagateToPCA, float maxR, float maxDZIni, float minParamChange, float minRelChi2Change, bool useAbsDCA)
{
fgFitterTwoProngBarrel.setBz(magField);
Expand All @@ -726,7 +726,7 @@
fgUsedKF = false;
}

// Setup the 2 prong FwdDCAFitterN
// Setup the 2 prong FwdDCAFitterN
void VarManager::SetupTwoProngFwdDCAFitter(float magField, bool propagateToPCA, float maxR, float minParamChange, float minRelChi2Change, bool useAbsDCA)
{
fgFitterTwoProngFwd.setBz(magField);
Expand Down Expand Up @@ -760,7 +760,7 @@
fgUsedKF = true;
}

// Setup the 3 prong DCAFitterN
// Setup the 3 prong DCAFitterN
void VarManager::SetupThreeProngDCAFitter(float magField, bool propagateToPCA, float maxR, float /*maxDZIni*/, float minParamChange, float minRelChi2Change, bool useAbsDCA)
{
fgFitterThreeProngBarrel.setBz(magField);
Expand All @@ -772,14 +772,14 @@
fgUsedKF = false;
}

// Setup the 4 prong KFParticle
// Setup the 4 prong KFParticle
void VarManager::SetupFourProngKFParticle(float magField)
{
KFParticle::SetField(magField);
fgUsedKF = true;
}

// Setup the 4 prong DCAFitterN
// Setup the 4 prong DCAFitterN
void VarManager::SetupFourProngDCAFitter(float magField, bool propagateToPCA, float maxR, float /*maxDZIni*/, float minParamChange, float minRelChi2Change, bool useAbsDCA)
{
fgFitterFourProngBarrel.setBz(magField);
Expand All @@ -802,9 +802,9 @@
float deltaPsi = psi1 - psi2;
if (std::abs(deltaPsi) > o2::constants::math::PI / harmonic) {
if (deltaPsi > 0.) {
deltaPsi -= o2::constants::math::TwoPI / harmonic;

Check failure on line 805 in PWGDQ/Core/VarManager.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
} else {
deltaPsi += o2::constants::math::TwoPI / harmonic;

Check failure on line 807 in PWGDQ/Core/VarManager.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[two-pi-add-subtract]

Use RecoDecay::constrainAngle to restrict angle to a given range.
}
}
return deltaPsi;
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
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
15 changes: 6 additions & 9 deletions PWGEM/PhotonMeson/Utils/TrackSelection.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,30 @@
#define PWGEM_PHOTONMESON_UTILS_TRACKSELECTION_H_

#include <TPDGCode.h>
#include <concepts>

#include <cmath>
#include <concepts>

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();
};

template <typename T>
concept is_sentinel = requires (T t)
{
concept is_sentinel = requires(T t) {
std::same_as<decltype(t.index), int64_t const>;
};

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