ATLAS Offline Software
AthenaMonManager.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef AthenaMonManager_H
6 #define AthenaMonManager_H
7 
8 #include <map>
9 #include <string>
10 
12 #include "GaudiKernel/StatusCode.h"
13 #include "GaudiKernel/ToolHandle.h"
16 
17 class ISvcLocator;
18 class ITHistSvc;
20 class TObject;
21 class IMonitorToolBase;
22 class LWHist;
23 
35 
36  public:
37 
50 
59 
60  AthenaMonManager( const std::string& name, ISvcLocator* pSvcLocator );
61 
62  virtual ~AthenaMonManager();
63 
68  static Environment_t envStringToEnum( const std::string& str );
69 
73  static DataType_t dataTypeStringToEnum( const std::string& str );
74 
79  static Environment_t environment();
80 
85  static DataType_t dataType();
86 
87  static unsigned int lumiBlockNumber();
88  static unsigned int runNumber();
89  static unsigned int fillNumber();
90 
91  static unsigned int getLBsLowStat();
92  static unsigned int getLBsMedStat();
93  static unsigned int getLBsHigStat();
94 
95  bool forkedProcess();
96 
97  virtual StatusCode initialize();
98  virtual StatusCode execute();
99  virtual StatusCode start();
100  virtual StatusCode stop();
101  virtual StatusCode finalize();
102 
103  virtual std::string fileKey() const;
104 
108  virtual void passOwnership( TObject* h, const std::string& key );
109  virtual void passOwnership( LWHist* h, const std::string& key );
110 
114  virtual void writeAndDelete( const std::string& key );
115  virtual LWHist *ownedLWHistOfKey(const std::string& key) const;
116  // If you know it is an LWHist use writeAndDeleteLWHist. The just deleted LWHist pointer will be returned (0 if nothing deleted)
117  virtual LWHist *writeAndDeleteLWHist( const std::string& key, const std::string& streamName );
118  virtual LWHist *writeAndResetLWHist( const std::string& key, const std::string& streamName );
119 
120  virtual void writeAndDeleteLWHist( LWHist*lwh );
121 
122  protected:
123  ToolHandleArray<IMonitorToolBase> m_monTools;
124 
125  ITHistSvc* m_THistSvc;
126 
127  private:
128  // Use private implementation idiom for more flexible development.
129  class Imp;
131 
132 };
133 
134 #endif
AthenaMonManager::ownedLWHistOfKey
virtual LWHist * ownedLWHistOfKey(const std::string &key) const
Definition: AthenaMonManager.cxx:726
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
LWHist
Definition: LWHist.h:26
AthenaMonManager::writeAndDeleteLWHist
virtual LWHist * writeAndDeleteLWHist(const std::string &key, const std::string &streamName)
Definition: AthenaMonManager.cxx:743
ManagedMonitorToolBase
Provides functionality for users to implement and save histograms, ntuples, and summary data,...
Definition: ManagedMonitorToolBase.h:74
AthenaMonManager::writeAndResetLWHist
virtual LWHist * writeAndResetLWHist(const std::string &key, const std::string &streamName)
Definition: AthenaMonManager.cxx:802
AthenaMonManager::runNumber
static unsigned int runNumber()
Definition: AthenaMonManager.cxx:364
AthenaMonManager::fileKey
virtual std::string fileKey() const
Definition: AthenaMonManager.cxx:699
AthenaMonManager::cosmics
@ cosmics
Definition: AthenaMonManager.h:58
AthenaMonManager::AOD
@ AOD
Definition: AthenaMonManager.h:49
AthenaMonManager::passOwnership
virtual void passOwnership(TObject *h, const std::string &key)
Pass ownership of a TObject/LWHist to this manager so that it will be deleted appropriately.
Definition: AthenaMonManager.cxx:707
AthenaMonManager::finalize
virtual StatusCode finalize()
Definition: AthenaMonManager.cxx:600
AthenaMonManager::envStringToEnum
static Environment_t envStringToEnum(const std::string &str)
Converts a string to an Environment_t of the same name.
Definition: AthenaMonManager.cxx:253
AthenaMonManager::heavyIonCollisions
@ heavyIonCollisions
Definition: AthenaMonManager.h:58
AthenaMonManager::DataType_t
DataType_t
An enumeration of the different types of data the monitoring application may be running over.
Definition: AthenaMonManager.h:58
AthenaMonManager::m_d
Imp * m_d
Definition: AthenaMonManager.h:129
AthenaMonManager::getLBsLowStat
static unsigned int getLBsLowStat()
Definition: AthenaMonManager.cxx:326
AthenaMonManager::environment
static Environment_t environment()
Returns the running environment of the monitoring application to help ManagedMonitorToolBase objects ...
Definition: AthenaMonManager.cxx:321
AthenaMonManager::fillNumber
static unsigned int fillNumber()
Definition: AthenaMonManager.cxx:376
AthAlgorithm.h
AthenaMonManager::getLBsMedStat
static unsigned int getLBsMedStat()
Definition: AthenaMonManager.cxx:329
AthenaMonManager::tier0ESD
@ tier0ESD
Definition: AthenaMonManager.h:49
AthenaMonManager::dataType
static DataType_t dataType()
Returns the data type that the monitoring application is running over to help ManagedMonitorToolBase ...
Definition: AthenaMonManager.cxx:338
AthenaMonManager::start
virtual StatusCode start()
Definition: AthenaMonManager.cxx:663
AthenaMonManager
An Algorithm that manages a set of modules, each inheriting from ManagedMonitorToolBase,...
Definition: AthenaMonManager.h:34
AthenaMonManager::dataTypeStringToEnum
static DataType_t dataTypeStringToEnum(const std::string &str)
Converts a string to a DataType_t of the same name.
Definition: AthenaMonManager.cxx:290
AthenaMonManager::collisions
@ collisions
Definition: AthenaMonManager.h:58
AthenaMonManager::tier0
@ tier0
Definition: AthenaMonManager.h:49
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthenaMonManager::online
@ online
Definition: AthenaMonManager.h:49
AthenaMonManager::writeAndDelete
virtual void writeAndDelete(const std::string &key)
If the TObject is owned by this manager, its Write() method is called and it is deleted.
Definition: AthenaMonManager.cxx:870
AthenaMonManager::tier0Raw
@ tier0Raw
Definition: AthenaMonManager.h:49
AthenaMonManager::user
@ user
Definition: AthenaMonManager.h:49
AthenaMonManager::m_monTools
ToolHandleArray< IMonitorToolBase > m_monTools
Definition: AthenaMonManager.h:123
AthAlgorithm
Definition: AthAlgorithm.h:47
AthenaMonManager::Environment_t
Environment_t
An enumeration of the different types of running environment the monitoring application may be in.
Definition: AthenaMonManager.h:49
IMonitorToolBase
Definition: IMonitorToolBase.h:25
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
AthenaMonManager::getLBsHigStat
static unsigned int getLBsHigStat()
Definition: AthenaMonManager.cxx:332
AthenaMonManager::execute
virtual StatusCode execute()
Definition: AthenaMonManager.cxx:512
AthenaMonManager::stop
virtual StatusCode stop()
Definition: AthenaMonManager.cxx:607
EventInfo.h
AthenaPoolExample_Copy.streamName
string streamName
Definition: AthenaPoolExample_Copy.py:39
AthenaMonManager::AthenaMonManager
AthenaMonManager(const std::string &name, ISvcLocator *pSvcLocator)
Definition: AthenaMonManager.cxx:208
h
AthenaMonManager::forkedProcess
bool forkedProcess()
Definition: AthenaMonManager.cxx:345
AthenaMonManager::altprod
@ altprod
Definition: AthenaMonManager.h:49
AthenaMonManager::m_THistSvc
ITHistSvc * m_THistSvc
Definition: AthenaMonManager.h:125
str
Definition: BTagTrackIpAccessor.cxx:11
AthenaMonManager::Imp
Definition: AthenaMonManager.cxx:40
AthenaMonManager::lumiBlockNumber
static unsigned int lumiBlockNumber()
Definition: AthenaMonManager.cxx:352
AthenaMonManager::userDefined
@ userDefined
Definition: AthenaMonManager.h:58
AthenaMonManager::~AthenaMonManager
virtual ~AthenaMonManager()
Definition: AthenaMonManager.cxx:234
AthenaMonManager::noOutput
@ noOutput
Definition: AthenaMonManager.h:49
AthenaMonManager::monteCarlo
@ monteCarlo
Definition: AthenaMonManager.h:58
AthenaMonManager::initialize
virtual StatusCode initialize()
Definition: AthenaMonManager.cxx:384
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37