Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qatable #13633

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open

Qatable #13633

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions Common/Utils/include/CommonUtils/EnumBitOperators.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#ifndef O2_FRAMEWORK_ENUM_BIT_OPERATORS_H_
#define O2_FRAMEWORK_ENUM_BIT_OPERATORS_H_

#include <type_traits>

#define O2_DEFINE_ENUM_BIT_OPERATORS(enum_t) \
constexpr auto operator|(enum_t lhs, enum_t rhs) \
{ \
return static_cast<enum_t>( \
static_cast<std::underlying_type_t<enum_t>>(lhs) | \
static_cast<std::underlying_type_t<enum_t>>(rhs)); \
} \
\
constexpr auto operator&(enum_t lhs, enum_t rhs) \
{ \
return static_cast<enum_t>( \
static_cast<std::underlying_type_t<enum_t>>(lhs) & \
static_cast<std::underlying_type_t<enum_t>>(rhs)); \
} \
\
constexpr auto operator^(enum_t lhs, enum_t rhs) \
{ \
return static_cast<enum_t>( \
static_cast<std::underlying_type_t<enum_t>>(lhs) ^ \
static_cast<std::underlying_type_t<enum_t>>(rhs)); \
} \
\
constexpr auto operator~(enum_t op) \
{ \
return static_cast<enum_t>( \
~static_cast<std::underlying_type_t<enum_t>>(op)); \
} \
\
constexpr auto& operator|=(enum_t& lhs, enum_t rhs) \
{ \
lhs = lhs | rhs; \
return lhs; \
} \
\
constexpr auto& operator&=(enum_t& lhs, enum_t rhs) \
{ \
lhs = lhs & rhs; \
return lhs; \
} \
\
constexpr enum_t& operator^=(enum_t& lhs, enum_t rhs) \
{ \
lhs = lhs ^ rhs; \
return lhs; \
}

#define O2_ENUM_TEST_BIT(mask, value) ((mask & value) == value)
#define O2_ENUM_SET_BIT(bit) ((1 << bit))
#define O2_ENUM_ANY_BIT(enum) ((static_cast<std::underlying_type_t<decltype(enum)>>(enum) != 0))

#endif
7 changes: 7 additions & 0 deletions Common/Utils/include/CommonUtils/TreeStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class TreeStream
const char* getName() const { return mTree.GetName(); }
void setID(int id) { mID = id; }
int getID() const { return mID; }

TreeStream& operator<<(const Bool_t& b)
{
CheckIn('B', &b);
Expand All @@ -75,6 +76,12 @@ class TreeStream
return *this;
}

TreeStream& operator<<(const int8_t& i)
{
CheckIn('B', &i);
return *this;
}

TreeStream& operator<<(const UChar_t& c)
{
CheckIn('b', &c);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
#include "TStopwatch.h"
#include "ZDCBase/Constants.h"
#include "GlobalTracking/MatchGlobalFwd.h"
#include "CommonUtils/TreeStreamRedirector.h"
#include "CommonUtils/EnumBitOperators.h"

#include <cstdint>
#include <limits>
#include <set>
#include <string>
#include <vector>
Expand Down Expand Up @@ -203,7 +207,15 @@ class BunchCrossings

std::vector<TimeWindow> mTimeWindows; // the time window structure covering the complete duration of mBCTimeVector
double mWindowSize; // the size of a single time window
}; // end internal class
}; // end internal class

// Steering bits for additional output during AOD production
enum struct AODProducerStreamerMask : uint8_t {
None = 0,
TrackQA = O2_ENUM_SET_BIT(0),
All = std::numeric_limits<std::underlying_type_t<AODProducerStreamerMask>>::max(),
};
O2_DEFINE_ENUM_BIT_OPERATORS(AODProducerStreamerMask)

class AODProducerWorkflowDPL : public Task
{
Expand Down Expand Up @@ -241,6 +253,9 @@ class AODProducerWorkflowDPL : public Task
std::unordered_set<GIndex> mGIDUsedBySVtx;
std::unordered_set<GIndex> mGIDUsedByStr;

AODProducerStreamerMask mStreamerMask;
std::shared_ptr<o2::utils::TreeStreamRedirector> mStreamer;

int mNThreads = 1;
bool mUseMC = true;
bool mEnableSV = true; // enable secondary vertices
Expand Down Expand Up @@ -339,6 +354,7 @@ class AODProducerWorkflowDPL : public Task
uint32_t mTrackCovOffDiag = 0xFFFF0000; // 7 bits
uint32_t mTrackSignal = 0xFFFFFF00; // 15 bits
uint32_t mTrackTime = 0xFFFFFFFF; // use full float precision for time
uint32_t mTPCTime0 = 0xFFFFFFE0; // 18 bits, providing 14256./(1<<19) = 0.027 TB precision e.g., ~0.13 mm in z
uint32_t mTrackTimeError = 0xFFFFFF00; // 15 bits
uint32_t mTrackPosEMCAL = 0xFFFFFF00; // 15 bits
uint32_t mTracklets = 0xFFFFFF00; // 15 bits
Expand Down Expand Up @@ -396,18 +412,28 @@ class AODProducerWorkflowDPL : public Task

struct TrackQA {
GID trackID;
float tpcTime0;
int16_t tpcdcaR;
int16_t tpcdcaZ;
uint8_t tpcClusterByteMask;
uint8_t tpcdEdxMax0R;
uint8_t tpcdEdxMax1R;
uint8_t tpcdEdxMax2R;
uint8_t tpcdEdxMax3R;
uint8_t tpcdEdxTot0R;
uint8_t tpcdEdxTot1R;
uint8_t tpcdEdxTot2R;
uint8_t tpcdEdxTot3R;
float tpcTime0{};
int16_t tpcdcaR{};
int16_t tpcdcaZ{};
uint8_t tpcClusterByteMask{};
uint8_t tpcdEdxMax0R{};
uint8_t tpcdEdxMax1R{};
uint8_t tpcdEdxMax2R{};
uint8_t tpcdEdxMax3R{};
uint8_t tpcdEdxTot0R{};
uint8_t tpcdEdxTot1R{};
uint8_t tpcdEdxTot2R{};
uint8_t tpcdEdxTot3R{};
int8_t dRefContY{std::numeric_limits<int8_t>::min()};
int8_t dRefContZ{std::numeric_limits<int8_t>::min()};
int8_t dRefContSnp{std::numeric_limits<int8_t>::min()};
int8_t dRefContTgl{std::numeric_limits<int8_t>::min()};
int8_t dRefContQ2Pt{std::numeric_limits<int8_t>::min()};
int8_t dRefGloY{std::numeric_limits<int8_t>::min()};
int8_t dRefGloZ{std::numeric_limits<int8_t>::min()};
int8_t dRefGloSnp{std::numeric_limits<int8_t>::min()};
int8_t dRefGloTgl{std::numeric_limits<int8_t>::min()};
int8_t dRefGloQ2Pt{std::numeric_limits<int8_t>::min()};
};

// helper struct for addToFwdTracksTable()
Expand Down
Loading
Loading