Filler for plain 1D histograms.
More...
#include <HistogramFiller1D.h>
|
| template<class H, typename W, typename C, typename ... Ms> |
| unsigned | fill (W weight, C cut, const Ms &... m) const |
| | Fill histogram from IMonitoredVariable.
|
| template<class H> |
| H * | histogram () const |
Filler for plain 1D histograms.
Definition at line 22 of file HistogramFiller1D.h.
◆ HistogramFiller1D()
Definition at line 24 of file HistogramFiller1D.h.
26 }
HistogramFiller(const HistogramDef &histDef, std::shared_ptr< IHistogramProvider > histogramProvider)
Default constructor.
◆ fill() [1/2]
Method that actually fills the ROOT object.
- Returns
- number of fills performed
Implements Monitored::HistogramFiller.
Reimplemented in Monitored::CumulativeHistogramFiller1D, Monitored::HistogramFillerRebinableAxis< HistogramFiller1D, Axis::X >, and Monitored::VecHistogramFiller1D.
Definition at line 28 of file HistogramFiller1D.h.
28 {
29
30 if ( vars.cut ) {
31 const size_t maskSize = vars.cut->size();
32
33 if (maskSize == 0 || (maskSize == 1 && !vars.cut->get(0))) { return 0; }
34 if (
ATH_UNLIKELY(maskSize > 1 && maskSize != vars[0]->size())) {
36 log << MSG::ERROR <<
"CutMask does not match the size of plotted variable: "
38 }
39 }
40
41
42 auto cutMaskAccessor = [&](
size_t i) {
return static_cast<bool>(vars.cut->get(i)); };
43
44 if (vars.weight) {
45 auto weightAccessor = [&](
size_t i){
return vars.weight->get(i); };
46
47 if (
ATH_UNLIKELY(vars.weight->size() != vars[0]->size())) {
49 log << MSG::ERROR <<
"Weight does not match the size of plotted variable: "
50 << vars.weight->size() <<
" " << vars[0]->size() <<
endmsg;
51 }
52
55 }
56
59 }
virtual unsigned fill(const VariablesPack &) const =0
Method that actually fills the ROOT object.
IMessageSvc * getMessageSvc(bool quiet=false)
auto noWeight
no weight for filling
auto noCut
no cut for filling
◆ fill() [2/2]
template<class
H, typename W, typename
C, typename ... Ms>
| unsigned Monitored::HistogramFiller::fill |
( |
W | weight, |
|
|
C | cut, |
|
|
const Ms &... | m ) const |
|
inlineprotectedinherited |
Fill histogram from IMonitoredVariable.
Supports arbitrary dimensions and double/string representation.
- Template Parameters
-
| H | histogram type (TH1, TH2, ...) |
- Parameters
-
Definition at line 168 of file HistogramFiller.h.
168 {
170
172 for (;
i < std::max({
m.size()...}); ++
i ) {
175 }
176 }
178 }
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
void doFill(H *hist, W weight, size_t i, const M &m1, const Ms &... m)
Perform (arbitrary dimension) histogram fill with weight.
◆ getLock()
| const std::unique_lock< std::mutex > Monitored::HistogramFiller::getLock |
( |
| ) |
const |
|
inlineinherited |
◆ histogram()
| H * Monitored::HistogramFiller::histogram |
( |
| ) |
const |
|
inlineprotectedinherited |
Definition at line 153 of file HistogramFiller.h.
153 {
155 }
std::shared_ptr< IHistogramProvider > m_histogramProvider
◆ histogramCutMaskName()
| const std::string & Monitored::HistogramFiller::histogramCutMaskName |
( |
| ) |
const |
|
inlineinherited |
Definition at line 143 of file HistogramFiller.h.
143 {
145 }
std::shared_ptr< HistogramDef > m_histDef
◆ histogramVariablesNames()
| const std::vector< std::string > & Monitored::HistogramFiller::histogramVariablesNames |
( |
| ) |
const |
|
inlineinherited |
◆ histogramWeightName()
| const std::string & Monitored::HistogramFiller::histogramWeightName |
( |
| ) |
const |
|
inlineinherited |
◆ touch()
| void Monitored::HistogramFiller::touch |
( |
| ) |
const |
|
inlineinherited |
◆ m_histDef
| std::shared_ptr<HistogramDef> Monitored::HistogramFiller::m_histDef |
|
protectedinherited |
◆ m_histogramProvider
◆ m_lock
| std::mutex Monitored::HistogramFiller::m_lock |
|
mutableprotectedinherited |
The documentation for this class was generated from the following file: