ATLAS Offline Software
Public Member Functions | Public Attributes | Private Attributes | List of all members
Monitored::HistogramFiller::VariablesPack Struct Reference

helper class to pass variables to fillers More...

#include <HistogramFiller.h>

Collaboration diagram for Monitored::HistogramFiller::VariablesPack:

Public Member Functions

 VariablesPack ()=default
 
 VariablesPack (const std::initializer_list< const Monitored::IMonitoredVariable * > &v)
 
const Monitored::IMonitoredVariableoperator[] (std::size_t i) const
 get monitored variable at given index More...
 
size_t size () const
 number of variables in the pack ( not counting the weight and mask ) More...
 
void set (unsigned index, const IMonitoredVariable *ptr)
 sets monitored variable at the index (may need to resize vector of variables) More...
 
std::vector< std::string > names () const
 names of all variables stored More...
 

Public Attributes

const Monitored::IMonitoredVariableweight = nullptr
 pointer to weight variable, typically absent More...
 
const Monitored::IMonitoredVariablecut = nullptr
 pointer to cut mask variable, typically absent More...
 

Private Attributes

boost::container::small_vector< const Monitored::IMonitoredVariable *, 3 > m_var
 Vector with small buffer optimization to avoid dynamic allocation for the most common case of histograms with a maximum of 3 variables. More...
 

Detailed Description

helper class to pass variables to fillers

Definition at line 72 of file HistogramFiller.h.

Constructor & Destructor Documentation

◆ VariablesPack() [1/2]

Monitored::HistogramFiller::VariablesPack::VariablesPack ( )
default

◆ VariablesPack() [2/2]

Monitored::HistogramFiller::VariablesPack::VariablesPack ( const std::initializer_list< const Monitored::IMonitoredVariable * > &  v)
inline

Definition at line 74 of file HistogramFiller.h.

75  : m_var( v ) {}

Member Function Documentation

◆ names()

std::vector<std::string> Monitored::HistogramFiller::VariablesPack::names ( ) const
inline

names of all variables stored

Definition at line 104 of file HistogramFiller.h.

104  {
105  std::vector<std::string> r;
106  for ( const auto* v: m_var )
107  if ( v != nullptr )
108  r.push_back( v->name() );
109  return r;
110  }

◆ operator[]()

const Monitored::IMonitoredVariable* Monitored::HistogramFiller::VariablesPack::operator[] ( std::size_t  i) const
inline

get monitored variable at given index

Definition at line 80 of file HistogramFiller.h.

80  {
81  return m_var[i];
82  }

◆ set()

void Monitored::HistogramFiller::VariablesPack::set ( unsigned  index,
const IMonitoredVariable ptr 
)
inline

sets monitored variable at the index (may need to resize vector of variables)

Definition at line 94 of file HistogramFiller.h.

94  {
95  if ( m_var.size() <= index ) {
96  m_var.resize(index+1);
97  }
98  m_var[index] = ptr;
99  }

◆ size()

size_t Monitored::HistogramFiller::VariablesPack::size ( ) const
inline

number of variables in the pack ( not counting the weight and mask )

Definition at line 87 of file HistogramFiller.h.

87  {
88  return m_var.size();
89  }

Member Data Documentation

◆ cut

const Monitored::IMonitoredVariable* Monitored::HistogramFiller::VariablesPack::cut = nullptr

pointer to cut mask variable, typically absent

Definition at line 113 of file HistogramFiller.h.

◆ m_var

boost::container::small_vector<const Monitored::IMonitoredVariable*, 3> Monitored::HistogramFiller::VariablesPack::m_var
private

Vector with small buffer optimization to avoid dynamic allocation for the most common case of histograms with a maximum of 3 variables.

Only 3D TEfficiency and TTress need more.

Definition at line 118 of file HistogramFiller.h.

◆ weight

const Monitored::IMonitoredVariable* Monitored::HistogramFiller::VariablesPack::weight = nullptr

pointer to weight variable, typically absent

Definition at line 112 of file HistogramFiller.h.


The documentation for this struct was generated from the following file:
beamspotman.r
def r
Definition: beamspotman.py:672
index
Definition: index.py:1
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
lumiFormat.i
int i
Definition: lumiFormat.py:85
Monitored::HistogramFiller::VariablesPack::m_var
boost::container::small_vector< const Monitored::IMonitoredVariable *, 3 > m_var
Vector with small buffer optimization to avoid dynamic allocation for the most common case of histogr...
Definition: HistogramFiller.h:118
python.PyAthena.v
v
Definition: PyAthena.py:154
DeMoScan.index
string index
Definition: DeMoScan.py:362