ATLAS Offline Software
Psc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
13 #ifndef TRIGPSC_PSC_H
14 #define TRIGPSC_PSC_H
15 
16 // Package includes
17 #include "TrigPSC/Config.h"
18 
19 // TDAQ includes
20 #include "hltinterface/HLTInterface.h"
21 
22 // Gaudi Includes
23 #include "GaudiKernel/StatusCode.h"
24 #include "GaudiKernel/SmartIF.h"
25 #include "GaudiKernel/ISvcLocator.h"
26 
27 // STL includes
28 #include <map>
29 #include <string>
30 #include <functional>
31 #include <memory>
32 
33 // Boost includes
34 #include <boost/property_tree/ptree.hpp>
35 
36 class IAppMgrUI;
37 
38 namespace psc {
39 
43  class Psc: public hltinterface::HLTInterface
44  {
45  public:
49  Psc() = default;
50 
54  virtual ~Psc();
55 
59  virtual bool configure (const boost::property_tree::ptree& config) override;
60 
64  virtual bool connect (const boost::property_tree::ptree& args) override;
65 
69  virtual bool prepareForRun (const boost::property_tree::ptree& args) override;
70 
74  virtual bool stopRun (const boost::property_tree::ptree& args) override;
75 
79  virtual bool disconnect (const boost::property_tree::ptree& args) override;
80 
84  virtual bool unconfigure (const boost::property_tree::ptree& args) override;
85 
90  virtual bool publishStatistics (const boost::property_tree::ptree& args) override;
91 
95  virtual bool hltUserCommand (const boost::property_tree::ptree& args) override;
96 
100  virtual bool doEventLoop () override;
101 
106  virtual bool prepareWorker (const boost::property_tree::ptree& args) override;
107 
112  virtual bool finalizeWorker (const boost::property_tree::ptree& args) override;
113 
114  private:
115  bool setDFProperties(const std::map<std::string, std::string>& name_tr_table);
116  bool setAthenaProperties();
117 
119  bool doAppMgrInit();
121  bool doAppMgrFinalize();
122 
129  template <typename T>
130  StatusCode callOnEventLoopMgr(std::function<StatusCode (T*)> func,
131  const std::string& name) const;
132 
133  private:
135  IAppMgrUI* m_pesaAppMgr{nullptr};
136  std::string m_nameEventLoopMgr;
137  bool m_interactive{false};
138  std::unique_ptr<psc::Config> m_config{nullptr};
139  int m_workerID{0};
140 
141  SmartIF<ISvcLocator> m_svcLoc;
142  };
143 }
144 
145 #endif /* TRIGPSC_PSC_H */
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
psc::Psc::unconfigure
virtual bool unconfigure(const boost::property_tree::ptree &args) override
Unconfigures the framework, releasing all acquired resources.
Definition: Psc.cxx:586
psc::Psc::doEventLoop
virtual bool doEventLoop() override
Starts the HLT event loop.
Definition: Psc.cxx:617
psc::Psc::stopRun
virtual bool stopRun(const boost::property_tree::ptree &args) override
stops the HLT framework without re-configuring
Definition: Psc.cxx:507
psc::Psc::m_run_number
uint32_t m_run_number
(initial) run number to be used for this run
Definition: Psc.h:134
psc::Psc::connect
virtual bool connect(const boost::property_tree::ptree &args) override
Connects the framework.
Definition: Psc.cxx:421
psc::Psc::callOnEventLoopMgr
StatusCode callOnEventLoopMgr(std::function< StatusCode(T *)> func, const std::string &name) const
Utility method to call a method on the event loop manager.
Definition: Psc.cxx:772
psc::Psc::setDFProperties
bool setDFProperties(const std::map< std::string, std::string > &name_tr_table)
Definition: Psc.cxx:697
psc::Psc::m_pesaAppMgr
IAppMgrUI * m_pesaAppMgr
Application Manager.
Definition: Psc.h:135
psc::Psc::doAppMgrFinalize
bool doAppMgrFinalize()
Finalize the application manager.
Definition: Psc.cxx:540
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
psc::Psc::prepareForRun
virtual bool prepareForRun(const boost::property_tree::ptree &args) override
prepares the HLT framework for a run
Definition: Psc.cxx:436
psc
Definition: Config.h:26
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
psc::Psc::publishStatistics
virtual bool publishStatistics(const boost::property_tree::ptree &args) override
Calls the HLT framework to publish statistics, after the run has finished.
Definition: Psc.cxx:597
psc::Psc::configure
virtual bool configure(const boost::property_tree::ptree &config) override
Configures the framework.
Definition: Psc.cxx:78
psc::Psc::Psc
Psc()=default
Default constructor.
psc::Psc::m_nameEventLoopMgr
std::string m_nameEventLoopMgr
name of the event loop manager
Definition: Psc.h:136
psc::Psc
Common base class for HLT Pesa Steering Controller.
Definition: Psc.h:44
psc::Psc::m_workerID
int m_workerID
worker ID (0=mother)
Definition: Psc.h:139
psc::Psc::disconnect
virtual bool disconnect(const boost::property_tree::ptree &args) override
Disconnects the framework.
Definition: Psc.cxx:575
ptree
boost::property_tree::ptree ptree
Definition: JsonFileLoader.cxx:16
psc::Psc::setAthenaProperties
bool setAthenaProperties()
Definition: Psc.cxx:711
psc::Psc::prepareWorker
virtual bool prepareWorker(const boost::property_tree::ptree &args) override
Method which can be called for a worker to perform the necessary steps to set unique worker IDs and a...
Definition: Psc.cxx:651
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Config.h
PSC Configuration type.
psc::Psc::m_config
std::unique_ptr< psc::Config > m_config
Config derived from ptree.
Definition: Psc.h:138
psc::Psc::m_interactive
bool m_interactive
Running in interactive mode (athenaHLT)
Definition: Psc.h:137
psc::Psc::m_svcLoc
SmartIF< ISvcLocator > m_svcLoc
Service locator handle.
Definition: Psc.h:141
psc::Psc::doAppMgrInit
bool doAppMgrInit()
Initialize the application manager.
Definition: Psc.cxx:379
psc::Psc::finalizeWorker
virtual bool finalizeWorker(const boost::property_tree::ptree &args) override
Method which can be called for a worker to perform a cleanup before the worker gets killed.
Definition: Psc.cxx:691
psc::Psc::hltUserCommand
virtual bool hltUserCommand(const boost::property_tree::ptree &args) override
Calls the HLT framework to notify it that a user command has arrived.
Definition: Psc.cxx:609
psc::Psc::~Psc
virtual ~Psc()
Virtual desctuctor.
Definition: Psc.cxx:67
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80