The Gaudi Framework  master (ff829712)
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
17class IHistogramSvc;
18namespace AIDA {
19 class IHistogram1D;
20} // namespace AIDA
21
22namespace 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
std::ostream & operator<<(std::ostream &s, AlgsExecutionStates::State x)
Streaming of State values.
#define GAUDI_API
Definition Kernel.h:49
bool operator<(backwards_compatibility_hack_time_timespan, backwards_compatibility_hack_time_timespan)
Definition Time.icpp:219
Simple helper class for description of 1D-histogram The class is targeted to act as the primary "hist...
Definition HistoDef.h:30
double m_high
High Edge.
Definition HistoDef.h:72
void setTitle(std::string value)
set the title
Definition HistoDef.h:61
int m_bins
Number of bins.
Definition HistoDef.h:73
int bins() const
get the number of bins
Definition HistoDef.h:51
const std::string & title() const
get the title
Definition HistoDef.h:53
double highEdge() const
get the high edge
Definition HistoDef.h:49
bool ok() const
check if all fields are "reasonable"
Definition HistoDef.h:69
double m_low
Low Edge.
Definition HistoDef.h:71
std::string m_title
Histogram title.
Definition HistoDef.h:70
void setBins(int value)
set number of bis
Definition HistoDef.h:59
Histo1DDef(double low, double high, int bins=100, std::string title="")
full constructor from edges, bins and the title
Definition HistoDef.cpp:28
void setLowEdge(double value)
set low edge
Definition HistoDef.h:55
void setHighEdge(double value)
set high edge
Definition HistoDef.h:57
double lowEdge() const
get the low edge
Definition HistoDef.h:47
Definition of the IHistogramSvc interface class.
collection of simple utilities to deal with histograms
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
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1