The Gaudi Framework
master (57817a18)
Toggle main menu visibility
Loading...
Searching...
No Matches
HistoDef.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#pragma once
12
13
#include <
GaudiKernel/Kernel.h
>
14
#include <iosfwd>
15
#include <string>
16
17
class
IHistogramSvc
;
18
namespace
AIDA
{
19
class
IHistogram1D;
20
}
// namespace AIDA
21
22
namespace
Gaudi
{
30
class
GAUDI_API
Histo1DDef
final {
31
public
:
38
Histo1DDef
(
double
low,
double
high,
int
bins
= 100, std::string
title
=
""
);
45
Histo1DDef
( std::string
title
=
""
,
double
low = 0.0,
double
high = 1.0,
int
bins
= 100 );
47
double
lowEdge
()
const
{
return
m_low
; }
49
double
highEdge
()
const
{
return
m_high
; }
51
int
bins
()
const
{
return
m_bins
; }
53
const
std::string&
title
()
const
{
return
m_title
; }
55
void
setLowEdge
(
double
value ) {
m_low
= value; }
57
void
setHighEdge
(
double
value ) {
m_high
= value; }
59
void
setBins
(
int
value ) {
m_bins
= value; }
61
void
setTitle
( std::string value ) {
m_title
= std::move( value ); }
63
std::ostream& fillStream( std::ostream& o )
const
;
65
friend
bool
operator<
(
const
Histo1DDef
& left,
const
Histo1DDef
& right );
67
friend
std::ostream&
operator<<
( std::ostream& o,
const
Gaudi::Histo1DDef
& histo );
69
bool
ok
()
const
{
return
0 <
bins
() &&
lowEdge
() <
highEdge
(); }
70
std::string
m_title
;
71
double
m_low
;
72
double
m_high
;
73
int
m_bins
;
74
};
75
81
namespace
Histos
{
87
GAUDI_API
AIDA::IHistogram1D*
book
(
IHistogramSvc
* svc,
const
std::string& path,
const
Gaudi::Histo1DDef
& hist );
94
GAUDI_API
AIDA::IHistogram1D*
book
(
IHistogramSvc
* svc,
const
std::string& dir,
const
std::string&
id
,
95
const
Gaudi::Histo1DDef
& hist );
102
GAUDI_API
AIDA::IHistogram1D*
book
(
IHistogramSvc
* svc,
const
std::string& dir,
const
int
id
,
103
const
Gaudi::Histo1DDef
& hist );
104
}
// namespace Histos
105
}
// namespace Gaudi
operator<<
std::ostream & operator<<(std::ostream &s, AlgsExecutionStates::State x)
Streaming of State values.
Definition
AlgsExecutionStates.h:99
Kernel.h
GAUDI_API
#define GAUDI_API
Definition
Kernel.h:49
operator<
bool operator<(backwards_compatibility_hack_time_timespan, backwards_compatibility_hack_time_timespan)
Definition
Time.h:518
Gaudi::Histo1DDef
Simple helper class for description of 1D-histogram The class is targeted to act as the primary "hist...
Definition
HistoDef.h:30
Gaudi::Histo1DDef::m_high
double m_high
High Edge.
Definition
HistoDef.h:72
Gaudi::Histo1DDef::setTitle
void setTitle(std::string value)
set the title
Definition
HistoDef.h:61
Gaudi::Histo1DDef::m_bins
int m_bins
Number of bins.
Definition
HistoDef.h:73
Gaudi::Histo1DDef::bins
int bins() const
get the number of bins
Definition
HistoDef.h:51
Gaudi::Histo1DDef::title
const std::string & title() const
get the title
Definition
HistoDef.h:53
Gaudi::Histo1DDef::highEdge
double highEdge() const
get the high edge
Definition
HistoDef.h:49
Gaudi::Histo1DDef::ok
bool ok() const
check if all fields are "reasonable"
Definition
HistoDef.h:69
Gaudi::Histo1DDef::m_low
double m_low
Low Edge.
Definition
HistoDef.h:71
Gaudi::Histo1DDef::m_title
std::string m_title
Histogram title.
Definition
HistoDef.h:70
Gaudi::Histo1DDef::setBins
void setBins(int value)
set number of bis
Definition
HistoDef.h:59
Gaudi::Histo1DDef::Histo1DDef
Histo1DDef(double low, double high, int bins=100, std::string title="")
full constructor from edges, bins and the title
Definition
HistoDef.cpp:28
Gaudi::Histo1DDef::setLowEdge
void setLowEdge(double value)
set low edge
Definition
HistoDef.h:55
Gaudi::Histo1DDef::setHighEdge
void setHighEdge(double value)
set high edge
Definition
HistoDef.h:57
Gaudi::Histo1DDef::lowEdge
double lowEdge() const
get the low edge
Definition
HistoDef.h:47
IHistogramSvc
Definition of the IHistogramSvc interface class.
Definition
IHistogramSvc.h:53
AIDA
Definition
Annotation.h:21
Gaudi::Histos
collection of simple utilities to deal with histograms
Gaudi::Histos::book
GAUDI_API AIDA::IHistogram1D * book(IHistogramSvc *svc, const std::string &path, const Gaudi::Histo1DDef &hist)
helper function to book 1D-histogram
Definition
HistoDef.cpp:57
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
GaudiKernel
include
GaudiKernel
HistoDef.h
Generated on
for The Gaudi Framework by
1.17.0