ATLAS Offline Software
Loading...
Searching...
No Matches
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
6#include <algorithm>
7
8#include "TH1.h"
9
10HistoGroupBase::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
25 return StatusCode::SUCCESS;
26}
27
28
30 return 0;
31}
32
34 return 0;
35}
36
38 return 0;
39}
40
41void HistoGroupBase::prefixHistoDir(const std::string & preDir){
42 m_histoDir = preDir + m_histoDir;
43}
44
45const std::vector<HistoGroupBase::HistData> & HistoGroupBase::bookedHistograms(){
47}
48
49
50void 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="";
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}
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Header file for AthHistogramAlgorithm.
std::string m_histoDir
The path where histos in this group leave.
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
const std::vector< HistData > & bookedHistograms()
return all the histos in this group
virtual int fillHistos()
bool m_prefixedHistoName
true if the histo name should contain the full hierarchy path
virtual int buildHistos()
virtual void renameAndRegister(TH1 *h, const std::string &subD="", Interval_t ityp=useToolInterval)
Rename an histo according to the tool's path.
std::vector< HistData > m_vBookedHistograms
The list of histos in this group.
int m_monIntervalType
when used in Athena monitoring context, the histos of this group will have this type of interval
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'
Interval_t
Redefinition of fill intervals as in ManagedMonitorToolBase.
virtual int finalizeHistos()
HistoGroupBase(const std::string &t)
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58