Skip to content

Commit

Permalink
Merge pull request #2569 from wmtan/ProperlyUpdateEmptyProcessHistoryID
Browse files Browse the repository at this point in the history
Framework fixes -- Properly update empty process history
  • Loading branch information
ktf committed Feb 20, 2014
2 parents dbe0d9e + 7b10bfe commit 8e26d6e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
3 changes: 2 additions & 1 deletion FWCore/Sources/src/DaqProvenanceHelper.cc
Expand Up @@ -100,6 +100,7 @@ namespace edm {

void
DaqProvenanceHelper::fixMetaData(std::vector<ProcessConfiguration>& pcv, std::vector<ProcessHistory>& phv) {
phv.push_back(ProcessHistory()); // For new processHistory, containing only processConfiguration_
std::vector<ProcessConfiguration> newPCs;
for(auto const& pc : pcv) {
if(pc.processName() == oldProcessName_) {
Expand All @@ -114,7 +115,7 @@ namespace edm {
// update existing process histories
for(auto& ph : phv) {
for(auto const& newPC : newPCs) {
if(matchProcesses(newPC, ph)) {
if(ph.empty() || matchProcesses(newPC, ph)) {
ProcessHistoryID oldPHID = ph.id();
ph.push_front(newPC);
ProcessHistoryID newPHID = ph.id();
Expand Down
24 changes: 10 additions & 14 deletions IOPool/Input/src/RootFile.cc
Expand Up @@ -1234,13 +1234,11 @@ namespace edm {
lumiTree_.fillAux<LuminosityBlockAux>(pLumiAux);
conversion(lumiAux, *lumiAuxiliary);
}
if(fileFormatVersion().processHistorySameWithinRun()) {
if(provenanceAdaptor_) {
lumiAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
}
if(daqProvenanceHelper_) {
lumiAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
}
if(provenanceAdaptor_) {
lumiAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
}
if(daqProvenanceHelper_) {
lumiAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
}
if(lumiAuxiliary->luminosityBlock() == 0 && !fileFormatVersion().runsAndLumis()) {
lumiAuxiliary->id() = LuminosityBlockID(RunNumber_t(1), LuminosityBlockNumber_t(1));
Expand All @@ -1260,13 +1258,11 @@ namespace edm {
runTree_.fillAux<RunAux>(pRunAux);
conversion(runAux, *runAuxiliary);
}
if(fileFormatVersion().processHistorySameWithinRun()) {
if(provenanceAdaptor_) {
runAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
}
if(daqProvenanceHelper_) {
runAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
}
if(provenanceAdaptor_) {
runAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
}
if(daqProvenanceHelper_) {
runAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
}
return runAuxiliary;
}
Expand Down

0 comments on commit 8e26d6e

Please sign in to comment.