Skip to content

Commit a8462e9

Browse files
authored
Merge branch 'AliceO2Group:dev' into new_geometry
2 parents 740e7a0 + c06edc8 commit a8462e9

139 files changed

Lines changed: 213451 additions & 1844 deletions

File tree

Some content is hidden

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

‎.github/workflows/clean-test.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ name: Clean PR checks
2727
description: build/O2/fullCI_slc9
2828
type: boolean
2929
default: true
30+
'check_build/O2/fullCI-slc10-x86':
31+
description: build/O2/fullCI-slc10-x86
32+
type: boolean
33+
default: true
3034
# Off by default, unlike every other check here: the gpu pool is a single
3135
# worker and a gpu-test round is hours, so resetting this is a much bigger
3236
# ask than requeueing one of the twenty-odd slc9/slc10 builders. Tick it

‎Common/MathUtils/include/MathUtils/detail/basicMath.h‎

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,36 @@ GPUdi() T log(T x)
9191
return o2::gpu::GPUCommonMath::Log(x);
9292
};
9393

94-
#ifndef GPUCA_GPUCODE_DEVICE // Double overloads using std namespace not visible on GPU
94+
template <class T>
95+
GPUdi() T exp(T x)
96+
{
97+
return o2::gpu::GPUCommonMath::Exp(x);
98+
};
99+
100+
#if !defined(GPUCA_GPUCODE_DEVICE) || defined(__CUDACC__) || defined(__HIPCC__) // Double specialisations, not for OpenCL and Metal
95101
template <>
96102
GPUhdi() double copysign(double x, double y)
97103
{
98-
return std::copysign(x, y);
104+
return o2::gpu::GPUCommonMath::Copysignd(x, y);
99105
}
100106
template <>
101107
GPUhdi() double sqrt(double x)
102108
{
103-
return std::sqrt(x);
109+
return o2::gpu::GPUCommonMath::Sqrtd(x);
104110
};
111+
template <>
112+
GPUdi() double log(double x)
113+
{
114+
return o2::gpu::GPUCommonMath::Logd(x);
115+
};
116+
template <>
117+
GPUdi() double exp(double x)
118+
{
119+
return o2::gpu::GPUCommonMath::Expd(x);
120+
};
121+
#endif
122+
123+
#ifndef GPUCA_GPUCODE_DEVICE // Double overloads using std namespace not visible on GPU
105124
GPUhdi() double abs(double x)
106125
{
107126
return std::abs(x);
@@ -120,11 +139,6 @@ GPUdi() bool finite(double x)
120139
return std::isfinite(x);
121140
#endif
122141
}
123-
template <>
124-
GPUdi() double log(double x)
125-
{
126-
return std::log(x);
127-
};
128142
#endif
129143

130144
} // namespace detail

‎Common/MathUtils/include/MathUtils/detail/trigonometric.h‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ GPUhdi() constexpr T fastATan2(T y, T x)
299299
if (xx < 0) { // p1 is in the range [Pi/4, 3*Pi/4]
300300
phi0 = Pi075;
301301
tan = y1 > T(0) ? -x1 / y1 : T(0); // yy is always >=0, hence y1>=0
302-
} else { // p1 is in the range [-Pi/4, Pi/4]
302+
} else { // p1 is in the range [-Pi/4, Pi/4]
303303
phi0 = Pi025;
304304
tan = x1 > T(0) ? y1 / x1 : T(0);
305305
}
@@ -376,41 +376,41 @@ GPUdi() double pi()
376376
return o2::constants::math::PI;
377377
}
378378

