Skip to content

Commit 9158354

Browse files
authored
Merge branch 'AliceO2Group:dev' into new-detector4
2 parents b148f09 + 3eadf36 commit 9158354

File tree

77 files changed

+1897
-1168
lines changed

Some content is hidden

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

77 files changed

+1897
-1168
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
/Detectors/TPC @davidrohr @wiechula @shahor02
7474
/Detectors/TRD @f3sch @bazinski @wille10
7575
/Detectors/Upgrades @mconcas
76+
/Detectors/Upgrades/ALICE3 @mconcas @njacazio
7677
/Detectors/Upgrades/ITS3 @fgrosa @arossi81 @mconcas @f3sch
7778
/Detectors/ZDC @coppedis
7879
/Detectors/CTF @shahor02

Common/ML/include/ML/OrtInterface.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,23 @@ class OrtModel
7070
Ort::SessionOptions* getSessionOptions();
7171
Ort::MemoryInfo* getMemoryInfo();
7272
Ort::Env* getEnv();
73-
int32_t getIntraOpNumThreads() const { return intraOpNumThreads; }
74-
int32_t getInterOpNumThreads() const { return interOpNumThreads; }
73+
int32_t getIntraOpNumThreads() const { return mIntraOpNumThreads; }
74+
int32_t getInterOpNumThreads() const { return mInterOpNumThreads; }
7575

7676
// Setters
77-
void setDeviceId(int32_t id) { deviceId = id; }
77+
void setDeviceId(int32_t id) { mDeviceId = id; }
7878
void setIO();
79-
void setActiveThreads(int threads) { intraOpNumThreads = threads; }
79+
void setActiveThreads(int threads) { mIntraOpNumThreads = threads; }
8080
void setIntraOpNumThreads(int threads)
8181
{
82-
if (deviceType == "CPU") {
83-
intraOpNumThreads = threads;
82+
if (mDeviceType == "CPU") {
83+
mIntraOpNumThreads = threads;
8484
}
8585
}
8686
void setInterOpNumThreads(int threads)
8787
{
88-
if (deviceType == "CPU") {
89-
interOpNumThreads = threads;
88+
if (mDeviceType == "CPU") {
89+
mInterOpNumThreads = threads;
9090
}
9191
}
9292
void setEnv(Ort::Env*);
@@ -113,19 +113,19 @@ class OrtModel
113113
private:
114114
// ORT variables -> need to be hidden as pImpl
115115
struct OrtVariables;
116-
OrtVariables* pImplOrt;
116+
OrtVariables* mPImplOrt;
117117

118118
// Input & Output specifications of the loaded network
119-
std::vector<const char*> inputNamesChar, outputNamesChar;
119+
std::vector<const char*> mInputNamesChar, mOutputNamesChar;
120120
std::vector<std::string> mInputNames, mOutputNames;
121-
std::vector<std::vector<int64_t>> mInputShapes, mOutputShapes, inputShapesCopy, outputShapesCopy; // Input shapes
122-
std::vector<int64_t> inputSizePerNode, outputSizePerNode; // Output shapes
123-
int32_t mInputsTotal = 0, mOutputsTotal = 0; // Total number of inputs and outputs
121+
std::vector<std::vector<int64_t>> mInputShapes, mOutputShapes, mInputShapesCopy, mOutputShapesCopy; // Input shapes
122+
std::vector<int64_t> mInputSizePerNode, mOutputSizePerNode; // Output shapes
123+
int32_t mInputsTotal = 0, mOutputsTotal = 0; // Total number of inputs and outputs
124124

125125
// Environment settings
126126
bool mInitialized = false;
127-
std::string modelPath, envName = "", deviceType = "CPU", thread_affinity = ""; // device options should be cpu, rocm, migraphx, cuda
128-
int32_t intraOpNumThreads = 1, interOpNumThreads = 1, deviceId = -1, enableProfiling = 0, loggingLevel = 0, allocateDeviceMemory = 0, enableOptimizations = 0;
127+
std::string mModelPath, mEnvName = "", mDeviceType = "CPU", mThreadAffinity = ""; // device options should be cpu, rocm, migraphx, cuda
128+
int32_t mIntraOpNumThreads = 1, mInterOpNumThreads = 1, mDeviceId = -1, mEnableProfiling = 0, mLoggingLevel = 0, mAllocateDeviceMemory = 0, mEnableOptimizations = 0;
129129

130130
std::string printShape(const std::vector<int64_t>&);
131131
std::string printShape(const std::vector<std::vector<int64_t>>&, std::vector<std::string>&);

Common/ML/src/OrtInterface.cxx

Lines changed: 125 additions & 125 deletions
Large diffs are not rendered by default.

DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackLTIntegral.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class TrackLTIntegral
6363
}
6464
}
6565

