Skip to content

Commit 44bfbda

Browse files
Merge branch 'AliceO2Group:master' into master
2 parents 78f367c + a387656 commit 44bfbda

File tree

256 files changed

+28018
-6506
lines changed

Some content is hidden

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

256 files changed

+28018
-6506
lines changed

ALICE3/Core/FastTracker.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -442,11 +442,7 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa
442442
inputTrack.getXYZGlo(posIni);
443443
const float initialRadius = std::hypot(posIni[0], posIni[1]);
444444
const float kTrackingMargin = 0.1;
445-
const int kMaxNumberOfDetectors = 20;
446-
if (kMaxNumberOfDetectors < layers.size()) {
447-
LOG(fatal) << "Too many layers in FastTracker, increase kMaxNumberOfDetectors";
448-
return -1; // too many layers
449-
}
445+
450446
int firstActiveLayer = -1; // first layer that is not inert
451447
for (size_t i = 0; i < layers.size(); ++i) {
452448
if (!layers[i].isInert()) {
@@ -461,8 +457,12 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa
461457
const int xrhosteps = 100;
462458
const bool applyAngularCorrection = true;
463459

460+
// Delphes sets this to 20 instead of the number of layers,
461+
// but does not count all points in the tpc as layers which we do here
462+
// Loop over all the added layers to prevent crash when adding the tpc
463+
// Should not affect efficiency calculation
464464
goodHitProbability.clear();
465-
for (int i = 0; i < kMaxNumberOfDetectors; ++i) {
465+
for (size_t i = 0; i < layers.size(); ++i) {
466466
goodHitProbability.push_back(-1.);
467467
}
468468
goodHitProbability[0] = 1.; // we use layer zero to accumulate
@@ -650,7 +650,7 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa
650650

651651
// generate efficiency
652652
float eff = 1.;
653-
for (int i = 0; i < kMaxNumberOfDetectors; i++) {
653+
for (size_t i = 0; i < layers.size(); i++) {
654654
float iGoodHit = goodHitProbability[i];
655655
if (iGoodHit <= 0)
656656
continue;

ALICE3/DataModel/A3DecayFinderTables.h

Lines changed: 305 additions & 1 deletion
Large diffs are not rendered by default.

ALICE3/DataModel/OTFMulticharm.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ DECLARE_SOA_INDEX_COLUMN_FULL(XiCCPion, xiCCPion, int, Tracks, "_PiXiCC");
3636

3737
DECLARE_SOA_COLUMN(XicMass, xicMass, float);
3838
DECLARE_SOA_COLUMN(XiccMass, xiccMass, float);
39+
DECLARE_SOA_COLUMN(LUTConfigId, lutConfigId, int); //! Index for LUT configuration
3940

4041
// kine vars
4142
DECLARE_SOA_COLUMN(XiccPt, xiccPt, float);
@@ -155,7 +156,8 @@ DECLARE_SOA_TABLE(MCharmCores, "AOD", "MCharmCores",
155156
otfmulticharm::XiccProperLength,
156157
otfmulticharm::Pi1cPt,
157158
otfmulticharm::Pi2cPt,
158-
otfmulticharm::PiccPt);
159+
otfmulticharm::PiccPt,
160+
otfmulticharm::LUTConfigId);
159161

160162
DECLARE_SOA_TABLE(MCharmPID, "AOD", "MCharmPID",
161163
otfmulticharm::Pi1cTofDeltaInner,

ALICE3/DataModel/OTFStrangeness.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,37 @@ DECLARE_SOA_TABLE(UpgradeCascades, "AOD", "UPGRADECASCADES",
6565

6666
using UpgradeCascade = UpgradeCascades::iterator;
6767

68+
namespace otfv0
69+
{
70+
DECLARE_SOA_INDEX_COLUMN(Collision, collision); //!
71+
DECLARE_SOA_INDEX_COLUMN_FULL(PosTrack, posTrack, int, Tracks, "_Pos"); //!
72+
DECLARE_SOA_INDEX_COLUMN_FULL(NegTrack, negTrack, int, Tracks, "_Neg"); //!
73+
DECLARE_SOA_INDEX_COLUMN(V0, v0); //!
74+
75+
// topo vars
76+
DECLARE_SOA_COLUMN(DCAV0Daughters, dcaV0Daughters, float);
77+
DECLARE_SOA_COLUMN(V0Radius, v0Radius, float);
78+
DECLARE_SOA_COLUMN(MLambda, mLambda, float);
79+
DECLARE_SOA_COLUMN(MAntiLambda, mAntiLambda, float);
80+
DECLARE_SOA_COLUMN(MK0, mK0, float);
81+
82+
// kinematics
83+
DECLARE_SOA_COLUMN(Pt, pt, float);
84+
85+
} // namespace otfv0
86+
DECLARE_SOA_TABLE(UpgradeV0s, "AOD", "UPGRADEV0S",
87+
o2::soa::Index<>,
88+
otfv0::CollisionId,
89+
otfv0::PosTrackId,
90+
otfv0::NegTrackId,
91+
otfv0::DCAV0Daughters,
92+
otfv0::V0Radius,
93+
otfv0::MLambda,
94+
otfv0::MAntiLambda,
95+
otfv0::MK0,
96+
otfv0::Pt);
97+
98+
using UpgradeV0 = UpgradeV0s::iterator;
6899
} // namespace o2::aod
69100

70101
#endif // ALICE3_DATAMODEL_OTFSTRANGENESS_H_

ALICE3/DataModel/OTFTracks.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 OTFTracks.h
14+
/// \author Jesper Karlsson Gumprecht
15+
/// \since 11/11/2025
16+
/// \brief Table to map track to LUT configuration
17+
///
18+
19+
#ifndef ALICE3_DATAMODEL_OTFTRACKS_H_
20+
#define ALICE3_DATAMODEL_OTFTRACKS_H_
21+
22+
// O2 includes
23+
#include "Framework/AnalysisDataModel.h"
24+
25+
namespace o2::aod
26+
{
27+
namespace otftracks
28+
{
29+
DECLARE_SOA_COLUMN(LUTConfigId, lutConfigId, int); //! Index for LUT configuration
30+
} // namespace otftracks
31+
32+
DECLARE_SOA_TABLE(OTFLUTConfigId, "AOD", "OTFLUTConfigId", otftracks::LUTConfigId);
33+
} // namespace o2::aod
34+
35+
#endif // ALICE3_DATAMODEL_OTFTRACKS_H_

ALICE3/ML/HfMlResponse3Prong.h

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
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 Alice3MlRResponse3Prong.h
13+
/// \brief Class to compute the ML response for HF 3-prong candidates
14+
/// \author Marcello Di Costanzo <marcello.di.costanzo@cern.ch>, Polytechnic University of Turin and INFN Turin
15+
16+
#ifndef ALICE3_ML_HFMLRESPONSE3PRONG_H_
17+
#define ALICE3_ML_HFMLRESPONSE3PRONG_H_
18+
19+
#include "Tools/ML/MlResponse.h"
20+
21+
#include <cstdint>
22+
#include <map>
23+
#include <string>
24+
#include <vector>
25+
26+
// Fill the map of available input features
27+
// the key is the feature's name (std::string)
28+
// the value is the corresponding value in EnumInputFeatures
29+
#define FILL_MAP_3PRONG(FEATURE) \
30+
{ \
31+
#FEATURE, static_cast<uint8_t>(InputFeatures3Prong::FEATURE) \
32+
}
33+
34+
// Specific case of CHECK_AND_FILL_ML_ALICE3_FULL(OBJECT, FEATURE, GETTER)
35+
// where OBJECT is named candidate and FEATURE = GETTER
36+
#define CHECK_AND_FILL_ML_ALICE3(GETTER) \
37+
case static_cast<uint8_t>(InputFeatures3Prong::GETTER): { \
38+
inputFeatures.emplace_back(candidate.GETTER()); \
39+
break; \
40+
}
41+
42+
namespace o2::analysis
43+
{
44+
enum class InputFeatures3Prong : uint8_t {
45+
ptProng0 = 0,
46+
ptProng1,
47+
ptProng2,
48+
impactParameterY0,
49+
impactParameterY1,
50+
impactParameterY2,
51+
impactParameterZ0,
52+
impactParameterZ1,
53+
impactParameterZ2,
54+
decayLength,
55+
decayLengthXY,
56+
decayLengthXYNormalised,
57+
cpa,
58+
cpaXY,
59+
chi2PCA,
60+
nSigRichPr0, // 0
61+
nSigRichKa0, // 0
62+
nSigRichPi0, // 0
63+
nSigRichPr1, // 1
64+
nSigRichKa1, // 1
65+
nSigRichPi1, // 1
66+
nSigRichPr2, // 2
67+
nSigRichKa2, // 2
68+
nSigRichPi2, // 2
69+
nSigInnTofPr0, // 0
70+
nSigInnTofKa0, // 0
71+
nSigInnTofPi0, // 0
72+
nSigInnTofPr1, // 1
73+
nSigInnTofKa1, // 1
74+
nSigInnTofPi1, // 1
75+
nSigInnTofPr2, // 2
76+
nSigInnTofKa2, // 2
77+
nSigInnTofPi2, // 2
78+
nSigOutTofPr0, // 0
79+
nSigOutTofKa0, // 0
80+
nSigOutTofPi0, // 0
81+
nSigOutTofPr1, // 1
82+
nSigOutTofKa1, // 1
83+
nSigOutTofPi1, // 1
84+
nSigOutTofPr2, // 2
85+
nSigOutTofKa2, // 2
86+
nSigOutTofPi2, // 2
87+
nSigTrkPr0, // 0
88+
nSigTrkKa0, // 0
89+
nSigTrkPi0, // 0
90+
nSigTrkPr1, // 1
91+
nSigTrkKa1, // 1
92+
nSigTrkPi1, // 1
93+
nSigTrkPr2, // 2
94+
nSigTrkKa2, // 2
95+
nSigTrkPi2 // 2
96+
};
97+
98+
template <typename TypeOutputScore = float>
99+
class HfMlResponse3Prong : public MlResponse<TypeOutputScore>
100+
{
101+
public:
102+
/// Default constructor
103+
HfMlResponse3Prong() = default;
104+
/// Default destructor
105+
virtual ~HfMlResponse3Prong() = default;
106+
107+
/// Method to get the input features vector needed for ML inference
108+
/// \tparam T1 type of the 3-prong candidate
109+
/// \param candidate is the 3-prong candidate
110+
/// \return inputFeatures vector
111+
template <typename T1>
112+
std::vector<float> getInputFeatures(T1 const& candidate)
113+
{
114+
std::vector<float> inputFeatures;
115+
116+
for (const auto& idx : MlResponse<TypeOutputScore>::mCachedIndices) {
117+
switch (idx) {
118+
CHECK_AND_FILL_ML_ALICE3(ptProng0);
119+
CHECK_AND_FILL_ML_ALICE3(ptProng1);
120+
CHECK_AND_FILL_ML_ALICE3(ptProng2);
121+
CHECK_AND_FILL_ML_ALICE3(impactParameterY0);
122+
CHECK_AND_FILL_ML_ALICE3(impactParameterY1);
123+
CHECK_AND_FILL_ML_ALICE3(impactParameterY2);
124+
CHECK_AND_FILL_ML_ALICE3(impactParameterZ0);
125+
CHECK_AND_FILL_ML_ALICE3(impactParameterZ1);
126+
CHECK_AND_FILL_ML_ALICE3(impactParameterZ2);
127+
CHECK_AND_FILL_ML_ALICE3(decayLength);
128+
CHECK_AND_FILL_ML_ALICE3(decayLengthXY);
129+
CHECK_AND_FILL_ML_ALICE3(decayLengthXYNormalised);
130+
CHECK_AND_FILL_ML_ALICE3(cpa);
131+
CHECK_AND_FILL_ML_ALICE3(cpaXY);
132+
CHECK_AND_FILL_ML_ALICE3(chi2PCA);
133+
// TRACKER PID variables
134+
CHECK_AND_FILL_ML_ALICE3(nSigTrkPr0);
135+
CHECK_AND_FILL_ML_ALICE3(nSigTrkKa1);
136+
CHECK_AND_FILL_ML_ALICE3(nSigTrkPi2);
137+
// RICH PID variables
138+
CHECK_AND_FILL_ML_ALICE3(nSigRichPr0);
139+
CHECK_AND_FILL_ML_ALICE3(nSigRichKa1);
140+
CHECK_AND_FILL_ML_ALICE3(nSigRichPi2);
141+
// INNER TOF PID variables
142+
CHECK_AND_FILL_ML_ALICE3(nSigInnTofPr0);
143+
CHECK_AND_FILL_ML_ALICE3(nSigInnTofKa1);
144+
CHECK_AND_FILL_ML_ALICE3(nSigInnTofPi2);
145+
// OUTER TOF PID variables
146+
CHECK_AND_FILL_ML_ALICE3(nSigOutTofPr0);
147+
CHECK_AND_FILL_ML_ALICE3(nSigOutTofKa1);
148+
CHECK_AND_FILL_ML_ALICE3(nSigOutTofPi2);
149+
}
150+
}
151+
return inputFeatures;
152+
}
153+
154+
protected:
155+
/// Method to fill the map of available input features
156+
void setAvailableInputFeatures()
157+
{
158+
MlResponse<TypeOutputScore>::mAvailableInputFeatures = {
159+
FILL_MAP_3PRONG(ptProng0),
160+
FILL_MAP_3PRONG(ptProng1),
161+
FILL_MAP_3PRONG(ptProng2),
162+
FILL_MAP_3PRONG(impactParameterY0),
163+
FILL_MAP_3PRONG(impactParameterY1),
164+
FILL_MAP_3PRONG(impactParameterY2),
165+
FILL_MAP_3PRONG(impactParameterZ0),
166+
FILL_MAP_3PRONG(impactParameterZ1),
167+
FILL_MAP_3PRONG(impactParameterZ2),
168+
FILL_MAP_3PRONG(decayLength),
169+
FILL_MAP_3PRONG(decayLengthXY),
170+
FILL_MAP_3PRONG(decayLengthXYNormalised),
171+
FILL_MAP_3PRONG(cpa),
172+
FILL_MAP_3PRONG(cpaXY),
173+
FILL_MAP_3PRONG(chi2PCA),
174+
// RICH PID variables
175+
FILL_MAP_3PRONG(nSigRichPr0),
176+
FILL_MAP_3PRONG(nSigRichKa0),
177+
FILL_MAP_3PRONG(nSigRichPi0),
178+
FILL_MAP_3PRONG(nSigRichPr1),
179+
FILL_MAP_3PRONG(nSigRichKa1),
180+
FILL_MAP_3PRONG(nSigRichPi1),
181+
FILL_MAP_3PRONG(nSigRichPr2),
182+
FILL_MAP_3PRONG(nSigRichKa2),
183+
FILL_MAP_3PRONG(nSigRichPi2),
184+
// INNER TOF PID variables
185+
FILL_MAP_3PRONG(nSigInnTofPr0),
186+
FILL_MAP_3PRONG(nSigInnTofKa0),
187+
FILL_MAP_3PRONG(nSigInnTofPi0),
188+
FILL_MAP_3PRONG(nSigInnTofPr1),
189+
FILL_MAP_3PRONG(nSigInnTofKa1),
190+
FILL_MAP_3PRONG(nSigInnTofPi1),
191+
FILL_MAP_3PRONG(nSigInnTofPr2),
192+
FILL_MAP_3PRONG(nSigInnTofKa2),
193+
FILL_MAP_3PRONG(nSigInnTofPi2),
194+
// OUTER TOF PID variables
195+
FILL_MAP_3PRONG(nSigOutTofPr0),
196+
FILL_MAP_3PRONG(nSigOutTofKa0),
197+
FILL_MAP_3PRONG(nSigOutTofPi0),
198+
FILL_MAP_3PRONG(nSigOutTofPr1),
199+
FILL_MAP_3PRONG(nSigOutTofKa1),
200+
FILL_MAP_3PRONG(nSigOutTofPi1),
201+
FILL_MAP_3PRONG(nSigOutTofPr2),
202+
FILL_MAP_3PRONG(nSigOutTofKa2),
203+
FILL_MAP_3PRONG(nSigOutTofPi2),
204+
// TRACKER PID variables
205+
FILL_MAP_3PRONG(nSigTrkPr0),
206+
FILL_MAP_3PRONG(nSigTrkKa0),
207+
FILL_MAP_3PRONG(nSigTrkPi0),
208+
FILL_MAP_3PRONG(nSigTrkPr1),
209+
FILL_MAP_3PRONG(nSigTrkKa1),
210+
FILL_MAP_3PRONG(nSigTrkPi1),
211+
FILL_MAP_3PRONG(nSigTrkPr2),
212+
FILL_MAP_3PRONG(nSigTrkKa2),
213+
FILL_MAP_3PRONG(nSigTrkPi2)};
214+
}
215+
};
216+
217+
} // namespace o2::analysis
218+
219+
#undef FILL_MAP_3PRONG
220+
#undef CHECK_AND_FILL_ML_ALICE3
221+
222+
#endif // ALICE3_ML_HFMLRESPONSE3PRONG_H_

ALICE3/TableProducer/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,18 @@ o2physics_add_dpl_workflow(alice3-correlatorddbar
4545
SOURCES alice3-correlatorDDbar.cxx
4646
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
4747
COMPONENT_NAME Analysis)
48+
49+
o2physics_add_dpl_workflow(alice3-hf-selector-3prong
50+
SOURCES alice3HfSelector3Prong.cxx
51+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter O2Physics::MLCore
52+
COMPONENT_NAME Analysis)
53+
54+
o2physics_add_dpl_workflow(alice3-hf-tree-creator-3prong
55+
SOURCES alice3HfTreeCreator3Prong.cxx
56+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
57+
COMPONENT_NAME Analysis)
58+
59+
o2physics_add_dpl_workflow(alice3-tracking-translator
60+
SOURCES alice3TrackingTranslator.cxx
61+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
62+
COMPONENT_NAME Analysis)

0 commit comments

Comments
 (0)