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  bool sharedMode() const { return false; }
36  void makeRunPrefix(std::string const& destinationDir);
37 
39 
40 private:
41  bool closefd() {
42  if (outfd_ >= 0) {
43  close(outfd_);
44  outfd_ = -1;
45  return true;
46  } else
47  return false;
48  }
49  void finishFileWrite(int ls);
50  void writeJsds();
51  int outfd_ = -1;
52 
53  int run_ = -1;
55 
60 
66 
69 
73 
77  bool writtenJSDs_ = false;
78 
79  std::unique_ptr<std::ofstream> ost_;
82 
84  unsigned int frdFileVersion_;
85 
88 
89  unsigned int lumiOpen_ = 0;
90  unsigned int lumiClosed_ = 0;
91 };
92 #endif
RawEventFileWriterForBU
Definition: RawEventFileWriterForBU.h:21
eostools.ls
def ls(path, rec=False)
Definition: eostools.py:349
RawEventFileWriterForBU::writtenJSDs_
bool writtenJSDs_
Definition: RawEventFileWriterForBU.h:77
RawEventFileWriterForBU::runPrefix_
std::string runPrefix_
Definition: RawEventFileWriterForBU.h:54
RawEventFileWriterForBU::perFileEventCount_
jsoncollector::IntJ perFileEventCount_
Definition: RawEventFileWriterForBU.h:67
RawEventFileWriterForBU::eolJsonDef_
jsoncollector::DataPointDefinition eolJsonDef_
Definition: RawEventFileWriterForBU.h:75
RawEventFileWriterForBU::initialize
void initialize(std::string const &destinationDir, std::string const &name, int ls)
Definition: RawEventFileWriterForBU.cc:105
RawEventFileWriterForBU::perRunLastLumi_
jsoncollector::IntJ perRunLastLumi_
Definition: RawEventFileWriterForBU.h:59
FRDEventMsgView
Definition: FRDEventMessage.h:137
RawEventFileWriterForBU::adlera_
uint32 adlera_
Definition: RawEventFileWriterForBU.h:86
RawEventFileWriterForBU::microSleep_
int microSleep_
Definition: RawEventFileWriterForBU.h:83
RawEventFileWriterForBU::adler32
uint32 adler32() const
Definition: RawEventFileWriterForBU.h:29
RawEventFileWriterForBU::eorJsonDef_
jsoncollector::DataPointDefinition eorJsonDef_
Definition: RawEventFileWriterForBU.h:76
RawEventFileWriterForBU::fileName_
std::string fileName_
Definition: RawEventFileWriterForBU.h:80
RawEventFileWriterForBU::perLumiLostEventCount_
jsoncollector::IntJ perLumiLostEventCount_
Definition: RawEventFileWriterForBU.h:64
RawEventFileWriterForBU::ost_
std::unique_ptr< std::ofstream > ost_
Definition: RawEventFileWriterForBU.h:79
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
RawEventFileWriterForBU::perRunLumiCount_
jsoncollector::IntJ perRunLumiCount_
Definition: RawEventFileWriterForBU.h:58
RawEventFileWriterForBU::perLumiFileCount_
jsoncollector::IntJ perLumiFileCount_
Definition: RawEventFileWriterForBU.h:62
RawEventFileWriterForBU::start
void start()
Definition: RawEventFileWriterForBU.h:31
RawEventFileWriterForBU::perRunEventCount_
jsoncollector::IntJ perRunEventCount_
Definition: RawEventFileWriterForBU.h:56
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:89
RawEventFileWriterForBU::~RawEventFileWriterForBU
~RawEventFileWriterForBU()
Definition: RawEventFileWriterForBU.cc:82
RawEventFileWriterForBU::stop
void stop()
Definition: RawEventFileWriterForBU.cc:282
RawEventFileWriterForBU::adlerb_
uint32 adlerb_
Definition: RawEventFileWriterForBU.h:87
RawEventFileWriterForBU::perLumiEventCount_
jsoncollector::IntJ perLumiEventCount_
Definition: RawEventFileWriterForBU.h:61
RawEventFileWriterForBU::perLumiSize_
jsoncollector::IntJ perLumiSize_
Definition: RawEventFileWriterForBU.h:65
RawEventFileWriterForBU::frdFileVersion_
unsigned int frdFileVersion_
Definition: RawEventFileWriterForBU.h:84
ParameterSetDescription.h
RawEventFileWriterForBU::lumiClosed_
unsigned int lumiClosed_
Definition: RawEventFileWriterForBU.h:90
RawEventFileWriterForBU::runMon_
jsoncollector::FastMonitor * runMon_
Definition: RawEventFileWriterForBU.h:72
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RawEventFileWriterForBU::closefd
bool closefd()
Definition: RawEventFileWriterForBU.h:41
RawEventFileWriterForBU::perRunFileCount_
jsoncollector::IntJ perRunFileCount_
Definition: RawEventFileWriterForBU.h:57
RawEventFileWriterForBU::writeJsds
void writeJsds()
Definition: RawEventFileWriterForBU.cc:174
edm::ParameterSet
Definition: ParameterSet.h:47
RawEventFileWriterForBU::finishFileWrite
void finishFileWrite(int ls)
Definition: RawEventFileWriterForBU.cc:207
RawEventFileWriterForBU::outfd_
int outfd_
Definition: RawEventFileWriterForBU.h:51
RawEventFileWriterForBU::rawJsonDef_
jsoncollector::DataPointDefinition rawJsonDef_
Definition: RawEventFileWriterForBU.h:74
RawEventFileWriterForBU::sharedMode
bool sharedMode() const
Definition: RawEventFileWriterForBU.h:35
RawEventFileWriterForBU::extendDescription
static void extendDescription(edm::ParameterSetDescription &desc)
Definition: RawEventFileWriterForBU.cc:307
RawEventFileWriterForBU::RawEventFileWriterForBU
RawEventFileWriterForBU(edm::ParameterSet const &ps)
Definition: RawEventFileWriterForBU.cc:24
jsoncollector::FastMonitor
Definition: FastMonitor.h:19
jsoncollector::DataPointDefinition
Definition: DataPointDefinition.h:20
RawEventFileWriterForBU::run_
int run_
Definition: RawEventFileWriterForBU.h:53
RawEventFileWriterForBU::perLumiTotalEventCount_
jsoncollector::IntJ perLumiTotalEventCount_
Definition: RawEventFileWriterForBU.h:63
RawEventFileWriterForBU::perFileSize_
jsoncollector::IntJ perFileSize_
Definition: RawEventFileWriterForBU.h:68
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
RawEventFileWriterForBU::destinationDir_
std::string destinationDir_
Definition: RawEventFileWriterForBU.h:81
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:297
FastMonitor.h
RawEventFileWriterForBU::fileMon_
jsoncollector::FastMonitor * fileMon_
Definition: RawEventFileWriterForBU.h:70
RawEventFileWriterForBU::endOfLS
void endOfLS(int ls)
Definition: RawEventFileWriterForBU.cc:249
RawEventFileWriterForBU::doOutputEvent
void doOutputEvent(FRDEventMsgView const &msg)
Definition: RawEventFileWriterForBU.cc:88
RawEventFileWriterForBU::lumiMon_
jsoncollector::FastMonitor * lumiMon_
Definition: RawEventFileWriterForBU.h:71