379-
#ifndef GPUCA_GPUCODE_DEVICE
379+
#if !defined(GPUCA_GPUCODE_DEVICE) || defined(__CUDACC__) || defined(__HIPCC__) // Double specialisations, not for OpenCL and Metal
380380
template <>
381381
GPUdi() double tan(double x)
382382
{
383-
return std::tan(x);
383+
return o2::gpu::GPUCommonMath::Tand(x);
384384
};
385385
template <>
386386
GPUdi() double sin(double x)
387387
{
388-
return std::sin(x);
388+
return o2::gpu::GPUCommonMath::Sind(x);
389389
};
390390
template <>
391391
GPUdi() double atan2(double y, double x)
392392
{
393-
return std::atan2(y, x);
393+
return o2::gpu::GPUCommonMath::ATan2d(y, x);
394394
};
395395
template <>
396396
GPUdi() double atan(double x)
397397
{
398-
return std::atan(x);
398+
return o2::gpu::GPUCommonMath::ATand(x);
399399
};
400400
template <>
401401
GPUdi() double asin(double x)
402402
{
403-
return std::asin(x);
403+
return o2::gpu::GPUCommonMath::ASind(x);
404404
};
405405
template <>
406406
GPUdi() double acos(double x)
407407
{
408-
return std::acos(x);
408+
return o2::gpu::GPUCommonMath::ACosd(x);
409409
};
410410
template <>
411411
GPUdi() double cos(double x)
412412
{
413-
return std::cos(x);
413+
return o2::gpu::GPUCommonMath::Cosd(x);
414414
};
415415
#endif
416416

‎DataFormats/Detectors/FIT/FV0/CMakeLists.txt‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ o2_add_library(DataFormatsFV0
1717
src/RawEventData.cxx
1818
src/CTF.cxx
1919
src/LookUpTable.cxx
20+
src/FV0RecoConfig.cxx
2021
PUBLIC_LINK_LIBRARIES O2::FV0Base
2122
O2::DataFormatsFIT
2223
O2::SimulationDataFormat
@@ -35,4 +36,6 @@ o2_target_root_dictionary(DataFormatsFV0
3536
include/DataFormatsFV0/RecPoints.h
3637
include/DataFormatsFV0/RawEventData.h
3738
include/DataFormatsFV0/LookUpTable.h
38-
include/DataFormatsFV0/CTF.h)
39+
include/DataFormatsFV0/CTF.h
40+
include/DataFormatsFV0/FV0RecoConfig.h
41+
)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
#ifndef ALICEO2_FV0_RECO_PARAM
13+
#define ALICEO2_FV0_RECO_PARAM
14+
15+
#include "CommonUtils/ConfigurableParamHelper.h"
16+
#include "DataFormatsFV0/ChannelData.h"
17+
18+
namespace o2::fv0
19+
{
20+
struct FV0RecoConfig : o2::conf::ConfigurableParamHelper<FV0RecoConfig> {
21+
double AmplitudeLowerThreshold = 24; // only channels with amplitude higher will participate in calibration and collision time
22+
double AmplitudeThresholdForMeanTime = 5; // Charge threshold, only above which the time is taken into account in calculating the mean time of all qualifying channels
23+
double TimeUpperThreshold = 1000.0; // only channels with time below will participate in calibration and collision time
24+
uint8_t mValidPmInputFlagMask = static_cast<uint8_t>(~(1u << ChannelData::kNumberADC));
25+
uint8_t mValidPmInputFlags = static_cast<uint8_t>((1u << ChannelData::kIsCFDinADCgate) | (1u << ChannelData::kIsEventInTVDC));
26+
27+
bool areChannelDataFlagsGood(uint8_t flags) const
28+
{
29+
return (flags & mValidPmInputFlagMask) == mValidPmInputFlags;
30+
}
31+
O2ParamDef(FV0RecoConfig, "FV0RecoConfig");
32+
ClassDefNV(FV0RecoConfig, 1);
33+
};
34+
35+
} // namespace o2::fv0
36+
37+
#endif

‎DataFormats/Detectors/FIT/FV0/src/DataFormatsFV0LinkDef.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,6 @@
4040
#pragma link C++ class o2::fv0::FV0CalibrationInfoObject + ;
4141
#pragma link C++ class o2::fv0::FV0ChannelTimeCalibrationObject + ;
4242

43+
#pragma link C++ class o2::fv0::FV0RecoConfig + ;
44+
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::fv0::FV0RecoConfig> + ;
4345
#endif
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
#include "DataFormatsFV0/FV0RecoConfig.h"
13+
14+
using namespace o2::fv0;
15+
O2ParamImpl(FV0RecoConfig);