66-
GPUd() void addStep(float dL, float p2Inv);
66+
GPUd() void addStep(float dL, float q2p2);
6767
GPUd() void addX2X0(float d) { mX2X0 += d; }
6868
GPUd() void addXRho(float d) { mXRho += d; }
6969

DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackParametrization.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ class TrackParametrization
191191
GPUd() value_t getPhi() const;
192192
GPUd() value_t getPhiPos() const;
193193

194+
GPUd() value_t getQ2P2() const;
194195
GPUd() value_t getPtInv() const;
195196
GPUd() value_t getP2Inv() const;
196197
GPUd() value_t getP2() const;
@@ -555,6 +556,18 @@ GPUdi() auto TrackParametrization<value_T>::getPhiPos() const -> value_t
555556
return phi;
556557
}
557558

559+
//____________________________________________________________
560+
template <typename value_T>
561+
GPUdi() auto TrackParametrization<value_T>::getQ2P2() const -> value_t
562+
{
563+
// return the (q/p)^2
564+
value_t q2pt2 = mP[kQ2Pt] * mP[kQ2Pt];
565+
if (q2pt2 < MinPTInv * MinPTInv) {
566+
q2pt2 = MinPTInv * MinPTInv;
567+
}
568+
return q2pt2 / (1.f + getTgl() * getTgl());
569+
}
570+
558571
//____________________________________________________________
559572
template <typename value_T>
560573
GPUdi() auto TrackParametrization<value_T>::getPtInv() const -> value_t

DataFormats/Reconstruction/src/TrackLTIntegral.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ GPUd() void TrackLTIntegral::print() const
3939
}
4040

4141
//_____________________________________________________
42-
GPUd() void TrackLTIntegral::addStep(float dL, float p2Inv)
42+
GPUd() void TrackLTIntegral::addStep(float dL, float q2p2)
4343
{
44-
///< add step in cm to integrals
44+
///< add step in cm to integrals, q2p2 is (q/p)^2.
4545
mL += dL;
4646
if (isTimeNotNeeded()) {
4747
return;
4848
}
4949
const float dTns = dL * 1000.f / o2::constants::physics::LightSpeedCm2NS; // time change in ps for beta = 1 particle
5050
for (int id = 0; id < getNTOFs(); id++) {
5151
const float m2z = track::PID::getMass2Z(id);
52-
const float betaInv = math_utils::sqrt(1.f + m2z * m2z * p2Inv);
52+
const float betaInv = math_utils::sqrt(1.f + m2z * m2z * q2p2);
5353
mT[id] += dTns * betaInv;
5454
}
5555
}

DataFormats/Reconstruction/test/testLTOFIntegration.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ BOOST_AUTO_TEST_CASE(TrackLTIntegral)
3333
const int nStep = 100;
3434
const float dx2x0 = 0.01f;
3535
for (int i = 0; i < nStep; i++) {
36-
lt.addStep(1., trc.getP2Inv());
37-
lt1.addStep(1., trc1.getP2Inv());
36+
lt.addStep(1., trc.getQ2P2());
37+
lt1.addStep(1., trc1.getQ2P2());
3838
lt1.addX2X0(dx2x0);
3939
}
4040
trc.printParam();

Detectors/Base/src/Propagator.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,14 @@ GPUd() bool PropagatorImpl<value_T>::PropagateToXBxByBz(TrackParCov_t& track, va
189189
res = false;
190190
}
191191
if (tofInfo) {
192-
tofInfo->addStep(mb.length, track.getP2Inv()); // fill L,ToF info using already calculated step length
192+
tofInfo->addStep(mb.length, track.getQ2P2()); // fill L,ToF info using already calculated step length
193193
tofInfo->addX2X0(mb.meanX2X0);
194194
tofInfo->addXRho(mb.getXRho(signCorr));
195195
}
196196
} else if (tofInfo) { // if tofInfo filling was requested w/o material correction, we need to calculate the step lenght
197197
auto xyz1 = track.getXYZGlo();
198198
math_utils::Vector3D<value_type> stepV(xyz1.X() - xyz0.X(), xyz1.Y() - xyz0.Y(), xyz1.Z() - xyz0.Z());
199-
tofInfo->addStep(stepV.R(), track.getP2Inv());
199+
tofInfo->addStep(stepV.R(), track.getQ2P2());
200200
}
201201
return res;
202202
};
@@ -258,14 +258,14 @@ GPUd() bool PropagatorImpl<value_T>::PropagateToXBxByBz(TrackPar_t& track, value
258258
res = false;
259259
}
260260
if (tofInfo) {
261-
tofInfo->addStep(mb.length, track.getP2Inv()); // fill L,ToF info using already calculated step length
261+
tofInfo->addStep(mb.length, track.getQ2P2()); // fill L,ToF info using already calculated step length
262262
tofInfo->addX2X0(mb.meanX2X0);
263263
tofInfo->addXRho(mb.getXRho(signCorr));
264264
}
265265
} else if (tofInfo) { // if tofInfo filling was requested w/o material correction, we need to calculate the step lenght
266266
auto xyz1 = track.getXYZGlo();
267267
math_utils::Vector3D<value_type> stepV(xyz1.X() - xyz0.X(), xyz1.Y() - xyz0.Y(), xyz1.Z() - xyz0.Z());
268-
tofInfo->addStep(stepV.R(), track.getP2Inv());
268+
tofInfo->addStep(stepV.R(), track.getQ2P2());
269269
}
270270
return res;
271271
};
@@ -324,14 +324,14 @@ GPUd() bool PropagatorImpl<value_T>::propagateToX(TrackParCov_t& track, value_ty
324324
res = false;
325325
}
326326
if (tofInfo) {
327-
tofInfo->addStep(mb.length, track.getP2Inv()); // fill L,ToF info using already calculated step length
327+
tofInfo->addStep(mb.length, track.getQ2P2()); // fill L,ToF info using already calculated step length
328328
tofInfo->addX2X0(mb.meanX2X0);
329329
tofInfo->addXRho(mb.getXRho(signCorr));
330330
}
331331
} else if (tofInfo) { // if tofInfo filling was requested w/o material correction, we need to calculate the step lenght
332332
auto xyz1 = track.getXYZGlo();
333333
math_utils::Vector3D<value_type> stepV(xyz1.X() - xyz0.X(), xyz1.Y() - xyz0.Y(), xyz1.Z() - xyz0.Z());
334-
tofInfo->addStep(stepV.R(), track.getP2Inv());
334+
tofInfo->addStep(stepV.R(), track.getQ2P2());
335335
}
336336
return res;
337337
};
@@ -390,14 +390,14 @@ GPUd() bool PropagatorImpl<value_T>::propagateToX(TrackPar_t& track, value_type
390390
res = false;
391391
}
392392
if (tofInfo) {
393-
tofInfo->addStep(mb.length, track.getP2Inv()); // fill L,ToF info using already calculated step length
393+
tofInfo->addStep(mb.length, track.getQ2P2()); // fill L,ToF info using already calculated step length
394394
tofInfo->addX2X0(mb.meanX2X0);
395395
tofInfo->addXRho(mb.getXRho(signCorr));
396396
}
397397
} else if (tofInfo) { // if tofInfo filling was requested w/o material correction, we need to calculate the step lenght
398398
auto xyz1 = track.getXYZGlo();
399399
math_utils::Vector3D<value_type> stepV(xyz1.X() - xyz0.X(), xyz1.Y() - xyz0.Y(), xyz1.Z() - xyz0.Z());
400-
tofInfo->addStep(stepV.R(), track.getP2Inv());
400+
tofInfo->addStep(stepV.R(), track.getQ2P2());
401401
}
402402
return res;
403403
};
@@ -717,7 +717,7 @@ GPUd() value_T PropagatorImpl<value_T>::estimateLTFast(o2::track::TrackLTIntegra
717717
// since we assume the track or its parent comes from the beam-line or decay, add XY(?) distance to it
718718
value_T dcaT = math_utils::detail::sqrt<value_type>(xdca * xdca + ydca * ydca);
719719
length += dcaT;
720-
lt.addStep(length, trc.getP2Inv());
720+
lt.addStep(length, trc.getQ2P2());
721721
return dcaT;
722722
}
723723

