 |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef AthenaMonitoringKernel_HistogramFiller_h
6 #define AthenaMonitoringKernel_HistogramFiller_h
8 #include <boost/container/small_vector.hpp>
25 template<
typename H,
typename W,
typename M,
typename ...Ms>
30 void doFill(
TProfile*,
W,
size_t,
const char*
const&,
const char*
const&);
32 void doFill(TProfile2D*,
W,
size_t,
const double&,
const double&,
const char*
const&);
34 void doFill(TProfile2D*,
W,
size_t,
const char*
const&,
const char*
const&,
const char*
const&);
36 void doFill(TProfile2D*,
W,
size_t,
const char*
const&,
const double&,
const char*
const&);
38 void doFill(TProfile2D*,
W,
size_t,
const double&,
const char*
const&,
const char*
const&);
74 VariablesPack(
const std::initializer_list<const Monitored::IMonitoredVariable*>&
v)
104 std::vector<std::string>
names()
const {
105 std::vector<std::string>
r;
106 for (
const auto*
v:
m_var )
108 r.push_back(
v->name() );
118 boost::container::small_vector<const Monitored::IMonitoredVariable*, 3>
m_var;
147 const std::unique_lock<std::mutex>
getLock()
const {
148 return std::unique_lock(
m_lock);
167 template<
class H,
typename W,
typename C,
typename ...Ms>
169 auto hist = this->histogram<H>();
const std::vector< std::string > & histogramVariablesNames() const
std::shared_ptr< HistogramDef > m_histDef
const std::string & histogramWeightName() const
std::shared_ptr< IHistogramProvider > m_histogramProvider
const Monitored::IMonitoredVariable * cut
pointer to cut mask variable, typically absent
const std::unique_lock< std::mutex > getLock() const
unsigned fill(W weight, C cut, const Ms &... m) const
Fill histogram from IMonitoredVariable.
const Monitored::IMonitoredVariable * operator[](std::size_t i) const
get monitored variable at given index
the internal class used to keep parsed Filler properties
HistogramFiller(const HistogramFiller &hf)
Copy constructor.
void set(unsigned index, const IMonitoredVariable *ptr)
sets monitored variable at the index (may need to resize vector of variables)
const Monitored::IMonitoredVariable * weight
pointer to weight variable, typically absent
helper class to pass variables to fillers
void doFill(H *hist, W weight, size_t i, const M &m1, const Ms &... m)
Perform (arbitrary dimension) histogram fill with weight.
def TProfile(*args, **kwargs)
Generic monitoring tool for athena components.
const std::string & histogramCutMaskName() const
size_t size() const
number of variables in the pack ( not counting the weight and mask )
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
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...
virtual unsigned fill(const VariablesPack &) const =0
Method that actually fills the ROOT object.
std::vector< std::string > names() const
names of all variables stored
Base class for all histogram fillers.
HistogramFiller & operator=(HistogramFiller const &)=delete
void touch() const
Ensure histogram exists.
VariablesPack(const std::initializer_list< const Monitored::IMonitoredVariable * > &v)
HistogramFiller(const HistogramDef &histDef, std::shared_ptr< IHistogramProvider > histogramProvider)
Default constructor.
virtual ~HistogramFiller()
Virtual destructor.