8#include "GaudiKernel/Bootstrap.h"
9#include "GaudiKernel/ISvcLocator.h"
10#include "GaudiKernel/Service.h"
11#include "GaudiKernel/IToolSvc.h"
20 validArguments(
const float arg) {
21 return not (std::isnan(arg));
25 validArguments(
const float arg1,
const float arg2) {
26 return not (std::isnan(arg1) or std::isnan(arg2));
30 validArguments(
const float arg1,
const float arg2,
const float arg3) {
31 return not (std::isnan(arg1) or std::isnan(arg2) or std::isnan(arg3));
42void TCCPlotsBase::book(TH1*& pHisto,
const std::string& histoIdentifier,
const std::string& folder) {
45 ATH_MSG_WARNING(
"Histogram definition is empty for identifier " << histoIdentifier);
58void TCCPlotsBase::book(TH2*& pHisto,
const std::string& histoIdentifier,
const std::string& folder) {
61 ATH_MSG_WARNING(
"Histogram definition is empty for identifier " << histoIdentifier);
75void TCCPlotsBase::book(TH3*& pHisto,
const std::string& histoIdentifier,
const std::string& folder) {
78 ATH_MSG_WARNING(
"Histogram definition is empty for identifier " << histoIdentifier);
95 if (pTh1 and validArguments(value)) {
101 if (pTh1 and validArguments(value)) {
102 pTh1->Fill(value, weight);
108 if (pTh2 and validArguments(xval, yval)) {
109 pTh2->Fill(xval, yval);
114 if (pTh2 and validArguments(xval, yval)) {
115 pTh2->Fill(xval, yval, weight);
121 if (pTh3 and validArguments(xval, yval, zval)) {
122 pTh3->Fill(xval, yval, zval);
127 if (pTh3 and validArguments(xval, yval, zval)) {
128 pTh3->Fill(xval, yval, zval, weight);
135 ATH_MSG_DEBUG(
"Retrieving SingleHistogramDefinition for "<< histoIdentifier);
138 bool folderDefault = (folder.empty() or folder ==
"default");
141 if (folderDefault and s.empty()) {
142 const std::string otherDefault = (folder.empty()) ? (
"default") :
"";
143 s =
m_histoDefSvc->definition(histoIdentifier, otherDefault);
146 ATH_MSG_WARNING(
"Histogram definition is empty for identifier " << histoIdentifier);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
TH1D * Book1D(const std::string &name, const std::string &labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
PlotBase(PlotBase *parent, const std::string &sDir)
TH3F * Book3D(const std::string &name, const std::string &labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, int nBinsZ, float startZ, float endZ, bool prependDir=true)
Book a TH3F histogram.
TH2F * Book2D(const std::string &name, const std::string &labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, bool prependDir=true)
Book a TH2F histogram.
Almost-a-struct for holding the single histogram definition.
bool isValid() const
Is the histogram definition valid.
IHistogramDefinitionSvc::axesLimits_t zAxis
bool empty() const
Is the histogram definition empty?
IHistogramDefinitionSvc::axesLimits_t xAxis
IHistogramDefinitionSvc::axesLimits_t yAxis
static void fillHisto(TH1 *pTh1, const float value)
void book(TH1 *&pHisto, const SingleHistogramDefinition &hd)
Book a TH1 histogram.
ServiceHandle< IHistogramDefinitionSvc > m_histoDefSvc
TCCPlotsBase(PlotBase *pParent, const std::string &folder)
SingleHistogramDefinition retrieveDefinition(const std::string &histoIdentifier, const std::string &folder="default")
Retrieve a single histogram definition, given the unique string identifier.