diff --git a/src/OutputFile.cc b/src/OutputFile.cc index 0e93e9505808cb791d095a5507e5e3d8ecdb0e9c..f4832ac4e655028db2678b80767bf9f882e472e0 100644 --- a/src/OutputFile.cc +++ b/src/OutputFile.cc @@ -37,10 +37,10 @@ void Detail::LumisectionMetadata::AddFileMetadata(FileMetadata&& fmd) { std::string Detail::LumisectionMetadata::MakeFooter(uint32_t run_number) const { std::stringstream footer; footer << "{\n \"data\":[\""; - footer << num_orbits << "\",\""; // NEvents - footer << num_files << "\",\""; // NFiles - footer << num_orbits << "\","; // Total Events - footer << "\"0\",\""; // NLost Events + footer << num_orbits << "\",\""; // NEvents + footer << num_files << "\",\""; // NFiles + footer << num_orbits << "\","; // Total Events + footer << "\"0\",\""; // NLost Events footer << content_size << "\"],"; // NBytes footer << "\n \"definition\":\""; footer << "/fff/ramdisk/" << Detail::FormatRun(run_number); @@ -68,5 +68,4 @@ std::string Detail::RunMetadata::MakeFooter(uint32_t ls_index) const { return footer.str(); } - // namespace Detail diff --git a/src/OutputFile.h b/src/OutputFile.h index 7c36ee2c373268f0fe2146a8d117020da6efa662..0c6334d7207404ef5f6fd7d2b303e797588826c9 100644 --- a/src/OutputFile.h +++ b/src/OutputFile.h @@ -99,7 +99,6 @@ struct RunMetadata { } // namespace Detail - using OutputHandleType = std::variant<FILE*, int>; class Output { @@ -107,7 +106,7 @@ class Output { using HeaderType = FRDFileHeader_v2; Output(Detail::FileMetadata md, Detail::RunMetadata* run_ptr) - : md_(std::move(md)), run_metrics_(run_ptr) {}; + : md_(std::move(md)), run_metrics_(run_ptr){}; Output() = default; ~Output() {} @@ -142,7 +141,6 @@ class Output { virtual bool Close() = 0; virtual bool IsOpen() const = 0; - protected: OutputHandleType handle_; std::optional<HeaderType> header_; @@ -230,12 +228,12 @@ class FileOutput : public Output { private: std::string filename_{}; std::optional<HeaderType> header_; + private: std::string working_path_; std::string destination_path_; }; - class DaxOutput : public Output { public: using HeaderType = FRDFileHeader_v2; diff --git a/src/OutputFileHandler.cc b/src/OutputFileHandler.cc index 7de71f200f55d2d38ee5e97bcaa9578c0a086126..a0d0c0f5ffdab2f66fe0290440cd0b6a1d572b27 100644 --- a/src/OutputFileHandler.cc +++ b/src/OutputFileHandler.cc @@ -70,9 +70,9 @@ int OutputFileHandler::StageSlice(const char *buffer, size_t size_bytes, uint32_ if (is_new_run || is_new_index) { LOG(TRACE) << "Committing file because ... new_run? " << is_new_run << ", new_index? " - << is_new_index << "(context: current_global_index_=" << current_global_index_ - << ", incoming_file_index=" << file_index << ", current_run=" << run_.number - << ", incoming_run=" << run_number << ")"; + << is_new_index << "(context: current_global_index_=" << current_global_index_ + << ", incoming_file_index=" << file_index << ", current_run=" << run_.number + << ", incoming_run=" << run_number << ")"; // Commit current file and start a new one, unless it's the first execution if (current_global_index_ != -1) CommitFile(); UpdateRunInfo(run_number, file_index); @@ -86,7 +86,8 @@ void OutputFileHandler::NewFile() { // Create a new file uint32_t ls_number = ls_->lumisection; uint32_t index_in_lumisection = ls_->GetIndexInLumisection(current_global_index_); - LOG(TRACE) << "opening file with index " << current_global_index_ << ", in lumisection " << ls_number; + LOG(TRACE) << "opening file with index " << current_global_index_ << ", in lumisection " + << ls_number; auto working_path = sink_.GetRootPath() + GetWorkingDir(); outputFile_ = @@ -123,7 +124,8 @@ void OutputFileHandler::CommitRun() { if (ls_) { auto ls_index_footer = ls_->lumisection; if (ls_index_footer != ls_index) { - LOG(WARNING) << "Expected lumisection number " << ls_index << ", but lumisection footer has " << ls_index_footer; + LOG(WARNING) << "Expected lumisection number " << ls_index << ", but lumisection footer has " + << ls_index_footer; assert(ls_index_footer == ls_index); } diff --git a/src/sink.h b/src/sink.h index d862cc2ffb0209137cd85b3c5f45d346b25bb4c7..f9bfccc8ece3600d6196bfc9b00f922842ce58bc 100644 --- a/src/sink.h +++ b/src/sink.h @@ -14,7 +14,7 @@ #include "OutputFile.h" #include "log.h" -template<typename TOutput> +template <typename TOutput> class Sink { public: void ProcessQueue() {