CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 <stdio.h>
13 #include <sys/types.h>
14 #include <sys/stat.h>
15 #include <fcntl.h>
16 
17 #include "boost/shared_array.hpp"
18 
19 
21 {
22  public:
23 
24  explicit RawEventFileWriterForBU(edm::ParameterSet const& ps);
27 
28  void doOutputEvent(FRDEventMsgView const& msg);
29  void doOutputEvent(boost::shared_array<unsigned char>& msg) {};
30  void doOutputEventFragment(unsigned char* dataPtr,
31  unsigned long dataSize);
32  //void doFlushFile();
33  uint32 adler32() const { return (adlerb_ << 16) | adlera_; }
34 
35  void start(){}
36  void stop();
37  void initialize(std::string const& destinationDir, std::string const& name, int ls);
38  void endOfLS(int ls);
39  bool sharedMode() const {return false;}
40  void makeRunPrefix(std::string const& destinationDir);
41 
42  void handler(int s);
43  static void staticHandler(int s) { instance->handler(s); }
44 
45  private:
46 
47  bool closefd(){if(outfd_>=0){close(outfd_); outfd_=-1; return true;} else return false;}
48  void finishFileWrite(int ls);
49  void writeJsds();
50  int outfd_ = -1;
51 
52  int run_ = -1;
54 
59 
65 
66 
69 
73 
77  bool writtenJSDs_=false;
78 
79  std::auto_ptr<std::ofstream> ost_;
82 
84 
87 
89 
90  unsigned int lumiOpen_ = 0;
91  unsigned int lumiClosed_ = 0;
92 
93 };
94 #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)
def ls
Definition: eostools.py:348
void doOutputEvent(boost::shared_array< unsigned char > &msg)
jsoncollector::IntJ perLumiEventCount_
jsoncollector::IntJ perLumiSize_
std::auto_ptr< std::ofstream > ost_
static void staticHandler(int s)
jsoncollector::FastMonitor * runMon_
jsoncollector::IntJ perRunFileCount_
RawEventFileWriterForBU(edm::ParameterSet const &ps)
unsigned int uint32
Definition: MsgTools.h:13
jsoncollector::DataPointDefinition rawJsonDef_
static RawEventFileWriterForBU * instance
jsoncollector::IntJ perLumiTotalEventCount_
jsoncollector::IntJ perFileSize_
void makeRunPrefix(std::string const &destinationDir)
void doOutputEvent(FRDEventMsgView const &msg)
jsoncollector::FastMonitor * lumiMon_