ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetMonitoring
Root
HistoGroupBase.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
JetMonitoring/HistoGroupBase.h
"
6
#include <algorithm>
7
8
#include "TH1.h"
9
10
HistoGroupBase::HistoGroupBase
(
const
std::string& n) :
asg
::
AsgTool
(n)
11
,
m_histoDir
(
""
)
12
,
m_monIntervalType
(8)
// corresponds to "all"
13
,
m_prefixedHistoName
(false)
14
,
m_interval
(-1)
15
{
16
declareInterface<HistoGroupBase>(
this
);
17
18
declareProperty
(
"MonitoringIntervalType"
,
m_monIntervalType
);
19
declareProperty
(
"HistoDir"
,
m_histoDir
);
20
declareProperty
(
"PrefixedHistoName"
,
m_prefixedHistoName
);
21
declareProperty
(
"IntervalType"
,
m_interval
);
22
}
23
24
StatusCode
HistoGroupBase::initialize
() {
25
return
StatusCode::SUCCESS;
26
}
27
28
29
int
HistoGroupBase::buildHistos
() {
30
return
0;
31
}
32
33
int
HistoGroupBase::fillHistos
(){
34
return
0;
35
}
36
37
int
HistoGroupBase::finalizeHistos
() {
38
return
0;
39
}
40
41
void
HistoGroupBase::prefixHistoDir
(
const
std::string & preDir){
42
m_histoDir
= preDir +
m_histoDir
;
43
}
44
45
const
std::vector<HistoGroupBase::HistData> &
HistoGroupBase::bookedHistograms
(){
46
return
m_vBookedHistograms
;
47
}
48
49
50
void
HistoGroupBase::renameAndRegister
(TH1*
h
,
const
std::string & subD,
Interval_t
ityp){
51
52
if
(
h
==
nullptr
)
return
;
53
54
if
( ityp ==
useToolInterval
) ityp = (
Interval_t
)
m_interval
;
55
56
std::string path =
m_histoDir
+subD;
57
std::string prefix=
""
;
58
if
(
m_prefixedHistoName
) {
59
prefix = path;
60
std::replace( prefix.begin(), prefix.end(),
'/'
,
'_'
);
61
}
62
h
->SetName( (prefix+
h
->GetName()).c_str() );
63
64
m_vBookedHistograms
.push_back( {
h
, std::move(path), ityp} );
65
}
HistoGroupBase.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
h
Header file for AthHistogramAlgorithm.
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::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::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::useToolInterval
@ useToolInterval
Definition
HistoGroupBase.h:41
HistoGroupBase::finalizeHistos
virtual int finalizeHistos()
Definition
HistoGroupBase.cxx:37
HistoGroupBase::HistoGroupBase
HistoGroupBase(const std::string &t)
Definition
HistoGroupBase.cxx:10
asg::AsgTool::AsgTool
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition
AsgTool.cxx:58
asg
Definition
DataHandleTestTool.h:28
Generated on
for ATLAS Offline Software by
1.17.0