The Gaudi Framework
v37r1 (a7f61348)
HistoDef.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2019 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
#ifndef GAUDIKERNEL_HISTODEF_H
12
#define GAUDIKERNEL_HISTODEF_H 1
13
// ============================================================================
14
// Include files
15
// ============================================================================
16
// STD & STL
17
// ============================================================================
18
#include <iosfwd>
19
#include <string>
20
// ============================================================================
21
// Gaudi
22
// ============================================================================
23
#include "
GaudiKernel/Kernel.h
"
24
// ============================================================================
25
// Forward decalrations
26
// ============================================================================
27
class
IHistogramSvc
;
28
namespace
AIDA
{
29
class
IHistogram1D;
30
}
// namespace AIDA
31
// ============================================================================
32
namespace
Gaudi
{
33
// ==========================================================================
41
class
GAUDI_API
Histo1DDef
final {
42
public
:
43
// ========================================================================
50
Histo1DDef
(
double
low,
double
high,
int
bins = 100,
std::string
title =
""
);
51
// ========================================================================
58
Histo1DDef
(
std::string
title =
""
,
double
low = 0.0,
double
high = 1.0,
int
bins = 100 );
59
// ========================================================================
60
public
:
61
// ========================================================================
63
double
lowEdge
()
const
{
return
m_low; }
65
double
highEdge
()
const
{
return
m_high; }
67
int
bins
()
const
{
return
m_bins; }
69
const
std::string
&
title
()
const
{
return
m_title; }
70
// ========================================================================
71
public
:
72
// ========================================================================
74
void
setLowEdge
(
double
value ) { m_low = value; }
76
void
setHighEdge
(
double
value ) { m_high = value; }
78
void
setBins
(
int
value ) { m_bins = value; }
80
void
setTitle
(
std::string
value ) { m_title =
std::move
( value ); }
81
// ========================================================================
82
public
:
83
// ========================================================================
85
std::ostream
& fillStream(
std::ostream
& o )
const
;
86
// ========================================================================
87
public
:
88
// ========================================================================
90
friend
bool
operator<
(
const
Histo1DDef
& left,
const
Histo1DDef
& right );
91
// ========================================================================
93
friend
std::ostream
&
operator<<
(
std::ostream
& o,
const
Gaudi::Histo1DDef
& histo );
94
// ========================================================================
95
public
:
96
// ========================================================================
98
bool
ok
()
const
{
return
0 < bins() && lowEdge() < highEdge(); }
99
// ========================================================================
100
private
:
101
// ========================================================================
102
// Histogram title
103
std::string
m_title
;
104
// Low Edge
105
double
m_low
;
106
// High Edge
107
double
m_high
;
108
// Number of bins
109
int
m_bins
;
110
// ========================================================================
111
};
112
// ==========================================================================
118
namespace
Histos
{
119
// ========================================================================
125
GAUDI_API
AIDA::IHistogram1D*
book
(
IHistogramSvc
* svc,
const
std::string
&
path
,
const
Gaudi::Histo1DDef
& hist );
126
// ========================================================================
133
GAUDI_API
AIDA::IHistogram1D*
book
(
IHistogramSvc
* svc,
const
std::string
& dir,
const
std::string
&
id
,
134
const
Gaudi::Histo1DDef
& hist );
135
// ========================================================================
142
GAUDI_API
AIDA::IHistogram1D*
book
(
IHistogramSvc
* svc,
const
std::string
& dir,
const
int
id
,
143
const
Gaudi::Histo1DDef
& hist );
144
// ========================================================================
145
}
// namespace Histos
146
// ==========================================================================
147
}
// end of namespace Gaudi
148
// ============================================================================
149
// The END
150
// ============================================================================
151
#endif // GAUDIKERNEL_HISTODEF_H
AIDA
GaudiKernel.
Definition:
Fill.h:20
std::string
STL class.
IHistogramSvc
Definition:
IHistogramSvc.h:56
std::move
T move(T... args)
GaudiAlg.HistoUtils.path
path
Definition:
HistoUtils.py:961
Gaudi::Histo1DDef::setLowEdge
void setLowEdge(double value)
set low edge
Definition:
HistoDef.h:74
Gaudi::Histo1DDef::m_high
double m_high
High Edge.
Definition:
HistoDef.h:107
Gaudi::Histo1DDef::m_low
double m_low
Low Edge.
Definition:
HistoDef.h:105
Gaudi::Histo1DDef::setTitle
void setTitle(std::string value)
set the title
Definition:
HistoDef.h:80
Gaudi::Histo1DDef
Definition:
HistoDef.h:41
Gaudi::Histo1DDef::setHighEdge
void setHighEdge(double value)
set high edge
Definition:
HistoDef.h:76
std::ostream
STL class.
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:77
Gaudi::Histo1DDef::ok
bool ok() const
check if all fields are "reasonable"
Definition:
HistoDef.h:98
Gaudi
Header file for std:chrono::duration-based Counters.
Definition:
__init__.py:1
Gaudi::Histo1DDef::highEdge
double highEdge() const
get the high edge
Definition:
HistoDef.h:65
Kernel.h
Gaudi::Histo1DDef::m_bins
int m_bins
Number of bins.
Definition:
HistoDef.h:109
Gaudi::Histo1DDef::m_title
std::string m_title
Histogram title.
Definition:
HistoDef.h:103
Gaudi::operator<
bool operator<(const Gaudi::Histo1DDef &left, const Gaudi::Histo1DDef &right)
Definition:
HistoDef.cpp:59
Gaudi::Histo1DDef::lowEdge
double lowEdge() const
get the low edge
Definition:
HistoDef.h:63
Gaudi::Histo1DDef::bins
int bins() const
get the number of bins
Definition:
HistoDef.h:67
Gaudi::Histo1DDef::title
const std::string & title() const
get the title
Definition:
HistoDef.h:69
Gaudi::Histo1DDef::setBins
void setBins(int value)
set number of bis
Definition:
HistoDef.h:78
GAUDI_API
#define GAUDI_API
Definition:
Kernel.h:81
Gaudi::operator<<
std::ostream & operator<<(std::ostream &o, const RootAddress &addr)
Definition:
MIHelpers.h:20
Histos
GaudiKernel
include
GaudiKernel
HistoDef.h
Generated on Mon Oct 30 2023 11:39:53 for The Gaudi Framework by
1.8.18