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 
27  void doOutputEvent(FRDEventMsgView const& msg);
28 
29  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
RawEventFileWriterForBU
Definition: RawEventFileWriterForBU.h:21
eostools.ls
def ls(path, rec=False)
Definition: eostools.py:349
RawEventFileWriterForBU::writtenJSDs_
bool writtenJSDs_
Definition: RawEventFileWriterForBU.h:76
RawEventFileWriterForBU::runPrefix_
std::string runPrefix_
Definition: RawEventFileWriterForBU.h:53
RawEventFileWriterForBU::perFileEventCount_
jsoncollector::IntJ perFileEventCount_
Definition: RawEventFileWriterForBU.h:66
RawEventFileWriterForBU::eolJsonDef_
jsoncollector::DataPointDefinition eolJsonDef_
Definition: RawEventFileWriterForBU.h:74
RawEventFileWriterForBU::initialize
void initialize(std::string const &destinationDir, std::string const &name, int ls)
Definition: RawEventFileWriterForBU.cc:104
RawEventFileWriterForBU::perRunLastLumi_
jsoncollector::IntJ perRunLastLumi_
Definition: RawEventFileWriterForBU.h:58
FRDEventMsgView
Definition: FRDEventMessage.h:137
RawEventFileWriterForBU::adlera_
uint32 adlera_
Definition: RawEventFileWriterForBU.h:85
RawEventFileWriterForBU::microSleep_
int microSleep_
Definition: RawEventFileWriterForBU.h:82
RawEventFileWriterForBU::adler32
uint32 adler32() const
Definition: RawEventFileWriterForBU.h:29
RawEventFileWriterForBU::eorJsonDef_
jsoncollector::DataPointDefinition eorJsonDef_
Definition: RawEventFileWriterForBU.h:75
RawEventFileWriterForBU::fileName_
std::string fileName_
Definition: RawEventFileWriterForBU.h:79
RawEventFileWriterForBU::perLumiLostEventCount_
jsoncollector::IntJ perLumiLostEventCount_
Definition: RawEventFileWriterForBU.h:63
RawEventFileWriterForBU::ost_
std::unique_ptr< std::ofstream > ost_
Definition: RawEventFileWriterForBU.h:78
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
RawEventFileWriterForBU::perRunLumiCount_
jsoncollector::IntJ perRunLumiCount_
Definition: RawEventFileWriterForBU.h:57
RawEventFileWriterForBU::perLumiFileCount_
jsoncollector::IntJ perLumiFileCount_
Definition: RawEventFileWriterForBU.h:61
RawEventFileWriterForBU::start
void start()
Definition: RawEventFileWriterForBU.h:31
RawEventFileWriterForBU::perRunEventCount_
jsoncollector::IntJ perRunEventCount_
Definition: RawEventFileWriterForBU.h:55
mps_check.msg
tuple msg
Definition: mps_check.py:285
FRDEventMessage.h
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:88
RawEventFileWriterForBU::~RawEventFileWriterForBU
~RawEventFileWriterForBU()
Definition: RawEventFileWriterForBU.cc:81
RawEventFileWriterForBU::stop
void stop()
Definition: RawEventFileWriterForBU.cc:281
RawEventFileWriterForBU::adlerb_
uint32 adlerb_
Definition: RawEventFileWriterForBU.h:86
RawEventFileWriterForBU::perLumiEventCount_
jsoncollector::IntJ perLumiEventCount_
Definition: RawEventFileWriterForBU.h:60
RawEventFileWriterForBU::perLumiSize_
jsoncollector::IntJ perLumiSize_
Definition: RawEventFileWriterForBU.h:64
RawEventFileWriterForBU::frdFileVersion_
unsigned int frdFileVersion_
Definition: RawEventFileWriterForBU.h:83
ParameterSetDescription.h
RawEventFileWriterForBU::lumiClosed_
unsigned int lumiClosed_
Definition: RawEventFileWriterForBU.h:89
RawEventFileWriterForBU::runMon_
jsoncollector::FastMonitor * runMon_
Definition: RawEventFileWriterForBU.h:71
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RawEventFileWriterForBU::closefd
bool closefd()
Definition: RawEventFileWriterForBU.h:40
RawEventFileWriterForBU::perRunFileCount_
jsoncollector::IntJ perRunFileCount_
Definition: RawEventFileWriterForBU.h:56
RawEventFileWriterForBU::writeJsds
void writeJsds()
Definition: RawEventFileWriterForBU.cc:173
edm::ParameterSet
Definition: ParameterSet.h:47
RawEventFileWriterForBU::finishFileWrite
void finishFileWrite(int ls)
Definition: RawEventFileWriterForBU.cc:206
RawEventFileWriterForBU::outfd_
int outfd_
Definition: RawEventFileWriterForBU.h:50
RawEventFileWriterForBU::rawJsonDef_
jsoncollector::DataPointDefinition rawJsonDef_
Definition: RawEventFileWriterForBU.h:73
RawEventFileWriterForBU::extendDescription
static void extendDescription(edm::ParameterSetDescription &desc)
Definition: RawEventFileWriterForBU.cc:306
RawEventFileWriterForBU::RawEventFileWriterForBU
RawEventFileWriterForBU(edm::ParameterSet const &ps)
Definition: RawEventFileWriterForBU.cc:23
jsoncollector::FastMonitor
Definition: FastMonitor.h:19
jsoncollector::DataPointDefinition
Definition: DataPointDefinition.h:20
RawEventFileWriterForBU::run_
int run_
Definition: RawEventFileWriterForBU.h:52
RawEventFileWriterForBU::perLumiTotalEventCount_
jsoncollector::IntJ perLumiTotalEventCount_
Definition: RawEventFileWriterForBU.h:62
RawEventFileWriterForBU::perFileSize_
jsoncollector::IntJ perFileSize_
Definition: RawEventFileWriterForBU.h:67
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
RawEventFileWriterForBU::destinationDir_
std::string destinationDir_
Definition: RawEventFileWriterForBU.h:80
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:296
FastMonitor.h
RawEventFileWriterForBU::fileMon_
jsoncollector::FastMonitor * fileMon_
Definition: RawEventFileWriterForBU.h:69
RawEventFileWriterForBU::endOfLS
void endOfLS(int ls)
Definition: RawEventFileWriterForBU.cc:248
RawEventFileWriterForBU::doOutputEvent
void doOutputEvent(FRDEventMsgView const &msg)
Definition: RawEventFileWriterForBU.cc:87
RawEventFileWriterForBU::lumiMon_
jsoncollector::FastMonitor * lumiMon_
Definition: RawEventFileWriterForBU.h:70