ATLAS Offline Software
Loading...
Searching...
No Matches
EFInterfaceSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef EFINTERFACESVC_H
6#define EFINTERFACESVC_H
7
8#include "GaudiKernel/IIncidentListener.h"
9#include "Gaudi/Interfaces/IOptionsSvc.h"
12#include "eformat/eformat.h"
13#include "df_ef_interface/df_ef_interface.h"
14#include <boost/dll.hpp>
15#include <boost/property_tree/ptree.hpp>
16#include <queue>
17#include <mutex>
18#include <memory>
19
28class EFInterfaceSvc: public extends <AthService, IIncidentListener>
29{
30public:
31
32 enum class Status {
33 OK = 0,
36 };
37
38 EFInterfaceSvc(const std::string& name, ISvcLocator *svc );
39 virtual ~EFInterfaceSvc() noexcept override {}
40
41 virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE () override;
42 virtual StatusCode stop() override;
43 virtual StatusCode finalize() override;
44
45 virtual void handle(const Incident& incident) override;
46 virtual Status getNext(std::unique_ptr<uint32_t[]>& rawEventPtr);
47 void eventDone(std::unique_ptr<uint32_t[]> rawEventPtr);
48 boost::property_tree::ptree prepInterfacePTree();
49
50 // Event Counters
51 uint32_t m_acceptedEvents{0};
52 uint32_t m_rejectedEvents{0};
53 uint32_t m_processedEvents{0};
54
55private:
56 boost::dll::shared_library m_efdfinterface_library;
57 std::unique_ptr<daq::df_ef_interface::EventHandler> m_eventHandler;
58 std::queue<std::future<std::unique_ptr<uint32_t []>>> m_getNextFuture;
59 std::mutex m_queueMutex;
60
61 // ------------------------- Properties --------------------------------------
62 Gaudi::Property<std::string> m_interface_library_name {this, "EFDFInterfaceLibraryName", "TrigDFEmulator",
63 "Name of the EFDF interface shared library to load"};
64 Gaudi::Property<int> m_getNextTimeout {this, "GetNextTimeout", 1000,
65 "Timeout for getting the next event (in milliseconds)"};
66 Gaudi::Property<int> m_stride {this, "Stride", 1,
67 "Stride for the event retrieval"};
68 Gaudi::Property<int> m_fileOffset {this, "FileOffset", 0,
69 "File offset for the event retrieval"};
70 Gaudi::Property<int> m_numEvents {this, "NumEvents", 100,
71 "Number of events to process"};
72 Gaudi::Property<int> m_skipEvents {this, "SkipEvents", 0,
73 "Number of events to skip"};
74 Gaudi::Property<bool> m_loopOverFiles {this, "LoopOverFiles", true,
75 "Flag to enable looping over files"};
76 Gaudi::Property<std::string> m_outputFileName {this, "OutputFileName", "test_output.data",
77 "Name of the output file"};
78 Gaudi::Property<std::vector<std::string>> m_files {this, "Files", {""},
79 "List of input files"};
80 Gaudi::Property<int> m_runNumber {this, "RunNumber", 0,
81 "Run number for the events processing"};
82 Gaudi::Property<int> m_triggerType {this, "TriggerType", 0,
83 "Trigger type for the events processing"};
84 Gaudi::Property<int> m_beamType {this, "BeamType", 0,
85 "Beam type"};
86 Gaudi::Property<int> m_beamEnergy {this, "BeamEnergy", 0,
87 "Beam energy"};
88 Gaudi::Property<std::string> m_detMask {this, "DetMask", "00000000000000000000000000000000",
89 "Detector mask"};
90 Gaudi::Property<std::string> m_T0_project_tag {this, "T0ProjectTag", "T0_project_tag",
91 "T0 project tag"};
92 Gaudi::Property<std::string> m_stream {this, "Stream", "stream",
93 "Stream name"};
94 Gaudi::Property<int> m_lumiblock {this, "Lumiblock", 0,
95 "Lumiblock"};
96};
97
98#endif // EFINTERFACESVC_H
99
Define macros for attributes used to control the static checker.
Gaudi::Property< std::string > m_outputFileName
virtual ~EFInterfaceSvc() noexcept override
@ NO_EVENT
no event available
@ STOP
stop transition (no more events)
Gaudi::Property< int > m_getNextTimeout
std::queue< std::future< std::unique_ptr< uint32_t[]> > > m_getNextFuture
EFInterfaceSvc(const std::string &name, ISvcLocator *svc)
virtual StatusCode stop() override
virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE() override
virtual StatusCode finalize() override
Gaudi::Property< int > m_beamType
uint32_t m_acceptedEvents
Gaudi::Property< std::string > m_stream
Gaudi::Property< std::string > m_detMask
Gaudi::Property< int > m_triggerType
Gaudi::Property< int > m_numEvents
void eventDone(std::unique_ptr< uint32_t[]> rawEventPtr)
virtual Status getNext(std::unique_ptr< uint32_t[]> &rawEventPtr)
Gaudi::Property< std::string > m_interface_library_name
Gaudi::Property< bool > m_loopOverFiles
Gaudi::Property< std::vector< std::string > > m_files
Gaudi::Property< int > m_fileOffset
std::unique_ptr< daq::df_ef_interface::EventHandler > m_eventHandler
Gaudi::Property< int > m_runNumber
Gaudi::Property< std::string > m_T0_project_tag
Gaudi::Property< int > m_beamEnergy
boost::dll::shared_library m_efdfinterface_library
Library with the df_ef_interface implementation.
Gaudi::Property< int > m_lumiblock
virtual void handle(const Incident &incident) override
uint32_t m_processedEvents
Gaudi::Property< int > m_stride
std::mutex m_queueMutex
Mutex for future queue.
uint32_t m_rejectedEvents
Gaudi::Property< int > m_skipEvents
boost::property_tree::ptree prepInterfacePTree()
void initialize()