Detectors/GlobalTracking/src/MatchTPCITS.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,7 +1714,7 @@ bool MatchTPCITS::refitTrackTPCITS(int slot, int iTPC, int& iITS, pmr::vector<o2
17141714
}
17151715
auto posEnd = tracOut.getXYZGlo();
17161716
auto lInt = propagator->estimateLTIncrement(tracOut, posStart, posEnd);
1717-
tofL.addStep(lInt, tracOut.getP2Inv());
1717+
tofL.addStep(lInt, tracOut.getQ2P2());
17181718
tofL.addX2X0(lInt * mTPCmeanX0Inv);
17191719
propagator->PropagateToXBxByBz(tracOut, o2::constants::geom::XTPCOuterRef, MaxSnp, 10., mUseMatCorrFlag, &tofL);
17201720

@@ -1804,7 +1804,7 @@ bool MatchTPCITS::refitABTrack(int iITSAB, const TPCABSeed& seed, pmr::vector<o2
18041804
}
18051805
auto posEnd = tracOut.getXYZGlo();
18061806
auto lInt = propagator->estimateLTIncrement(tracOut, posStart, posEnd);
1807-
tofL.addStep(lInt, tracOut.getP2Inv());
1807+
tofL.addStep(lInt, tracOut.getQ2P2());
18081808
tofL.addX2X0(lInt * mTPCmeanX0Inv);
18091809
propagator->PropagateToXBxByBz(tracOut, o2::constants::geom::XTPCOuterRef, MaxSnp, 10., mUseMatCorrFlag, &tofL);
18101810
const auto& trackTune = TrackTuneParams::Instance();

Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/TimeFrameGPU.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,13 @@
1515

1616
#include "ITStracking/TimeFrame.h"
1717
#include "ITStracking/Configuration.h"
18-
19-
#include "ITStrackingGPU/ClusterLinesGPU.h"
2018
#include "ITStrackingGPU/Utils.h"
2119

2220
#include <gsl/gsl>
2321

24-
namespace o2
25-
{
26-
namespace its
27-
{
28-
namespace gpu
22+
namespace o2::its::gpu
2923
{
24+
3025
class Stream;
3126

3227
class DefaultGPUAllocator : public ExternalAllocator
@@ -228,7 +223,6 @@ inline int TimeFrameGPU<nLayers>::getNumberOfCells() const
228223
return std::accumulate(mNCells.begin(), mNCells.end(), 0);
229224
}
230225

231-
} // namespace gpu
232-
} // namespace its
233-
} // namespace o2
226+
} // namespace o2::its::gpu
227+
234228
#endif

0 commit comments

Comments
 (0)