Skip to content

Commit 177676e

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents 0cafff3 + 4ec9c7a commit 177676e

File tree

218 files changed

+7760
-4254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+7760
-4254
lines changed

.git-blame-ignore-revs

Whitespace-only changes.

.github/workflows/mega-linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
id: ml
3939
# You can override MegaLinter flavor used to have faster performances
4040
# More info at https://megalinter.io/flavors/
41-
uses: oxsecurity/megalinter@v8.5.0
41+
uses: oxsecurity/megalinter@v8.7.0
4242
env:
4343
# All available variables are described in documentation:
4444
# https://megalinter.io/configuration/

.mega-linter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ PYTHON_PYRIGHT_CONFIG_FILE: pyproject.toml
3939
PYTHON_RUFF_CONFIG_FILE: pyproject.toml
4040
CPP_CPPLINT_FILE_EXTENSIONS: [".C", ".c", ".c++", ".cc", ".cl", ".cpp", ".cu", ".cuh", ".cxx", ".cxx.in", ".h", ".h++", ".hh", ".h.in", ".hpp", ".hxx", ".inc", ".inl", ".macro"]
4141
CPP_CLANG_FORMAT_FILE_EXTENSIONS: [".C", ".c", ".c++", ".cc", ".cl", ".cpp", ".cu", ".cuh", ".cxx", ".cxx.in", ".h", ".h++", ".hh", ".h.in", ".hpp", ".hxx", ".inc", ".inl", ".macro"]
42+
CPP_CPPCHECK_ARGUMENTS: --language=c++ --std=c++20 --check-level=exhaustive --suppressions-list=cppcheck_config
4243
REPOSITORY_GITLEAKS_PR_COMMITS_SCAN: true

ALICE3/Core/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,22 @@
1212
o2physics_add_library(ALICE3Core
1313
SOURCES TOFResoALICE3.cxx
1414
DelphesO2TrackSmearer.cxx
15-
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore)
15+
PUBLIC_LINK_LIBRARIES O2::Framework
16+
O2Physics::AnalysisCore)
1617

1718
o2physics_target_root_dictionary(ALICE3Core
1819
HEADERS TOFResoALICE3.h
20+
TrackUtilities.h
1921
DelphesO2TrackSmearer.h
2022
LINKDEF ALICE3CoreLinkDef.h)
2123

2224
o2physics_add_library(FastTracker
2325
SOURCES FastTracker.cxx
24-
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore)
26+
DetLayer.cxx
27+
PUBLIC_LINK_LIBRARIES O2::Framework
28+
O2Physics::AnalysisCore)
2529

2630
o2physics_target_root_dictionary(FastTracker
2731
HEADERS FastTracker.h
32+
DetLayer.h
2833
LINKDEF FastTrackerLinkDef.h)

ALICE3/Core/DetLayer.cxx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
///
13+
/// \file DetLayer.cxx
14+
/// \author David Dobrigkeit Chinellato
15+
/// \since 11/03/2021
16+
/// \brief Basic struct to hold information regarding a detector layer to be used in fast simulation
17+
///
18+
19+
#include "DetLayer.h"

ALICE3/Core/FastTracker.cxx

Lines changed: 41 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// or submit itself to any jurisdiction.
1111

1212
#include <vector>
13+
#include <string>
1314
#include "TMath.h"
1415
#include "TMatrixD.h"
1516
#include "TRandom.h"
@@ -60,7 +61,7 @@ void FastTracker::AddLayer(TString name, float r, float z, float x0, float xrho,
6061
layers.push_back(newLayer);
6162
}
6263

