ATLAS Offline Software
Loading...
Searching...
No Matches
HiveAlgBase.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
13
14
15#ifndef ATHEXHIVE_BASEALG_H
16#define ATHEXHIVE_BASEALG_H
17
20#include "GaudiKernel/ServiceHandle.h"
21#include "GaudiKernel/ICPUCrunchSvc.h"
23
24#include <string>
25
26class HiveAlgBase : public AthAlgorithm {
27
28public:
29
30 HiveAlgBase (const std::string& name, ISvcLocator* pSvcLocator);
31 virtual ~HiveAlgBase();
32
33 // make Algs clonable
34 virtual bool isClonable() const override { return true; }
35
36 virtual StatusCode initialize() override;
37
38protected:
39
40 // cause Alg to sleep for time defined by "Time" Property
41 unsigned int sleep();
42
43 // Handle to HiveExSvc, which accumulates how much time each Alg sleeps
44 ServiceHandle<IHiveExSvc> m_hes{this,"HiveExSvc","HiveExSvc","Handle to HiveExSvc"};
45
46 // Handle to CPUCrunchSvc, which burns CPU time
47 ServiceHandle<ICPUCrunchSvc> m_ccs{this,"CPUCrunchSvc","CPUCrunchSvc","Handle to CPUCrunchSvc"};
48
49 // Handle to random number service
50 ServiceHandle<IAthRNGSvc> m_rngSvc{this,"AthRNGSvc","AthRNGSvc","Handle to random number service"};
51
52private:
53
54 Gaudi::Property<unsigned int> m_time{this, "Time", 0, "default alg sleep time in ms"};
55 Gaudi::Property<bool> m_doCrunch{this, "Crunch", false, "Crunch instead of Sleep"};
56
57
58};
59#endif
Abstract Interface class for HiveExSvc, that accumualtes Algorithm run times by name.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
unsigned int sleep()
Gaudi::Property< unsigned int > m_time
Definition HiveAlgBase.h:54
HiveAlgBase(const std::string &name, ISvcLocator *pSvcLocator)
ServiceHandle< ICPUCrunchSvc > m_ccs
Definition HiveAlgBase.h:47
ServiceHandle< IAthRNGSvc > m_rngSvc
Definition HiveAlgBase.h:50
ServiceHandle< IHiveExSvc > m_hes
Definition HiveAlgBase.h:44
virtual StatusCode initialize() override
virtual ~HiveAlgBase()
Gaudi::Property< bool > m_doCrunch
Definition HiveAlgBase.h:55
virtual bool isClonable() const override
Definition HiveAlgBase.h:34