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
23 changes: 16 additions & 7 deletions Tools/KFparticle/KFUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,26 @@
#define HomogeneousField
#endif

#include <utility>
#include "Common/Core/RecoDecay.h"
#include "Common/Core/trackUtilities.h"

#include <Framework/Logger.h>
#include <ReconstructionDataFormats/PID.h>
#include <ReconstructionDataFormats/Track.h>
#include <ReconstructionDataFormats/TrackParametrizationWithError.h>

#include <TDatabasePDG.h> // FIXME

Check failure on line 33 in Tools/KFparticle/KFUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.

#include "KFParticle.h"
#include "KFPTrack.h"
#include "KFPVertex.h"
#include "KFParticleBase.h"
#include "KFVertex.h"
#include <KFPTrack.h>
#include <KFPVertex.h>
#include <KFParticle.h>
#include <KFParticleBase.h>

#include "Common/Core/RecoDecay.h"
#include <array>
#include <cmath>
#include <cstdint>
#include <stdexcept>
#include <utility>

/// @brief Function to create a KFPVertex from the collision table in the AO2Ds.
/// The Multiplicity table is required to set the number of real PV Contributors
Expand Down Expand Up @@ -243,9 +252,9 @@
py1 = kfpprong1.GetPy();
pz1 = kfpprong1.GetPz();
std::array<double, 2> m = {0., 0.};
m[0] = TDatabasePDG::Instance()->GetParticle(pdgprong0)->Mass(); // FIXME: Get from the PDG service of the common header

Check failure on line 255 in Tools/KFparticle/KFUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
m[1] = TDatabasePDG::Instance()->GetParticle(pdgprong1)->Mass(); // FIXME: Get from the PDG service of the common header

Check failure on line 256 in Tools/KFparticle/KFUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
double mTot = TDatabasePDG::Instance()->GetParticle(pdgvtx)->Mass(); // FIXME: Get from the PDG service of the common header

Check failure on line 257 in Tools/KFparticle/KFUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/database]

Do not use TDatabasePDG directly. Use o2::constants::physics::Mass... or Service<o2::framework::O2DatabasePDG> instead.
int iProng = ip;

float cosThetastar = RecoDecay::cosThetaStar(std::array{std::array{px0, py0, pz0}, std::array{px1, py1, pz1}}, m, mTot, iProng);
Expand Down Expand Up @@ -287,11 +296,11 @@
float dx_particle = PV.GetX() - kfpParticle.GetX();
float dy_particle = PV.GetY() - kfpParticle.GetY();
float dz_particle = PV.GetZ() - kfpParticle.GetZ();
float l_particle = sqrt(dx_particle * dx_particle + dy_particle * dy_particle + dz_particle * dz_particle);

Check failure on line 299 in Tools/KFparticle/KFUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
float dl_particle = (PV.GetCovariance(0) + kfpParticle.GetCovariance(0)) * dx_particle * dx_particle + (PV.GetCovariance(2) + kfpParticle.GetCovariance(2)) * dy_particle * dy_particle + (PV.GetCovariance(5) + kfpParticle.GetCovariance(5)) * dz_particle * dz_particle + 2 * ((PV.GetCovariance(1) + kfpParticle.GetCovariance(1)) * dx_particle * dy_particle + (PV.GetCovariance(3) + kfpParticle.GetCovariance(3)) * dx_particle * dz_particle + (PV.GetCovariance(4) + kfpParticle.GetCovariance(4)) * dy_particle * dz_particle);
if (fabs(l_particle) < 1.e-8f)

Check failure on line 301 in Tools/KFparticle/KFUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
l_particle = 1.e-8f;
dl_particle = dl_particle < 0. ? 1.e8f : sqrt(dl_particle) / l_particle;

Check failure on line 303 in Tools/KFparticle/KFUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
if (dl_particle == 0.)
return 9999.;
return l_particle / dl_particle;
Expand All @@ -305,11 +314,11 @@
{
float dx_particle = PV.GetX() - kfpParticle.GetX();
float dy_particle = PV.GetY() - kfpParticle.GetY();
float l_particle = sqrt(dx_particle * dx_particle + dy_particle * dy_particle);

Check failure on line 317 in Tools/KFparticle/KFUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
float dl_particle = (PV.GetCovariance(0) + kfpParticle.GetCovariance(0)) * dx_particle * dx_particle + (PV.GetCovariance(2) + kfpParticle.GetCovariance(2)) * dy_particle * dy_particle + 2 * ((PV.GetCovariance(1) + kfpParticle.GetCovariance(1)) * dx_particle * dy_particle);
if (fabs(l_particle) < 1.e-8f)

Check failure on line 319 in Tools/KFparticle/KFUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
l_particle = 1.e-8f;
dl_particle = dl_particle < 0. ? 1.e8f : sqrt(dl_particle) / l_particle;

Check failure on line 321 in Tools/KFparticle/KFUtilities.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
if (dl_particle == 0.)
return 9999.;
return l_particle / dl_particle;
Expand Down
13 changes: 7 additions & 6 deletions Tools/ML/MlResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@
#ifndef TOOLS_ML_MLRESPONSE_H_
#define TOOLS_ML_MLRESPONSE_H_

#include <onnxruntime_cxx_api.h>
#include "Tools/ML/model.h"

#include <CCDB/CcdbApi.h>
#include <Framework/Array2D.h>
#include <Framework/Logger.h>

#include <cstddef>
#include <cstdint>
#include <map>
#include <string>
#include <vector>

#include "CCDB/CcdbApi.h"
#include "Framework/Array2D.h"

#include "Tools/ML/model.h"

namespace o2
{
namespace cuts_ml
Expand Down
15 changes: 14 additions & 1 deletion Tools/ML/model.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,22 @@
/// \brief A general-purpose class with functions for ONNX model applications
///

// ONNX includes
#include "Tools/ML/model.h"

#include <Framework/Logger.h>

#include <TSystem.h>

#include <onnxruntime_cxx_api.h>

#include <cassert>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <sstream>
#include <string>
#include <vector>

namespace o2
{

Expand Down
21 changes: 10 additions & 11 deletions Tools/ML/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,18 @@
#ifndef TOOLS_ML_MODEL_H_
#define TOOLS_ML_MODEL_H_

// C++ and system includes
#include <onnxruntime_cxx_api.h>
#include <vector>
#include <string>
#include <memory>
#include <map>
#include <algorithm>
#include <Framework/Logger.h>

// ROOT includes
#include "TSystem.h"
#include <onnxruntime_cxx_api.h>

// O2 includes
#include "Framework/Logger.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <iterator>
#include <memory>
#include <string>
#include <vector>

namespace o2
{
Expand Down
Loading