‎DataFormats/Detectors/GlobalTracking/include/DataFormatsGlobalTracking/TrackCosmicsExtended.h‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,20 @@ struct TrackCosmicsExtended {
110110
///< approach to the beam line; valid if chi2MatchPolished >= 0
111111
float chi2MatchPolished = -1.f; ///< chi2 of the polished bottom and top halves at the closest approach (< 0: not polished)
112112
o2::MCCompLabel label{}; ///< MC label of the cosmic (MC only)
113+
float tpcOccBef = -1.f; ///< TPC clusters in the orbit before the time of the cosmic (TOF time if hasTOFTime(), else the matcher's),
114+
///< from the TPC occupancy map (-1: no map, or the orbit is not fully inside the TF)
115+
float tpcOccAft = -1.f; ///< same for the orbit after the time of the cosmic, i.e. while its clusters drift
113116

114117
bool hasTOFTime() const { return scoreTOFPair >= 0.f; } ///< a HitTOFFlight pair gave the cosmic its time timeTOFMUS
115-
ClassDefNV(TrackCosmicsExtended, 1);
118+
ClassDefNV(TrackCosmicsExtended, 2);
116119
};
117120

118-
/// per-TF quantities of the TPC transformation used in the reconstruction
121+
/// per-TF quantities: the TPC transformation used in the reconstruction and the TPC occupancy
119122
struct CosmicsTFInfo {
120-
float vDrift = 0.f; ///< drift velocity of the transformation [cm/time bin]
121-
float t0 = 0.f; ///< time offset of the transformation [time bins]
122-
ClassDefNV(CosmicsTFInfo, 1);
123+
float vDrift = 0.f; ///< drift velocity of the transformation [cm/time bin]
124+
float t0 = 0.f; ///< time offset of the transformation [time bins]
125+
float tpcOcc = -1.f; ///< TPC clusters per orbit, average of the TF (TPC occupancy map) (< 0: no map)
126+
ClassDefNV(CosmicsTFInfo, 2);
123127
};
124128

125129
} // namespace o2::dataformats

