Skip to content

Commit

Permalink
Merge pull request #9683 from wddgit/streamModuleDescriptionBug
Browse files Browse the repository at this point in the history
Bug fix. Fix moduleDescription function
  • Loading branch information
cmsbuild committed Jun 20, 2015
2 parents b08ba44 + f0476dc commit 1f0b617
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions FWCore/Framework/interface/stream/EDAnalyzerAdaptorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ namespace edm {
template<typename T> void createStreamModules(T iFunc) {
for(auto& m: m_streamModules) {
m = iFunc();
setModuleDescriptionPtr(m);
}
}

Expand Down Expand Up @@ -158,6 +159,7 @@ namespace edm {
ThinnedAssociationsHelper&) { }

// ---------- member data --------------------------------
void setModuleDescriptionPtr(EDAnalyzerBase* m);
void setModuleDescription(ModuleDescription const& md) {
moduleDescription_ = md;
}
Expand Down
5 changes: 5 additions & 0 deletions FWCore/Framework/src/stream/EDAnalyzerAdaptorBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,8 @@ EDAnalyzerAdaptorBase::doPostForkReacquireResources(unsigned int iChildIndex, un
mod->postForkReacquireResources(iChildIndex,iNumberOfChildren);
}
}

void
EDAnalyzerAdaptorBase::setModuleDescriptionPtr(EDAnalyzerBase* m) {
m->setModuleDescriptionPtr(&moduleDescription_);
}
8 changes: 6 additions & 2 deletions FWCore/Framework/test/stubs/TestStreamAnalyzers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ for testing purposes only.
#include "FWCore/Utilities/interface/GlobalIdentifier.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/TriggerNamesService.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/EDMException.h"



namespace edmtest {
namespace stream {

Expand Down Expand Up @@ -97,6 +97,10 @@ struct Cache {
}

void analyze(edm::Event const&, edm::EventSetup const&) override {
if(moduleDescription().processName() != edm::Service<edm::service::TriggerNamesService>()->getProcessName()) {
throw cms::Exception("LogicError")
<< "module description not properly initialized in stream analyzer";
}
++m_count;
++(runCache()->value);

Expand Down

0 comments on commit 1f0b617

Please sign in to comment.