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

Constructor & Destructor Documentation

◆ TriggerProperties() [1/2]

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

Definition at line 29 of file Trigger.h.

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

◆ 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 }
void loadLegs(const ImportData::TrigDef &src, Array &dest)
Definition Trigger.h:82

Member Function Documentation

◆ cbegin()

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 }
constexpr int cbegin_offset(xAOD::Type::ObjectType obj) const
Definition Trigger.h:101

◆ cbegin_offset()

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 }
constexpr unsigned nDistinctLegs() const
Definition Trigger.h:45
@ 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 117 of file Trigger.h.

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

◆ cend_offset()

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 }
@ 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 82 of file Trigger.h.

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

◆ mixed()

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 }
#define x

◆ nDistinctLegs() [1/2]

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 }
constexpr bool mixed() const
Definition Trigger.h:40

◆ nDistinctLegs() [2/2]

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;
65 if (!(m_type & TT_MUON_FLAG))
66 return 0;
67 firstPos = (m_type & TT_PHOTON_FLAG);
68 break;
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()

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

Definition at line 34 of file Trigger.h.

34{ return m_type; }

◆ valid()

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) &
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: