ATLAS Offline Software
Classes | Functions
GlobalSim::BDT Namespace Reference

Classes

struct  BDT
 
class  OpAdd
 
struct  Tree
 

Functions

constexpr int floorlog2 (int x)
 
constexpr int pow2 (int x)
 
template<class T , int N, class Op >
reduce (const T *x, Op op)
 
constexpr int fn_classes (int n_classes)
 

Function Documentation

◆ floorlog2()

constexpr int GlobalSim::BDT::floorlog2 ( int  x)
constexpr

Definition at line 22 of file Trigger/TrigT1/Global/GlobalSimulation/src/GlobalAlgs/Egamma1BDT/BDT.h.

22 { return (x < 2) ? 0 : 1 + floorlog2(x / 2); }

◆ fn_classes()

constexpr int GlobalSim::BDT::fn_classes ( int  n_classes)
constexpr

Definition at line 44 of file Trigger/TrigT1/Global/GlobalSimulation/src/GlobalAlgs/Egamma1BDT/BDT.h.

44  {
45  return n_classes == 2 ? 1 : n_classes;
46  }

◆ pow2()

constexpr int GlobalSim::BDT::pow2 ( int  x)
constexpr

Definition at line 24 of file Trigger/TrigT1/Global/GlobalSimulation/src/GlobalAlgs/Egamma1BDT/BDT.h.

24 { return x == 0 ? 1 : 2 * pow2(x - 1); }

◆ reduce()

template<class T , int N, class Op >
T GlobalSim::BDT::reduce ( const T *  x,
Op  op 
)

Definition at line 26 of file Trigger/TrigT1/Global/GlobalSimulation/src/GlobalAlgs/Egamma1BDT/BDT.h.

26  {
27  static constexpr int leftN = pow2(floorlog2(N - 1)) > 0 ? pow2(floorlog2(N - 1)) : 0;
28  static constexpr int rightN = N - leftN > 0 ? N - leftN : 0;
29  if (N == 1) {
30  return x[0];
31  }
32  if (N == 2) {
33  return op(x[0], x[1]);
34  }
35  return op(reduce<T, leftN, Op>(x, op), reduce<T, rightN, Op>(x + leftN, op));
36  }
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
x
#define x
GlobalSim::BDT::floorlog2
constexpr int floorlog2(int x)
Definition: Trigger/TrigT1/Global/GlobalSimulation/src/GlobalAlgs/Egamma1BDT/BDT.h:22
GlobalSim::BDT::pow2
constexpr int pow2(int x)
Definition: Trigger/TrigT1/Global/GlobalSimulation/src/GlobalAlgs/Egamma1BDT/BDT.h:24