‎DataFormats/Reconstruction/include/ReconstructionDataFormats/BaseCluster.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ class BaseCluster
3434
{
3535
private:
3636
math_utils::Point3D<T> mPos; // cartesian position
37-
T mSigmaY2; // error in Y direction (usually rphi)
38-
T mSigmaZ2; // error in Z direction (usually Z)
39-
T mSigmaYZ; // non-diagonal term of error matrix
37+
T mSigmaY2 = 0; // error in Y direction (usually rphi)
38+
T mSigmaZ2 = 0; // error in Z direction (usually Z)
39+
T mSigmaYZ = 0; // non-diagonal term of error matrix
4040
std::uint16_t mSensorID = 0; // the sensor id
4141
std::int8_t mCount = 0; // user field reserved for counting
4242
std::uint8_t mBits = 0; // user field reserved for bit flags

‎DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackParametrization.h‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ GPUdi() auto TrackParametrization<value_T>::getR2() const -> value_t
402402
template <typename value_T>
403403
GPUdi() auto TrackParametrization<value_T>::getR() const -> value_t
404404
{
405-
return gpu::CAMath::Sqrt(getR2());
405+
return math_utils::detail::sqrt<value_t>(getR2());
406406
}
407407

408408
//____________________________________________________________
@@ -441,7 +441,7 @@ GPUdi() auto TrackParametrization<value_T>::getCsp2() const -> value_t
441441
template <typename value_T>
442442
GPUdi() auto TrackParametrization<value_T>::getCsp() const -> value_t
443443
{
444-
return gpu::CAMath::Sqrt(getCsp2());
444+
return math_utils::detail::sqrt<value_t>(getCsp2());
445445
}
446446

447447
//____________________________________________________________
@@ -518,7 +518,7 @@ GPUdi() void TrackParametrization<value_T>::getCircleParamsLoc(value_t bz, o2::m
518518
constexpr value_t MinSagitta = 0.01f, TPCMidR = 160.f, MinCurv = 8 * MinSagitta / (TPCMidR * TPCMidR);
519519
if (gpu::CAMath::Abs(c.rC) > MinCurv) {
520520
c.rC = 1.f / getCurvature(bz);
521-
value_t sn = getSnp(), cs = gpu::CAMath::Sqrt((1.f - sn) * (1.f + sn));
521+
value_t sn = getSnp(), cs = math_utils::detail::sqrt<value_t>((1.f - sn) * (1.f + sn));
522522
c.xC = getX() - sn * c.rC; // center in tracking
523523
c.yC = getY() + cs * c.rC; // frame. Note: r is signed!!!
524524
c.rC = gpu::CAMath::Abs(c.rC);
@@ -546,7 +546,7 @@ GPUdi() void TrackParametrization<value_T>::getLineParams(o2::math_utils::Interv
546546
// get line parameterization as { x = x0 + xSlp*t, y = y0 + ySlp*t }
547547
o2::math_utils::detail::sincos(getAlpha(), sna, csa);
548548
o2::math_utils::detail::rotateZ<value_t>(getX(), getY(), ln.getX0(), ln.getY0(), sna, csa); // reference point in global frame
549-
value_t snp = getSnp(), csp = gpu::CAMath::Sqrt((1.f - snp) * (1.f + snp));
549+
value_t snp = getSnp(), csp = math_utils::detail::sqrt<value_t>((1.f - snp) * (1.f + snp));
550550
ln.setDX(csp * csa - snp * sna);
551551
ln.setDY(snp * csa + csp * sna);
552552
}
@@ -577,7 +577,7 @@ template <typename value_T>
577577
GPUdi() auto TrackParametrization<value_T>::getPhi() const -> value_t
578578
{
579579
// track pt direction phi (in 0:2pi range)
580-
value_t phi = gpu::CAMath::ASin(getSnp()) + getAlpha();
580+
value_t phi = math_utils::detail::asin<value_t>(getSnp()) + getAlpha();
581581
math_utils::detail::bringTo02Pi<value_t>(phi);
582582
return phi;
583583
}
@@ -587,7 +587,7 @@ template <typename value_T>
587587
GPUdi() auto TrackParametrization<value_T>::getPhiPos() const -> value_t
588588
{
589589
// angle of track position (in -pi:pi range)
590-
value_t phi = gpu::CAMath::ATan2(getY(), getX()) + getAlpha();
590+
value_t phi = math_utils::detail::atan2<value_t>(getY(), getX()) + getAlpha();
591591
math_utils::detail::bringTo02Pi<value_t>(phi);
592592
return phi;
593593
}
@@ -638,7 +638,7 @@ template <typename value_T>
638638
GPUdi() auto TrackParametrization<value_T>::getPInv() const -> value_t
639639
{
640640
// return the inverted track momentum
641-
return getPtInv() / gpu::CAMath::Sqrt(1.f + getTgl() * getTgl()); // getPtInv() is protected against being 0, full charge accounted
641+
return getPtInv() / math_utils::detail::sqrt<value_t>(1.f + getTgl() * getTgl()); // getPtInv() is protected against being 0, full charge accounted
642642
}
643643

644644
//____________________________________________________________
@@ -662,7 +662,7 @@ template <typename value_T>
662662
GPUdi() auto TrackParametrization<value_T>::getE() const -> value_t
663663
{
664664
// return the track energy
665-
return gpu::CAMath::Sqrt(getE2());
665+
return math_utils::detail::sqrt<value_t>(getE2());
666666
}
667667

668668
//____________________________________________________________
@@ -677,14 +677,14 @@ GPUdi() auto TrackParametrization<value_T>::getPt() const -> value_t
677677
template <typename value_T>
678678
GPUdi() auto TrackParametrization<value_T>::getTheta() const -> value_t
679679
{
680-
return constants::math::PIHalf - gpu::CAMath::ATan(mP[3]);
680+
return constants::math::PIHalf - math_utils::detail::atan<value_t>(mP[3]);
681681
}
682682

683683
//____________________________________________________________
684684
template <typename value_T>
685685
GPUdi() auto TrackParametrization<value_T>::getEta() const -> value_t
686686
{
687-
return -gpu::CAMath::Log(gpu::CAMath::Tan(0.5f * getTheta()));
687+
return -math_utils::detail::log<value_t>(math_utils::detail::tan<value_t>(0.5f * getTheta()));
688688
}
689689

690690
//_______________________________________________________

0 commit comments

Comments
 (0)