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
62 static std::unique_ptr<ByteStreamDataWriter>
63 makeWriter(int version,
64 const std::string& writingPath,
65 const std::string& fileNameCore,
66 const EventStorage::run_parameters_record& rPar,
67 const std::vector<std::string>& fmdStrings,
68 unsigned int maxFileNE = 0,
69 unsigned int maxFileMB = 0,
70 unsigned int startIndex = 1,
71 EventStorage::CompressionType compression = EventStorage::NONE,
72 unsigned int compLevel = 1);
73
92 static std::unique_ptr<ByteStreamDataWriter>
93 makeWriter(int version,
94 const std::string& writingPath,
95 boost::shared_ptr<EventStorage::FileNameCallback> theFNCB,
96 const EventStorage::run_parameters_record& rPar,
97 const std::string& project,
98 const std::string& streamType,
99 const std::string& streamName,
100 const std::string& stream,
101 unsigned int lumiBlockNumber,
102 const std::string& applicationName,
103 const std::vector<std::string>& fmdStrings,
104 unsigned int maxFileNE = 0,
105 unsigned int maxFileMB = 0,
106 EventStorage::CompressionType compression = EventStorage::NONE,
107 unsigned int compLevel = 1);
108
117 static std::unique_ptr<ByteStreamDataWriter>
118 makeWriter(const DataWriterParameters& parameters);
119
120
122 virtual ~ByteStreamDataWriter() = default;
123
124 // abstract class cannot be copied
127
136 virtual EventStorage::DWError putData(unsigned int dataSize, const void *data) = 0;
137
141 virtual bool good() const = 0;
142
143};
144
145
156 int version{0};
157
159 std::string writingPath{""};
160
162 std::string fileNameCore{""};
163
165 EventStorage::run_parameters_record rPar{
166 0, 0, 0, 0, 0, 0, 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, 0, 0 };
167
169 std::vector<std::string> fmdStrings;
170
172 unsigned int maxFileNE{0};
173
175 unsigned int maxFileMB{0};
176
178 unsigned int startIndex{1};
179
181 EventStorage::CompressionType compression{EventStorage::NONE};
182
184 unsigned int compLevel{1};
185
187 boost::shared_ptr<EventStorage::FileNameCallback> theFNCB;
188
190 std::string project{""};
191
193 std::string streamType{""};
194
196 std::string streamName{""};
197
199 std::string stream{""};
200
202 unsigned int lumiBlockNumber{0};
203
205 std::string applicationName{""};
206};
207
208#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