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

Constructor & Destructor Documentation

◆ TriggerProperties() [1/2]

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

Definition at line 27 of file Trigger.h.

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

◆ TriggerProperties() [2/2]

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

Definition at line 28 of file Trigger.h.

28 : m_type(def.type) { loadLegs(def, m_legs); }

Member Function Documentation

◆ cbegin()

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

Definition at line 91 of file Trigger.h.

92  {
93  return m_legs.cbegin() + cbegin_offset(obj);
94  }

◆ cbegin_offset()

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

Definition at line 85 of file Trigger.h.

◆ cend()

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

Definition at line 102 of file Trigger.h.

103  {
104  return m_legs.cbegin() + nDistinctLegs() + cend_offset(obj);
105  }

◆ cend_offset()

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

Definition at line 96 of file Trigger.h.

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

71  {
72  if(src.type != m_type) throw std::runtime_error ("Calculator bug");
73  std::fill(dest.begin(), dest.end(), 0);
75  {
76  dest[0] = src.leg[0];
77  dest[1] = src.leg[2];
78  }
79  else
80  {
81  std::copy_n(src.leg.cbegin(), nDistinctLegs(), dest.begin());
82  }
83  }

◆ mixed()

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

Definition at line 34 of file Trigger.h.

35  {
36  auto x = m_type&TT_MASK_FLAVOUR;
37  return (x!=TT_ELECTRON_FLAG) && (x!=TT_MUON_FLAG) && (x!=TT_PHOTON_FLAG);
38  }

◆ nDistinctLegs() [1/2]

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

Definition at line 39 of file Trigger.h.

40  {
41  auto x = m_type&TT_MASK_SYMMETRY;
42  if(m_type&TT_SINGLELEPTON_FLAG) return 1;
43  else if(m_type&TT_DILEPTON_FLAG) return 2 - 1*(x==TT_SYM);
44  else if(m_type&TT_TRILEPTON_FLAG) return (x==TT_ASYM)? 3 : 1 + 1*(mixed()||(x!=TT_SYM));
45  else if((m_type&TT_TETRALEPTON_FLAG) && x==TT_SYM) return 1;
46  return 0;
47  }

◆ nDistinctLegs() [2/2]

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

Definition at line 48 of file Trigger.h.

49  {
50  bool firstPos = true;
51  switch(obj)
52  {
54  if(!(m_type&TT_ELECTRON_FLAG)) return 0;
55  break;
56  case xAOD::Type::Muon:
57  if(!(m_type&TT_MUON_FLAG)) return 0;
58  firstPos = (m_type&TT_PHOTON_FLAG);
59  break;
60  case xAOD::Type::Photon:
61  if(!(m_type&TT_PHOTON_FLAG)) return 0;
62  firstPos = false;
63  break;
64  default: return 0;
65  }
66  if(!mixed()) return nDistinctLegs();
67  return (firstPos == (m_type&TT_X2Y_FLAG))? 1 : nDistinctLegs()-1;
68  }

◆ type()

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

Definition at line 29 of file Trigger.h.

29 { return m_type; }

◆ valid()

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

validity of mixed() function

Definition at line 30 of file Trigger.h.

Member Data Documentation

◆ m_legs

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

Definition at line 109 of file Trigger.h.

◆ m_type

TriggerType TrigGlobEffCorr::TriggerProperties::m_type
protected

Definition at line 108 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:96
TrigGlobEffCorr::TT_2E_MU_SYM
@ TT_2E_MU_SYM
Definition: ImportData.h:64
TrigGlobEffCorr::TriggerProperties::m_legs
std::array< std::size_t, 4 > m_legs
Definition: Trigger.h:109
TrigGlobEffCorr::TriggerProperties::mixed
constexpr bool mixed() const
Definition: Trigger.h:34
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:32
WriteCellNoiseToCool.src
src
Definition: WriteCellNoiseToCool.py:513
TrigGlobEffCorr::TriggerProperties::nDistinctLegs
constexpr unsigned nDistinctLegs() const
Definition: Trigger.h:39
TrigGlobEffCorr::TT_SINGLELEPTON_FLAG
@ TT_SINGLELEPTON_FLAG
Definition: ImportData.h:36
perfmonmt-printer.dest
dest
Definition: perfmonmt-printer.py:189
TrigGlobEffCorr::TriggerProperties::loadLegs
void loadLegs(const ImportData::TrigDef &src, Array &dest)
Definition: Trigger.h:70
x
#define x
TrigGlobEffCorr::TT_MUON_FLAG
@ TT_MUON_FLAG
Definition: ImportData.h:27
TrigGlobEffCorr::TriggerProperties::m_type
TriggerType m_type
Definition: Trigger.h:108
TrigGlobEffCorr::TT_SYM
@ TT_SYM
Definition: ImportData.h:30
TrigGlobEffCorr::TT_ELECTRON_FLAG
@ TT_ELECTRON_FLAG
Definition: ImportData.h:26
TrigGlobEffCorr::TT_2MU_G_SYM
@ TT_2MU_G_SYM
Definition: ImportData.h:75
TrigGlobEffCorr::TT_X2Y_FLAG
@ TT_X2Y_FLAG
Definition: ImportData.h:25
TrigGlobEffCorr::TT_PHOTON_FLAG
@ TT_PHOTON_FLAG
Definition: ImportData.h:28
TrigGlobEffCorr::TT_TETRALEPTON_FLAG
@ TT_TETRALEPTON_FLAG
Definition: ImportData.h:80
TrigGlobEffCorr::TT_TRILEPTON_FLAG
@ TT_TRILEPTON_FLAG
Definition: ImportData.h:54
TrigGlobEffCorr::ImportData::TrigDef::type
TriggerType type
Definition: ImportData.h:94
TrigGlobEffCorr::TT_MASK_SYMMETRY
@ TT_MASK_SYMMETRY
Definition: ImportData.h:33
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:29
lumiFormat.fill
fill
Definition: lumiFormat.py:111
TrigGlobEffCorr::TriggerProperties::cbegin_offset
constexpr int cbegin_offset(xAOD::Type::ObjectType obj) const
Definition: Trigger.h:85
TrigGlobEffCorr::TT_DILEPTON_FLAG
@ TT_DILEPTON_FLAG
Definition: ImportData.h:41
TrigGlobEffCorr::TT_2E_G_SYM
@ TT_2E_G_SYM
Definition: ImportData.h:71
python.PyAthena.obj
obj
Definition: PyAthena.py:135
TileDCSDataPlotter.tt
tt
Definition: TileDCSDataPlotter.py:874