File indexing completed on 2025-08-06 08:17:19
0001
0002
0003 #ifndef FUN4ALLRAW_FUN4ALLFILEOUTSTREAM_H
0004 #define FUN4ALLRAW_FUN4ALLFILEOUTSTREAM_H
0005
0006 #include "Fun4AllEventOutStream.h"
0007
0008 #include <Event/phenixTypes.h>
0009
0010 #include <iostream>
0011 #include <string>
0012
0013 class Event;
0014 class oBuffer;
0015
0016 class Fun4AllFileOutStream : public Fun4AllEventOutStream
0017 {
0018 public:
0019 static constexpr unsigned int LENGTH = (4 * 1024 * 1024);
0020 Fun4AllFileOutStream(const std::string &frule = "OUTDATA-%010d-%04d.PRDFF", const std::string &name = "FILEOUTSTREAM");
0021 ~Fun4AllFileOutStream() override;
0022 int WriteEventOut(Event *evt) override;
0023 int CloseOutStream() override;
0024 virtual void identify(std::ostream &os = std::cout) const;
0025 oBuffer *GetoBuffer() { return m_ob; }
0026 void SetoBuffer(oBuffer *bf) { m_ob = bf; }
0027 uint64_t MaxSize() const { return m_MaxSize; }
0028 void DeleteoBuffer();
0029 const std::string &FileRule() const { return m_FileRule; }
0030 int iSeq() const { return m_iSeq; }
0031 void iSeq(const int i) { m_iSeq = i; }
0032 uint64_t BytesWritten() const { return m_BytesWritten; }
0033 void BytesWritten(const uint64_t i) { m_BytesWritten = i; }
0034 int OutFileDescriptor() const { return m_OutFileDesc; }
0035 void OutFileDescriptor(const int i) { m_OutFileDesc = i; }
0036 PHDWORD *xb() { return m_xb; }
0037 void SetNEvents(unsigned int i) { m_nEvents = i; }
0038 unsigned int GetNEvents() const { return m_nEvents; }
0039
0040 private:
0041 std::string m_FileRule;
0042 oBuffer *m_ob{nullptr};
0043 int m_iSeq{0};
0044 PHDWORD m_xb[LENGTH]{};
0045 int m_OutFileDesc{-1};
0046 unsigned int m_nEvents{0};
0047 uint64_t m_BytesWritten{0};
0048 uint64_t m_MaxSize{100000000000LL};
0049 };
0050
0051 #endif