ATLAS Offline Software
Loading...
Searching...
No Matches
HistoGroupBase.h
Go to the documentation of this file.
1// -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2017 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
22class TH1;
23
24// temporary, we should define a proper interface
25static const InterfaceID IID_HistoGroupBase("HistoGroupBase", 1, 0);
26
28
30
31 public:
32
33 //--------------------------------------------
35 // (TO DO : typedef to ManagedMonitorToolBase::Interval_t
36 // when compiled in Athena, redefine when compiling standalone ? )
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;
50 };
51
52 HistoGroupBase(const std::string & t);
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
83protected:
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
97
100
102
103};
104#endif
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
static const InterfaceID IID_HistoGroupBase("HistoGroupBase", 1, 0)
Header file for AthHistogramAlgorithm.
T * bookHistoInSubDir(const std::string &subD, T *h, Interval_t ityp=useToolInterval)
Same as bookHistom but put the histo under subdirectory subD.
virtual void setInterval(Interval_t ityp, bool force=false)
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()
static const InterfaceID & interfaceID()
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)
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...
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Base class for the dual-use tool interface classes.
Definition IAsgTool.h:41
Definition run.py:1
Simply a histo and its path in the hiearchy.