ATLAS Offline Software
Loading...
Searching...
No Matches
ByteStreamCnvSvc.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 BYTESTREAMCNVSVC_BYTESTREAMCNVSVC_H
6#define BYTESTREAMCNVSVC_BYTESTREAMCNVSVC_H
7
15#include "GaudiKernel/ThreadLocalContext.h"
16#include "GaudiKernel/ServiceHandle.h"
17
18#include <map>
19
21
35
36class ByteStreamCnvSvc : public extends<ByteStreamCnvSvcBase,
37 IByteStreamCnvSvc, IByteStreamEventAccess> {
38public:
40 ByteStreamCnvSvc(const std::string& name, ISvcLocator* svc);
41
43 virtual ~ByteStreamCnvSvc() = default;
44
46 virtual StatusCode initialize() override;
47 virtual StatusCode finalize() override;
48
50 virtual StatusCode connectOutput(const std::string& t, const std::string& mode) override;
51 virtual StatusCode connectOutput(const std::string& t) override;
52
54 virtual StatusCode commitOutput(const std::string& outputConnection, bool b) override;
55
57 virtual RawEventWrite* getRawEvent() override
58 {
59 return m_slots->m_rawEventWrite.get();
60 }
61
62protected:
63 RawEventWrite* setRawEvent (std::unique_ptr<RawEventWrite> rawEventWrite);
64
66 virtual FullEventAssemblerBase* findFullEventAssembler(const std::string& name) const override;
67 virtual StatusCode storeFullEventAssembler(std::unique_ptr<FullEventAssemblerBase> fea, const std::string& name) override;
68
69private:
71 Gaudi::Property<std::string> m_ioSvcName{this, "ByteStreamOutputSvc", "", "ByteStream output service name"};
72
74 Gaudi::Property<std::vector<std::string>> m_ioSvcNameList{this, "ByteStreamOutputSvcList", {}, "", "OrderedSet<T>"};
75
77 Gaudi::Property<bool> m_fillTriggerBits{this, "FillTriggerBits", true, "Read in xTrigDecision and use it to fill Trigger bits in event header"};
78
80 std::map<std::string, IByteStreamOutputSvc*> m_ioSvcMap;
81
83 ServiceHandle<StoreGateSvc> m_evtStore{this, "EventStore", "StoreGateSvc"};
84
86 Gaudi::Property<std::string> m_userType{this, "UserType", "RawEvent", "User type"};
87
89 struct SlotData
90 {
91 std::unique_ptr<RawEventWrite> m_rawEventWrite;
92 std::map<std::string, std::unique_ptr<FullEventAssemblerBase>> m_feaMap;
93 std::vector<uint32_t> m_tagBuff;
94 std::vector<uint32_t> m_l1Buff;
95 std::vector<uint32_t> m_l2Buff;
96 std::vector<uint32_t> m_efBuff;
97
98 void clear()
99 {
100 m_rawEventWrite.reset();
101 m_feaMap.clear();
102 m_tagBuff.clear();
103 m_l1Buff.clear();
104 m_l2Buff.clear();
105 m_efBuff.clear();
106 }
107 };
109
111 void writeFEA (SlotData& slot);
112};
113
114#endif // BYTESTREAMCNVSVC_BYTESTREAMCNVSVC_H
Maintain a set of objects, one per slot.
This file contains the interface for the ByteStreamOutputSvc classes.
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::FullEventFragment RawEventWrite
data type for writing raw event
Definition RawEvent.h:39
virtual RawEventWrite * getRawEvent() override
Implementation of IByteStreamEventAccess: Get RawEvent.
void writeFEA(SlotData &slot)
Write the FEA to RawEvent.
virtual StatusCode commitOutput(const std::string &outputConnection, bool b) override
Implements ConversionSvc's commitOutput.
Gaudi::Property< std::string > m_ioSvcName
name of the service
virtual StatusCode storeFullEventAssembler(std::unique_ptr< FullEventAssemblerBase > fea, const std::string &name) override
ByteStreamCnvSvc(const std::string &name, ISvcLocator *svc)
Standard Constructor.
Gaudi::Property< std::vector< std::string > > m_ioSvcNameList
list of service names
virtual ~ByteStreamCnvSvc()=default
Standard Destructor.
std::map< std::string, IByteStreamOutputSvc * > m_ioSvcMap
Services for writing output.
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
virtual StatusCode connectOutput(const std::string &t, const std::string &mode) override
Implements ConversionSvc's connectOutput.
SG::SlotSpecificObj< SlotData > m_slots
virtual FullEventAssemblerBase * findFullEventAssembler(const std::string &name) const override
Implementation of IByteStreamCnvSvc interface.
Gaudi::Property< bool > m_fillTriggerBits
fill trigger bits
ServiceHandle< StoreGateSvc > m_evtStore
Event store.
RawEventWrite * setRawEvent(std::unique_ptr< RawEventWrite > rawEventWrite)
virtual StatusCode finalize() override
Gaudi::Property< std::string > m_userType
user type
base class for assembling a full atlas raw event from subfragments
Maintain a set of objects, one per slot.
std::vector< uint32_t > m_l2Buff
std::map< std::string, std::unique_ptr< FullEventAssemblerBase > > m_feaMap
std::vector< uint32_t > m_l1Buff
std::vector< uint32_t > m_tagBuff
std::vector< uint32_t > m_efBuff
std::unique_ptr< RawEventWrite > m_rawEventWrite