Project
Loading...
Searching...
No Matches
Definitions.h
Go to the documentation of this file.
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.
14
15#ifndef TRACKINGITS_DEFINITIONS_H_
16#define TRACKINGITS_DEFINITIONS_H_
17
18#include <type_traits>
19#include <cstdint>
20
21namespace o2::its
22{
23
24enum class TrackletMode {
25 Layer0Layer1 = 0,
26 Layer1Layer2 = 2
27};
28
29template <bool IsConst, typename T>
30using maybe_const = typename std::conditional<IsConst, const T, T>::type;
31
32// simple implemnetion of logging with exp. backoff
34 uint64_t evCount{0};
35 uint64_t nextLog{1};
36 int32_t iteration{-1};
37 int32_t layer{-1};
38 bool needToLog(int32_t iter, int32_t lay)
39 {
40 if (iteration != iter || layer != lay) {
41 iteration = iter;
42 layer = lay;
43 evCount = 0;
44 nextLog = 1;
45 }
46 if (++evCount > nextLog) {
47 nextLog *= 2;
48 return true;
49 }
50 return false;
51 }
52};
53} // namespace o2::its
54
55#endif
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
typename std::conditional< IsConst, const T, T >::type maybe_const
Definition Definitions.h:30
bool needToLog(int32_t iter, int32_t lay)
Definition Definitions.h:38