ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetMonitoring
JetMonitoring
HistoGroupBase.h
Go to the documentation of this file.
1
// -*- c++ -*-
2
3
/*
4
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
#ifndef JETMONITORING_HISTOGROUPBASE_H
8
#define JETMONITORING_HISTOGROUPBASE_H
17
18
#include <vector>
19
#include <string>
20
#include "
AsgTools/AsgTool.h
"
21
22
class
TH1;
23
24
// temporary, we should define a proper interface
25
static
const
InterfaceID
IID_HistoGroupBase
(
"HistoGroupBase"
, 1, 0);
26
27
class
HistoGroupBase
:
public
asg::AsgTool
{
28
29
ASG_TOOL_CLASS
(
HistoGroupBase
,
asg::IAsgTool
)
30
31
public
:
32
33
//--------------------------------------------
35
// (TO DO : typedef to ManagedMonitorToolBase::Interval_t
36
// when compiled in Athena, redefine when compiling standalone ? )
37
enum
Interval_t
{
file
= 0,
eventsBlock
,
lumiBlock
,
38
lowStat
,
medStat
,
higStat
,
39
run
,
fill
,
all
,
40
41
useToolInterval
// used to use the value from the tool's m_interval property
42
};
43
44
46
struct
HistData
{
47
TH1*
hist
{};
48
std::string
path
;
49
Interval_t
interval
{};
50
};
51
52
HistoGroupBase
(
const
std::string & t);
53
~HistoGroupBase
(){}
54
55
virtual
StatusCode
initialize
() ;
56
57
virtual
int
buildHistos
();
58
59
virtual
int
fillHistos
();
60
61
virtual
int
finalizeHistos
();
62
63
65
virtual
void
prefixHistoDir
(
const
std::string & preDir);
66
68
template
<
class
T>
69
T*
bookHisto
(T*
h
,
Interval_t
ityp=
useToolInterval
) {
renameAndRegister
(
h
,
""
,ityp);
return
h
;}
70
72
template
<
class
T>
73
T*
bookHistoInSubDir
(
const
std::string& subD, T*
h
,
Interval_t
ityp=
useToolInterval
) {
renameAndRegister
(
h
, subD,ityp);
return
h
;}
74
76
const
std::vector<HistData> &
bookedHistograms
();
77
78
79
virtual
void
setInterval
(
Interval_t
ityp,
bool
force =
false
){
if
(force || (
m_interval
==-1) )
m_interval
= ityp;}
80
81
static
const
InterfaceID&
interfaceID
( ){
return
IID_HistoGroupBase
;}
82
83
protected
:
84
86
virtual
void
renameAndRegister
(TH1*
h
,
const
std::string & subD=
""
,
Interval_t
ityp=
useToolInterval
);
87
88
90
std::vector<HistData>
m_vBookedHistograms
;
91
93
std::string
m_histoDir
;
94
96
int
m_monIntervalType
;
97
99
bool
m_prefixedHistoName
;
100
101
int
m_interval
;
102
103
};
104
#endif
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition
AsgToolMacros.h:68
AsgTool.h
IID_HistoGroupBase
static const InterfaceID IID_HistoGroupBase("HistoGroupBase", 1, 0)
h
Header file for AthHistogramAlgorithm.
HistoGroupBase::bookHistoInSubDir
T * bookHistoInSubDir(const std::string &subD, T *h, Interval_t ityp=useToolInterval)
Same as bookHistom but put the histo under subdirectory subD.
Definition
HistoGroupBase.h:73
HistoGroupBase::setInterval
virtual void setInterval(Interval_t ityp, bool force=false)
Definition
HistoGroupBase.h:79
HistoGroupBase::m_histoDir
std::string m_histoDir
The path where histos in this group leave.
Definition
HistoGroupBase.h:93
HistoGroupBase::initialize
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition
HistoGroupBase.cxx:24
HistoGroupBase::bookedHistograms
const std::vector< HistData > & bookedHistograms()
return all the histos in this group
Definition
HistoGroupBase.cxx:45
HistoGroupBase::fillHistos
virtual int fillHistos()
Definition
HistoGroupBase.cxx:33
HistoGroupBase::m_prefixedHistoName
bool m_prefixedHistoName
true if the histo name should contain the full hierarchy path
Definition
HistoGroupBase.h:99
HistoGroupBase::m_interval
int m_interval
Definition
HistoGroupBase.h:101
HistoGroupBase::buildHistos
virtual int buildHistos()
Definition
HistoGroupBase.cxx:29
HistoGroupBase::interfaceID
static const InterfaceID & interfaceID()
Definition
HistoGroupBase.h:81
HistoGroupBase::renameAndRegister
virtual void renameAndRegister(TH1 *h, const std::string &subD="", Interval_t ityp=useToolInterval)
Rename an histo according to the tool's path.
Definition
HistoGroupBase.cxx:50
HistoGroupBase::~HistoGroupBase
~HistoGroupBase()
Definition
HistoGroupBase.h:53
HistoGroupBase::m_vBookedHistograms
std::vector< HistData > m_vBookedHistograms
The list of histos in this group.
Definition
HistoGroupBase.h:90
HistoGroupBase::m_monIntervalType
int m_monIntervalType
when used in Athena monitoring context, the histos of this group will have this type of interval
Definition
HistoGroupBase.h:96
HistoGroupBase::prefixHistoDir
virtual void prefixHistoDir(const std::string &preDir)
allows a higher level tool to put the histos in this group as a sub-dir of 'preDir'
Definition
HistoGroupBase.cxx:41
HistoGroupBase::Interval_t
Interval_t
Redefinition of fill intervals as in ManagedMonitorToolBase.
Definition
HistoGroupBase.h:37
HistoGroupBase::medStat
@ medStat
Definition
HistoGroupBase.h:38
HistoGroupBase::all
@ all
Definition
HistoGroupBase.h:39
HistoGroupBase::file
@ file
Definition
HistoGroupBase.h:37
HistoGroupBase::useToolInterval
@ useToolInterval
Definition
HistoGroupBase.h:41
HistoGroupBase::higStat
@ higStat
Definition
HistoGroupBase.h:38
HistoGroupBase::eventsBlock
@ eventsBlock
Definition
HistoGroupBase.h:37
HistoGroupBase::lowStat
@ lowStat
Definition
HistoGroupBase.h:38
HistoGroupBase::run
@ run
Definition
HistoGroupBase.h:39
HistoGroupBase::lumiBlock
@ lumiBlock
Definition
HistoGroupBase.h:37
HistoGroupBase::fill
@ fill
Definition
HistoGroupBase.h:39
HistoGroupBase::finalizeHistos
virtual int finalizeHistos()
Definition
HistoGroupBase.cxx:37
HistoGroupBase::HistoGroupBase
HistoGroupBase(const std::string &t)
Definition
HistoGroupBase.cxx:10
HistoGroupBase::bookHisto
T * bookHisto(T *h, Interval_t ityp=useToolInterval)
register the histo h in this group (if h!=NULL). The histo name is changed if m_prefixedHistoName==tr...
Definition
HistoGroupBase.h:69
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition
AsgTool.h:47
asg::IAsgTool
Base class for the dual-use tool interface classes.
Definition
IAsgTool.h:41
HistoGroupBase::HistData
Simply a histo and its path in the hiearchy.
Definition
HistoGroupBase.h:46
HistoGroupBase::HistData::hist
TH1 * hist
Definition
HistoGroupBase.h:47
HistoGroupBase::HistData::path
std::string path
Definition
HistoGroupBase.h:48
HistoGroupBase::HistData::interval
Interval_t interval
Definition
HistoGroupBase.h:49
Generated on
for ATLAS Offline Software by
1.17.0