ATLAS Offline Software
TrigByteStreamCnvSvc.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 TRIGBYTESTREAMCNVSVC_H
6 #define TRIGBYTESTREAMCNVSVC_H
7 
12 
13 // Forward declarations
14 class StoreGateSvc;
16 
23 class TrigByteStreamCnvSvc : public extends<ByteStreamCnvSvcBase,
24  IByteStreamCnvSvc, IByteStreamEventAccess> {
25 public:
27  TrigByteStreamCnvSvc(const std::string& name, ISvcLocator* svcLoc);
29  virtual ~TrigByteStreamCnvSvc();
30 
31  // ------------------------- IService methods --------------------------------
32  virtual StatusCode initialize() override;
33  virtual StatusCode finalize() override;
34 
35  // ------------------------- IConversionSvc methods --------------------------
37  virtual StatusCode connectOutput(const std::string& outputFile) override;
39  StatusCode connectOutput(const std::string& outputFile, const EventContext& eventContext);
41  virtual StatusCode connectOutput(const std::string& outputFile, const std::string& openMode) override;
43  virtual StatusCode commitOutput(const std::string& outputFile, bool do_commit) override;
45  StatusCode commitOutput(const std::string& outputFile, bool do_commit, const EventContext& eventContext);
46 
47  // ------------------------- IByteStreamEventAccess methods ------------------
49  virtual RawEventWrite* getRawEvent() override;
51  RawEventWrite* getRawEvent(const EventContext& eventContext) const;
52 
53 protected:
54  // ------------------------- IByteStreamCnvSvc methods ------------------
55  virtual FullEventAssemblerBase* findFullEventAssembler(const std::string& name) const override;
56  virtual StatusCode storeFullEventAssembler(std::unique_ptr<FullEventAssemblerBase> fea, const std::string& name) override;
57 
58 private:
59  // ------------------------- Helper methods ----------------------------------
61  RawEventWrite* setRawEvent(std::unique_ptr<RawEventWrite>&& rawEventWrite, const EventContext& eventContext);
63  void clearRawEvent(const EventContext& eventContext);
65  void printRawEvent(const EventContext& eventContext) const;
67  void monitorRawEvent(const std::unique_ptr<uint32_t[]>& rawEventPtr) const;
69  const EventContext* currentContext() const;
70 
71  // ------------------------- Service / Tool handles --------------------------
72  ServiceHandle<StoreGateSvc> m_evtStore {this, "EventStore", "StoreGateSvc"};
73  ServiceHandle<IROBDataProviderSvc> m_robDataProviderSvc {this, "ROBDataProvider", "ROBDataProviderSvc"};
74  ToolHandle<GenericMonitoringTool> m_monTool {this, "MonTool", "" , "Monitoring tool"};
75 
76  // ------------------------- Other private members ---------------------------
78 };
79 
80 #endif // TRIGBYTESTREAMCNVSVC_H
RawEventWrite
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::FullEventFragment RawEventWrite
data type for writing raw event
Definition: RawEvent.h:39
TrigByteStreamCnvSvc::commitOutput
virtual StatusCode commitOutput(const std::string &outputFile, bool do_commit) override
In the case of online BS data, this method binds and sends out the output FullEventFragment.
Definition: TrigByteStreamCnvSvc.cxx:177
TrigByteStreamCnvSvc::monitorRawEvent
void monitorRawEvent(const std::unique_ptr< uint32_t[]> &rawEventPtr) const
Fill histograms from contents of a FullEventFragment.
Definition: TrigByteStreamCnvSvc.cxx:280
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TrigByteStreamCnvSvc::m_rawEventWriteCache
SG::SlotSpecificObj< std::unique_ptr< RawEventWrite > > m_rawEventWriteCache
Definition: TrigByteStreamCnvSvc.h:77
TrigByteStreamCnvSvc::connectOutput
virtual StatusCode connectOutput(const std::string &outputFile) override
In the case of online BS data, this method creates the output FullEventFragment and fills its header.
Definition: TrigByteStreamCnvSvc.cxx:139
compareGeometries.outputFile
string outputFile
Definition: compareGeometries.py:25
TrigByteStreamCnvSvc::~TrigByteStreamCnvSvc
virtual ~TrigByteStreamCnvSvc()
Standard destructor.
Definition: TrigByteStreamCnvSvc.cxx:92
IROBDataProviderSvc
Interface class for managing ROB for both online and offline.
Definition: IROBDataProviderSvc.h:23
FullEventAssemblerBase
base class for assembling a full atlas raw event from subfragments
Definition: FullEventAssembler.h:23
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
TrigByteStreamCnvSvc::setRawEvent
RawEventWrite * setRawEvent(std::unique_ptr< RawEventWrite > &&rawEventWrite, const EventContext &eventContext)
Store new raw event in the cache.
Definition: TrigByteStreamCnvSvc.cxx:269
TrigByteStreamCnvSvc::m_robDataProviderSvc
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
Definition: TrigByteStreamCnvSvc.h:73
TrigByteStreamCnvSvc::findFullEventAssembler
virtual FullEventAssemblerBase * findFullEventAssembler(const std::string &name) const override
Definition: TrigByteStreamCnvSvc.cxx:124
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigByteStreamCnvSvc::finalize
virtual StatusCode finalize() override
Definition: TrigByteStreamCnvSvc.cxx:110
TrigByteStreamCnvSvc::TrigByteStreamCnvSvc
TrigByteStreamCnvSvc(const std::string &name, ISvcLocator *svcLoc)
Standard constructor.
Definition: TrigByteStreamCnvSvc.cxx:86
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigByteStreamCnvSvc::storeFullEventAssembler
virtual StatusCode storeFullEventAssembler(std::unique_ptr< FullEventAssemblerBase > fea, const std::string &name) override
Definition: TrigByteStreamCnvSvc.cxx:129
TrigByteStreamCnvSvc::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigByteStreamCnvSvc.h:74
TrigByteStreamCnvSvc::m_evtStore
ServiceHandle< StoreGateSvc > m_evtStore
Definition: TrigByteStreamCnvSvc.h:72
TrigByteStreamCnvSvc::printRawEvent
void printRawEvent(const EventContext &eventContext) const
Print contents of the raw event.
Definition: TrigByteStreamCnvSvc.cxx:404
TrigByteStreamCnvSvc::currentContext
const EventContext * currentContext() const
Hack used in HLT to avoid using ThreadLocalContext, see explanation in the implementation.
Definition: TrigByteStreamCnvSvc.cxx:244
SlotSpecificObj.h
Maintain a set of objects, one per slot.
ByteStreamCnvSvcBase.h
IByteStreamCnvSvc.h
TrigByteStreamCnvSvc::clearRawEvent
void clearRawEvent(const EventContext &eventContext)
Delete raw event from the cache.
Definition: TrigByteStreamCnvSvc.cxx:275
TrigByteStreamCnvSvc
A ByteStreamCnvSvc implementation for online use.
Definition: TrigByteStreamCnvSvc.h:24
TrigByteStreamCnvSvc::getRawEvent
virtual RawEventWrite * getRawEvent() override
Return a pointer to the raw event for the current event context.
Definition: TrigByteStreamCnvSvc.cxx:257
ServiceHandle< StoreGateSvc >
TrigByteStreamCnvSvc::initialize
virtual StatusCode initialize() override
Definition: TrigByteStreamCnvSvc.cxx:97