The Gaudi Framework
master (57817a18)
Toggle main menu visibility
Loading...
Searching...
No Matches
H1D.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
#pragma once
12
13
#include "
Generic1D.h
"
14
#include <AIDA/IHistogram1D.h>
15
#include <
Gaudi/Histograming/Sink/Utils.h
>
16
#include <
GaudiKernel/DataObject.h
>
17
#include <TH1D.h>
18
19
#include <nlohmann/json.hpp>
20
21
#include <mutex>
22
23
namespace
Gaudi
{
24
31
class
GAUDI_API
Histogram1D
:
public
DataObject
,
public
Gaudi::Generic1D
<AIDA::IHistogram1D, TH1D> {
32
private
:
33
void
init
(
const
std::string&
title
,
bool
initialize_axis =
true
);
34
void
initSums
();
35
36
protected
:
38
double
m_sumwx
= 0;
39
40
public
:
42
Histogram1D
();
44
Histogram1D
( TH1D* rep );
45
47
void
adoptRepresentation
( TObject* rep )
override
;
49
virtual
bool
setBinContents
(
int
i,
int
entries
,
double
height,
double
error,
double
centre );
50
// overwrite reset
51
bool
reset
()
override
;
52
// free function reset
53
friend
void
reset
(
Histogram1D
& h ) { h.reset(); }
55
friend
void
to_json
( nlohmann::json& j,
Gaudi::Histogram1D
const
& h ) { j = *h.m_rep.get(); }
57
virtual
bool
setStatistics(
int
allEntries,
double
eqBinEntries,
double
mean,
double
rms );
59
bool
fill(
double
x,
double
weight )
override
;
61
bool
setRms(
double
rms );
63
void
copyFromAida(
const
AIDA::IHistogram1D& h );
65
const
CLID
&
clID
()
const override
{
return
classID
(); }
66
static
const
CLID
&
classID
() {
return
CLID_H1D; }
71
StreamBuffer
& serialize(
StreamBuffer
& s );
72
77
StreamBuffer
& serialize(
StreamBuffer
& s )
const
;
78
79
private
:
80
std::mutex
m_fillSerialization
;
81
82
};
// end class Histogram1D
83
}
// end namespace Gaudi
CLID
unsigned int CLID
Class ID definition.
Definition
ClassID.h:16
DataObject.h
Utils.h
Generic1D.h
GAUDI_API
#define GAUDI_API
Definition
Kernel.h:49
DataObject::DataObject
DataObject()
Standard Constructor.
Definition
DataObject.cpp:23
Gaudi::Generic1D
Common AIDA implementation stuff for histograms and profiles using ROOT implementations.
Definition
Generic1D.h:45
Gaudi::Generic1D< AIDA::IHistogram1D, TH1D >::title
std::string title() const override
Definition
Generic1D.h:65
Gaudi::Generic1D< AIDA::IHistogram1D, TH1D >::entries
int entries() const override
Definition
Generic1D.h:82
Gaudi::Histogram1D
AIDA implementation for 1 D histograms using ROOT THD1.
Definition
H1D.h:31
Gaudi::Histogram1D::classID
static const CLID & classID()
Definition
H1D.h:66
Gaudi::Histogram1D::clID
const CLID & clID() const override
Retrieve reference to class defininition identifier.
Definition
H1D.h:65
Gaudi::Histogram1D::to_json
friend void to_json(nlohmann::json &j, Gaudi::Histogram1D const &h)
conversion to json via nlohmann library
Definition
H1D.h:55
Gaudi::Histogram1D::adoptRepresentation
void adoptRepresentation(TObject *rep) override
Adopt ROOT histogram representation.
Definition
H1D.cpp:108
Gaudi::Histogram1D::Histogram1D
Histogram1D()
Standard constructor.
Definition
H1D.cpp:73
Gaudi::Histogram1D::m_sumwx
double m_sumwx
cache sumwx when setting contents since I don't have bin mean
Definition
H1D.h:38
Gaudi::Histogram1D::reset
friend void reset(Histogram1D &h)
Definition
H1D.h:53
Gaudi::Histogram1D::m_fillSerialization
std::mutex m_fillSerialization
Definition
H1D.h:80
Gaudi::Histogram1D::reset
bool reset() override
Definition
H1D.cpp:101
Gaudi::Histogram1D::initSums
void initSums()
Definition
H1D.cpp:92
Gaudi::Histogram1D::init
void init(const std::string &title, bool initialize_axis=true)
Definition
H1D.cpp:81
Gaudi::Histogram1D::setBinContents
virtual bool setBinContents(int i, int entries, double height, double error, double centre)
set bin content (entries and centre are not used )
Definition
H1D.cpp:116
StreamBuffer
The stream buffer is a small object collecting object data.
Definition
StreamBuffer.h:48
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
GaudiCommonSvc
include
GaudiCommonSvc
H1D.h
Generated on
for The Gaudi Framework by
1.17.0