Skip to content

Commit

Permalink
Merge pull request #26518 from Dr15Jones/clangDQMStreamerReader
Browse files Browse the repository at this point in the history
Changed DQMStreamerReader method name to not clash with base class name
  • Loading branch information
cmsbuild committed Apr 25, 2019
2 parents 3b874ac + 527279e commit 8808890
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
30 changes: 15 additions & 15 deletions DQMServices/StreamerIO/plugins/DQMStreamerReader.cc
Expand Up @@ -46,7 +46,7 @@ DQMStreamerReader::~DQMStreamerReader() {
// and closeFile_ throws away no ServiceRegistry found exception...
//
// Normally, this file should be closed before this destructor is called.
//closeFile_("destructor");
//closeFileImp_("destructor");
}

void DQMStreamerReader::reset_() {
Expand Down Expand Up @@ -93,7 +93,7 @@ void DQMStreamerReader::reset_() {
fiterator_.logFileAction("DQMStreamerReader initialised.");
}

void DQMStreamerReader::openFile_(const DQMFileIterator::LumiEntry& entry) {
void DQMStreamerReader::openFileImp_(const DQMFileIterator::LumiEntry& entry) {
processedEventPerLs_ = 0;
edm::ParameterSet pset;

Expand Down Expand Up @@ -131,7 +131,7 @@ void DQMStreamerReader::openFile_(const DQMFileIterator::LumiEntry& entry) {
}
}

void DQMStreamerReader::closeFile_(const std::string& reason) {
void DQMStreamerReader::closeFileImp_(const std::string& reason) {
if (file_.open()) {
file_.streamFile_->closeStreamerFile();
file_.streamFile_ = nullptr;
Expand All @@ -140,21 +140,21 @@ void DQMStreamerReader::closeFile_(const std::string& reason) {
}
}

bool DQMStreamerReader::openNextFile_() {
closeFile_("skipping to another file");
bool DQMStreamerReader::openNextFileImp_() {
closeFileImp_("skipping to another file");

DQMFileIterator::LumiEntry currentLumi = fiterator_.open();
std::string p = currentLumi.get_data_path();

if (boost::filesystem::exists(p)) {
try {
openFile_(currentLumi);
openFileImp_(currentLumi);
return true;
} catch (const cms::Exception& e) {
fiterator_.logFileAction(std::string("Can't deserialize registry data (in open file): ") + e.what(), p);
fiterator_.logLumiState(currentLumi, "error: data file corrupted");

closeFile_("data file corrupted");
closeFileImp_("data file corrupted");
return false;
}
} else {
Expand Down Expand Up @@ -209,13 +209,13 @@ bool DQMStreamerReader::prepareNextFile() {
if (edm::shutdown_flag.load()) {
fiterator_.logFileAction("Shutdown flag was set, shutting down.");

closeFile_("shutdown flag is set");
closeFileImp_("shutdown flag is set");
return false;
}

// check for end of run file and force quit
if (flagEndOfRunKills_ && (fiterator_.state() != State::OPEN)) {
closeFile_("forced end-of-run");
closeFileImp_("forced end-of-run");
return false;
}

Expand All @@ -230,22 +230,22 @@ bool DQMStreamerReader::prepareNextFile() {
// close it
if ((processedEventPerLs_ >= minEventsPerLs_) &&
(!fiterator_.lumiReady()) && (fiterator_.state() == State::EOR)) {
closeFile_("graceful end-of-run");
closeFileImp_("graceful end-of-run");
return false;
}

// skip to the next file if we have no files openned yet
if (!file_.open()) {
if (fiterator_.lumiReady()) {
openNextFile_();
openNextFileImp_();
// we might need to open once more (if .dat is missing)
continue;
}
}

// or if there is a next file and enough eventshas been processed.
if (fiterator_.lumiReady() && (processedEventPerLs_ >= minEventsPerLs_)) {
openNextFile_();
openNextFileImp_();
// we might need to open once more (if .dat is missing)
continue;
}
Expand Down Expand Up @@ -280,7 +280,7 @@ EventMsgView const* DQMStreamerReader::prepareNextEvent() {
if (eview == nullptr) {
// read unsuccessful
// this means end of file, so close the file
closeFile_("eof");
closeFileImp_("eof");
} else {
if (!acceptEvent(eview)) {
continue;
Expand Down Expand Up @@ -317,7 +317,7 @@ bool DQMStreamerReader::checkNextEvent() {
} catch (const cms::Exception& e) {
// try to recover from corrupted files/events
fiterator_.logFileAction(std::string("Can't deserialize event or registry data: ") + e.what());
closeFile_("data file corrupted");
closeFileImp_("data file corrupted");

// this is not optimal, but hopefully we won't catch this many times in a row
return checkNextEvent();
Expand Down Expand Up @@ -401,7 +401,7 @@ void DQMStreamerReader::skip(int toSkip) {
} catch (const cms::Exception& e) {
// try to recover from corrupted files/events
fiterator_.logFileAction(std::string("Can't deserialize event data: ") + e.what());
closeFile_("data file corrupted");
closeFileImp_("data file corrupted");
}
}

Expand Down
6 changes: 3 additions & 3 deletions DQMServices/StreamerIO/plugins/DQMStreamerReader.h
Expand Up @@ -41,10 +41,10 @@ class DQMStreamerReader : public edm::StreamerInputSource {
// which will break things if called
void reset_() override;

void openFile_(const DQMFileIterator::LumiEntry& entry);
void closeFile_(const std::string& reason);
void openFileImp_(const DQMFileIterator::LumiEntry& entry);
void closeFileImp_(const std::string& reason);

bool openNextFile_();
bool openNextFileImp_();

InitMsgView const* getHeaderMsg();
EventMsgView const* getEventMsg();
Expand Down

0 comments on commit 8808890

Please sign in to comment.