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 using namespace jsoncollector;
20 
22 {
23  public:
24 
25  explicit RawEventFileWriterForBU(edm::ParameterSet const& ps);
28 
29  void doOutputEvent(FRDEventMsgView const& msg);
30  void doOutputEvent(boost::shared_array<unsigned char>& msg) {};
31  void doOutputEventFragment(unsigned char* dataPtr,
32  unsigned long dataSize);
33  //void doFlushFile();
34  uint32 adler32() const { return (adlerb_ << 16) | adlera_; }
35 
36  void start(){}
37  void stop();
38  void initialize(std::string const& destinationDir, std::string const& name, int ls);
39  void endOfLS(int ls);
40  bool sharedMode() const {return false;}
41  void makeRunPrefix(std::string const& destinationDir);
42 
43  void handler(int s);
44  static void staticHandler(int s) { instance->handler(s); }
45 
46  private:
47 
48  bool closefd(){if(outfd_>=0){close(outfd_); outfd_=-1; return true;} else return false;}
49  void finishFileWrite(int ls);
50  void writeJsds();
51  int outfd_ = -1;
52 
53  int run_ = -1;
55 
60 
65 
67 
68  FastMonitor* fileMon_ = nullptr;
69  FastMonitor* lumiMon_ = nullptr;
70  FastMonitor* runMon_ = nullptr;
71 
75  bool writtenJSDs_=false;
76 
77  std::auto_ptr<std::ofstream> ost_;
80 
82 
85 
87 
88  unsigned int lumiOpen_ = 0;
89  unsigned int lumiClosed_ = 0;
90 
91 };
92 #endif
static AlgebraicMatrix initialize()
static PFTauRenderPlugin instance
DataPointDefinition rawJsonDef_
def ls
Definition: eostools.py:346
void doOutputEvent(boost::shared_array< unsigned char > &msg)
DataPointDefinition eorJsonDef_
std::auto_ptr< std::ofstream > ost_
static void staticHandler(int s)
unsigned int uint32
Definition: MsgTools.h:13
static RawEventFileWriterForBU * instance
DataPointDefinition eolJsonDef_