|
ATLAS Offline Software
|
Go to the documentation of this file.
17 #ifndef OFFLINE_EVENTSTORAGE_V5_DATAWRITER_H
18 #define OFFLINE_EVENTSTORAGE_V5_DATAWRITER_H
25 #include <boost/shared_ptr.hpp>
26 #include <boost/utility.hpp>
28 #include "EventStorage/DWError.h"
30 #include "EventStorage/FileNameCallback.h"
31 #include "EventStorage/RawFileName.h"
35 class DataWriterCallBack;
60 const std::string& fileNameCore,
62 const std::vector<std::string>& fmdStrings,
63 const unsigned int startIndex = 1,
65 const unsigned int compLevel = 1);
70 boost::shared_ptr<EventStorage::FileNameCallback> theFNCB,
76 const unsigned int lumiBlockNumber,
77 const std::string& applicationName,
78 const std::vector<std::string>& fmdStrings,
80 const unsigned int compLevel = 1);
83 const std::string& fileNameCore,
89 const unsigned int lumiBlockNumber,
90 const std::string& applicationName,
91 const std::vector<std::string>& fmdStrings,
93 const unsigned int compLevel = 1);
100 void initDW(
const std::string& writingPath,
101 boost::shared_ptr<EventStorage::FileNameCallback> theFNCB,
106 const std::string&
stream,
107 const unsigned int lumiBlockNumber,
108 const std::string& applicationName,
109 const std::vector<std::string>& fmdStrings,
111 const unsigned int compLevel);
117 bool precompressed =
false);
129 EventStorage::DWError
setMaxFileNE(
const unsigned int& maxFileNE);
134 EventStorage::DWError
setMaxFileMB(
const unsigned int& maxFileMB);
150 void cd(
const std::string& writingPath);
206 EventStorage::DWError
putData(
const unsigned int&
entries,
const struct iovec* my_iovec);
292 std::string
getAppName(
const std::string& fileNameCore)
const;
294 const std::string& element)
const;
346 #endif // OFFLINE_EVENTSTORAGE_V5_DATAWRITER_H
std::string nameFile(const FileStatus &fs) const
get the name of the current file
int64_t getPosition() const
get the offset of the latest written event; one should call it AFTER putData(...)
std::string m_applicationName
std::vector< std::string > freeMetaDataStrings
~DataWriter()
destructor, the way to close the sequence of files
file_start_record m_file_start_record
std::string m_nextWritePath
uint64_t getFileSize(const std::string &fileNameCore) const
float getTime(const xAOD::TrackParticle &p)
Accessor utility function for getting the track time.
bool good() const
feedback to user
CompressionType m_compression
bool inTransition() const
The file currently open is not closed immediately after cd() this method will return true if we are i...
file_end_record m_file_end_record
unsigned int dataMB_InFileSequence() const
number of mega bytes written to the file sequence
std::string m_fileNameCore
file_name_strings m_file_name_strings
EventStorage::DWError setMaxFileNE(const unsigned int &maxFileNE)
max size of 1 file in number of data blocks (or events) 1 putData call is one block
bool fileExists(const std::string &name) const
void file_record(void *ri, const void *pi)
unsigned int dataMB_InFile() const
number of mega bytes written to the current file
std::string getElement(const std::string &fileNameCore, const std::string &element) const
EventStorage::DWError closeFile()
Close the currently open file.
EventStorage::DWError nextFile()
close the file and open next one immediately
CompressionType getCompression() const
Returns the compression type for this file.
void initDW(const std::string &writingPath, boost::shared_ptr< EventStorage::FileNameCallback > theFNCB, const run_parameters_record &rPar, const std::string &project, const std::string &streamType, const std::string &streamName, const std::string &stream, const unsigned int lumiBlockNumber, const std::string &applicationName, const std::vector< std::string > &fmdStrings, const CompressionType compression, const unsigned int compLevel)
POOL::TEvent event(POOL::TEvent::kClassAccess)
void date_timeAsInt(uint32_t &getDate, uint32_t &getTime) const
unsigned int eventsInFileSequence() const
number of events written to the file sequence
void setRunParamsRecord(const run_parameters_record &rPar)
void setGuid(const std::string &Guid)
Externally set the GUID for the next file in this sequence.
EventStorage::DWError putData(const unsigned int &dataSize, const void *event)
Write a single block of data.
freeMetaDataStrings m_fmdStrings
std::string getAppName(const std::string &fileNameCore) const
size_t dataSize(TDA::PayloadIterator start)
Size in bytes of the buffer that is needed to decode next fragment data content.
unsigned int m_lumiBlockNumber
DataWriter(const std::string &writingPath, boost::shared_ptr< EventStorage::FileNameCallback > theFNCB, const run_parameters_record &rPar, const std::string &project, const std::string &streamType, const std::string &streamName, const std::string &stream, const unsigned int lumiBlockNumber, const std::string &applicationName, const std::vector< std::string > &fmdStrings, const CompressionType compression=NONE, const unsigned int compLevel=1)
void cd(const std::string &writingPath)
set another writing path
internal_run_parameters_record m_internal_run_parameters_record
T_ResultType project(ParameterMapping::type< N > parameter_map, const T_Matrix &matrix)
DataBuffer * m_compressed
EventStorage::DWError setMaxFileMB(const unsigned int &maxFileMB)
max size of 1 file in MB.
EventStorage::DataWriterCallBack * m_callBack
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
EventStorage::DWError putPrecompressedData(const unsigned int &dataSize, const void *event)
Write a single block of data already compressed.
boost::shared_ptr< EventStorage::FileNameCallback > m_filenamecallback
void setGUID(const std::string &GUID)
Set the GUID for the next file in this sequence.
void registerCallBack(EventStorage::DataWriterCallBack *pUserCBclass)
If you want to define actions to be taken when a file is open or closed register your call-back class...
unsigned int eventsInFile() const
number of events written to the currently open file
EventStorage::DWError putData_implementation(const unsigned int &entries, const iovec_const *my_iovec, uint32_t &sizeToDisk, bool precompressed=false)