ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
TrigGlobEffCorr::TriggerProperties Class Reference

#include <Trigger.h>

Collaboration diagram for TrigGlobEffCorr::TriggerProperties:

Public Member Functions

constexpr TriggerProperties (TriggerType tt)
 
 TriggerProperties (const ImportData::TrigDef &def)
 
constexpr TriggerType type () const
 
constexpr bool valid () const
 
constexpr bool mixed () const
 
constexpr unsigned nDistinctLegs () const
 
constexpr unsigned nDistinctLegs (xAOD::Type::ObjectType obj) const
 
template<typename Array >
void loadLegs (const ImportData::TrigDef &src, Array &dest)
 
constexpr int cbegin_offset (xAOD::Type::ObjectType obj) const
 
constexpr auto cbegin (xAOD::Type::ObjectType obj) const
 
constexpr int cend_offset (xAOD::Type::ObjectType obj) const
 
constexpr auto cend (xAOD::Type::ObjectType obj) const
 

Protected Attributes

TriggerType m_type
 
std::array< std::size_t, 4 > m_legs
 

Detailed Description

Definition at line 27 of file Trigger.h.

Constructor & Destructor Documentation

◆ TriggerProperties() [1/2]

constexpr TrigGlobEffCorr::TriggerProperties::TriggerProperties ( TriggerType  tt)
inlineexplicitconstexpr

Definition at line 29 of file Trigger.h.

29 : m_type(tt), m_legs{} {}

◆ TriggerProperties() [2/2]

TrigGlobEffCorr::TriggerProperties::TriggerProperties ( const ImportData::TrigDef def)
inlineexplicit

Definition at line 30 of file Trigger.h.

31  : m_type(def.type) {
32  loadLegs(def, m_legs);
33  }

Member Function Documentation

◆ cbegin()

constexpr auto TrigGlobEffCorr::TriggerProperties::cbegin ( xAOD::Type::ObjectType  obj) const
inlineconstexpr

Definition at line 107 of file Trigger.h.

107  {
108  return m_legs.cbegin() + cbegin_offset(obj);
109  }

◆ cbegin_offset()

constexpr int TrigGlobEffCorr::TriggerProperties::cbegin_offset ( xAOD::Type::ObjectType  obj) const
inlineconstexpr

Definition at line 101 of file Trigger.h.

101  {
102  return (obj != xAOD::Type::Electron) *
105  }

◆ cend()

constexpr auto TrigGlobEffCorr::TriggerProperties::cend ( xAOD::Type::ObjectType  obj) const
inlineconstexpr

Definition at line 117 of file Trigger.h.

117  {
118  return m_legs.cbegin() + nDistinctLegs() + cend_offset(obj);
119  }

◆ cend_offset()

constexpr int TrigGlobEffCorr::TriggerProperties::cend_offset ( xAOD::Type::ObjectType  obj) const
inlineconstexpr

Definition at line 111 of file Trigger.h.

111  {
112  return -((obj != xAOD::Type::Photon) *
115  }

◆ loadLegs()

template<typename Array >
void TrigGlobEffCorr::TriggerProperties::loadLegs ( const ImportData::TrigDef src,
Array &  dest 
)
inline

can't be thrown due to bad user action – only in case of a bug in the Calculator class

special case needed to skip the duplicated leg for 2X_Y triggers

Works as well for non-mixed trilepton triggers since the asymmetric leg is always stored first

Definition at line 82 of file Trigger.h.

82  {
83  if (src.type != m_type)
84  throw std::runtime_error(
85  "Calculator bug");
86  std::fill(dest.begin(), dest.end(), 0);
88  if (m_type == TT_2E_MU_SYM || m_type == TT_2E_G_SYM ||
89  m_type == TT_2MU_G_SYM)
90  {
92  dest[0] = src.leg[0];
93  dest[1] = src.leg[2];
94  } else
95  {
97  std::copy_n(src.leg.cbegin(), nDistinctLegs(), dest.begin());
98  }
99  }

◆ mixed()

constexpr bool TrigGlobEffCorr::TriggerProperties::mixed ( ) const
inlineconstexpr

Definition at line 40 of file Trigger.h.

40  {
41  auto x = m_type & TT_MASK_FLAVOUR;
42  return (x != TT_ELECTRON_FLAG) && (x != TT_MUON_FLAG) &&
43  (x != TT_PHOTON_FLAG);
44  }

◆ nDistinctLegs() [1/2]

constexpr unsigned TrigGlobEffCorr::TriggerProperties::nDistinctLegs ( ) const
inlineconstexpr

Definition at line 45 of file Trigger.h.

45  {
46  auto x = m_type & TT_MASK_SYMMETRY;
48  return 1;
49  else if (m_type & TT_DILEPTON_FLAG)
50  return 2 - 1 * (x == TT_SYM);
51  else if (m_type & TT_TRILEPTON_FLAG)
52  return (x == TT_ASYM) ? 3 : 1 + 1 * (mixed() || (x != TT_SYM));
53  else if ((m_type & TT_TETRALEPTON_FLAG) && x == TT_SYM)
54  return 1;
55  return 0;
56  }

◆ nDistinctLegs() [2/2]

constexpr unsigned TrigGlobEffCorr::TriggerProperties::nDistinctLegs ( xAOD::Type::ObjectType  obj) const
inlineconstexpr

Definition at line 57 of file Trigger.h.

57  {
58  bool firstPos = true;
59  switch (obj) {
61  if (!(m_type & TT_ELECTRON_FLAG))
62  return 0;
63  break;
64  case xAOD::Type::Muon:
65  if (!(m_type & TT_MUON_FLAG))
66  return 0;
67  firstPos = (m_type & TT_PHOTON_FLAG);
68  break;
69  case xAOD::Type::Photon:
70  if (!(m_type & TT_PHOTON_FLAG))
71  return 0;
72  firstPos = false;
73  break;
74  default:
75  return 0;
76  }
77  if (!mixed())
78  return nDistinctLegs();
79  return (firstPos == (m_type & TT_X2Y_FLAG)) ? 1 : nDistinctLegs() - 1;
80  }

◆ type()

constexpr TriggerType TrigGlobEffCorr::TriggerProperties::type ( ) const
inlineconstexpr

Definition at line 34 of file Trigger.h.

34 { return m_type; }

◆ valid()

constexpr bool TrigGlobEffCorr::TriggerProperties::valid ( ) const
inlineconstexpr

validity of mixed() function

Definition at line 35 of file Trigger.h.

35  {
36  return !((m_type & TT_MASK_FLAVOUR) &
38  TT_PHOTON_FLAG));
39  }

Member Data Documentation

◆ m_legs

std::array<std::size_t, 4> TrigGlobEffCorr::TriggerProperties::m_legs
protected

Definition at line 123 of file Trigger.h.

◆ m_type

TriggerType TrigGlobEffCorr::TriggerProperties::m_type
protected

Definition at line 122 of file Trigger.h.


The documentation for this class was generated from the following file:
TrigGlobEffCorr::TriggerProperties::cend_offset
constexpr int cend_offset(xAOD::Type::ObjectType obj) const
Definition: Trigger.h:111
TrigGlobEffCorr::TT_2E_MU_SYM
@ TT_2E_MU_SYM
Definition: ImportData.h:63
TrigGlobEffCorr::TriggerProperties::m_legs
std::array< std::size_t, 4 > m_legs
Definition: Trigger.h:123
TrigGlobEffCorr::TriggerProperties::mixed
constexpr bool mixed() const
Definition: Trigger.h:40
xAOD::Electron
Electron_v1 Electron
Definition of the current "egamma version".
Definition: Event/xAOD/xAODEgamma/xAODEgamma/Electron.h:17
TrigGlobEffCorr::TT_ASYM
@ TT_ASYM
Definition: ImportData.h:31
WriteCellNoiseToCool.src
src
Definition: WriteCellNoiseToCool.py:513
TrigGlobEffCorr::TriggerProperties::nDistinctLegs
constexpr unsigned nDistinctLegs() const
Definition: Trigger.h:45
TrigGlobEffCorr::TT_SINGLELEPTON_FLAG
@ TT_SINGLELEPTON_FLAG
Definition: ImportData.h:35
perfmonmt-printer.dest
dest
Definition: perfmonmt-printer.py:189
TrigGlobEffCorr::TriggerProperties::loadLegs
void loadLegs(const ImportData::TrigDef &src, Array &dest)
Definition: Trigger.h:82
x
#define x
TrigGlobEffCorr::TT_MUON_FLAG
@ TT_MUON_FLAG
Definition: ImportData.h:26
TrigGlobEffCorr::TriggerProperties::m_type
TriggerType m_type
Definition: Trigger.h:122
TrigGlobEffCorr::TT_SYM
@ TT_SYM
Definition: ImportData.h:29
TrigGlobEffCorr::TT_ELECTRON_FLAG
@ TT_ELECTRON_FLAG
Definition: ImportData.h:25
TrigGlobEffCorr::TT_2MU_G_SYM
@ TT_2MU_G_SYM
Definition: ImportData.h:74
TrigGlobEffCorr::TT_X2Y_FLAG
@ TT_X2Y_FLAG
Definition: ImportData.h:24
TrigGlobEffCorr::TT_PHOTON_FLAG
@ TT_PHOTON_FLAG
Definition: ImportData.h:27
TrigGlobEffCorr::TT_TETRALEPTON_FLAG
@ TT_TETRALEPTON_FLAG
Definition: ImportData.h:79
TrigGlobEffCorr::TT_TRILEPTON_FLAG
@ TT_TRILEPTON_FLAG
Definition: ImportData.h:53
TrigGlobEffCorr::ImportData::TrigDef::type
TriggerType type
Definition: ImportData.h:91
TrigGlobEffCorr::TT_MASK_SYMMETRY
@ TT_MASK_SYMMETRY
Definition: ImportData.h:32
xAOD::Photon
Photon_v1 Photon
Definition of the current "egamma version".
Definition: Event/xAOD/xAODEgamma/xAODEgamma/Photon.h:17
Muon
struct TBPatternUnitContext Muon
TrigGlobEffCorr::TT_MASK_FLAVOUR
@ TT_MASK_FLAVOUR
Definition: ImportData.h:28
lumiFormat.fill
fill
Definition: lumiFormat.py:104
TrigGlobEffCorr::TriggerProperties::cbegin_offset
constexpr int cbegin_offset(xAOD::Type::ObjectType obj) const
Definition: Trigger.h:101
TrigGlobEffCorr::TT_DILEPTON_FLAG
@ TT_DILEPTON_FLAG
Definition: ImportData.h:40
TrigGlobEffCorr::TT_2E_G_SYM
@ TT_2E_G_SYM
Definition: ImportData.h:70
python.PyAthena.obj
obj
Definition: PyAthena.py:132
TileDCSDataPlotter.tt
tt
Definition: TileDCSDataPlotter.py:876