Skip to content

Commit 22bfb67

Browse files
authored
Merge branch 'AliceO2Group:dev' into destructorsFix
2 parents 03913e4 + f8c8cd5 commit 22bfb67

File tree

90 files changed

+4041
-2190
lines changed

Some content is hidden

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

90 files changed

+4041
-2190
lines changed

Common/DCAFitter/include/DCAFitter/DCAFitterN.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,20 @@ struct TrackCovI {
4141
// (otherwise for quazi-collinear tracks the X will not be constrained)
4242
float cyy = trc.getSigmaY2(), czz = trc.getSigmaZ2(), cyz = trc.getSigmaZY(), cxx = cyy * xerrFactor;
4343
float detYZ = cyy * czz - cyz * cyz;
44-
if (detYZ > 0.) {
45-
auto detYZI = 1. / detYZ;
46-
sxx = 1. / cxx;
47-
syy = czz * detYZI;
48-
syz = -cyz * detYZI;
49-
szz = cyy * detYZI;
50-
} else {
44+
if (detYZ <= 0.) {
5145
#ifndef GPUCA_GPUCODE
52-
throw std::runtime_error("invalid track covariance");
46+
printf("overriding invalid track covariance from %s\n", trc.asString().c_str());
5347
#else
54-
printf("invalid track covariance\n");
48+
printf("overriding invalid track covariance cyy:%e czz:%e cyz:%e\n", cyy, czz, cyz);
5549
#endif
50+
cyz = o2::gpu::GPUCommonMath::Sqrt(cyy * czz) * (cyz > 0 ? 0.98f : -0.98f);
51+
detYZ = cyy * czz - cyz * cyz;
5652
}
53+
auto detYZI = 1. / detYZ;
54+
sxx = 1. / cxx;
55+
syy = czz * detYZI;
56+
syz = -cyz * detYZI;
57+
szz = cyy * detYZI;
5758
}
5859
};
5960

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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+
#ifndef O2_FRAMEWORK_ENUM_BIT_OPERATORS_H_
12+
#define O2_FRAMEWORK_ENUM_BIT_OPERATORS_H_
13+
14+
#include <type_traits>
15+
16+
#define O2_DEFINE_ENUM_BIT_OPERATORS(enum_t) \
17+
constexpr auto operator|(enum_t lhs, enum_t rhs) \
18+
{ \
19+
return static_cast<enum_t>( \
20+
static_cast<std::underlying_type_t<enum_t>>(lhs) | \
21+
static_cast<std::underlying_type_t<enum_t>>(rhs)); \
22+
} \
23+
\
24+
constexpr auto operator&(enum_t lhs, enum_t rhs) \
25+
{ \
26+
return static_cast<enum_t>( \
27+
static_cast<std::underlying_type_t<enum_t>>(lhs) & \
28+
static_cast<std::underlying_type_t<enum_t>>(rhs)); \
29+
} \
30+
\
31+
constexpr auto operator^(enum_t lhs, enum_t rhs) \
32+
{ \
33+
return static_cast<enum_t>( \
34+
static_cast<std::underlying_type_t<enum_t>>(lhs) ^ \
35+
static_cast<std::underlying_type_t<enum_t>>(rhs)); \
36+
} \
37+
\
38+
constexpr auto operator~(enum_t op) \
39+
{ \
40+
return static_cast<enum_t>( \
41+
~static_cast<std::underlying_type_t<enum_t>>(op)); \
42+
} \
43+
\
44+
constexpr auto& operator|=(enum_t& lhs, enum_t rhs) \
45+
{ \
46+
lhs = lhs | rhs; \
47+
return lhs; \
48+
} \
49+
\
50+
constexpr auto& operator&=(enum_t& lhs, enum_t rhs) \
51+
{ \
52+
lhs = lhs & rhs; \
53+
return lhs; \
54+
} \
55+
\
56+
constexpr enum_t& operator^=(enum_t& lhs, enum_t rhs) \
57+
{ \
58+
lhs = lhs ^ rhs; \
59+
return lhs; \
60+
}
61+
62+
#define O2_ENUM_TEST_BIT(mask, value) ((mask & value) == value)
63+
#define O2_ENUM_SET_BIT(bit) ((1 << bit))
64+
#define O2_ENUM_ANY_BIT(enum) ((static_cast<std::underlying_type_t<decltype(enum)>>(enum) != 0))
65+
66+
#endif

