ATLAS Offline Software
HiveExSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
11 #ifndef HIVEEXSVC_H
12 #define HIVEEXSVC_H 1
13 
14 #include "AthExHive/IHiveExSvc.h"
15 #include "GaudiKernel/ContextSpecificPtr.h"
17 
18 #include <string>
19 #include <vector>
20 #include <list>
21 #include <mutex>
22 #include <memory>
23 
24 class HiveExSvc : public extends1<AthService,IHiveExSvc> {
25 
26 public:
27  HiveExSvc(const std::string& name, ISvcLocator* svc);
28  virtual ~HiveExSvc();
29 
30  virtual StatusCode initialize() override;
31  virtual StatusCode finalize() override;
32 
33  virtual void add(const std::string&, const unsigned int&) override;
34 
35 private:
36 
37  // data structure to hold timing info
38  struct tDat {
39  tDat(const std::string& n, const unsigned int& t): algName(n), sleep_time(t){};
40  std::string algName {""};
41  unsigned int sleep_time {0};
42  };
43 
44  // vector of time data, one entry per event slot
45  std::vector< std::list<tDat> > m_times;
46 
47  // can't use a simple vector of mutexes, as the aren't copy/move
48  // contructible
49  std::vector< std::unique_ptr<std::mutex> > m_locks;
50 
51 };
52 
53 #endif
HiveExSvc::initialize
virtual StatusCode initialize() override
Definition: HiveExSvc.cxx:24
HiveExSvc::HiveExSvc
HiveExSvc(const std::string &name, ISvcLocator *svc)
Definition: HiveExSvc.cxx:14
HiveExSvc::tDat
Definition: HiveExSvc.h:38
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
HiveExSvc::tDat::tDat
tDat(const std::string &n, const unsigned int &t)
Definition: HiveExSvc.h:39
HiveExSvc::tDat::algName
std::string algName
Definition: HiveExSvc.h:40
HiveExSvc::m_times
std::vector< std::list< tDat > > m_times
Definition: HiveExSvc.h:45
HiveExSvc::m_locks
std::vector< std::unique_ptr< std::mutex > > m_locks
Definition: HiveExSvc.h:49
beamspotman.n
n
Definition: beamspotman.py:731
IHiveExSvc.h
Abstract Interface class for HiveExSvc, that accumualtes Algorithm run times by name.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
HiveExSvc::tDat::sleep_time
unsigned int sleep_time
Definition: HiveExSvc.h:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
HiveExSvc::~HiveExSvc
virtual ~HiveExSvc()
Definition: HiveExSvc.cxx:19
HiveExSvc::add
virtual void add(const std::string &, const unsigned int &) override
Definition: HiveExSvc.cxx:77
HiveExSvc
Definition: HiveExSvc.h:24
AthService.h
HiveExSvc::finalize
virtual StatusCode finalize() override
Definition: HiveExSvc.cxx:46