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/ServiceHandle.h"
16
17#include <map>
18
20
34
35class ByteStreamCnvSvc : public extends<ByteStreamCnvSvcBase,
36 IByteStreamCnvSvc, IByteStreamEventAccess> {
37public:
39 ByteStreamCnvSvc(const std::string& name, ISvcLocator* svc);
40
42 virtual ~ByteStreamCnvSvc() = default;
43
45 virtual StatusCode initialize() override;
46 virtual StatusCode finalize() override;
47
49 virtual StatusCode connectOutput(const std::string& t, const std::string& mode) override;
50 virtual StatusCode connectOutput(const std::string& t) override;
51
53 virtual StatusCode commitOutput(const std::string& outputConnection, bool b) override;
54
56 virtual RawEventWrite* getRawEvent() override
57 {
58 return m_slots->m_rawEventWrite.get();
59 }
60
61protected:
62 RawEventWrite* setRawEvent (std::unique_ptr<RawEventWrite> rawEventWrite);
63
65 virtual FullEventAssemblerBase* findFullEventAssembler(const std::string& name) const override;
66 virtual StatusCode storeFullEventAssembler(std::unique_ptr<FullEventAssemblerBase> fea, const std::string& name) override;
67
68private:
70 Gaudi::Property<std::string> m_ioSvcName{this, "ByteStreamOutputSvc", "", "ByteStream output service name"};
71
73 Gaudi::Property<std::vector<std::string>> m_ioSvcNameList{this, "ByteStreamOutputSvcList", {}, "", "OrderedSet<T>"};
74
76 Gaudi::Property<bool> m_fillTriggerBits{this, "FillTriggerBits", true, "Read in xTrigDecision and use it to fill Trigger bits in event header"};
77
79 std::map<std::string, IByteStreamOutputSvc*> m_ioSvcMap;
80
82 ServiceHandle<StoreGateSvc> m_evtStore{this, "EventStore", "StoreGateSvc"};
83
85 Gaudi::Property<std::string> m_userType{this, "UserType", "RawEvent", "User type"};
86
88 struct SlotData
89 {
90 std::unique_ptr<RawEventWrite> m_rawEventWrite;
91 std::map<std::string, std::unique_ptr<FullEventAssemblerBase>> m_feaMap;
92 std::vector<uint32_t> m_tagBuff;
93 std::vector<uint32_t> m_l1Buff;
94 std::vector<uint32_t> m_l2Buff;
95 std::vector<uint32_t> m_efBuff;
96
97 void clear()
98 {
99 m_rawEventWrite.reset();
100 m_feaMap.clear();
101 m_tagBuff.clear();
102 m_l1Buff.clear();
103 m_l2Buff.clear();
104 m_efBuff.clear();
105 }
106 };
108
110 void writeFEA (SlotData& slot);
111};
112
113#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