#include <VecHistogramFiller1D.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 |
Definition at line 11 of file VecHistogramFiller1D.h.
◆ VecHistogramFiller1D()
Definition at line 13 of file VecHistogramFiller1D.h.
HistogramFiller1D(const HistogramDef &definition, std::shared_ptr< IHistogramProvider > provider)
◆ fill() [1/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.
◆ fill() [2/2]
Method that actually fills the ROOT object.
- Returns
- number of fills performed
Reimplemented from Monitored::HistogramFiller1D.
Definition at line 17 of file VecHistogramFiller1D.h.
17 {
18 if (
ATH_UNLIKELY(vars.size() == 0 or vars[0] ==
nullptr) ) {
return 0; }
19
20 if (vars.cut) {
21 const size_t maskSize = vars.cut->size();
22
23 if (maskSize == 0 || (maskSize == 1 && !vars.cut->get(0))) { return 0; }
24
25 if (
ATH_UNLIKELY(maskSize > 1 && maskSize != vars[0]->size())) {
27 log << MSG::ERROR <<
"CutMask does not match the size of plotted variable: "
29 }
30 }
31
33
36 log << MSG::WARNING <<
"Histogram " <<
histogram->GetName()
37 << " filled with kVec(UO) option with variable " << vars[0]->name()
38 <<
" have incompatible sizes (histogram) " <<
histogram->GetNbinsX()
39 << " (variable) " << vars[0]->size()
40 <<
" They ought to match exactly for kVec option or n. hist. bins +2 == var. size fro kVecOU" <<
endmsg;
41 return 0;
42 }
43
45 for (
unsigned i = 0;
i < vars[0]->size(); ++
i) {
46 if (vars.cut == nullptr or vars.cut->get(i)) {
47 const double value = vars[0]->get(i);
48 histogram->AddBinContent(i+offset, value);
50 }
51 }
52
53 return vars[0]->size();
54 }
std::shared_ptr< HistogramDef > m_histDef
IMessageSvc * getMessageSvc(bool quiet=false)
◆ 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 |
◆ 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: