Skip to content

Commit 7c28d95

Browse files
authored
Merge branch 'AliceO2Group:master' into master
2 parents f296de6 + 1fc194d commit 7c28d95

32 files changed

+1591
-658
lines changed

.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
4243
REPOSITORY_GITLEAKS_PR_COMMITS_SCAN: true

ALICE3/Core/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ o2physics_target_root_dictionary(ALICE3Core
2323

2424
o2physics_add_library(FastTracker
2525
SOURCES FastTracker.cxx
26+
DetLayer.cxx
2627
PUBLIC_LINK_LIBRARIES O2::Framework
2728
O2Physics::AnalysisCore)
2829

2930
o2physics_target_root_dictionary(FastTracker
3031
HEADERS FastTracker.h
32+
DetLayer.h
3133
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: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void FastTracker::AddLayer(TString name, float r, float z, float x0, float xrho,
6060
layers.push_back(newLayer);
6161
}
6262

63-
DetLayer FastTracker::GetLayer(int layer, bool ignoreBarrelLayers)
63+
DetLayer FastTracker::GetLayer(int layer, bool ignoreBarrelLayers) const
6464
{
6565
int layerIdx = layer;
6666
if (ignoreBarrelLayers) {
@@ -74,6 +74,18 @@ DetLayer FastTracker::GetLayer(int layer, bool ignoreBarrelLayers)
7474
return layers[layerIdx];
7575
}
7676

77+
int FastTracker::GetLayerIndex(std::string name) const
78+
{
79+
int i = 0;
80+
for (const auto& layer : layers) {
81+
if (layer.name == name) {
82+
return i;
83+
}
84+
i++;
85+
}
86+
return -1;
87+
}
88+
7789
void FastTracker::Print()
7890
{
7991
// print out layer setup
@@ -100,18 +112,18 @@ void FastTracker::AddSiliconALICE3v4(std::vector<float> pixelResolution)
100112
float resRPhiOT = pixelResolution[2];
101113
float resZOT = pixelResolution[3];
102114

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});
115+
AddLayer("bpipe0", 0.48, 250, 0.00042, 2.772e-02, 0.0f, 0.0f, 0.0f, 0); // 150 mum Be
116+
AddLayer("ddd0", 0.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
117+
AddLayer("ddd1", 1.2, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
118+
AddLayer("ddd2", 2.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
119+
AddLayer("bpipe1", 5.7, 250, 0.0014, 9.24e-02, 0.0f, 0.0f, 0.0f, 0); // 500 mum Be
120+
AddLayer("ddd3", 7., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
121+
AddLayer("ddd4", 10., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
122+
AddLayer("ddd5", 13., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
123+
AddLayer("ddd6", 16., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
124+
AddLayer("ddd7", 25., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
125+
AddLayer("ddd8", 40., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
126+
AddLayer("ddd9", 45., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
115127
}
116128

117129
void FastTracker::AddSiliconALICE3v2(std::vector<float> pixelResolution)
@@ -128,19 +140,19 @@ void FastTracker::AddSiliconALICE3v2(std::vector<float> pixelResolution)
128140
float resRPhiOT = pixelResolution[2];
129141
float resZOT = pixelResolution[3];
130142

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});
143+
AddLayer("bpipe0", 0.48, 250, 0.00042, 2.772e-02, 0.0f, 0.0f, 0.0f, 0); // 150 mum Be
144+
AddLayer("B00", 0.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
145+
AddLayer("B01", 1.2, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
146+
AddLayer("B02", 2.5, 250, x0IT, xrhoIB, resRPhiIT, resZIT, eff, 1);
147+
AddLayer("bpipe1", 3.7, 250, 0.0014, 9.24e-02, 0.0f, 0.0f, 0.0f, 0); // 500 mum Be
148+
AddLayer("B03", 3.75, 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
149+
AddLayer("B04", 7., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
150+
AddLayer("B05", 12., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
151+
AddLayer("B06", 20., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
152+
AddLayer("B07", 30., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
153+
AddLayer("B08", 45., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
154+
AddLayer("B09", 60., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
155+
AddLayer("B10", 80., 250, x0OT, xrhoOT, resRPhiOT, resZOT, eff, 1);
144156
}
145157

146158
void FastTracker::AddTPC(float phiResMean, float zResMean)
@@ -333,7 +345,6 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa
333345
// was there a problem on this layer?
334346
if (!ok && il > 0) { // may fail to reach target layer due to the eloss
335347
float rad2 = inputTrack.getX() * inputTrack.getX() + inputTrack.getY() * inputTrack.getY();
336-
float fMinRadTrack = 132.;
337348
float maxR = layers[il - 1].r + kTrackingMargin * 2;
338349
float minRad = (fMinRadTrack > 0 && fMinRadTrack < maxR) ? fMinRadTrack : maxR;
339350
if (rad2 - minRad * minRad < kTrackingMargin * kTrackingMargin) { // check previously reached layer

ALICE3/Core/FastTracker.h

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ class FastTracker
3535
virtual ~FastTracker() {}
3636

3737
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);
38+
DetLayer GetLayer(const int layer, bool ignoreBarrelLayers = true) const;
39+
int GetLayerIndex(const std::string name) const;
3940

4041
void AddSiliconALICE3v4(std::vector<float> pixelResolution);
4142
void AddSiliconALICE3v2(std::vector<float> pixelResolution);
@@ -55,6 +56,15 @@ class FastTracker
5556
// Definition of detector layers
5657
std::vector<DetLayer> layers;
5758
std::vector<std::vector<float>> hits; // bookkeep last added hits
59+
void SetRadiationLength(const std::string layerName, float x0) { layers[GetLayerIndex(layerName)].x0 = x0; }
60+
void SetRadius(const std::string layerName, float r) { layers[GetLayerIndex(layerName)].r = r; }
61+
void SetResolutionRPhi(const std::string layerName, float resRPhi) { layers[GetLayerIndex(layerName)].resRPhi = resRPhi; }
62+
void SetResolutionZ(const std::string layerName, float resZ) { layers[GetLayerIndex(layerName)].resZ = resZ; }
63+
void SetResolution(const std::string layerName, float resRPhi, float resZ)
64+
{
65+
SetResolutionRPhi(layerName, resRPhi);
66+
SetResolutionZ(layerName, resZ);
67+
}
5868

5969
// operational
6070
bool applyZacceptance; // check z acceptance or not
@@ -75,6 +85,17 @@ class FastTracker
7585
float avgRapidity;
7686
float lhcUPCScale;
7787
float upcBackgroundMultiplier;
88+
float fMinRadTrack = 132.;
89+
90+
// Setters and getters
91+
void SetIntegrationTime(float t) { integrationTime = t; }
92+
void SetMaxRadiusOfSlowDetectors(float r) { maxRadiusSlowDet = r; }
93+
void SetAvgRapidity(float y) { avgRapidity = y; }
94+
void SetdNdEtaCent(float d) { dNdEtaCent = d; }
95+
void SetLhcUPCscale(float s) { lhcUPCScale = s; }
96+
void SetBField(float b) { magneticField = b; }
97+
void SetMinRadTrack(float r) { fMinRadTrack = r; }
98+
// void SetAtLeastHits(int n) { fMinRadTrack = n; }
7899

79100
uint64_t covMatOK; // cov mat has negative eigenvals
80101
uint64_t covMatNotOK; // cov mat has negative eigenvals
@@ -84,6 +105,7 @@ class FastTracker
84105
int nSiliconPoints; // silicon-based space points added to track
85106
int nGasPoints; // tpc-based space points added to track
86107
std::vector<float> goodHitProbability;
108+
float GetGoodHitProb(int layer) const { return goodHitProbability[layer]; }
87109

88110
ClassDef(FastTracker, 1);
89111
};

ALICE3/DataModel/OTFPIDTrk.h

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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 OTFPIDTrk.h
14+
/// \author Berkin Ulukutlu TUM
15+
/// \author Henrik Fribert TUM
16+
/// \author Nicolò Jacazio Università del Piemonte Orientale
17+
/// \since May 22, 2025
18+
/// \brief Set of tables for the ALICE3 Trk PID information
19+
///
20+
21+
#ifndef ALICE3_DATAMODEL_OTFPIDTRK_H_
22+
#define ALICE3_DATAMODEL_OTFPIDTRK_H_
23+
24+
// O2 includes
25+
#include "Framework/AnalysisDataModel.h"
26+
27+
namespace o2::aod
28+
{
29+
namespace upgrade::trk
30+
{
31+
32+
DECLARE_SOA_COLUMN(TimeOverThresholdBarrel, timeOverThresholdBarrel, float); //! Time over threshold for the barrel layers
33+
DECLARE_SOA_COLUMN(ClusterSizeBarrel, clusterSizeBarrel, float); //! Cluster size for the barrel layers
34+
DECLARE_SOA_COLUMN(TimeOverThresholdForward, timeOverThresholdForward, float); //! Time over threshold for the Forward layers
35+
DECLARE_SOA_COLUMN(ClusterSizeForward, clusterSizeForward, float); //! Cluster size for the barrel layers
36+
37+
DECLARE_SOA_COLUMN(NSigmaTrkEl, nSigmaEl, float); //! NSigma electron from the tracker layers
38+
DECLARE_SOA_COLUMN(NSigmaTrkMu, nSigmaMu, float); //! NSigma muon from the tracker layers
39+
DECLARE_SOA_COLUMN(NSigmaTrkPi, nSigmaPi, float); //! NSigma pion from the tracker layers
40+
DECLARE_SOA_COLUMN(NSigmaTrkKa, nSigmaKa, float); //! NSigma kaon from the tracker layers
41+
DECLARE_SOA_COLUMN(NSigmaTrkPr, nSigmaPr, float); //! NSigma proton from the tracker layers
42+
43+
DECLARE_SOA_DYNAMIC_COLUMN(NSigmaTrk, nSigmaTrk, //! General function to get the nSigma for the tracker layers
44+
[](const float el,
45+
const float mu,
46+
const float pi,
47+
const float ka,
48+
const float pr,
49+
const int id) -> float {
50+
switch (std::abs(id)) {
51+
case 0:
52+
return el;
53+
case 1:
54+
return mu;
55+
case 2:
56+
return pi;
57+
case 3:
58+
return ka;
59+
case 4:
60+
return pr;
61+
default:
62+
LOG(fatal) << "Unrecognized PDG code for InnerTOF";
63+
return 999.f;
64+
}
65+
});
66+
67+
} // namespace upgrade::trk
68+
69+
DECLARE_SOA_TABLE(UpgradeTrkPidSignals, "AOD", "UPGRADETRKSIG",
70+
upgrade::trk::TimeOverThresholdBarrel,
71+
upgrade::trk::ClusterSizeBarrel);
72+
73+
DECLARE_SOA_TABLE(UpgradeTrkPids, "AOD", "UPGRADETRKPID",
74+
upgrade::trk::NSigmaTrkEl,
75+
upgrade::trk::NSigmaTrkMu,
76+
upgrade::trk::NSigmaTrkPi,
77+
upgrade::trk::NSigmaTrkKa,
78+
upgrade::trk::NSigmaTrkPr,
79+
upgrade::trk::NSigmaTrk<upgrade::trk::NSigmaTrkEl,
80+
upgrade::trk::NSigmaTrkMu,
81+
upgrade::trk::NSigmaTrkPi,
82+
upgrade::trk::NSigmaTrkKa,
83+
upgrade::trk::NSigmaTrkPr>);
84+
85+
using UpgradeTrkPidSignal = UpgradeTrkPidSignals::iterator;
86+
using UpgradeTrkPid = UpgradeTrkPids::iterator;
87+
88+
} // namespace o2::aod
89+
90+
#endif // ALICE3_DATAMODEL_OTFPIDTRK_H_

ALICE3/TableProducer/OTF/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,8 @@ o2physics_add_dpl_workflow(onthefly-richpid
2323
SOURCES onTheFlyRichPid.cxx
2424
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsCommonDataFormats O2Physics::ALICE3Core
2525
COMPONENT_NAME Analysis)
26+
27+
o2physics_add_dpl_workflow(onthefly-trkpid
28+
SOURCES onTheFlyTrackerPid.cxx
29+
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsCommonDataFormats O2Physics::ALICE3Core
30+
COMPONENT_NAME Analysis)

0 commit comments

Comments
 (0)