|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef AthenaMonitoringKernel_HistogramFiller_h
6 #define AthenaMonitoringKernel_HistogramFiller_h
24 template<
typename H,
typename W,
typename M,
typename ...Ms>
29 void doFill(
TProfile*,
W,
size_t,
const char*
const&,
const char*
const&);
31 void doFill(TProfile2D*,
W,
size_t,
const double&,
const double&,
const char*
const&);
33 void doFill(TProfile2D*,
W,
size_t,
const char*
const&,
const char*
const&,
const char*
const&);
35 void doFill(TProfile2D*,
W,
size_t,
const char*
const&,
const double&,
const char*
const&);
37 void doFill(TProfile2D*,
W,
size_t,
const double&,
const char*
const&,
const char*
const&);
73 VariablesPack(
const std::initializer_list<const Monitored::IMonitoredVariable*>&
v)
105 std::vector<std::string>
names()
const {
106 std::vector<std::string>
r;
107 for (
const auto*
v:
var )
109 r.push_back(
v->name() );
113 std::vector<const Monitored::IMonitoredVariable*>
var = {
nullptr,
nullptr,
nullptr,
nullptr };
144 const std::unique_lock<std::mutex>
getLock()
const {
145 return std::unique_lock(
m_lock);
156 std::function<
bool(
size_t)> cutMaskValue = [] (size_t){
return true; };
158 if (
mask !=
nullptr ) {
163 return std::make_pair(0, [](
size_t){
return false; });
167 return std::make_pair(
maskSize, [
mask](
size_t i){
return static_cast<bool>(
mask->get(
i)); });
170 return std::make_pair(
maskSize, cutMaskValue);
183 template<
class H,
typename W,
typename C,
typename ...Ms>
185 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.
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 reszie 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.
virtual unsigned fill(const VariablesPack &) const =0
Method that actually fills the ROOT object.
std::vector< std::string > names() const
names of all varaibles stored
void fill(H5::Group &out_file, size_t iterations)
Base class for all histogram fillers.
HistogramFiller & operator=(HistogramFiller const &)=delete
std::vector< const Monitored::IMonitoredVariable * > var
storage for variables, default size of 4, serves all histograming uses
void touch() const
Ensure histogram exists.
void reset()
removes all monitored variables
VariablesPack(const std::initializer_list< const Monitored::IMonitoredVariable * > &v)
std::pair< size_t, std::function< bool(size_t)> > getCutMaskFunc(const Monitored::IMonitoredVariable *mask) const
setBGCode setTAP setLVL2ErrorBits bool
HistogramFiller(const HistogramDef &histDef, std::shared_ptr< IHistogramProvider > histogramProvider)
Default constructor.
virtual ~HistogramFiller()
Virtual destructor.