Skip to content

Commit 555a188

Browse files
authored
Merge branch 'AliceO2Group:dev' into fd3_digits
2 parents 37aa59f + ca2fdfa commit 555a188

396 files changed

Lines changed: 17305 additions & 10474 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/async-list-label.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
/Detectors/TPC @davidrohr @wiechula @shahor02
7474
/Detectors/TRD @f3sch @bazinski @wille10
7575
/Detectors/Upgrades @mconcas
76-
/Detectors/Upgrades/ALICE3 @mconcas @njacazio
76+
/Detectors/Upgrades/ALICE3 @mconcas @njacazio @fcolamar
7777
/Detectors/Upgrades/ITS3 @fgrosa @arossi81 @mconcas @f3sch
7878
/Detectors/ZDC @coppedis @cortesep
7979
/Detectors/CTF @shahor02

Common/MathUtils/include/MathUtils/Cartesian.h

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -284,25 +284,15 @@ GPUdi() SMatrix<T, D1, D1, MatRepSym<T, D1>> Similarity(const SMatrix<T, D1, D2,
284284
#if (!defined(GPUCA_STANDALONE) || !defined(DGPUCA_NO_ROOT)) && !defined(GPUCA_GPUCODE) && !defined(GPUCOMMONRTYPES_H_ACTIVE)
285285
std::ostream& operator<<(std::ostream& os, const o2::math_utils::Rotation2Df_t& t);
286286
std::ostream& operator<<(std::ostream& os, const o2::math_utils::Rotation2Dd_t& t);
287-
288-
namespace std
287+
namespace o2::framework
289288
{
289+
template <typename T>
290+
struct is_forced_trivially_copyable;
290291

291-
/// Defining Point3D explicitly as trivially copyable
292-
///
293-
/// std::is_trivially_copyable<ROOT::Math::Cartesian3D<T>> fails because the class
294-
/// implements a copy constructor, although it does not much more than the default copy
295-
/// constructor. We need Point3D to fulfill the condition in order to make types
296-
/// inheriting from it or using it as member can be safely detected as messageable.
297-
///
298-
/// We believe that Point3D is messageable and explicitly specialize the type trait.
299-
/// There is a unit test for checking trivial copy
300-
/// This is a workaround, we will also make suggestions to fix the cause in ROOT itself
301-
/// TODO: delete once it is fixed in ROOT
302292
template <typename T>
303-
struct is_trivially_copyable<o2::math_utils::Point3D<T>> : std::true_type {
293+
struct is_forced_trivially_copyable<o2::math_utils::Point3D<T>> : std::true_type {
304294
};
305-
} // namespace std
295+
} // namespace o2::framework
306296
#endif // Disable for GPU
307297

308298
#endif

Common/MathUtils/test/testCartesian.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ BOOST_AUTO_TEST_CASE(Cartesian_test)
7777
BOOST_AUTO_TEST_CASE(Point3D_messageable)
7878
{
7979
using ElementType = math_utils::Point3D<int>;
80-
static_assert(std::is_trivially_copyable<ElementType>::value == true);
80+
static_assert(o2::framework::is_forced_trivially_copyable<ElementType>::value == true);
8181
std::vector<ElementType> pts(10);
8282
auto makeElement = [](int idx) {
8383
return ElementType{idx, idx + 10, idx + 20};

DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "ReconstructionDataFormats/TrackMCHMID.h"
3535
#include "DataFormatsITSMFT/TrkClusRef.h"
3636
#include "DataFormatsITSMFT/TopologyDictionary.h"
37-
#include "ITSMFTBase/DPLAlpideParam.h"
37+
#include "DataFormatsITSMFT/DPLAlpideParam.h"
3838
// FIXME: ideally, the data formats definition should be independent of the framework
3939
// collectData is using the input of ProcessingContext to extract the first valid
4040
// header and the TF orbit from it

DataFormats/Detectors/ITSMFT/ITS/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@
1111

1212
o2_add_library(DataFormatsITS
1313
SOURCES src/TrackITS.cxx
14+
src/TimeEstBC.cxx
1415
PUBLIC_LINK_LIBRARIES O2::ReconstructionDataFormats
16+
O2::SimulationDataFormat
1517
O2::DataFormatsITSMFT)
1618

1719
o2_target_root_dictionary(DataFormatsITS
18-
HEADERS include/DataFormatsITS/TrackITS.h)
20+
HEADERS include/DataFormatsITS/TrackITS.h
21+
include/DataFormatsITS/Vertex.h
22+
include/DataFormatsITS/TimeEstBC.h)
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
// Copyright 2019-2026 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 O2_TRACKINGITS_TIMEESTBC_H_
13+
#define O2_TRACKINGITS_TIMEESTBC_H_
14+
15+
#include <limits>
16+
#include <cstdint>
17+
#include "CommonDataFormat/TimeStamp.h"
18+
#include "GPUCommonRtypes.h"
19+
#include "GPUCommonDef.h"
20+
#include "GPUCommonMath.h"
21+
22+
namespace o2::its
23+
{
24+
// Time estimates are given in BC
25+
// error needs to cover maximum 1 orbit
26+
using TimeStampType = uint32_t;
27+
using TimeStampErrorType = uint16_t;
28+
// this is an symmetric time error [t0-tE, t0+tE]
29+
using TimeStamp = o2::dataformats::TimeStampWithError<float, float>;
30+
// this is an asymmetric time interval [t0, t0+tE] used for internal calculations
31+
class TimeEstBC : public o2::dataformats::TimeStampWithError<TimeStampType, TimeStampErrorType>
32+
{
33+
using Base = o2::dataformats::TimeStampWithError<TimeStampType, TimeStampErrorType>;
34+
35+
public:
36+
GPUhdDefault() TimeEstBC() = default;
37+
GPUhdi() TimeEstBC(TimeStampType t, TimeStampErrorType e) : Base(t, e) {}
38+
39+
// convert to symmetric center+-half representation
40+
GPUhdi() its::TimeStamp makeSymmetrical() const noexcept
41+
{
42+
const auto start = static_cast<float>(this->getTimeStamp());
43+
const float half = (float)this->getTimeStampError() / 2.f;
44+
return {start + half, half};
45+
}
46+
47+
// check if timestamps overlap within their interval
48+
GPUhdi() bool isCompatible(const TimeEstBC& o) const noexcept
49+
{
50+
return this->upper() > o.lower() && o.upper() > this->lower();
51+
}
52+
53+
// check if this time interval is fully contained within o
54+
GPUhdi() bool isContainedIn(const TimeEstBC& o) const noexcept
55+
{
56+
return this->lower() >= o.lower() && this->upper() <= o.upper();
57+
}
58+
59+
GPUhdi() TimeEstBC& operator+=(const TimeEstBC& o) noexcept
60+
{
61+
add(o);
62+
return *this;
63+
}
64+
65+
GPUhdi() TimeEstBC operator+(const TimeEstBC& o) const noexcept
66+
{
67+
TimeEstBC res = *this;
68+
res += o;
69+
return res;
70+
}
71+
72+
// upper bound of interval t0+tE
73+
GPUhdi() TimeStampType upper() const noexcept
74+
{
75+
TimeStampType t = this->getTimeStamp();
76+
TimeStampType e = this->getTimeStampError();
77+
constexpr TimeStampType max = std::numeric_limits<TimeStampType>::max();
78+
return (t > (max - e)) ? max : t + e;
79+
}
80+
81+
// lower bound of interval t0
82+
GPUhdi() TimeStampType lower() const noexcept
83+
{
84+
return this->getTimeStamp();
85+
}
86+
87+
private:
88+
// intersect with the other timestamp
89+
// this assumes already that both overlap
90+
GPUhdi() void add(const TimeEstBC& o) noexcept
91+
{
92+
const TimeStampType lo = o2::gpu::CAMath::Max(this->lower(), o.lower());
93+
const TimeStampType hi = o2::gpu::CAMath::Min(this->upper(), o.upper());
94+
this->setTimeStamp(lo);
95+
this->setTimeStampError(static_cast<TimeStampErrorType>(hi - lo));
96+
}
97+
98+
ClassDefNV(TimeEstBC, 1);
99+
};
100+
101+
} // namespace o2::its
102+
103+
#endif

DataFormats/Detectors/ITSMFT/ITS/include/DataFormatsITS/TrackITS.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
1+
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
22
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
33
// All rights not expressly granted are reserved.
44
//
@@ -16,11 +16,12 @@
1616
#ifndef ALICEO2_ITS_TRACKITS_H
1717
#define ALICEO2_ITS_TRACKITS_H
1818

19-
#include <vector>
19+
#include <cstdint>
2020

2121
#include "GPUCommonDef.h"
2222
#include "ReconstructionDataFormats/Track.h"
2323
#include "CommonDataFormat/RangeReference.h"
24+
#include "DataFormatsITS/TimeEstBC.h"
2425

2526
namespace o2
2627
{
@@ -35,8 +36,7 @@ namespace its
3536
class TrackITS : public o2::track::TrackParCov
3637
{
3738
enum UserBits {
38-
kNextROF = 1 << 28,
39-
kSharedClusters = 1 << 29
39+
kSharedClusters = 1 << 28
4040
};
4141

4242
using Cluster = o2::itsmft::Cluster;
@@ -93,6 +93,9 @@ class TrackITS : public o2::track::TrackParCov
9393

9494
bool isBetter(const TrackITS& best, float maxChi2) const;
9595

96+
GPUhdi() auto& getTimeStamp() { return mTime; }
97+
GPUhdi() const auto& getTimeStamp() const { return mTime; }
98+
9699
GPUhdi() o2::track::TrackParCov& getParamIn() { return *this; }
97100
GPUhdi() const o2::track::TrackParCov& getParamIn() const { return *this; }
98101

@@ -122,8 +125,6 @@ class TrackITS : public o2::track::TrackParCov
122125
}
123126
int getNFakeClusters() const;
124127

125-
void setNextROFbit(bool toggle = true) { mClusterSizes = toggle ? (mClusterSizes | kNextROF) : (mClusterSizes & ~kNextROF); }
126-
bool hasHitInNextROF() const { return mClusterSizes & kNextROF; }
127128
void setSharedClusters(bool toggle = true) { mClusterSizes = toggle ? (mClusterSizes | kSharedClusters) : (mClusterSizes & ~kSharedClusters); }
128129
bool hasSharedClusters() const { return mClusterSizes & kSharedClusters; }
129130

@@ -157,9 +158,10 @@ class TrackITS : public o2::track::TrackParCov
157158
ClusRefs mClusRef; ///< references on clusters
158159
float mChi2 = 0.; ///< Chi2 for this track
159160
uint32_t mPattern = 0; ///< layers pattern
160-
unsigned int mClusterSizes = 0u;
161+
uint32_t mClusterSizes = 0u; ///< 4bit packed cluster sizes
162+
TimeStamp mTime; ///< track time stamp with error in BC since start of TF, symmetrical
161163

162-
ClassDefNV(TrackITS, 6);
164+
ClassDefNV(TrackITS, 7);
163165
};
164166

165167
class TrackITSExt : public TrackITS
@@ -169,15 +171,13 @@ class TrackITSExt : public TrackITS
169171
static constexpr int MaxClusters = 16; /// Prepare for overlaps and new detector configurations
170172
using TrackITS::TrackITS; // inherit base constructors
171173

172-
GPUh() TrackITSExt(o2::track::TrackParCov&& parCov, short ncl, float chi2,
173-
o2::track::TrackParCov&& outer, std::array<int, MaxClusters> cls)
174+
GPUh() TrackITSExt(o2::track::TrackParCov&& parCov, short ncl, float chi2, o2::track::TrackParCov&& outer, std::array<int, MaxClusters> cls)
174175
: TrackITS(parCov, chi2, outer), mIndex{cls}
175176
{
176177
setNumberOfClusters(ncl);
177178
}
178179

179-
GPUh() TrackITSExt(o2::track::TrackParCov& parCov, short ncl, float chi2, std::uint32_t rof,
180-
o2::track::TrackParCov& outer, std::array<int, MaxClusters> cls)
180+
GPUh() TrackITSExt(o2::track::TrackParCov& parCov, short ncl, float chi2, std::uint32_t rof, o2::track::TrackParCov& outer, std::array<int, MaxClusters> cls)
181181
: TrackITS(parCov, chi2, outer), mIndex{cls}
182182
{
183183
setNumberOfClusters(ncl);
@@ -212,7 +212,7 @@ class TrackITSExt : public TrackITS
212212

213213
private:
214214
std::array<int, MaxClusters> mIndex = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; ///< Indices of associated clusters
215-
ClassDefNV(TrackITSExt, 2);
215+
ClassDefNV(TrackITSExt, 3);
216216
};
217217
} // namespace its
218218
} // namespace o2
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Copyright 2019-2026 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 O2_TRACKINGITS_VERTEX_H_
13+
#define O2_TRACKINGITS_VERTEX_H_
14+
15+
#include "GPUCommonDef.h"
16+
#ifndef GPUCA_GPUCODE_DEVICE
17+
#include <type_traits>
18+
#endif
19+
#include "ReconstructionDataFormats/Vertex.h"
20+
#include "SimulationDataFormat/MCCompLabel.h"
21+
#include "DataFormatsITS/TimeEstBC.h"
22+
23+
namespace o2::its
24+
{
25+
// NOTE: this uses the internal asymmetrical time reprenstation!
26+
using Vertex = o2::dataformats::Vertex<o2::its::TimeEstBC>;
27+
using VertexLabel = std::pair<o2::MCCompLabel, float>;
28+
} // namespace o2::its
29+
30+
#ifndef GPUCA_GPUCODE_DEVICE
31+
/// Defining ITS Vertex explicitly as messageable
32+
namespace o2::framework
33+
{
34+
template <typename T>
35+
struct is_messageable;
36+
template <>
37+
struct is_messageable<o2::dataformats::Vertex<o2::its::TimeEstBC>> : std::true_type {
38+
};
39+
} // namespace o2::framework
40+
#endif
41+
42+
#endif

DataFormats/Detectors/ITSMFT/ITS/src/DataFormatsITSLinkDef.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@
1414
#pragma link off all globals;
1515
#pragma link off all classes;
1616
#pragma link off all functions;
17+
1718
#pragma link C++ class o2::its::TrackITS + ;
1819
#pragma link C++ class std::vector < o2::its::TrackITS> + ;
1920

21+
#pragma link C++ class o2::its::TimeEstBC + ;
22+
#pragma link C++ class std::vector < o2::its::TimeEstBC> + ;
23+
24+
#pragma link C++ class o2::dataformats::Vertex < o2::its::TimeEstBC> + ;
25+
#pragma link C++ class std::vector < o2::dataformats::Vertex < o2::its::TimeEstBC>> + ;
26+
2027
#endif

0 commit comments

Comments
 (0)