ATLAS Offline Software
Loading...
Searching...
No Matches
ByteStreamDataWriterV5.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <stdexcept>
8
10
11namespace {
12
14runPram_to_v5(const EventStorage::run_parameters_record& rPar)
15{
16 // convert current run_parameters_record to v5
18 rPar.marker,
19 rPar.record_size,
20 rPar.run_number,
21 rPar.max_events,
22 rPar.rec_enable,
23 rPar.trigger_type,
24 rPar.detector_mask_LS, /* v5 detector_mask = v6 detector_mask_LS, detector_mask_MS is lost */
25 rPar.beam_type,
26 rPar.beam_energy
27 };
28 return rPar_v5;
29}
30
31}
32
33
35 const std::string& fileNameCore,
36 const EventStorage::run_parameters_record& rPar,
37 const std::vector<std::string>& fmdStrings,
38 unsigned int maxFileNE,
39 unsigned int maxFileMB,
40 unsigned int startIndex,
41 EventStorage::CompressionType compression,
42 unsigned int compLevel)
43{
44 // convert current run_parameters_record to v5
45 offline_EventStorage_v5::run_parameters_record rPar_v5 = ::runPram_to_v5(rPar);
46
47 // convert compression type
50
52 fileNameCore,
53 rPar_v5,
54 fmdStrings,
55 startIndex,
56 compression_v5,
57 compLevel));
58 m_writer->setMaxFileNE(maxFileNE);
59 m_writer->setMaxFileMB(maxFileMB);
60}
61
63 boost::shared_ptr<EventStorage::FileNameCallback> theFNCB,
64 const EventStorage::run_parameters_record& rPar,
65 const std::string& project,
66 const std::string& streamType,
67 const std::string& streamName,
68 const std::string& stream,
69 unsigned int lumiBlockNumber,
70 const std::string& applicationName,
71 const std::vector<std::string>& fmdStrings,
72 unsigned int maxFileNE,
73 unsigned int maxFileMB,
74 EventStorage::CompressionType compression,
75 unsigned int compLevel)
76{
77 // convert current run_parameters_record to v5
78 offline_EventStorage_v5::run_parameters_record rPar_v5 = ::runPram_to_v5(rPar);
79
80 // convert compression type
83
85 theFNCB,
86 rPar_v5,
87 project,
88 streamType,
89 streamName,
90 stream,
91 lumiBlockNumber,
92 applicationName,
93 fmdStrings,
94 compression_v5,
95 compLevel));
96 m_writer->setMaxFileNE(maxFileNE);
97 m_writer->setMaxFileMB(maxFileMB);
98}
99
103
104EventStorage::DWError
105ByteStreamDataWriterV5::putData(unsigned int dataSize, const void *data)
106{
107 return m_writer->putData(dataSize, data);
108}
109
110bool
112{
113 return m_writer->good();
114}
This file contains the class definition for the ByteStreamDataWriterV5 class.
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
T_ResultType project(ParameterMapping::type< N > parameter_map, const T_Matrix &matrix)
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.
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)
std::unique_ptr< offline_EventStorage_v5::DataWriter > m_writer