Implementation of ByteStreamDataWriter for version 5 (run1) of EventStorage.
More...
#include <ByteStreamDataWriterV5.h>
|
| | ByteStreamDataWriterV5 (const std::string &writingPath, const std::string &fileNameCore, const EventStorage::run_parameters_record &rPar, const std::vector< std::string > &fmdStrings, unsigned int maxFileNE, unsigned int maxFileMB, unsigned int startIndex, EventStorage::CompressionType compression, unsigned int compLevel) |
| | ByteStreamDataWriterV5 (const std::string &writingPath, boost::shared_ptr< EventStorage::FileNameCallback > theFNCB, const EventStorage::run_parameters_record &rPar, const std::string &project, const std::string &streamType, const std::string &streamName, const std::string &stream, unsigned int lumiBlockNumber, const std::string &applicationName, const std::vector< std::string > &fmdStrings, unsigned int maxFileNE, unsigned int maxFileMB, EventStorage::CompressionType compression, unsigned int compLevel) |
| virtual | ~ByteStreamDataWriterV5 () |
| | ByteStreamDataWriterV5 (const ByteStreamDataWriterV5 &)=delete |
| ByteStreamDataWriterV5 & | operator= (const ByteStreamDataWriterV5 &)=delete |
| virtual EventStorage::DWError | putData (unsigned int dataSize, const void *data) override |
| | Write a single block of data.
|
| virtual bool | good () const override |
| | Feedback to user, check if open and last write went OK.
|
|
| 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.
|
| static std::unique_ptr< ByteStreamDataWriter > | makeWriter (int version, const std::string &writingPath, boost::shared_ptr< EventStorage::FileNameCallback > theFNCB, const EventStorage::run_parameters_record &rPar, const std::string &project, const std::string &streamType, const std::string &streamName, const std::string &stream, unsigned int lumiBlockNumber, const std::string &applicationName, const std::vector< std::string > &fmdStrings, unsigned int maxFileNE=0, unsigned int maxFileMB=0, EventStorage::CompressionType compression=EventStorage::NONE, unsigned int compLevel=1) |
| | Factory method returning data writer instance for specified version.
|
| static std::unique_ptr< ByteStreamDataWriter > | makeWriter (const DataWriterParameters ¶meters) |
| | Factory method returning data writer instance for specified version.
|
◆ ByteStreamDataWriterV5() [1/3]
| ByteStreamDataWriterV5::ByteStreamDataWriterV5 |
( |
const std::string & | writingPath, |
|
|
const std::string & | fileNameCore, |
|
|
const EventStorage::run_parameters_record & | rPar, |
|
|
const std::vector< std::string > & | fmdStrings, |
|
|
unsigned int | maxFileNE, |
|
|
unsigned int | maxFileMB, |
|
|
unsigned int | startIndex, |
|
|
EventStorage::CompressionType | compression, |
|
|
unsigned int | compLevel ) |
Definition at line 34 of file ByteStreamDataWriterV5.cxx.
43{
44
45 offline_EventStorage_v5::run_parameters_record rPar_v5 = ::runPram_to_v5(rPar);
46
47
50
51 m_writer.reset(
new offline_EventStorage_v5::DataWriter(writingPath,
52 fileNameCore,
53 rPar_v5,
54 fmdStrings,
55 startIndex,
56 compression_v5,
57 compLevel));
60}
std::unique_ptr< offline_EventStorage_v5::DataWriter > m_writer
◆ ByteStreamDataWriterV5() [2/3]
| ByteStreamDataWriterV5::ByteStreamDataWriterV5 |
( |
const std::string & | writingPath, |
|
|
boost::shared_ptr< EventStorage::FileNameCallback > | theFNCB, |
|
|
const EventStorage::run_parameters_record & | rPar, |
|
|
const std::string & | project, |
|
|
const std::string & | streamType, |
|
|
const std::string & | streamName, |
|
|
const std::string & | stream, |
|
|
unsigned int | lumiBlockNumber, |
|
|
const std::string & | applicationName, |
|
|
const std::vector< std::string > & | fmdStrings, |
|
|
unsigned int | maxFileNE, |
|
|
unsigned int | maxFileMB, |
|
|
EventStorage::CompressionType | compression, |
|
|
unsigned int | compLevel ) |
Definition at line 62 of file ByteStreamDataWriterV5.cxx.
76{
77
78 offline_EventStorage_v5::run_parameters_record rPar_v5 = ::runPram_to_v5(rPar);
79
80
83
84 m_writer.reset(
new offline_EventStorage_v5::DataWriter(writingPath,
85 theFNCB,
86 rPar_v5,
88 streamType,
89 streamName,
90 stream,
91 lumiBlockNumber,
92 applicationName,
93 fmdStrings,
94 compression_v5,
95 compLevel));
98}
T_ResultType project(ParameterMapping::type< N > parameter_map, const T_Matrix &matrix)
◆ ~ByteStreamDataWriterV5()
| ByteStreamDataWriterV5::~ByteStreamDataWriterV5 |
( |
| ) |
|
|
virtual |
◆ ByteStreamDataWriterV5() [3/3]
◆ good()
| bool ByteStreamDataWriterV5::good |
( |
| ) |
const |
|
overridevirtual |
◆ makeWriter() [1/3]
Factory method returning data writer instance for specified version.
Throws exception in case of problems, never returns zero pointer.
- Parameters
-
| parameters | set of parameters needed to initiate DataWriter |
- Exceptions
-
| std::exception | (or sub-class) is thrown in case of problems. |
Definition at line 170 of file ByteStreamDataWriter.cxx.
170 {
171
184
185
202}
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.
◆ makeWriter() [2/3]
| std::unique_ptr< ByteStreamDataWriter > ByteStreamDataWriter::makeWriter |
( |
int | version, |
|
|
const std::string & | writingPath, |
|
|
boost::shared_ptr< EventStorage::FileNameCallback > | theFNCB, |
|
|
const EventStorage::run_parameters_record & | rPar, |
|
|
const std::string & | project, |
|
|
const std::string & | streamType, |
|
|
const std::string & | streamName, |
|
|
const std::string & | stream, |
|
|
unsigned int | lumiBlockNumber, |
|
|
const std::string & | applicationName, |
|
|
const std::vector< std::string > & | fmdStrings, |
|
|
unsigned int | maxFileNE = 0, |
|
|
unsigned int | maxFileMB = 0, |
|
|
EventStorage::CompressionType | compression = EventStorage::NONE, |
|
|
unsigned int | compLevel = 1 ) |
|
staticinherited |
Factory method returning data writer instance for specified version.
Throws exception in case of problems, never returns zero pointer.
- Parameters
-
| version | writer version to instantiate, 0 for most current version, other supported values: 5 for run1-compatible output. Exception is thrown is version is not supported. |
| writingPath | directory where to write data |
| theFNCB | callback method for generating file names |
| rPar | other parameters from IS including the run number |
| fmdStrings | optional vector of strings containing metadata |
| maxFileNE | max size of a file in number of data blocks (or events) |
| maxFileMB | max size of a file in MB. The file is closed before this limit is overrun. |
| startIndex | initial file sequence index |
| compression | Compression type |
| compLevel | Compression level |
- Exceptions
-
| std::exception | (or sub-class) is thrown in case of problems. |
Definition at line 112 of file ByteStreamDataWriter.cxx.
127{
129 if (version == 0 or version == FILE_FORMAT_VERSION) {
130
131 res =
new ByteStreamDataWriterCurrent(writingPath,
132 theFNCB,
133 rPar,
135 streamType,
136 streamName,
137 stream,
138 lumiBlockNumber,
139 applicationName,
140 fmdStrings,
141 maxFileNE,
142 maxFileMB,
143 compression,
144 compLevel);
145 } else if (version == 5) {
146
147 res =
new ByteStreamDataWriterV5(writingPath,
148 theFNCB,
149 rPar,
151 streamType,
152 streamName,
153 stream,
154 lumiBlockNumber,
155 applicationName,
156 fmdStrings,
157 maxFileNE,
158 maxFileMB,
159 compression,
160 compLevel);
161 } else {
162
163 versionException(version);
164 }
165
166 return std::unique_ptr<ByteStreamDataWriter>(
res);
167}
std::pair< std::vector< unsigned int >, bool > res
◆ makeWriter() [3/3]
| std::unique_ptr< ByteStreamDataWriter > 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 ) |
|
staticinherited |
Factory method returning data writer instance for specified version.
Throws exception in case of problems, never returns zero pointer.
- Parameters
-
| version | writer version to instantiate, 0 for most current version, other supported values: 5 for run1-compatible output. Exception is thrown if version is not supported. |
| writingPath | directory where to write data |
| fileNameCore | file name not including the ending "._NNNN.data" |
| rPar | other parameters from IS including the run number |
| fmdStrings | optional vector of strings containing metadata |
| maxFileNE | max size of a file in number of data blocks (or events) |
| maxFileMB | max size of a file in MB. The file is closed before this limit is overrun. |
| startIndex | initial file sequence index |
| compression | Compression type |
| compLevel | Compression level |
- Exceptions
-
| std::exception | (or sub-class) is thrown in case of problems. |
Definition at line 69 of file ByteStreamDataWriter.cxx.
79{
81 if (version == 0 or version == FILE_FORMAT_VERSION) {
82
83 res =
new ByteStreamDataWriterCurrent(writingPath,
84 fileNameCore,
85 rPar,
86 fmdStrings,
87 maxFileNE,
88 maxFileMB,
89 startIndex,
90 compression,
91 compLevel);
92 } else if (version == 5) {
93
94 res =
new ByteStreamDataWriterV5(writingPath,
95 fileNameCore,
96 rPar,
97 fmdStrings,
98 maxFileNE,
99 maxFileMB,
100 startIndex,
101 compression,
102 compLevel);
103 } else {
104
105 versionException(version);
106 }
107
108 return std::unique_ptr<ByteStreamDataWriter>(
res);
109}
◆ operator=()
◆ putData()
| EventStorage::DWError ByteStreamDataWriterV5::putData |
( |
unsigned int | dataSize, |
|
|
const void * | data ) |
|
overridevirtual |
Write a single block of data.
If one of the size limits would be exceeded, the current file will be closed and another one will be opened automatically.
- Parameters
-
| dataSize | size of the data block in bytes |
| data | start of the event data in memory |
Implements ByteStreamDataWriter.
Definition at line 105 of file ByteStreamDataWriterV5.cxx.
106{
108}
char data[hepevt_bytes_allocation_ATLAS]
◆ m_writer
The documentation for this class was generated from the following files: