ATLAS Offline Software
TrigByteStreamInputSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGBYTESTREAMINPUTSVC_H
6 #define TRIGBYTESTREAMINPUTSVC_H
7 
14 #include <memory.h>
15 
16 // Forward declarations
17 class StoreGateSvc;
18 
24 class TrigByteStreamInputSvc : public extends<AthService, IByteStreamInputSvc> {
25 public:
27  TrigByteStreamInputSvc(const std::string& name, ISvcLocator* svcLoc);
29  virtual ~TrigByteStreamInputSvc();
30 
31  // ------------------------- Service methods --------------------------------
32  virtual StatusCode initialize() override;
33  virtual StatusCode finalize() override;
34 
35  // ------------------------- ByteStreamInputSvc methods ----------------------
36  virtual const RawEvent* nextEvent() override;
37  virtual const RawEvent* previousEvent() override;
38  virtual const RawEvent* currentEvent() const override;
39 
40 private:
41  // ------------------------- Service handles ---------------------------------
42  ServiceHandle<IROBDataProviderSvc> m_robDataProviderSvc {this, "ROBDataProvider", "ROBDataProviderSvc"};
43  ServiceHandle<StoreGateSvc> m_evtStore {this, "EventStore", "StoreGateSvc"};
44  ToolHandle<GenericMonitoringTool> m_monTool {this, "MonTool", "" , "Monitoring tool"};
45 
46  // ------------------------- Properties --------------------------------------
47  Gaudi::Property<int> m_checkCTPFragmentModuleID {this, "CheckCTPFragmentModuleID", -1,
48  "After reading a new event, assert we can retrieve the CTP fragment with Module ID given by this property, "
49  "and that has no errors. A value <0 disables the check."};
50 
51  // ------------------------- Private data members ----------------------------
52  struct EventCache {
53  ~EventCache() = default;
54  void releaseEvent();
55  std::unique_ptr<RawEvent> fullEventFragment {nullptr};
56  std::unique_ptr<uint32_t[]> rawData {nullptr};
57  };
58 
61 };
62 
63 #endif // TRIGBYTESTREAMINPUTSVC_H
TrigByteStreamInputSvc::EventCache::rawData
std::unique_ptr< uint32_t[]> rawData
Underlying data structure.
Definition: TrigByteStreamInputSvc.h:56
TrigByteStreamInputSvc::nextEvent
virtual const RawEvent * nextEvent() override
Definition: TrigByteStreamInputSvc.cxx:63
TrigByteStreamInputSvc::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigByteStreamInputSvc.h:44
TrigByteStreamInputSvc::EventCache::~EventCache
~EventCache()=default
RawEvent
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Definition: RawEvent.h:37
TrigByteStreamInputSvc::EventCache::fullEventFragment
std::unique_ptr< RawEvent > fullEventFragment
Current event fragment.
Definition: TrigByteStreamInputSvc.h:55
TrigByteStreamInputSvc::EventCache::releaseEvent
void releaseEvent()
Definition: TrigByteStreamInputSvc.cxx:197
TrigByteStreamInputSvc::initialize
virtual StatusCode initialize() override
Definition: TrigByteStreamInputSvc.cxx:37
TrigByteStreamInputSvc::m_evtStore
ServiceHandle< StoreGateSvc > m_evtStore
Definition: TrigByteStreamInputSvc.h:43
TrigByteStreamInputSvc::m_robDataProviderSvc
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
Definition: TrigByteStreamInputSvc.h:42
TrigByteStreamInputSvc::m_checkCTPFragmentModuleID
Gaudi::Property< int > m_checkCTPFragmentModuleID
Definition: TrigByteStreamInputSvc.h:47
TrigByteStreamInputSvc::currentEvent
virtual const RawEvent * currentEvent() const override
Definition: TrigByteStreamInputSvc.cxx:191
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
SG::SlotSpecificObj
Maintain a set of objects, one per slot.
Definition: AthenaKernel/AthenaKernel/SlotSpecificObj.h:70
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
RawEvent.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigByteStreamInputSvc::~TrigByteStreamInputSvc
virtual ~TrigByteStreamInputSvc()
Standard destructor.
Definition: TrigByteStreamInputSvc.cxx:32
TrigByteStreamInputSvc::m_eventsCache
SG::SlotSpecificObj< EventCache > m_eventsCache
Cache of RawEvent pointer per event slot.
Definition: TrigByteStreamInputSvc.h:59
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
TrigByteStreamInputSvc::previousEvent
virtual const RawEvent * previousEvent() override
Definition: TrigByteStreamInputSvc.cxx:183
TrigByteStreamInputSvc
A ByteStreamInputSvc implementation for online use, reading events from hltinterface::DataCollector.
Definition: TrigByteStreamInputSvc.h:24
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
IByteStreamInputSvc.h
This file contains the interface for the ByteStreamInputSvc classes.
TrigByteStreamInputSvc::EventCache
Definition: TrigByteStreamInputSvc.h:52
TrigByteStreamInputSvc::finalize
virtual StatusCode finalize() override
Definition: TrigByteStreamInputSvc.cxx:51
TrigByteStreamInputSvc::TrigByteStreamInputSvc
TrigByteStreamInputSvc(const std::string &name, ISvcLocator *svcLoc)
Standard constructor.
Definition: TrigByteStreamInputSvc.cxx:26
AthService.h
SlotSpecificObj.h
Maintain a set of objects, one per slot.
TrigByteStreamInputSvc::m_maxLB
uint16_t m_maxLB
Maximum lumi block number seen so far, used for monitoring.
Definition: TrigByteStreamInputSvc.h:60
IROBDataProviderSvc.h
ServiceHandle< IROBDataProviderSvc >