ATLAS Offline Software
Loading...
Searching...
No Matches
ByteStreamDataWriter.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_BYTESTREAMDATAWRITER_H
6#define BYTESTREAMCNVSVC_BYTESTREAMDATAWRITER_H
7
12
13#include <cstdint>
14#include <memory>
15#include <string>
16#include <vector>
17
18#include "EventStorage/DWError.h"
19#include "EventStorage/ESCompression.h"
20#include "EventStorage/EventStorageRecords.h"
21#include "EventStorage/FileNameCallback.h"
22#include "boost/shared_ptr.hpp"
23
25
40
42public:
43
63 static std::unique_ptr<ByteStreamDataWriter>
64 makeWriter(int version,
65 const std::string& writingPath,
66 const std::string& fileNameCore,
67 const EventStorage::run_parameters_record& rPar,
68 const std::vector<std::string>& fmdStrings,
69 unsigned int maxFileNE = 0,
70 unsigned int maxFileMB = 0,
71 unsigned int startIndex = 1,
72 EventStorage::CompressionType compression = EventStorage::NONE,
73 unsigned int compLevel = 1);
74
94 static std::unique_ptr<ByteStreamDataWriter>
95 makeWriter(int version,
96 const std::string& writingPath,
97 boost::shared_ptr<EventStorage::FileNameCallback> theFNCB,
98 const EventStorage::run_parameters_record& rPar,
99 const std::string& project,
100 const std::string& streamType,
101 const std::string& streamName,
102 const std::string& stream,
103 unsigned int lumiBlockNumber,
104 const std::string& applicationName,
105 const std::vector<std::string>& fmdStrings,
106 unsigned int maxFileNE = 0,
107 unsigned int maxFileMB = 0,
108 EventStorage::CompressionType compression = EventStorage::NONE,
109 unsigned int compLevel = 1);
110
119 static std::unique_ptr<ByteStreamDataWriter>
120 makeWriter(const DataWriterParameters& parameters);
121
122
124 virtual ~ByteStreamDataWriter() = default;
125
126 // abstract class cannot be copied
129
138 virtual EventStorage::DWError putData(unsigned int dataSize, const void *data) = 0;
139
143 virtual bool good() const = 0;
144
145};
146
147
159 int version{0};
160
162 std::string writingPath{""};
163
165 std::string fileNameCore{""};
166
168 EventStorage::run_parameters_record rPar{
169 0, 0, 0, 0, 0, 0, 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, 0, 0 };
170
172 std::vector<std::string> fmdStrings;
173
175 unsigned int maxFileNE{0};
176
178 unsigned int maxFileMB{0};
179
181 unsigned int startIndex{1};
182
184 EventStorage::CompressionType compression{EventStorage::NONE};
185
187 unsigned int compLevel{1};
188
190 boost::shared_ptr<EventStorage::FileNameCallback> theFNCB;
191
193 std::string project{""};
194
196 std::string streamType{""};
197
199 std::string streamName{""};
200
202 std::string stream{""};
203
205 unsigned int lumiBlockNumber{0};
206
208 std::string applicationName{""};
209};
210
211#endif // BYTESTREAMCNVSVC_BYTESTREAMDATAWRITER_H
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
T_ResultType project(ParameterMapping::type< N > parameter_map, const T_Matrix &matrix)
static std::unique_ptr< ByteStreamDataWriter > makeWriter(int version, const std::string &writingPath, const std::string &fileNameCore, const EventStorage::run_parameters_record &rPar, const std::vector< std::string > &fmdStrings, unsigned int maxFileNE=0, unsigned int maxFileMB=0, unsigned int startIndex=1, EventStorage::CompressionType compression=EventStorage::NONE, unsigned int compLevel=1)
Factory method returning data writer instance for specified version.
ByteStreamDataWriter(const ByteStreamDataWriter &)=delete
virtual EventStorage::DWError putData(unsigned int dataSize, const void *data)=0
Write a single block of data.
virtual bool good() const =0
Feedback to user, check if open and last write went OK.
virtual ~ByteStreamDataWriter()=default
ByteStreamDataWriter & operator=(const ByteStreamDataWriter &)=delete
Class containing parameters needed to initiate DataWriter.
unsigned int maxFileMB
Max size of a file in MB. The file is closed before this limit is overrun.
EventStorage::run_parameters_record rPar
Other parameters from IS including the run number.
std::string streamName
stream name for use with simple file name
std::string writingPath
Directory where to write data.
int version
Writer version to instantiate, 0 for most current version.
boost::shared_ptr< EventStorage::FileNameCallback > theFNCB
callback method for generating file names
unsigned int lumiBlockNumber
luminosity block number for use with simple file name
std::string stream
not sure for use with simple file name
unsigned int startIndex
Initial file sequence index.
std::string fileNameCore
File name not including the ending "._NNNN.data".
EventStorage::CompressionType compression
Compression type.
std::string applicationName
application name for use with simple file name
std::vector< std::string > fmdStrings
Optional vector of strings containing metadata.
std::string streamType
stream type for use with simple file name
unsigned int compLevel
Compression level.
unsigned int maxFileNE
Max size of a file in number of data blocks (or events)
std::string project
project name for use with simple file name