ATLAS Offline Software
Loading...
Searching...
No Matches
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
12
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
36class IAppMgrUI;
37
38namespace 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:
134 uint32_t m_run_number{0};
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 */
PSC Configuration type.
bool setAthenaProperties()
Definition Psc.cxx:711
uint32_t m_run_number
(initial) run number to be used for this run
Definition Psc.h:134
bool setDFProperties(const std::map< std::string, std::string > &name_tr_table)
Definition Psc.cxx:697
virtual bool unconfigure(const boost::property_tree::ptree &args) override
Unconfigures the framework, releasing all acquired resources.
Definition Psc.cxx:586
int m_workerID
worker ID (0=mother)
Definition Psc.h:139
virtual ~Psc()
Virtual desctuctor.
Definition Psc.cxx:67
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
virtual bool configure(const boost::property_tree::ptree &config) override
Configures the framework.
Definition Psc.cxx:78
Psc()=default
Default constructor.
bool m_interactive
Running in interactive mode (athenaHLT)
Definition Psc.h:137
IAppMgrUI * m_pesaAppMgr
Application Manager.
Definition Psc.h:135
bool doAppMgrFinalize()
Finalize the application manager.
Definition Psc.cxx:540
bool doAppMgrInit()
Initialize the application manager.
Definition Psc.cxx:379
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
virtual bool disconnect(const boost::property_tree::ptree &args) override
Disconnects the framework.
Definition Psc.cxx:575
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
std::string m_nameEventLoopMgr
name of the event loop manager
Definition Psc.h:136
virtual bool prepareForRun(const boost::property_tree::ptree &args) override
prepares the HLT framework for a run
Definition Psc.cxx:436
virtual bool connect(const boost::property_tree::ptree &args) override
Connects the framework.
Definition Psc.cxx:421
virtual bool stopRun(const boost::property_tree::ptree &args) override
stops the HLT framework without re-configuring
Definition Psc.cxx:507
SmartIF< ISvcLocator > m_svcLoc
Service locator handle.
Definition Psc.h:141
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
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
virtual bool doEventLoop() override
Starts the HLT event loop.
Definition Psc.cxx:617
std::unique_ptr< psc::Config > m_config
Config derived from ptree.
Definition Psc.h:138
Definition Config.h:26