From 2bd967110b623dd1622d57110fc9224ead8606e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Tue, 15 Jul 2025 10:44:39 +0200 Subject: [PATCH 1/4] Update TrackUtilities.h --- ALICE3/Core/TrackUtilities.h | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/ALICE3/Core/TrackUtilities.h b/ALICE3/Core/TrackUtilities.h index 3650d500aaf..a9607160517 100644 --- a/ALICE3/Core/TrackUtilities.h +++ b/ALICE3/Core/TrackUtilities.h @@ -19,11 +19,9 @@ #ifndef ALICE3_CORE_TRACKUTILITIES_H_ #define ALICE3_CORE_TRACKUTILITIES_H_ -#include - #include "ReconstructionDataFormats/Track.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/AnalysisHelpers.h" + +#include #include "TLorentzVector.h" namespace o2::upgrade @@ -37,22 +35,7 @@ namespace o2::upgrade void convertTLorentzVectorToO2Track(const int charge, const TLorentzVector particle, const std::vector productionVertex, - o2::track::TrackParCov& o2track) -{ - std::array params; - std::array covm = {0.}; - float s, c, x; - o2::math_utils::sincos(static_cast(particle.Phi()), s, c); - o2::math_utils::rotateZInv(static_cast(productionVertex[0]), static_cast(productionVertex[1]), x, params[0], s, c); - params[1] = static_cast(productionVertex[2]); - params[2] = 0.; // since alpha = phi - const auto theta = 2. * std::atan(std::exp(-particle.PseudoRapidity())); - params[3] = 1. / std::tan(theta); - params[4] = charge / particle.Pt(); - - // Initialize TrackParCov in-place - new (&o2track)(o2::track::TrackParCov)(x, particle.Phi(), params, covm); -} + o2::track::TrackParCov& o2track); /// Function to convert a TLorentzVector into a perfect Track /// \param pdgCode particle pdg @@ -60,11 +43,12 @@ void convertTLorentzVectorToO2Track(const int charge, /// \param productionVertex where the particle was produced /// \param o2track the address of the resulting TrackParCov /// \param pdg the pdg service +template void convertTLorentzVectorToO2Track(int pdgCode, TLorentzVector particle, std::vector productionVertex, o2::track::TrackParCov& o2track, - const o2::framework::Service& pdg) + const PdgService& pdg) { const auto pdgInfo = pdg->GetParticle(pdgCode); int charge = 0; @@ -78,10 +62,10 @@ void convertTLorentzVectorToO2Track(int pdgCode, /// \param particle the particle to convert (mcParticle) /// \param o2track the address of the resulting TrackParCov /// \param pdg the pdg service -template +template void convertMCParticleToO2Track(McParticleType& particle, o2::track::TrackParCov& o2track, - const o2::framework::Service& pdg) + const PdgService& pdg) { static TLorentzVector tlv; tlv.SetPxPyPzE(particle.px(), particle.py(), particle.pz(), particle.e()); @@ -92,9 +76,9 @@ void convertMCParticleToO2Track(McParticleType& particle, /// \param particle the particle to convert (mcParticle) /// \param o2track the address of the resulting TrackParCov /// \param pdg the pdg service -template +template o2::track::TrackParCov convertMCParticleToO2Track(McParticleType& particle, - const o2::framework::Service& pdg) + const PdgService& pdg) { o2::track::TrackParCov o2track; convertMCParticleToO2Track(particle, o2track, pdg); From 3308a22fca5eb7c74b50b71936927060483d1477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Tue, 15 Jul 2025 10:46:29 +0200 Subject: [PATCH 2/4] Add cxx --- ALICE3/Core/CMakeLists.txt | 1 + ALICE3/Core/TrackUtilities.cxx | 41 ++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 ALICE3/Core/TrackUtilities.cxx diff --git a/ALICE3/Core/CMakeLists.txt b/ALICE3/Core/CMakeLists.txt index 285c1624853..6d44d580c45 100644 --- a/ALICE3/Core/CMakeLists.txt +++ b/ALICE3/Core/CMakeLists.txt @@ -11,6 +11,7 @@ o2physics_add_library(ALICE3Core SOURCES TOFResoALICE3.cxx + TrackUtilities.cxx DelphesO2TrackSmearer.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore) diff --git a/ALICE3/Core/TrackUtilities.cxx b/ALICE3/Core/TrackUtilities.cxx new file mode 100644 index 00000000000..fc439ebaa0e --- /dev/null +++ b/ALICE3/Core/TrackUtilities.cxx @@ -0,0 +1,41 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +/// +/// \file TrackUtilities.cxx +/// +/// \brief Set of utilities for the ALICE3 track handling +/// +/// \since May 21, 2025 +/// + +#include "TrackUtilities.h" + +#include + +void o2::upgrade::convertTLorentzVectorToO2Track(const int charge, + const TLorentzVector particle, + const std::vector productionVertex, + o2::track::TrackParCov& o2track) +{ + std::array params; + std::array covm = {0.}; + float s, c, x; + o2::math_utils::sincos(static_cast(particle.Phi()), s, c); + o2::math_utils::rotateZInv(static_cast(productionVertex[0]), static_cast(productionVertex[1]), x, params[0], s, c); + params[1] = static_cast(productionVertex[2]); + params[2] = 0.; // since alpha = phi + const auto theta = 2. * std::atan(std::exp(-particle.PseudoRapidity())); + params[3] = 1. / std::tan(theta); + params[4] = charge / particle.Pt(); + + // Initialize TrackParCov in-place + new (&o2track)(o2::track::TrackParCov)(x, particle.Phi(), params, covm); +} From 25d6d725d3ea8deb890af831a55d0153e8d26561 Mon Sep 17 00:00:00 2001 From: ALICE Builder Date: Tue, 15 Jul 2025 10:47:01 +0200 Subject: [PATCH 3/4] Please consider the following formatting changes to #12058 (#12059) --- ALICE3/Core/TrackUtilities.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ALICE3/Core/TrackUtilities.h b/ALICE3/Core/TrackUtilities.h index a9607160517..1fb70ab5d7f 100644 --- a/ALICE3/Core/TrackUtilities.h +++ b/ALICE3/Core/TrackUtilities.h @@ -21,9 +21,10 @@ #include "ReconstructionDataFormats/Track.h" -#include #include "TLorentzVector.h" +#include + namespace o2::upgrade { From fa24f786994b644cbec8bd19388a6cc2bd5d73eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Tue, 15 Jul 2025 10:51:25 +0200 Subject: [PATCH 4/4] U --- ALICE3/Core/TrackUtilities.cxx | 7 +++---- ALICE3/Core/TrackUtilities.h | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ALICE3/Core/TrackUtilities.cxx b/ALICE3/Core/TrackUtilities.cxx index fc439ebaa0e..c07fe145ccf 100644 --- a/ALICE3/Core/TrackUtilities.cxx +++ b/ALICE3/Core/TrackUtilities.cxx @@ -9,10 +9,9 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// -/// \file TrackUtilities.cxx -/// -/// \brief Set of utilities for the ALICE3 track handling -/// +/// \file TrackUtilities.cxx +/// \author Nicolò Jacazio, Universita del Piemonte Orientale (IT) +/// \brief Set of utilities for the ALICE3 track handling /// \since May 21, 2025 /// diff --git a/ALICE3/Core/TrackUtilities.h b/ALICE3/Core/TrackUtilities.h index 1fb70ab5d7f..9bbc00c8f09 100644 --- a/ALICE3/Core/TrackUtilities.h +++ b/ALICE3/Core/TrackUtilities.h @@ -9,10 +9,9 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// -/// \file TrackUtilities.h -/// -/// \brief Set of utilities for the ALICE3 track handling -/// +/// \file TrackUtilities.h +/// \author Nicolò Jacazio, Universita del Piemonte Orientale (IT) +/// \brief Set of utilities for the ALICE3 track handling /// \since May 21, 2025 ///