ATLAS Offline Software
TrigByteStreamInputSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGBYTESTREAMINPUTSVC_H
6 #define TRIGBYTESTREAMINPUTSVC_H
7 
13 #include <memory.h>
14 
15 // Forward declarations
16 class StoreGateSvc;
17 
24 public:
26  TrigByteStreamInputSvc(const std::string& name, ISvcLocator* svcLoc);
28  virtual ~TrigByteStreamInputSvc();
29 
30  // -------------------------- IInterface methods -----------------------------
31  virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface) override;
32 
33  // ------------------------- Service methods --------------------------------
34  virtual StatusCode initialize() override;
35  virtual StatusCode finalize() override;
36 
37  // ------------------------- ByteStreamInputSvc methods ----------------------
38  virtual const RawEvent* nextEvent() override;
39  virtual const RawEvent* previousEvent() override;
40  virtual const RawEvent* currentEvent() const override;
41 
42 private:
43  // ------------------------- Service handles ---------------------------------
44  ServiceHandle<IROBDataProviderSvc> m_robDataProviderSvc {this, "ROBDataProvider", "ROBDataProviderSvc"};
45  ServiceHandle<StoreGateSvc> m_evtStore {this, "EventStore", "StoreGateSvc"};
46  ToolHandle<GenericMonitoringTool> m_monTool {this, "MonTool", "" , "Monitoring tool"};
47 
48  // ------------------------- Properties --------------------------------------
49  Gaudi::Property<int> m_checkCTPFragmentModuleID {this, "CheckCTPFragmentModuleID", -1,
50  "After reading a new event, assert we can retrieve the CTP fragment with Module ID given by this property, "
51  "and that has no errors. A value <0 disables the check."};
52 
53  // ------------------------- Private data members ----------------------------
54  struct EventCache {
55  ~EventCache() = default;
56  void releaseEvent();
57  std::unique_ptr<RawEvent> fullEventFragment {nullptr};
58  std::unique_ptr<uint32_t[]> rawData {nullptr};
59  };
60 
63 };
64 
65 #endif // TRIGBYTESTREAMINPUTSVC_H
ByteStreamInputSvc.h
This file contains the class definition for the ByteStreamInputSvc class.
TrigByteStreamInputSvc::EventCache::rawData
std::unique_ptr< uint32_t[]> rawData
Underlying data structure.
Definition: TrigByteStreamInputSvc.h:58
ByteStreamInputSvc
This class provides the base class to services to read bytestream data. The concrete class can provid...
Definition: ByteStreamInputSvc.h:23
TrigByteStreamInputSvc::nextEvent
virtual const RawEvent * nextEvent() override
virtual method for advance to the next event
Definition: TrigByteStreamInputSvc.cxx:79
TrigByteStreamInputSvc::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigByteStreamInputSvc.h:46
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:57
TrigByteStreamInputSvc::EventCache::releaseEvent
void releaseEvent()
Definition: TrigByteStreamInputSvc.cxx:213
TrigByteStreamInputSvc::initialize
virtual StatusCode initialize() override
Definition: TrigByteStreamInputSvc.cxx:53
TrigByteStreamInputSvc::m_evtStore
ServiceHandle< StoreGateSvc > m_evtStore
Definition: TrigByteStreamInputSvc.h:45
TrigByteStreamInputSvc::m_robDataProviderSvc
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
Definition: TrigByteStreamInputSvc.h:44
TrigByteStreamInputSvc::m_checkCTPFragmentModuleID
Gaudi::Property< int > m_checkCTPFragmentModuleID
Definition: TrigByteStreamInputSvc.h:49
TrigByteStreamInputSvc::currentEvent
virtual const RawEvent * currentEvent() const override
virtual method for accessing the current event
Definition: TrigByteStreamInputSvc.cxx:207
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
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:88
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::queryInterface
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface) override
Definition: TrigByteStreamInputSvc.cxx:37
TrigByteStreamInputSvc::m_eventsCache
SG::SlotSpecificObj< EventCache > m_eventsCache
Cache of RawEvent pointer per event slot.
Definition: TrigByteStreamInputSvc.h:61
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
TrigByteStreamInputSvc::previousEvent
virtual const RawEvent * previousEvent() override
Definition: TrigByteStreamInputSvc.cxx:199
TrigByteStreamInputSvc
A ByteStreamInputSvc implementation for online use, reading events from hltinterface::DataCollector.
Definition: TrigByteStreamInputSvc.h:23
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TrigByteStreamInputSvc::EventCache
Definition: TrigByteStreamInputSvc.h:54
TrigByteStreamInputSvc::finalize
virtual StatusCode finalize() override
Definition: TrigByteStreamInputSvc.cxx:67
TrigByteStreamInputSvc::TrigByteStreamInputSvc
TrigByteStreamInputSvc(const std::string &name, ISvcLocator *svcLoc)
Standard constructor.
Definition: TrigByteStreamInputSvc.cxx:26
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:62
IROBDataProviderSvc.h
ServiceHandle< IROBDataProviderSvc >