The Gaudi Framework
master (57817a18)
Toggle main menu visibility
Loading...
Searching...
No Matches
H2D.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2026 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 "
Generic2D.h
"
14
#include <AIDA/IHistogram2D.h>
15
#include <
Gaudi/Histograming/Sink/Utils.h
>
16
#include <
GaudiKernel/DataObject.h
>
17
#include <TH2D.h>
18
19
#include <mutex>
20
#include <nlohmann/json.hpp>
21
22
namespace
Gaudi
{
23
class
Histogram1D
;
24
31
class
GAUDI_API
Histogram2D
:
public
DataObject
,
public
Generic2D
<AIDA::IHistogram2D, TH2D> {
32
public
:
34
Histogram2D
();
36
Histogram2D
( TH2D* rep );
37
39
bool
fill
(
double
x,
double
y,
double
weight = 1. )
override
;
41
virtual
bool
setBinContents
(
int
binIndexX,
int
binIndexY,
int
entries
,
double
height,
double
error,
double
centreX,
42
double
centreY );
44
bool
setRms
(
double
rmsX
,
double
rmsY
);
45
// overwrite reset
46
bool
reset
()
override
;
47
// free function reset
48
friend
void
reset
(
Histogram2D
& h ) { h.reset(); }
50
friend
void
to_json
( nlohmann::json& j,
Histogram2D
const
& h ) { j = *h.m_rep.get(); }
52
void
copyFromAida(
const
AIDA::IHistogram2D& h );
54
const
CLID
&
clID
()
const override
{
return
classID
(); }
55
static
const
CLID
&
classID
() {
return
CLID_H2D; }
56
57
protected
:
58
// cache sumwx and sumwy when setting contents since I don't have bin mean
59
double
m_sumwx
= 0;
60
double
m_sumwy
= 0;
61
62
private
:
63
std::mutex
m_fillSerialization
;
64
};
65
}
// namespace Gaudi
CLID
unsigned int CLID
Class ID definition.
Definition
ClassID.h:16
DataObject.h
Utils.h
Generic2D.h
GAUDI_API
#define GAUDI_API
Definition
Kernel.h:49
DataObject::DataObject
DataObject()
Standard Constructor.
Definition
DataObject.cpp:23
Gaudi::Generic2D< AIDA::IHistogram2D, TH2D >::entries
int entries() const override
Definition
Generic2D.h:184
Gaudi::Generic2D< AIDA::IHistogram2D, TH2D >::Generic2D
Generic2D()=default
Gaudi::Generic2D< AIDA::IHistogram2D, TH2D >::rmsY
double rmsY() const override
Definition
Generic2D.h:282
Gaudi::Generic2D< AIDA::IHistogram2D, TH2D >::rmsX
double rmsX() const override
Definition
Generic2D.h:277
Gaudi::Histogram1D
AIDA implementation for 1 D histograms using ROOT THD1.
Definition
H1D.h:31
Gaudi::Histogram2D::reset
friend void reset(Histogram2D &h)
Definition
H2D.h:48
Gaudi::Histogram2D::fill
bool fill(double x, double y, double weight=1.) override
Fill the Histogram2D with a value and the.
Definition
H2D.cpp:172
Gaudi::Histogram2D::Histogram2D
Histogram2D()
Standard Constructor.
Definition
H2D.cpp:140
Gaudi::Histogram2D::to_json
friend void to_json(nlohmann::json &j, Histogram2D const &h)
conversion to json via nlohmann library
Definition
H2D.h:50
Gaudi::Histogram2D::m_sumwx
double m_sumwx
Definition
H2D.h:59
Gaudi::Histogram2D::clID
const CLID & clID() const override
Retrieve reference to class defininition identifier.
Definition
H2D.h:54
Gaudi::Histogram2D::reset
bool reset() override
Definition
H2D.cpp:166
Gaudi::Histogram2D::classID
static const CLID & classID()
Definition
H2D.h:55
Gaudi::Histogram2D::m_fillSerialization
std::mutex m_fillSerialization
Definition
H2D.h:63
Gaudi::Histogram2D::setRms
bool setRms(double rmsX, double rmsY)
Sets the rms of the histogram.
Definition
H2D.cpp:179
Gaudi::Histogram2D::setBinContents
virtual bool setBinContents(int binIndexX, int binIndexY, int entries, double height, double error, double centreX, double centreY)
Fast filling method for a given bin. It can be also the over/underflow bin.
Definition
H2D.cpp:153
Gaudi::Histogram2D::m_sumwy
double m_sumwy
Definition
H2D.h:60
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
H2D.h
Generated on
for The Gaudi Framework by
1.17.0