The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
HistoStrings.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 files
14// ============================================================================
15// STD & STL
16// ============================================================================
17#include <iosfwd>
18#include <string>
19// ============================================================================
20// GaudiKernel
21// ============================================================================
23// ============================================================================
24// forward declarations
25// ============================================================================
26// Forward declarations
27// ============================================================================
28// AIDA
29// ============================================================================
30namespace AIDA {
31 class IHistogram1D;
32 class IHistogram2D;
33 class IHistogram3D;
34 class IProfile1D;
35 class IProfile2D;
36} // namespace AIDA
37// ============================================================================
38// ROOT
39// ============================================================================
40class TH1D; // ROOT
41class TH2D; // ROOT
42class TH3D; // ROOT
43class TProfile; // ROOT
44class TProfile2D; // ROOT
45// ============================================================================
46namespace Gaudi {
47 // ==========================================================================
48 namespace Utils {
49 // ========================================================================
50 namespace Histos {
51 // ======================================================================
58 // ====================================================================
59 public:
60 // ====================================================================
68 static std::string toString( const TH1D& histo, const bool asXML = false );
69 // ====================================================================
77 static std::string toString( const TH2D& histo, const bool asXML = false );
78 // ====================================================================
86 static std::string toString( const AIDA::IHistogram1D& histo, const bool asXML = false );
87 // ====================================================================
95 static std::string toString( const AIDA::IHistogram2D& histo, const bool asXML = false );
96 // ====================================================================
102 static StatusCode fromString( TH1D& result, const std::string& input );
103 // ====================================================================
109 static StatusCode fromString( AIDA::IHistogram1D& result, const std::string& input );
110 // ====================================================================
116 static StatusCode fromString( TH2D& result, const std::string& input );
117 // ====================================================================
123 static StatusCode fromString( AIDA::IHistogram2D& result, const std::string& input );
124 // ====================================================================
125 static std::string toXml( const TH1D& histo );
126 static std::string toXml( const TH2D& histo );
127 static std::string toXml( const TH3D& histo );
128 static std::string toXml( const TProfile& histo );
129 static std::string toXml( const TProfile2D& histo );
130 // ====================================================================
131 static std::string toXml( const AIDA::IHistogram1D& histo );
132 static std::string toXml( const AIDA::IHistogram2D& histo );
133 static std::string toXml( const AIDA::IHistogram3D& histo );
134 static std::string toXml( const AIDA::IProfile1D& histo );
135 static std::string toXml( const AIDA::IProfile2D& histo );
136 // ====================================================================
137 static StatusCode fromXml( TH1D& result, const std::string& input );
138 static StatusCode fromXml( TH2D& result, const std::string& input );
139 static StatusCode fromXml( TH3D& result, const std::string& input );
140 static StatusCode fromXml( TProfile& result, const std::string& input );
141 static StatusCode fromXml( TProfile2D& result, const std::string& input );
142 // ====================================================================
143 static StatusCode fromXml( AIDA::IHistogram1D& result, const std::string& input );
144 static StatusCode fromXml( AIDA::IHistogram2D& result, const std::string& input );
145 static StatusCode fromXml( AIDA::IHistogram3D& result, const std::string& input );
146 static StatusCode fromXml( AIDA::IProfile1D& result, const std::string& input );
147 static StatusCode fromXml( AIDA::IProfile2D& result, const std::string& input );
148 // ====================================================================
149 };
150 // ======================================================================
151 } // namespace Histos
152 // ========================================================================
153 } // namespace Utils
154 // ==========================================================================
155} // end of namespace Gaudi
156// ============================================================================
157// The END
158// ============================================================================
#define GAUDI_API
Definition Kernel.h:49
Helper class to produce "good" dictionaries.
static StatusCode fromString(TH1D &result, const std::string &input)
parse the histogram from string
static std::string toString(const TH1D &histo, const bool asXML=false)
convert the histogram into the string
static StatusCode fromXml(TH1D &result, const std::string &input)
static std::string toXml(const TH1D &histo)
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
Collection of useful utilities for manipulations with AIDA hisgograms.
Definition HistoDump.h:27
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1