The Gaudi Framework
master (37c0b60a)
HistoStrings.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2024 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 GAUDIUTILS_HISTOSTRINGS_H
12
#define GAUDIUTILS_HISTOSTRINGS_H 1
13
// ============================================================================
14
// Include files
15
// ============================================================================
16
// STD & STL
17
// ============================================================================
18
#include <iosfwd>
19
#include <string>
20
// ============================================================================
21
// GaudiKernel
22
// ============================================================================
23
#include <
GaudiKernel/StatusCode.h
>
24
// ============================================================================
25
// forward declarations
26
// ============================================================================
27
// Forward declarations
28
// ============================================================================
29
// AIDA
30
// ============================================================================
31
namespace
AIDA
{
32
class
IHistogram1D;
33
class
IHistogram2D;
34
class
IHistogram3D;
35
class
IProfile1D;
36
class
IProfile2D;
37
}
// namespace AIDA
38
// ============================================================================
39
// ROOT
40
// ============================================================================
41
class
TH1D;
// ROOT
42
class
TH2D;
// ROOT
43
class
TH3D;
// ROOT
44
class
TProfile;
// ROOT
45
class
TProfile2D;
// ROOT
46
// ============================================================================
47
namespace
Gaudi
{
48
// ==========================================================================
49
namespace
Utils {
50
// ========================================================================
51
namespace
Histos {
52
// ======================================================================
58
class
GAUDI_API
HistoStrings
{
59
// ====================================================================
60
public
:
61
// ====================================================================
69
static
std::string
toString
(
const
TH1D& histo,
const
bool
asXML =
false
);
70
// ====================================================================
78
static
std::string
toString
(
const
TH2D& histo,
const
bool
asXML =
false
);
79
// ====================================================================
87
static
std::string
toString
(
const
AIDA::IHistogram1D& histo,
const
bool
asXML =
false
);
88
// ====================================================================
96
static
std::string
toString
(
const
AIDA::IHistogram2D& histo,
const
bool
asXML =
false
);
97
// ====================================================================
103
static
StatusCode
fromString( TH1D& result,
const
std::string
& input );
104
// ====================================================================
110
static
StatusCode
fromString( AIDA::IHistogram1D& result,
const
std::string
& input );
111
// ====================================================================
117
static
StatusCode
fromString( TH2D& result,
const
std::string
& input );
118
// ====================================================================
124
static
StatusCode
fromString( AIDA::IHistogram2D& result,
const
std::string
& input );
125
// ====================================================================
126
static
std::string
toXml
(
const
TH1D& histo );
127
static
std::string
toXml
(
const
TH2D& histo );
128
static
std::string
toXml
(
const
TH3D& histo );
129
static
std::string
toXml
(
const
TProfile& histo );
130
static
std::string
toXml
(
const
TProfile2D& histo );
131
// ====================================================================
132
static
std::string
toXml
(
const
AIDA::IHistogram1D& histo );
133
static
std::string
toXml
(
const
AIDA::IHistogram2D& histo );
134
static
std::string
toXml
(
const
AIDA::IHistogram3D& histo );
135
static
std::string
toXml
(
const
AIDA::IProfile1D& histo );
136
static
std::string
toXml
(
const
AIDA::IProfile2D& histo );
137
// ====================================================================
138
static
StatusCode
fromXml
( TH1D& result,
const
std::string
& input );
139
static
StatusCode
fromXml
( TH2D& result,
const
std::string
& input );
140
static
StatusCode
fromXml
( TH3D& result,
const
std::string
& input );
141
static
StatusCode
fromXml
( TProfile& result,
const
std::string
& input );
142
static
StatusCode
fromXml
( TProfile2D& result,
const
std::string
& input );
143
// ====================================================================
144
static
StatusCode
fromXml
( AIDA::IHistogram1D& result,
const
std::string
& input );
145
static
StatusCode
fromXml
( AIDA::IHistogram2D& result,
const
std::string
& input );
146
static
StatusCode
fromXml
( AIDA::IHistogram3D& result,
const
std::string
& input );
147
static
StatusCode
fromXml
( AIDA::IProfile1D& result,
const
std::string
& input );
148
static
StatusCode
fromXml
( AIDA::IProfile2D& result,
const
std::string
& input );
149
// ====================================================================
150
};
151
// ======================================================================
152
}
// namespace Histos
153
// ========================================================================
154
}
// namespace Utils
155
// ==========================================================================
156
}
// end of namespace Gaudi
157
// ============================================================================
158
// The END
159
// ============================================================================
160
#endif // GAUDIUTILS_HISTOSTRINGS_H
AIDA
GaudiKernel.
Definition:
Annotation.h:22
std::string
STL class.
StatusCode.h
StatusCode
Definition:
StatusCode.h:65
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition:
__init__.py:1
Gaudi::Utils::toString
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition:
ToStream.h:353
Gaudi::Utils::Histos::fromXml
GAUDI_API StatusCode fromXml(TH1D &result, std::string_view input)
parse the histogram from standard ROOT XML
Definition:
HistoXML.cpp:199
GAUDI_API
#define GAUDI_API
Definition:
Kernel.h:81
Gaudi::Utils::Histos::HistoStrings
Definition:
HistoStrings.h:58
Gaudi::Utils::Histos::toXml
GAUDI_API std::ostream & toXml(const TH1D &histo, std::ostream &stream)
stream the ROOT histogram into output stream as XML
Definition:
HistoXML.cpp:76
GaudiUtils
include
GaudiUtils
HistoStrings.h
Generated on Thu Dec 19 2024 15:35:07 for The Gaudi Framework by
1.8.18