CMS 3D CMS Logo

RawEventFileWriterForBU.h
Go to the documentation of this file.
1 #ifndef EVFRAWEVENTFILEWRITERFORBU
2 #define EVFRAWEVENTFILEWRITERFORBU
3 
4 // $Id: RawEventFileWriterForBU.h,v 1.1.2.5 2013/03/28 14:56:53 aspataru Exp $
5 
8 
10 
11 #include <fstream>
12 #include <cstdio>
13 #include <sys/types.h>
14 #include <sys/stat.h>
15 
16 #include "boost/shared_array.hpp"
17 
18 
20 {
21  public:
22 
23  explicit RawEventFileWriterForBU(edm::ParameterSet const& ps);
26 
27  void doOutputEvent(FRDEventMsgView const& msg);
28  void doOutputEvent(boost::shared_array<unsigned char>& msg) {};
29  void doOutputEventFragment(unsigned char* dataPtr,
30  unsigned long dataSize);
31  //void doFlushFile();
32  uint32 adler32() const { return (adlerb_ << 16) | adlera_; }
33 
34  void start(){}
35  void stop();
36  void initialize(std::string const& destinationDir, std::string const& name, int ls);
37  void endOfLS(int ls);
38  bool sharedMode() const {return false;}
39  void makeRunPrefix(std::string const& destinationDir);
40 
41  private:
42 
43  bool closefd(){if(outfd_>=0){close(outfd_); outfd_=-1; return true;} else return false;}
44  void finishFileWrite(int ls);
45  void writeJsds();
46  int outfd_ = -1;
47 
48  int run_ = -1;
50 
55 
61 
62 
65 
69 
73  bool writtenJSDs_=false;
74 
75  std::auto_ptr<std::ofstream> ost_;
78 
80 
83 
84  unsigned int lumiOpen_ = 0;
85  unsigned int lumiClosed_ = 0;
86 
87 };
88 #endif
jsoncollector::FastMonitor * fileMon_
void initialize(std::string const &destinationDir, std::string const &name, int ls)
jsoncollector::IntJ perLumiLostEventCount_
jsoncollector::IntJ perFileEventCount_
jsoncollector::DataPointDefinition eolJsonDef_
jsoncollector::IntJ perRunLumiCount_
jsoncollector::IntJ perRunLastLumi_
jsoncollector::DataPointDefinition eorJsonDef_
jsoncollector::IntJ perLumiFileCount_
jsoncollector::IntJ perRunEventCount_
void doOutputEventFragment(unsigned char *dataPtr, unsigned long dataSize)
void doOutputEvent(boost::shared_array< unsigned char > &msg)
jsoncollector::IntJ perLumiEventCount_
jsoncollector::IntJ perLumiSize_
std::auto_ptr< std::ofstream > ost_
jsoncollector::FastMonitor * runMon_
jsoncollector::IntJ perRunFileCount_
RawEventFileWriterForBU(edm::ParameterSet const &ps)
unsigned int uint32
Definition: MsgTools.h:13
jsoncollector::DataPointDefinition rawJsonDef_
def ls(path, rec=False)
Definition: eostools.py:348
tuple msg
Definition: mps_check.py:277
jsoncollector::IntJ perLumiTotalEventCount_
jsoncollector::IntJ perFileSize_
void makeRunPrefix(std::string const &destinationDir)
void doOutputEvent(FRDEventMsgView const &msg)
jsoncollector::FastMonitor * lumiMon_