Common/Utils/include/CommonUtils/IRFrameSelector.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ class IRFrameSelector
4646
auto getIRFrames() const { return mFrames; }
4747
bool isSet() const { return mIsSet; }
4848

49+
void setOwnList(const std::vector<o2::dataformats::IRFrame>& lst, bool toBeSorted);
50+
4951
private:
5052
gsl::span<const o2::dataformats::IRFrame> mFrames{}; // externally provided span of IRFrames, must be sorted in IRFrame.getMin()
5153
o2::dataformats::IRFrame mLastIRFrameChecked{}; // last frame which was checked

Common/Utils/include/CommonUtils/TreeStream.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class TreeStream
6363
const char* getName() const { return mTree.GetName(); }
6464
void setID(int id) { mID = id; }
6565
int getID() const { return mID; }
66+
6667
TreeStream& operator<<(const Bool_t& b)
6768
{
6869
CheckIn('B', &b);
@@ -75,6 +76,12 @@ class TreeStream
7576
return *this;
7677
}
7778

79+
TreeStream& operator<<(const int8_t& i)
80+
{
81+
CheckIn('B', &i);
82+
return *this;
83+
}
84+
7885
TreeStream& operator<<(const UChar_t& c)
7986
{
8087
CheckIn('b', &c);

Common/Utils/src/IRFrameSelector.cxx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,16 @@ size_t IRFrameSelector::loadIRFrames(const std::string& fname)
167167
return mOwnList.size();
168168
}
169169

170+
void IRFrameSelector::setOwnList(const std::vector<o2::dataformats::IRFrame>& lst, bool toBeSorted)
171+
{
172+
clear();
173+
mOwnList.insert(mOwnList.end(), lst.begin(), lst.end());
174+
if (toBeSorted) {
175+
std::sort(mOwnList.begin(), mOwnList.end(), [](const auto& a, const auto& b) { return a.getMin() < b.getMin(); });
176+
}
177+
setSelectedIRFrames(mOwnList, 0, 0, 0, false);
178+
}
179+
170180
void IRFrameSelector::print(bool lst) const
171181
{
172182
LOGP(info, "Last query stopped at entry {} for IRFrame {}:{}", mLastBoundID,
@@ -183,6 +193,8 @@ void IRFrameSelector::clear()
183193
{
184194
mIsSet = false;
185195
mOwnList.clear();
196+
mLastIRFrameChecked.getMin().clear(); // invalidate
197+
mLastBoundID = -1;
186198
mFrames = {};
187199
}
188200

Detectors/AOD/include/AODProducerWorkflow/AODProducerHelpers.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include <boost/functional/hash.hpp>
1919
#include <boost/tuple/tuple.hpp>
2020
#include <boost/unordered_map.hpp>
21-
#include <string>
22-
#include <vector>
2321
#include <Framework/AnalysisHelpers.h>
2422

2523
namespace o2::aodhelpers
@@ -55,7 +53,7 @@ auto createTableCursor(framework::ProcessingContext& pc)
5553
framework::Produces<T> c;
5654
c.resetCursor(pc.outputs()
5755
.make<framework::TableBuilder>(framework::OutputForTable<T>::ref()));
58-
c.setLabel(o2::aod::MetadataTrait<T>::metadata::tableLabel());
56+
c.setLabel(aod::label<T::ref>());
5957
return c;
6058
}
6159
} // namespace o2::aodhelpers

Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "DataFormatsTRD/TrackTRD.h"
2222
#include "DetectorsBase/GRPGeomHelper.h"
2323
#include "DetectorsBase/Propagator.h"
24-
#include "Framework/AnalysisHelpers.h"
2524
#include "Framework/DataProcessorSpec.h"
2625
#include "Framework/Task.h"
2726
#include "ReconstructionDataFormats/GlobalTrackID.h"
@@ -30,9 +29,12 @@
3029
#include "TStopwatch.h"
3130
#include "ZDCBase/Constants.h"
3231
#include "GlobalTracking/MatchGlobalFwd.h"
32+
#include "CommonUtils/TreeStreamRedirector.h"
33+
#include "CommonUtils/EnumBitOperators.h"
3334

35+
#include <cstdint>
36+
#include <limits>
3437
#include <set>
35-
#include <string>
3638
#include <vector>
3739
#include <random>
3840
using namespace o2::framework;
@@ -203,7 +205,15 @@ class BunchCrossings
203205

