CMS 3D CMS Logo

RawEventFileWriterForBU.h
Go to the documentation of this file.
1 #ifndef EVFRAWEVENTFILEWRITERFORBU
2 #define EVFRAWEVENTFILEWRITERFORBU
3 
4 // C++ headers
5 #include <cstdio>
6 #include <fstream>
7 #include <memory>
8 #include <vector>
9 
10 // system headers
11 #include <sys/stat.h>
12 #include <sys/types.h>
13 #include <unistd.h>
14 
15 // CMSSW headers
20 
22 public:
23  explicit RawEventFileWriterForBU(edm::ParameterSet const& ps);
26 
28 
29  edm::streamer::uint32 adler32() const { return (adlerb_ << 16) | adlera_; }
30 
31  void start() {}
32  void stop();
33  void initialize(std::string const& destinationDir, std::string const& name, int ls);
34  void endOfLS(int ls);
35  void makeRunPrefix(std::string const& destinationDir);
36 
38 
39 private:
40  bool closefd() {
41  if (outfd_ >= 0) {
42  close(outfd_);
43  outfd_ = -1;
44  return true;
45  } else
46  return false;
47  }
48  void finishFileWrite(int ls);
49  void writeJsds();
50  int outfd_ = -1;
51 
52  int run_ = -1;
54 
59 
65 
68 
72 
76  bool writtenJSDs_ = false;
77 
78  std::unique_ptr<std::ofstream> ost_;
81 
83  unsigned int frdFileVersion_;
84 
87 
88  unsigned int lumiOpen_ = 0;
89  unsigned int lumiClosed_ = 0;
90 };
91 #endif
jsoncollector::FastMonitor * fileMon_
void initialize(std::string const &destinationDir, std::string const &name, int ls)
jsoncollector::IntJ perLumiLostEventCount_
edm::streamer::uint32 adlera_
std::unique_ptr< std::ofstream > ost_
jsoncollector::IntJ perFileEventCount_
jsoncollector::DataPointDefinition eolJsonDef_
jsoncollector::IntJ perRunLumiCount_
jsoncollector::IntJ perRunLastLumi_
jsoncollector::DataPointDefinition eorJsonDef_
jsoncollector::IntJ perLumiFileCount_
jsoncollector::IntJ perRunEventCount_
void doOutputEvent(edm::streamer::FRDEventMsgView const &msg)
edm::streamer::uint32 adlerb_
jsoncollector::IntJ perLumiEventCount_
jsoncollector::IntJ perLumiSize_
jsoncollector::FastMonitor * runMon_
jsoncollector::IntJ perRunFileCount_
static void extendDescription(edm::ParameterSetDescription &desc)
RawEventFileWriterForBU(edm::ParameterSet const &ps)
jsoncollector::DataPointDefinition rawJsonDef_
tuple msg
Definition: mps_check.py:286
jsoncollector::IntJ perLumiTotalEventCount_
jsoncollector::IntJ perFileSize_
edm::streamer::uint32 adler32() const
unsigned int uint32
Definition: MsgTools.h:14
void makeRunPrefix(std::string const &destinationDir)
jsoncollector::FastMonitor * lumiMon_