ATLAS Offline Software
ByteStreamDataWriter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef BYTESTREAMCNVSVC_BYTESTREAMDATAWRITER_H
6 #define BYTESTREAMCNVSVC_BYTESTREAMDATAWRITER_H
7 
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 
42 public:
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>
121 
122 
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 
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
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
DataWriterParameters::streamName
std::string streamName
stream name for use with simple file name
Definition: ByteStreamDataWriter.h:199
DataWriterParameters::stream
std::string stream
not sure for use with simple file name
Definition: ByteStreamDataWriter.h:202
ByteStreamDataWriter::ByteStreamDataWriter
ByteStreamDataWriter()
Definition: ByteStreamDataWriter.h:123
DataWriterParameters::maxFileMB
unsigned int maxFileMB
Max size of a file in MB. The file is closed before this limit is overrun.
Definition: ByteStreamDataWriter.h:178
DataWriterParameters::streamType
std::string streamType
stream type for use with simple file name
Definition: ByteStreamDataWriter.h:196
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
DataWriterParameters::version
int version
Writer version to instantiate, 0 for most current version.
Definition: ByteStreamDataWriter.h:159
ByteStreamDataWriter::good
virtual bool good() const =0
Feedback to user, check if open and last write went OK.
DataWriterParameters::project
std::string project
project name for use with simple file name
Definition: ByteStreamDataWriter.h:193
ByteStreamDataWriter::~ByteStreamDataWriter
virtual ~ByteStreamDataWriter()
Definition: ByteStreamDataWriter.h:124
DataWriterParameters::maxFileNE
unsigned int maxFileNE
Max size of a file in number of data blocks (or events)
Definition: ByteStreamDataWriter.h:175
DataWriterParameters::applicationName
std::string applicationName
application name for use with simple file name
Definition: ByteStreamDataWriter.h:208
DataWriterParameters::writingPath
std::string writingPath
Directory where to write data.
Definition: ByteStreamDataWriter.h:162
DataWriterParameters::fileNameCore
std::string fileNameCore
File name not including the ending "._NNNN.data".
Definition: ByteStreamDataWriter.h:165
DataWriterParameters::lumiBlockNumber
unsigned int lumiBlockNumber
luminosity block number for use with simple file name
Definition: ByteStreamDataWriter.h:205
ByteStreamDataWriter::putData
virtual EventStorage::DWError putData(unsigned int dataSize, const void *data)=0
Write a single block of data.
DataWriterParameters
Class containing parameters needed to initiate DataWriter.
Definition: ByteStreamDataWriter.h:153
DataWriterParameters::theFNCB
boost::shared_ptr< EventStorage::FileNameCallback > theFNCB
callback method for generating file names
Definition: ByteStreamDataWriter.h:190
PayloadHelpers::dataSize
size_t dataSize(TDA::PayloadIterator start)
Size in bytes of the buffer that is needed to decode next fragment data content.
Definition: TriggerEDMDeserialiserAlg.cxx:188
ByteStreamDataWriter::makeWriter
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.
Definition: ByteStreamDataWriter.cxx:69
DataWriterParameters::startIndex
unsigned int startIndex
Initial file sequence index.
Definition: ByteStreamDataWriter.h:181
project
T_ResultType project(ParameterMapping::type< N > parameter_map, const T_Matrix &matrix)
Definition: MeasurementSelector.h:142
get_generator_info.version
version
Definition: get_generator_info.py:33
DataWriterParameters::compLevel
unsigned int compLevel
Compression level.
Definition: ByteStreamDataWriter.h:187
AthenaPoolExample_Copy.streamName
string streamName
Definition: AthenaPoolExample_Copy.py:39
RunTileMonitoring.streamType
streamType
Definition: RunTileMonitoring.py:158
offline_EventStorage_v5::CompressionType
CompressionType
Definition: v5_EventStorageRecords.h:41
ByteStreamDataWriter::operator=
ByteStreamDataWriter & operator=(const ByteStreamDataWriter &)=delete
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
DataWriterParameters::compression
EventStorage::CompressionType compression
Compression type.
Definition: ByteStreamDataWriter.h:184
DataWriterParameters::fmdStrings
std::vector< std::string > fmdStrings
Optional vector of strings containing metadata.
Definition: ByteStreamDataWriter.h:172
python.BeamSpotUpdate.compression
compression
Definition: BeamSpotUpdate.py:188
ByteStreamDataWriter::ByteStreamDataWriter
ByteStreamDataWriter(const ByteStreamDataWriter &)=delete
ByteStreamDataWriter
This class defines abstract interface for data writing.
Definition: ByteStreamDataWriter.h:41
DataWriterParameters::rPar
EventStorage::run_parameters_record rPar
Other parameters from IS including the run number.
Definition: ByteStreamDataWriter.h:168