63-
DetLayer FastTracker::GetLayer(int layer, bool ignoreBarrelLayers)
64+
DetLayer FastTracker::GetLayer(int layer, bool ignoreBarrelLayers) const
6465
{
6566
int layerIdx = layer;
6667
if (ignoreBarrelLayers) {
@@ -74,6 +75,18 @@ DetLayer FastTracker::GetLayer(int layer, bool ignoreBarrelLayers)
7475
return layers[layerIdx];
7576
}
7677

78+
int FastTracker::GetLayerIndex(std::string name) const
79+
{
80+
int i = 0;
81+
for (const auto& layer : layers) {
82+
if (layer.name == name) {
83+
return i;
84+
}
85+
i++;
86+
}
87+
return -1;
88+
}
89+
7790
void FastTracker::Print()
7891
{
7992
// print out layer setup
@@ -100,18 +113,18 @@ void FastTracker::AddSiliconALICE3v4(std::vector<float> pixelResolution)
100113
float resRPhiOT = pixelResolution[2];
101114
float resZOT = pixelResolution[3];
102115

103-
layers.push_back(DetLayer{"bpipe0", 0.48, 250, 0.00042, 2.772e-02, 0.0f, 0.0f, 0.0f, 0}); // 150 mum Be
104-
layers.push_back(DetLayer{"ddd0", 0.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1});
105-
layers.push_back(DetLayer{"ddd1", 1.2, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1});
106-
layers.push_back(DetLayer{"ddd2", 2.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1});
107-
layers.push_back(DetLayer{"bpipe1", 5.7, 250, 0.0014, 9.24e-02, 0.0f, 0.0f, 0.0f, 0}); // 500 mum Be
108-
layers.push_back(DetLayer{"ddd3", 7., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
109-
layers.push_back(DetLayer{"ddd4", 10., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
110-
layers.push_back(DetLayer{"ddd5", 13., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
111-
layers.push_back(DetLayer{"ddd6", 16., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
112-
layers.push_back(DetLayer{"ddd7", 25., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
113-
layers.push_back(DetLayer{"ddd8", 40., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
114-
layers.push_back(DetLayer{"ddd9", 45., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
116+
AddLayer("bpipe0", 0.48, 250, 0.00042, 2.772e-02, 0.0f, 0.0f, 0.0f, 0); // 150 mum Be
117+
AddLayer("ddd0", 0.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
118+
AddLayer("ddd1", 1.2, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
119+
AddLayer("ddd2", 2.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
120+
AddLayer("bpipe1", 5.7, 250, 0.0014, 9.24e-02, 0.0f, 0.0f, 0.0f, 0); // 500 mum Be
121+
AddLayer("ddd3", 7., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
122+
AddLayer("ddd4", 10., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
123+
AddLayer("ddd5", 13., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
124+
AddLayer("ddd6", 16., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
125+
AddLayer("ddd7", 25., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
126+
AddLayer("ddd8", 40., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
127+
AddLayer("ddd9", 45., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
115128
}
116129

117130
void FastTracker::AddSiliconALICE3v2(std::vector<float> pixelResolution)
@@ -128,19 +141,19 @@ void FastTracker::AddSiliconALICE3v2(std::vector<float> pixelResolution)
128141
float resRPhiOT = pixelResolution[2];
129142
float resZOT = pixelResolution[3];
130143

131-
layers.push_back(DetLayer{"bpipe0", 0.48, 250, 0.00042, 2.772e-02, 0.0f, 0.0f, 0.0f, 0}); // 150 mum Be
132-
layers.push_back(DetLayer{"B00", 0.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1});
133-
layers.push_back(DetLayer{"B01", 1.2, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1});
134-
layers.push_back(DetLayer{"B02", 2.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1});
135-
layers.push_back(DetLayer{"bpipe1", 3.7, 250, 0.0014, 9.24e-02, 0.0f, 0.0f, 0.0f, 0}); // 500 mum Be
136-
layers.push_back(DetLayer{"B03", 3.75, 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
137-
layers.push_back(DetLayer{"B04", 7., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
138-
layers.push_back(DetLayer{"B05", 12., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
139-
layers.push_back(DetLayer{"B06", 20., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
140-
layers.push_back(DetLayer{"B07", 30., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
141-
layers.push_back(DetLayer{"B08", 45., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
142-
layers.push_back(DetLayer{"B09", 60., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
143-
layers.push_back(DetLayer{"B10", 80., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1});
144+
AddLayer("bpipe0", 0.48, 250, 0.00042, 2.772e-02, 0.0f, 0.0f, 0.0f, 0); // 150 mum Be
145+
AddLayer("B00", 0.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
146+
AddLayer("B01", 1.2, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
147+
AddLayer("B02", 2.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
148+
AddLayer("bpipe1", 3.7, 250, 0.0014, 9.24e-02, 0.0f, 0.0f, 0.0f, 0); // 500 mum Be
149+
AddLayer("B03", 3.75, 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
150+
AddLayer("B04", 7., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
151+
AddLayer("B05", 12., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
152+
AddLayer("B06", 20., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
153+
AddLayer("B07", 30., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
154+
AddLayer("B08", 45., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
155+
AddLayer("B09", 60., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
156+
AddLayer("B10", 80., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
144157
}
145158

146159
void FastTracker::AddTPC(float phiResMean, float zResMean)
@@ -202,7 +215,7 @@ float FastTracker::Dist(float z, float r)
202215
if (i == nSteps - 1)
203216
index = 1;
204217
z0 = -4 * sigmaD + i * dz0;
205-
dist += index * (dz0 / 3.) * (1 / o2::math_utils::sqrt(o2::constants::math::TwoPI) / sigmaD) * exp(-z0 * z0 / 2. / sigmaD / sigmaD) * (1 / o2::math_utils::sqrt((z - z0) * (z - z0) + r * r));
218+
dist += index * (dz0 / 3.) * (1 / o2::math_utils::sqrt(o2::constants::math::TwoPI) / sigmaD) * std::exp(-z0 * z0 / 2. / sigmaD / sigmaD) * (1 / o2::math_utils::sqrt((z - z0) * (z - z0) + r * r));
206219
if (index != 4)
207220
index = 4;
208221
else
@@ -283,7 +296,7 @@ float FastTracker::ProbGoodChiSqHit(float radius, float searchRadiusRPhi, float
283296

284297
// function to provide a reconstructed track from a perfect input track
285298
// returns number of intercepts (generic for now)
286-
int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackParCov& outputTrack, float nch)
299+
int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackParCov& outputTrack, const float nch)
287300
{
288301
hits.clear();
289302
nIntercepts = 0;
@@ -333,7 +346,6 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa
333346
// was there a problem on this layer?
334347
if (!ok && il > 0) { // may fail to reach target layer due to the eloss
335348
float rad2 = inputTrack.getX() * inputTrack.getX() + inputTrack.getY() * inputTrack.getY();
336-
float fMinRadTrack = 132.;
337349
float maxR = layers[il - 1].r + kTrackingMargin * 2;
338350
float minRad = (fMinRadTrack > 0 && fMinRadTrack < maxR) ? fMinRadTrack : maxR;
339351
if (rad2 - minRad * minRad < kTrackingMargin * kTrackingMargin) { // check previously reached layer

ALICE3/Core/FastTracker.h

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include <fairlogger/Logger.h> // not a system header but megalinter thinks so
1616
#include <vector>
17+
#include <string>
1718
#include "DetLayer.h"
1819
#include "ReconstructionDataFormats/Track.h"
1920

@@ -34,15 +35,38 @@ class FastTracker
3435
FastTracker();
3536
virtual ~FastTracker() {}
3637

38+
// Layer and layer configuration
3739
void AddLayer(TString name, float r, float z, float x0, float xrho, float resRPhi = 0.0f, float resZ = 0.0f, float eff = 0.0f, int type = 0);
38-
DetLayer GetLayer(const int layer, bool ignoreBarrelLayers = true);
40+
DetLayer GetLayer(const int layer, bool ignoreBarrelLayers = true) const;
41+
int GetLayerIndex(const std::string name) const;
42+
void SetRadiationLength(const std::string layerName, float x0) { layers[GetLayerIndex(layerName)].x0 = x0; }
43+
void SetRadius(const std::string layerName, float r) { layers[GetLayerIndex(layerName)].r = r; }
44+
void SetResolutionRPhi(const std::string layerName, float resRPhi) { layers[GetLayerIndex(layerName)].resRPhi = resRPhi; }
45+
void SetResolutionZ(const std::string layerName, float resZ) { layers[GetLayerIndex(layerName)].resZ = resZ; }
46+
void SetResolution(const std::string layerName, float resRPhi, float resZ)
47+
{
48+
SetResolutionRPhi(layerName, resRPhi);
49+
SetResolutionZ(layerName, resZ);
50+
}
3951

4052
void AddSiliconALICE3v4(std::vector<float> pixelResolution);
4153
void AddSiliconALICE3v2(std::vector<float> pixelResolution);
4254
void AddTPC(float phiResMean, float zResMean);
4355

4456
void Print();
45-
int FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackParCov& outputTrack, float nch);
57+
58+
/**
59+
* @brief Performs fast tracking on the input track parameters.
60+
*
61+
* Propagates the given input track through the detector layers, applying
62+
* relevant corrections and updates, and stores the result in outputTrack.
63+
*
64+
* @param inputTrack The input track parameters and covariance (const, by value).
65+
* @param outputTrack Reference to the output track parameters and covariance, to be filled.
66+
* @param nch Charged particle multiplicity (used for hit density calculations).
67+
* @return int i.e. number of intercepts (implementation-defined).
68+
*/
69+
int FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackParCov& outputTrack, const float nch);
4670

4771
// For efficiency calculation
4872
float Dist(float z, float radius);
@@ -52,6 +76,32 @@ class FastTracker
5276
float HitDensity(float radius);
5377
float ProbGoodChiSqHit(float radius, float searchRadiusRPhi, float searchRadiusZ);
5478

79+
// Setters and getters for configuration
80+
void SetIntegrationTime(float t) { integrationTime = t; }
81+
void SetMaxRadiusOfSlowDetectors(float r) { maxRadiusSlowDet = r; }
82+
void SetAvgRapidity(float y) { avgRapidity = y; }
83+
void SetdNdEtaCent(float d) { dNdEtaCent = d; }
84+
void SetLhcUPCscale(float s) { lhcUPCScale = s; }
85+
void SetBField(float b) { magneticField = b; }
86+
void SetMinRadTrack(float r) { fMinRadTrack = r; }
87+
void SetMagneticField(float b) { magneticField = b; }
88+
void SetApplyZacceptance(bool b) { applyZacceptance = b; }
89+
void SetApplyMSCorrection(bool b) { applyMSCorrection = b; }
90+
void SetApplyElossCorrection(bool b) { applyElossCorrection = b; }
91+
92+
// Getters for the last track
93+
int GetNIntercepts() const { return nIntercepts; }
94+
int GetNSiliconPoints() const { return nSiliconPoints; }
95+
int GetNGasPoints() const { return nGasPoints; }
96+
float GetGoodHitProb(int layer) const { return goodHitProbability[layer]; }
97+
std::size_t GetNHits() const { return hits.size(); }
98+
float GetHitX(const int i) const { return hits[i][0]; }
99+
float GetHitY(const int i) const { return hits[i][1]; }
100+
float GetHitZ(const int i) const { return hits[i][2]; }
101+
uint64_t GetCovMatOK() const { return covMatOK; }
102+
uint64_t GetCovMatNotOK() const { return covMatNotOK; }
103+
104+
private:
55105
// Definition of detector layers
56106
std::vector<DetLayer> layers;
57107
std::vector<std::vector<float>> hits; // bookkeep last added hits
@@ -75,6 +125,7 @@ class FastTracker
75125
float avgRapidity;
76126
float lhcUPCScale;
77127
float upcBackgroundMultiplier;
128+
float fMinRadTrack = 132.;
78129

79130
uint64_t covMatOK; // cov mat has negative eigenvals
80131
uint64_t covMatNotOK; // cov mat has negative eigenvals

ALICE3/Core/TrackUtilities.h

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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.h
13+
///
14+
/// \brief Set of utilities for the ALICE3 track handling
15+
///
16+
/// \since May 21, 2025
17+
///
18+
19+
#ifndef ALICE3_CORE_TRACKUTILITIES_H_
20+
#define ALICE3_CORE_TRACKUTILITIES_H_
21+
22+
#include <vector>
23+
24+
#include "ReconstructionDataFormats/Track.h"
25+
#include "Framework/O2DatabasePDGPlugin.h"
26+
#include "Framework/AnalysisHelpers.h"
27+
#include "TLorentzVector.h"
28+
29+
namespace o2::upgrade
30+
{
31+
32+
/// Function to convert a TLorentzVector into a perfect Track
33+
/// \param charge particle charge (integer)
34+
/// \param particle the particle to convert (TLorentzVector)
35+
/// \param productionVertex where the particle was produced
36+
/// \param o2track the address of the resulting TrackParCov
37+
void convertTLorentzVectorToO2Track(const int charge,
38+
const TLorentzVector particle,
39+
const std::vector<double> productionVertex,
40+
o2::track::TrackParCov& o2track)
41+
{
42+
std::array<float, 5> params;
43+
std::array<float, 15> covm = {0.};
44+
float s, c, x;
45+
o2::math_utils::sincos(static_cast<float>(particle.Phi()), s, c);
46+
o2::math_utils::rotateZInv(static_cast<float>(productionVertex[0]), static_cast<float>(productionVertex[1]), x, params[0], s, c);
47+
params[1] = static_cast<float>(productionVertex[2]);
48+
params[2] = 0.; // since alpha = phi
49+
const auto theta = 2. * std::atan(std::exp(-particle.PseudoRapidity()));
50+
params[3] = 1. / std::tan(theta);
51+
params[4] = charge / particle.Pt();
52+
53+
// Initialize TrackParCov in-place
54+
new (&o2track)(o2::track::TrackParCov)(x, particle.Phi(), params, covm);
55+
}
56+
57+
/// Function to convert a TLorentzVector into a perfect Track
58+
/// \param pdgCode particle pdg
59+
/// \param particle the particle to convert (TLorentzVector)
60+
/// \param productionVertex where the particle was produced
61+
/// \param o2track the address of the resulting TrackParCov
62+
/// \param pdg the pdg service
63+
void convertTLorentzVectorToO2Track(int pdgCode,
64+
TLorentzVector particle,
65+
std::vector<double> productionVertex,
66+
o2::track::TrackParCov& o2track,
67+
const o2::framework::Service<o2::framework::O2DatabasePDG>& pdg)
68+
{
69+
const auto pdgInfo = pdg->GetParticle(pdgCode);
70+
int charge = 0;
71+
if (pdgInfo != nullptr) {
72+
charge = pdgInfo->Charge() / 3;
73+
}
74+
convertTLorentzVectorToO2Track(charge, particle, productionVertex, o2track);
75+
}
76+
77+
/// Function to convert a McParticle into a perfect Track
78+
/// \param particle the particle to convert (mcParticle)
79+
/// \param o2track the address of the resulting TrackParCov
80+
/// \param pdg the pdg service
81+
template <typename McParticleType>
82+
void convertMCParticleToO2Track(McParticleType& particle,
83+
o2::track::TrackParCov& o2track,
84+
const o2::framework::Service<o2::framework::O2DatabasePDG>& pdg)
85+
{
86+
static TLorentzVector tlv;
87+
tlv.SetPxPyPzE(particle.px(), particle.py(), particle.pz(), particle.e());
88+
tlv.SetXYZT(particle.vx(), particle.vy(), particle.vz(), particle.vt());
89+
convertTLorentzVectorToO2Track(particle.pdgCode(), tlv, {particle.vx(), particle.vy(), particle.vz()}, o2track, pdg);
90+
}
91+
92+
/// Function to convert a McParticle into a perfect Track
93+
/// \param particle the particle to convert (mcParticle)
94+
/// \param o2track the address of the resulting TrackParCov
95+
/// \param pdg the pdg service
96+
template <typename McParticleType>
97+
o2::track::TrackParCov convertMCParticleToO2Track(McParticleType& particle,
98+
const o2::framework::Service<o2::framework::O2DatabasePDG>& pdg)
99+
{
100+
o2::track::TrackParCov o2track;
101+
convertMCParticleToO2Track(particle, o2track, pdg);
102+
return o2track;
103+
}
104+
105+
} // namespace o2::upgrade
106+
107+
#endif // ALICE3_CORE_TRACKUTILITIES_H_

0 commit comments

Comments
 (0)