13#include "TEfficiency.h"
19 validArguments(
const float arg) {
20 return not (std::isnan(arg));
24 validArguments(
const float arg,
const float arg2) {
25 return not (std::isnan(arg) or std::isnan(arg2));
29 validArguments(
const float arg,
const float arg2,
const float arg3) {
30 return not (std::isnan(arg) or std::isnan(arg2) or std::isnan(arg3));
52 hd.
yAxis.second,
false);
59 hd.
yAxis.second,
false);
66 hd.
yAxis.second,
false);
83 if (pTprofile and validArguments(
bin, weight)) {
84 pTprofile->Fill(
bin, weight,weight2);
90 if (pTprofile and validArguments(xval,yval, weight) and validArguments(weight2)) {
91 pTprofile->Fill(xval,yval, weight,weight2);
98 if (pTh1 and validArguments(value)) {
105 if (pTh1 and validArguments(value)) {
106 pTh1->Fill(value, weight);
113 if (pTh2 and validArguments(xval, yval)) {
114 pTh2->Fill(xval, yval);
121 if (pTh2 and validArguments(xval, yval)) {
122 pTh2->Fill(xval, yval, weight);
128 if (pTh3 and validArguments(xval, yval, zval)) {
129 pTh3->Fill(xval, yval, zval);
135 if (pTeff and validArguments(value)) {
136 if(weight==1.) pTeff->Fill(accepted, value);
137 else pTeff->FillWeighted(accepted, weight, value);
143 if (eff2d and validArguments(xvalue, yvalue)) {
144 if(weight==1.) eff2d->Fill(accepted, xvalue, yvalue);
145 else eff2d->FillWeighted(accepted, weight, xvalue, yvalue);
155 bool folderDefault = (folder.empty() or folder ==
"default");
158 if (folderDefault and s.empty()) {
159 const std::string otherDefault = (folder.empty()) ? (
"default") :
"";
160 s =
m_histoDefSvc->definition(histoIdentifier, otherDefault);
163 ATH_MSG_WARNING(
"Histogram definition is empty for identifier " << histoIdentifier);
165 if (!nameOverride.empty()){
166 s.name = nameOverride;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
static void fillHisto(TProfile *pTprofile, const float bin, const float weight, const float weight2=1.0)
ServiceHandle< IHistogramDefinitionSvc > m_histoDefSvc
void book(Htype *&pHisto, const std::string &histoIdentifier, const std::string &nameOverride="", const std::string &folder="default")
Helper method to book histograms using an identifier string.
InDetPlotBase(InDetPlotBase *pParent, const std::string &dirName)
Constructor taking parent node and directory name for plots.
SingleHistogramDefinition retrieveDefinition(const std::string &histoIdentifier, const std::string &folder="default", const std::string &nameOverride="")
Retrieve a single histogram definition, given the unique string identifier.
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)
TProfile * BookTProfile(const std::string &name, const std::string &labels, int nBinsX, float startX, float endX, float startY=-1, float endY=-1, bool prependDir=true, bool useRMS=false)
Book a TProfile 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.
TEfficiency * BookTEfficiency(const std::string &name, const std::string &labels, const int nBinsX, const float xlo, const float xhi, const bool prependDir=true)
Book a (1-D) TEfficiency histogram.
TProfile2D * BookTProfile2D(const std::string &name, const std::string &labels, const int nBinsX, const double xlo, const double xhi, const int nBinsY, const double ylo, const double yhi, bool prependDir=true, bool useRMS=false)
Book a TProfile 2D histogram with variable binning in x-axis and limits in y-values.
Almost-a-struct for holding the single histogram definition.
bool isValid() const
Is the histogram definition valid.
IHistogramDefinitionSvc::axesLimits_t xAxis
IHistogramDefinitionSvc::axesLimits_t yAxis