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 
19 public:
20  explicit RawEventFileWriterForBU(edm::ParameterSet const& ps);
23 
24  void doOutputEvent(FRDEventMsgView const& msg);
25  void doOutputEvent(boost::shared_array<unsigned char>& msg){};
26  void doOutputEventFragment(unsigned char* dataPtr, unsigned long dataSize);
27  //void doFlushFile();
28  uint32 adler32() const { return (adlerb_ << 16) | adlera_; }
29 
30  void start() {}
31  void stop();
32  void initialize(std::string const& destinationDir, std::string const& name, int ls);
33  void endOfLS(int ls);
34  bool sharedMode() const { return false; }
35  void makeRunPrefix(std::string const& destinationDir);
36 
37 private:
38  bool closefd() {
39  if (outfd_ >= 0) {
40  close(outfd_);
41  outfd_ = -1;
42  return true;
43  } else
44  return false;
45  }
46  void finishFileWrite(int ls);
47  void writeJsds();
48  int outfd_ = -1;
49 
50  int run_ = -1;
52 
57 
63 
66 
70 
74  bool writtenJSDs_ = false;
75 
76  std::unique_ptr<std::ofstream> ost_;
79 
81  unsigned int frdFileVersion_;
82 
85 
86  unsigned int lumiOpen_ = 0;
87  unsigned int lumiClosed_ = 0;
88 };
89 #endif
RawEventFileWriterForBU
Definition: RawEventFileWriterForBU.h:18
eostools.ls
def ls(path, rec=False)
Definition: eostools.py:349
RawEventFileWriterForBU::writtenJSDs_
bool writtenJSDs_
Definition: RawEventFileWriterForBU.h:74
RawEventFileWriterForBU::runPrefix_
std::string runPrefix_
Definition: RawEventFileWriterForBU.h:51
RawEventFileWriterForBU::perFileEventCount_
jsoncollector::IntJ perFileEventCount_
Definition: RawEventFileWriterForBU.h:64
RawEventFileWriterForBU::eolJsonDef_
jsoncollector::DataPointDefinition eolJsonDef_
Definition: RawEventFileWriterForBU.h:72
RawEventFileWriterForBU::initialize
void initialize(std::string const &destinationDir, std::string const &name, int ls)
Definition: RawEventFileWriterForBU.cc:116
RawEventFileWriterForBU::perRunLastLumi_
jsoncollector::IntJ perRunLastLumi_
Definition: RawEventFileWriterForBU.h:56
FRDEventMsgView
Definition: FRDEventMessage.h:107
RawEventFileWriterForBU::adlera_
uint32 adlera_
Definition: RawEventFileWriterForBU.h:83
RawEventFileWriterForBU::microSleep_
int microSleep_
Definition: RawEventFileWriterForBU.h:80
RawEventFileWriterForBU::adler32
uint32 adler32() const
Definition: RawEventFileWriterForBU.h:28
RawEventFileWriterForBU::eorJsonDef_
jsoncollector::DataPointDefinition eorJsonDef_
Definition: RawEventFileWriterForBU.h:73
RawEventFileWriterForBU::fileName_
std::string fileName_
Definition: RawEventFileWriterForBU.h:77
RawEventFileWriterForBU::perLumiLostEventCount_
jsoncollector::IntJ perLumiLostEventCount_
Definition: RawEventFileWriterForBU.h:61
RawEventFileWriterForBU::ost_
std::unique_ptr< std::ofstream > ost_
Definition: RawEventFileWriterForBU.h:76
RawEventFileWriterForBU::perRunLumiCount_
jsoncollector::IntJ perRunLumiCount_
Definition: RawEventFileWriterForBU.h:55
RawEventFileWriterForBU::perLumiFileCount_
jsoncollector::IntJ perLumiFileCount_
Definition: RawEventFileWriterForBU.h:59
RawEventFileWriterForBU::start
void start()
Definition: RawEventFileWriterForBU.h:30
RawEventFileWriterForBU::perRunEventCount_
jsoncollector::IntJ perRunEventCount_
Definition: RawEventFileWriterForBU.h:53
mps_check.msg
tuple msg
Definition: mps_check.py:285
FRDEventMessage.h
RawEventFileWriterForBU::doOutputEventFragment
void doOutputEventFragment(unsigned char *dataPtr, unsigned long dataSize)
Definition: RawEventFileWriterForBU.cc:110
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
uint32
unsigned int uint32
Definition: MsgTools.h:13
RawEventFileWriterForBU::lumiOpen_
unsigned int lumiOpen_
Definition: RawEventFileWriterForBU.h:86
RawEventFileWriterForBU::~RawEventFileWriterForBU
~RawEventFileWriterForBU()
Definition: RawEventFileWriterForBU.cc:87
RawEventFileWriterForBU::stop
void stop()
Definition: RawEventFileWriterForBU.cc:293
RawEventFileWriterForBU::adlerb_
uint32 adlerb_
Definition: RawEventFileWriterForBU.h:84
RawEventFileWriterForBU::doOutputEvent
void doOutputEvent(boost::shared_array< unsigned char > &msg)
Definition: RawEventFileWriterForBU.h:25
RawEventFileWriterForBU::perLumiEventCount_
jsoncollector::IntJ perLumiEventCount_
Definition: RawEventFileWriterForBU.h:58
RawEventFileWriterForBU::perLumiSize_
jsoncollector::IntJ perLumiSize_
Definition: RawEventFileWriterForBU.h:62
RawEventFileWriterForBU::frdFileVersion_
unsigned int frdFileVersion_
Definition: RawEventFileWriterForBU.h:81
RawEventFileWriterForBU::lumiClosed_
unsigned int lumiClosed_
Definition: RawEventFileWriterForBU.h:87
RawEventFileWriterForBU::runMon_
jsoncollector::FastMonitor * runMon_
Definition: RawEventFileWriterForBU.h:69
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RawEventFileWriterForBU::closefd
bool closefd()
Definition: RawEventFileWriterForBU.h:38
RawEventFileWriterForBU::perRunFileCount_
jsoncollector::IntJ perRunFileCount_
Definition: RawEventFileWriterForBU.h:54
RawEventFileWriterForBU::writeJsds
void writeJsds()
Definition: RawEventFileWriterForBU.cc:185
edm::ParameterSet
Definition: ParameterSet.h:36
RawEventFileWriterForBU::finishFileWrite
void finishFileWrite(int ls)
Definition: RawEventFileWriterForBU.cc:218
RawEventFileWriterForBU::outfd_
int outfd_
Definition: RawEventFileWriterForBU.h:48
RawEventFileWriterForBU::rawJsonDef_
jsoncollector::DataPointDefinition rawJsonDef_
Definition: RawEventFileWriterForBU.h:71
RawEventFileWriterForBU::sharedMode
bool sharedMode() const
Definition: RawEventFileWriterForBU.h:34
RawEventFileWriterForBU::RawEventFileWriterForBU
RawEventFileWriterForBU(edm::ParameterSet const &ps)
Definition: RawEventFileWriterForBU.cc:26
jsoncollector::FastMonitor
Definition: FastMonitor.h:19
jsoncollector::DataPointDefinition
Definition: DataPointDefinition.h:20
RawEventFileWriterForBU::run_
int run_
Definition: RawEventFileWriterForBU.h:50
RawEventFileWriterForBU::perLumiTotalEventCount_
jsoncollector::IntJ perLumiTotalEventCount_
Definition: RawEventFileWriterForBU.h:60
RawEventFileWriterForBU::perFileSize_
jsoncollector::IntJ perFileSize_
Definition: RawEventFileWriterForBU.h:65
RawEventFileWriterForBU::destinationDir_
std::string destinationDir_
Definition: RawEventFileWriterForBU.h:78
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
jsoncollector::IntJ
Definition: JsonMonitorable.h:66
ParameterSet.h
RawEventFileWriterForBU::makeRunPrefix
void makeRunPrefix(std::string const &destinationDir)
Definition: RawEventFileWriterForBU.cc:308
FastMonitor.h
RawEventFileWriterForBU::fileMon_
jsoncollector::FastMonitor * fileMon_
Definition: RawEventFileWriterForBU.h:67
RawEventFileWriterForBU::endOfLS
void endOfLS(int ls)
Definition: RawEventFileWriterForBU.cc:260
RawEventFileWriterForBU::doOutputEvent
void doOutputEvent(FRDEventMsgView const &msg)
Definition: RawEventFileWriterForBU.cc:93
RawEventFileWriterForBU::lumiMon_
jsoncollector::FastMonitor * lumiMon_
Definition: RawEventFileWriterForBU.h:68