Skip to content
Snippets Groups Projects
Commit 88f30d2b authored by RoccoA97's avatar RoccoA97
Browse files

Fixing fields of EoLS and EoR json files

parent 40d5e47e
No related branches found
No related tags found
1 merge request!98Reduce wait time for writing the EoR file
Pipeline #7160549 failed
...@@ -50,6 +50,7 @@ int OutputFileHandler::GetCurrentRunNumber() const { return current_run_number_; ...@@ -50,6 +50,7 @@ int OutputFileHandler::GetCurrentRunNumber() const { return current_run_number_;
void OutputFileHandler::UpdateRunInfo(uint32_t run, uint32_t index) { void OutputFileHandler::UpdateRunInfo(uint32_t run, uint32_t index) {
if (current_run_number_ != static_cast<int>(run)) { if (current_run_number_ != static_cast<int>(run)) {
run_NOrbits_ = 0; run_NOrbits_ = 0;
run_NFiles_ = 0;
LOG(TRACE) << "Previous run: " << current_run_number_ << " | New run: " << run; LOG(TRACE) << "Previous run: " << current_run_number_ << " | New run: " << run;
} }
...@@ -186,6 +187,7 @@ void OutputFileHandler::close_and_rename::operator()() const { ...@@ -186,6 +187,7 @@ void OutputFileHandler::close_and_rename::operator()() const {
// TODO: new counters logic here to be tested // TODO: new counters logic here to be tested
outputfilehandler_->updateLumisectionFileSize(outputFile.getFileSize()); outputfilehandler_->updateLumisectionFileSize(outputFile.getFileSize());
outputfilehandler_->updateLumisectionNOrbits(outputFile.getNOrbits()); outputfilehandler_->updateLumisectionNOrbits(outputFile.getNOrbits());
outputfilehandler_->updateLumisectionNFiles(1);
if (outputFile.Index() == outputfilehandler_->max_index_per_ls_ && if (outputFile.Index() == outputfilehandler_->max_index_per_ls_ &&
outputfilehandler_->getCMSSWHeaders() && outputfilehandler_->isMainPipeline()) { // end of lumisection outputfilehandler_->getCMSSWHeaders() && outputfilehandler_->isMainPipeline()) { // end of lumisection
...@@ -209,8 +211,8 @@ void OutputFileHandler::write_EoLS_file(uint32_t ls) { ...@@ -209,8 +211,8 @@ void OutputFileHandler::write_EoLS_file(uint32_t ls) {
// TODO: To me it looks like there are more fields than intended in this file... // TODO: To me it looks like there are more fields than intended in this file...
EoLS_file_string_stream << "{\n \"data\":[\"" << ls_NOrbits_ << "\",\"" // NEvents EoLS_file_string_stream << "{\n \"data\":[\"" << ls_NOrbits_ << "\",\"" // NEvents
<< 1 + max_index_per_ls_ << "\",\"" // NFiles << ls_NFiles_ << "\",\"" // NFiles
<< constants::N_orbits_per_lumisection << "\"," // Total Events << ls_NOrbits_ << "\"," // Total Events
<< "\"0\",\"" // NLost Events << "\"0\",\"" // NLost Events
<< ls_file_size_ << "\"],\n \"definition\":\"" // NBytes << ls_file_size_ << "\"],\n \"definition\":\"" // NBytes
<< "/fff/ramdisk/run" << std::setfill('0') << std::setw(6) << "/fff/ramdisk/run" << std::setfill('0') << std::setw(6)
...@@ -218,7 +220,9 @@ void OutputFileHandler::write_EoLS_file(uint32_t ls) { ...@@ -218,7 +220,9 @@ void OutputFileHandler::write_EoLS_file(uint32_t ls) {
ls_file_size_ = 0; ls_file_size_ = 0;
run_NOrbits_ += ls_NOrbits_; run_NOrbits_ += ls_NOrbits_;
run_NFiles_ += ls_NFiles_;
ls_NOrbits_ = 0; ls_NOrbits_ = 0;
ls_NFiles_ = 0;
EoLS_file << EoLS_file_string_stream.str(); EoLS_file << EoLS_file_string_stream.str();
EoLS_file.close(); EoLS_file.close();
} }
...@@ -236,11 +240,9 @@ void OutputFileHandler::write_EoR_file() { ...@@ -236,11 +240,9 @@ void OutputFileHandler::write_EoR_file() {
EoR_file.open(EoR_filename.str().c_str(), std::ios_base::out); EoR_file.open(EoR_filename.str().c_str(), std::ios_base::out);
std::stringstream EoR_file_string_stream; std::stringstream EoR_file_string_stream;
EoR_file_string_stream << "{\n \"data\":[\"" << run_NOrbits_ // NEvents EoR_file_string_stream << "{\n \"data\":[\"" << run_NOrbits_ // NEvents
<< "\",\"" << "\",\"" << run_NFiles_ // NFiles
<< (ls * static_cast<int>(max_index_per_ls_ + 1)) + << "\",\"" << ls << "\",\"" // NLumis
(nOrbitsPerFile_ * current_index_) // NFiles << ls << "\"],\n \"definition\":\"" // LastLumi
<< "\",\"" << ls << "\",\"" // NLumis
<< ls << "\"],\n \"definition\":\"" // LastLumi
<< "/fff/ramdisk/run" << std::setfill('0') << std::setw(6) << "/fff/ramdisk/run" << std::setfill('0') << std::setw(6)
<< current_run_number_ << "/jsd/EoR.jsd\",\n \"source\":\"l1scout\"\n}"; << current_run_number_ << "/jsd/EoR.jsd\",\n \"source\":\"l1scout\"\n}";
EoR_file << EoR_file_string_stream.str(); EoR_file << EoR_file_string_stream.str();
......
...@@ -36,7 +36,9 @@ class OutputFileHandler { ...@@ -36,7 +36,9 @@ class OutputFileHandler {
file_size_(0), file_size_(0),
NOrbits_(0), NOrbits_(0),
ls_NOrbits_(0), ls_NOrbits_(0),
run_NOrbits_(0) { ls_NFiles_(0),
run_NOrbits_(0),
run_NFiles_(0) {
close_and_rename_.SetOutputFileHandlerObj(*this); close_and_rename_.SetOutputFileHandlerObj(*this);
t = std::thread(close_and_rename_); t = std::thread(close_and_rename_);
if (cmsswHeaders_) { if (cmsswHeaders_) {
...@@ -117,11 +119,14 @@ class OutputFileHandler { ...@@ -117,11 +119,14 @@ class OutputFileHandler {
size_t getLumisectionFileSize() { return ls_file_size_; } size_t getLumisectionFileSize() { return ls_file_size_; }
uint32_t getLumisectionNOrbits() { return ls_NOrbits_; } uint32_t getLumisectionNOrbits() { return ls_NOrbits_; }
uint32_t getLumisectionNFiles() { return ls_NFiles_; }
uint32_t getRunNOrbits() { return run_NOrbits_; } uint32_t getRunNOrbits() { return run_NOrbits_; }
void updateLumisectionFileSize(size_t file_size) { ls_file_size_ += file_size; } void updateLumisectionFileSize(size_t file_size) { ls_file_size_ += file_size; }
void updateLumisectionNOrbits(uint32_t NOrbits) { ls_NOrbits_ += NOrbits; } void updateLumisectionNOrbits(uint32_t NOrbits) { ls_NOrbits_ += NOrbits; }
void updateLumisectionNFiles(uint32_t NFiles) { ls_NFiles_ += NFiles; }
void updateRunNOrbits(uint32_t NOrbits) { run_NOrbits_ += NOrbits; } void updateRunNOrbits(uint32_t NOrbits) { run_NOrbits_ += NOrbits; }
void updateRunNFiles(uint32_t NFiles) { run_NFiles_ += NFiles; }
std::string base_path_; std::string base_path_;
std::string run_dir_; std::string run_dir_;
...@@ -142,7 +147,9 @@ class OutputFileHandler { ...@@ -142,7 +147,9 @@ class OutputFileHandler {
size_t file_size_{}; size_t file_size_{};
uint32_t NOrbits_{}; uint32_t NOrbits_{};
uint32_t ls_NOrbits_{}; uint32_t ls_NOrbits_{};
uint32_t ls_NFiles_{};
uint32_t run_NOrbits_{}; uint32_t run_NOrbits_{};
uint32_t run_NFiles_{};
}; };
#endif #endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment