ATLAS Offline Software
Loading...
Searching...
No Matches
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 25 of file Trigger.h.

Constructor & Destructor Documentation

◆ TriggerProperties() [1/2]

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

Definition at line 27 of file Trigger.h.

27: m_type(tt), m_legs{} {}
std::array< std::size_t, 4 > m_legs
Definition Trigger.h:121

◆ TriggerProperties() [2/2]

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

Definition at line 28 of file Trigger.h.

29 : m_type(def.type) {
30 loadLegs(def, m_legs);
31 }
void loadLegs(const ImportData::TrigDef &src, Array &dest)
Definition Trigger.h:80

Member Function Documentation

◆ cbegin()

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

Definition at line 105 of file Trigger.h.

105 {
106 return m_legs.cbegin() + cbegin_offset(obj);
107 }
constexpr int cbegin_offset(xAOD::Type::ObjectType obj) const
Definition Trigger.h:99

◆ cbegin_offset()

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

Definition at line 99 of file Trigger.h.

99 {
100 return (obj != xAOD::Type::Electron) *
103 }
constexpr unsigned nDistinctLegs() const
Definition Trigger.h:43
@ Muon
The object is a muon.
Definition ObjectType.h:48
@ Electron
The object is an electron.
Definition ObjectType.h:46

◆ cend()

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

Definition at line 115 of file Trigger.h.

115 {
116 return m_legs.cbegin() + nDistinctLegs() + cend_offset(obj);
117 }
constexpr int cend_offset(xAOD::Type::ObjectType obj) const
Definition Trigger.h:109

◆ cend_offset()

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

Definition at line 109 of file Trigger.h.

109 {
110 return -((obj != xAOD::Type::Photon) *
113 }
@ Photon
The object is a photon.
Definition ObjectType.h:47

◆ 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 80 of file Trigger.h.

80 {
81 if (src.type != m_type)
82 throw std::runtime_error(
83 "Calculator bug");
85 std::fill(dest.begin(), dest.end(), 0);
89 {
90 dest[0] = src.leg[0];
91 dest[1] = src.leg[2];
92 } else
94 {
95 std::copy_n(src.leg.cbegin(), nDistinctLegs(), dest.begin());
96 }
97 }

◆ mixed()

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

Definition at line 38 of file Trigger.h.

38 {
39 auto x = m_type & TT_MASK_FLAVOUR;
40 return (x != TT_ELECTRON_FLAG) && (x != TT_MUON_FLAG) &&
41 (x != TT_PHOTON_FLAG);
42 }
#define x

◆ nDistinctLegs() [1/2]

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

Definition at line 43 of file Trigger.h.

43 {
44 auto x = m_type & TT_MASK_SYMMETRY;
46 return 1;
47 else if (m_type & TT_DILEPTON_FLAG)
48 return 2 - 1 * (x == TT_SYM);
49 else if (m_type & TT_TRILEPTON_FLAG)
50 return (x == TT_ASYM) ? 3 : 1 + 1 * (mixed() || (x != TT_SYM));
51 else if ((m_type & TT_TETRALEPTON_FLAG) && x == TT_SYM)
52 return 1;
53 return 0;
54 }
constexpr bool mixed() const
Definition Trigger.h:38

◆ nDistinctLegs() [2/2]

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

Definition at line 55 of file Trigger.h.

55 {
56 bool firstPos = true;
57 switch (obj) {
59 if (!(m_type & TT_ELECTRON_FLAG))
60 return 0;
61 break;
63 if (!(m_type & TT_MUON_FLAG))
64 return 0;
65 firstPos = (m_type & TT_PHOTON_FLAG);
66 break;
68 if (!(m_type & TT_PHOTON_FLAG))
69 return 0;
70 firstPos = false;
71 break;
72 default:
73 return 0;
74 }
75 if (!mixed())
76 return nDistinctLegs();
77 return (firstPos == (m_type & TT_X2Y_FLAG)) ? 1 : nDistinctLegs() - 1;
78 }

◆ type()

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

Definition at line 32 of file Trigger.h.

32{ return m_type; }

◆ valid()

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

validity of mixed() function

Definition at line 33 of file Trigger.h.

33 {
34 return !((m_type & TT_MASK_FLAVOUR) &
37 }

Member Data Documentation

◆ m_legs

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

Definition at line 121 of file Trigger.h.

◆ m_type

TriggerType TrigGlobEffCorr::TriggerProperties::m_type
protected

Definition at line 120 of file Trigger.h.


The documentation for this class was generated from the following file: