|
| 1 | +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. |
| 2 | +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. |
| 3 | +// All rights not expressly granted are reserved. |
| 4 | +// |
| 5 | +// This software is distributed under the terms of the GNU General Public |
| 6 | +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". |
| 7 | +// |
| 8 | +// In applying this license CERN does not waive the privileges and immunities |
| 9 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 10 | +// or submit itself to any jurisdiction. |
| 11 | +/// |
| 12 | +/// \file TrackUtilities.cxx |
| 13 | +/// |
| 14 | +/// \brief Set of utilities for the ALICE3 track handling |
| 15 | +/// |
| 16 | +/// \since May 21, 2025 |
| 17 | +/// |
| 18 | + |
| 19 | +#include "TrackUtilities.h" |
| 20 | + |
| 21 | +#include <vector> |
| 22 | + |
| 23 | +void o2::upgrade::convertTLorentzVectorToO2Track(const int charge, |
| 24 | + const TLorentzVector particle, |
| 25 | + const std::vector<double> productionVertex, |
| 26 | + o2::track::TrackParCov& o2track) |
| 27 | +{ |
| 28 | + std::array<float, 5> params; |
| 29 | + std::array<float, 15> covm = {0.}; |
| 30 | + float s, c, x; |
| 31 | + o2::math_utils::sincos(static_cast<float>(particle.Phi()), s, c); |
| 32 | + o2::math_utils::rotateZInv(static_cast<float>(productionVertex[0]), static_cast<float>(productionVertex[1]), x, params[0], s, c); |
| 33 | + params[1] = static_cast<float>(productionVertex[2]); |
| 34 | + params[2] = 0.; // since alpha = phi |
| 35 | + const auto theta = 2. * std::atan(std::exp(-particle.PseudoRapidity())); |
| 36 | + params[3] = 1. / std::tan(theta); |
| 37 | + params[4] = charge / particle.Pt(); |
| 38 | + |
| 39 | + // Initialize TrackParCov in-place |
| 40 | + new (&o2track)(o2::track::TrackParCov)(x, particle.Phi(), params, covm); |
| 41 | +} |
0 commit comments