![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "GaudiKernel/Bootstrap.h"
13 #include "GaudiKernel/ISvcLocator.h"
14 #include "GaudiKernel/Service.h"
15 #include "GaudiKernel/IToolSvc.h"
17 #include "TEfficiency.h"
24 validArguments(
const float arg) {
25 return not (std::isnan(
arg));
29 validArguments(
const float arg,
const float arg2) {
30 return not (std::isnan(
arg) or std::isnan(arg2));
34 validArguments(
const float arg,
const float arg2,
const float arg3) {
35 return not (std::isnan(
arg) or std::isnan(arg2) or std::isnan(arg3));
55 hd.
yAxis.second,
false);
62 hd.
yAxis.second,
false);
69 hd.
yAxis.second,
false);
86 if (pTprofile and validArguments(
bin,
weight)) {
93 if (pTprofile and validArguments(
xval,
yval,
weight) and validArguments(weight2)) {
101 if (pTh1 and validArguments(
value)) {
108 if (pTh1 and validArguments(
value)) {
116 if (pTh2 and validArguments(
xval,
yval)) {
124 if (pTh2 and validArguments(
xval,
yval)) {
131 if (pTh3 and validArguments(
xval,
yval, zval)) {
138 if (pTeff and validArguments(
value)) {
146 if (eff2d and validArguments(xvalue, yvalue)) {
147 if(
weight==1.) eff2d->Fill(accepted, xvalue, yvalue);
148 else eff2d->FillWeighted(accepted,
weight, xvalue, yvalue);
158 ISvcLocator* svcLoc = Gaudi::svcLocator();
160 if (
sc.isFailure()) {
161 ATH_MSG_FATAL(
"failed to retrieve HistogramDefinitionSvc in " << __FILE__);
162 throw std::runtime_error(
"Could initialise the HistogramDefinitionSvc");
166 bool folderDefault = (
folder.empty() or
folder ==
"default");
169 if (folderDefault and
s.empty()) {
170 const std::string otherDefault = (
folder.empty()) ? (
"default") :
"";
174 ATH_MSG_WARNING(
"Histogram definition is empty for identifier " << histoIdentifier);
176 if (!nameOverride.empty()){
177 s.name = nameOverride;
TH1F * Book1D(const std::string &name, const std::string &labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
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.
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.
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 TH2D 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.
Mixin class to give extra capabilities to plots such as ATH_MSG and an easier booking interface,...
IHistogramDefinitionSvc::axesLimits_t xAxis
int Fill(double, double, double)
::StatusCode StatusCode
StatusCode definition for legacy code.
int Fill(double, double, double)
Class to provide easy MsgStream access and capabilities.
virtual SingleHistogramDefinition definition(const std::string &name, const std::string &dirName="") const =0
Return a histogram definition, retrieved by histogram identifier (and directory name,...
IHistogramDefinitionSvc * m_histoDefSvc
Almost-a-struct for holding the single histogram definition.
InDetPlotBase(InDetPlotBase *pParent, const std::string &dirName)
Constructor taking parent node and directory name for plots.
#define ATH_MSG_WARNING(x)
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.
IHistogramDefinitionSvc::axesLimits_t yAxis
bool isValid() const
Is the histogram definition valid.
static void fillHisto(TProfile *pTprofile, const float bin, const float weight, const float weight2=1.0)
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.