204206
std::vector<TimeWindow> mTimeWindows; // the time window structure covering the complete duration of mBCTimeVector
205207
double mWindowSize; // the size of a single time window
206-
}; // end internal class
208+
}; // end internal class
209+
210+
// Steering bits for additional output during AOD production
211+
enum struct AODProducerStreamerMask : uint8_t {
212+
None = 0,
213+
TrackQA = O2_ENUM_SET_BIT(0),
214+
All = std::numeric_limits<std::underlying_type_t<AODProducerStreamerMask>>::max(),
215+
};
216+
O2_DEFINE_ENUM_BIT_OPERATORS(AODProducerStreamerMask)
207217

208218
class AODProducerWorkflowDPL : public Task
209219
{
@@ -241,6 +251,9 @@ class AODProducerWorkflowDPL : public Task
241251
std::unordered_set<GIndex> mGIDUsedBySVtx;
242252
std::unordered_set<GIndex> mGIDUsedByStr;
243253

254+
AODProducerStreamerMask mStreamerMask{0};
255+
std::shared_ptr<o2::utils::TreeStreamRedirector> mStreamer;
256+
244257
int mNThreads = 1;
245258
bool mUseMC = true;
246259
bool mEnableSV = true; // enable secondary vertices
@@ -339,6 +352,7 @@ class AODProducerWorkflowDPL : public Task
339352
uint32_t mTrackCovOffDiag = 0xFFFF0000; // 7 bits
340353
uint32_t mTrackSignal = 0xFFFFFF00; // 15 bits
341354
uint32_t mTrackTime = 0xFFFFFFFF; // use full float precision for time
355+
uint32_t mTPCTime0 = 0xFFFFFFE0; // 18 bits, providing 14256./(1<<19) = 0.027 TB precision e.g., ~0.13 mm in z
342356
uint32_t mTrackTimeError = 0xFFFFFF00; // 15 bits
343357
uint32_t mTrackPosEMCAL = 0xFFFFFF00; // 15 bits
344358
uint32_t mTracklets = 0xFFFFFF00; // 15 bits
@@ -397,18 +411,28 @@ class AODProducerWorkflowDPL : public Task
397411

398412
struct TrackQA {
399413
GID trackID;
400-
float tpcTime0;
401-
int16_t tpcdcaR;
402-
int16_t tpcdcaZ;
403-
uint8_t tpcClusterByteMask;
404-
uint8_t tpcdEdxMax0R;
405-
uint8_t tpcdEdxMax1R;
406-
uint8_t tpcdEdxMax2R;
407-
uint8_t tpcdEdxMax3R;
408-
uint8_t tpcdEdxTot0R;
409-
uint8_t tpcdEdxTot1R;
410-
uint8_t tpcdEdxTot2R;
411-
uint8_t tpcdEdxTot3R;
414+
float tpcTime0{};
415+
int16_t tpcdcaR{};
416+
int16_t tpcdcaZ{};
417+
uint8_t tpcClusterByteMask{};
418+
uint8_t tpcdEdxMax0R{};
419+
uint8_t tpcdEdxMax1R{};
420+
uint8_t tpcdEdxMax2R{};
421+
uint8_t tpcdEdxMax3R{};
422+
uint8_t tpcdEdxTot0R{};
423+
uint8_t tpcdEdxTot1R{};
424+
uint8_t tpcdEdxTot2R{};
425+
uint8_t tpcdEdxTot3R{};
426+
int8_t dRefContY{std::numeric_limits<int8_t>::min()};
427+
int8_t dRefContZ{std::numeric_limits<int8_t>::min()};
428+
int8_t dRefContSnp{std::numeric_limits<int8_t>::min()};
429+
int8_t dRefContTgl{std::numeric_limits<int8_t>::min()};
430+
int8_t dRefContQ2Pt{std::numeric_limits<int8_t>::min()};
431+
int8_t dRefGloY{std::numeric_limits<int8_t>::min()};
432+
int8_t dRefGloZ{std::numeric_limits<int8_t>::min()};
433+
int8_t dRefGloSnp{std::numeric_limits<int8_t>::min()};
434+
int8_t dRefGloTgl{std::numeric_limits<int8_t>::min()};
435+
int8_t dRefGloQ2Pt{std::numeric_limits<int8_t>::min()};
412436
};
413437

414438
// helper struct for addToFwdTracksTable()

0 commit comments

Comments
 (0)