The Gaudi Framework
master (57817a18)
Toggle main menu visibility
Loading...
Searching...
No Matches
P2D.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 "
Generic2D.h
"
14
#include <AIDA/IProfile1D.h>
15
#include <
Gaudi/Histograming/Sink/Utils.h
>
16
#include <
GaudiKernel/DataObject.h
>
17
#include <TProfile2D.h>
18
19
#include <nlohmann/json.hpp>
20
21
#include <mutex>
22
23
namespace
Gaudi
{
24
31
class
GAUDI_API
Profile2D
:
public
DataObject
,
public
Generic2D
<AIDA::IProfile2D, TProfile2D> {
32
public
:
34
Profile2D
() :
Base
( new TProfile2D() ) {
35
m_classType
=
"IProfile2D"
;
36
m_rep
->SetErrorOption(
"s"
);
37
m_rep
->SetDirectory(
nullptr
);
38
}
39
40
Profile2D
( TProfile2D* rep );
41
43
bool
fill
(
double
x,
double
y,
double
z,
double
weight )
override
{
44
// avoid race conditions when filling the profile
45
auto
guard = std::scoped_lock{
m_fillSerialization
};
46
m_rep
->Fill( x, y, z, weight );
47
return
true
;
48
}
49
friend
void
reset
(
Profile2D
& h ) { h.reset(); }
51
friend
void
to_json
( nlohmann::json& j,
Profile2D
const
& p ) { j = *p.
m_rep
.get(); }
53
const
CLID
&
clID
()
const override
{
return
classID
(); }
54
static
const
CLID
&
classID
() {
return
CLID_ProfileH2; }
55
56
private
:
57
std::mutex
m_fillSerialization
;
58
};
59
}
// 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::IProfile2D, TProfile2D >::Generic2D
Generic2D()=default
Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >::m_rep
std::unique_ptr< TProfile2D > m_rep
Definition
Generic2D.h:161
Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >::m_classType
std::string m_classType
Definition
Generic2D.h:163
Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >::Base
Generic2D< AIDA::IProfile2D, TProfile2D > Base
Definition
Generic2D.h:47
Gaudi::Profile2D
AIDA implementation for 2 D profiles using ROOT TProfile2D.
Definition
P2D.h:31
Gaudi::Profile2D::classID
static const CLID & classID()
Definition
P2D.h:54
Gaudi::Profile2D::reset
friend void reset(Profile2D &h)
Definition
P2D.h:49
Gaudi::Profile2D::m_fillSerialization
std::mutex m_fillSerialization
Definition
P2D.h:57
Gaudi::Profile2D::Profile2D
Profile2D()
Default Constructor.
Definition
P2D.h:34
Gaudi::Profile2D::to_json
friend void to_json(nlohmann::json &j, Profile2D const &p)
conversion to json via nlohmann library
Definition
P2D.h:51
Gaudi::Profile2D::clID
const CLID & clID() const override
Retrieve reference to class defininition identifier.
Definition
P2D.h:53
Gaudi::Profile2D::fill
bool fill(double x, double y, double z, double weight) override
Fill bin content.
Definition
P2D.h:43
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
P2D.h
Generated on
for The Gaudi Framework by
1.17.0