Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3252
b: "refs/heads/CMSSW_7_0_X"
c: d64a00e
h: "refs/heads/CMSSW_7_0_X"
v: v3
  • Loading branch information
Dr15Jones committed Dec 22, 2005
1 parent 5ef59d3 commit 2529567
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
"refs/heads/CMSSW_7_0_X": 65e2fafeb35d367a0adf69f6808775c9421f2b81
"refs/heads/CMSSW_7_0_X": d64a00e9ee0a878ac2cf6e46a3cf11cd1ce7084f
81 changes: 75 additions & 6 deletions trunk/FWCore/Framework/src/EventProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,76 @@ namespace edm {
return shared_ptr<InputSource>();
}

static
std::auto_ptr<eventsetup::EventSetupProvider>
makeEventSetupProvider(ParameterSet const& params)
{
using namespace std;
using namespace edm::eventsetup;
vector<string> prefers = params.getParameter<vector<string> >("@all_esprefers");
if(prefers.empty()){
return std::auto_ptr<EventSetupProvider>(new EventSetupProvider());
}

EventSetupProvider::PreferredProviderInfo preferInfo;
EventSetupProvider::RecordToDataMap recordToData;
//recordToData.insert(std::make_pair(std::string("DummyRecord"),
// std::make_pair(std::string("DummyData"),std::string())));
//preferInfo[ComponentDescription("DummyProxyProvider","",false)]=recordToData;

for(vector<string>::iterator itName = prefers.begin();
itName != prefers.end();
++itName)
{
recordToData.clear();
ParameterSet preferPSet = params.getParameter<ParameterSet>(*itName);
std::vector<std::string> recordNames = preferPSet.getParameterNames();
for(std::vector<std::string>::iterator itRecordName = recordNames.begin();
itRecordName != recordNames.end();
++itRecordName) {
if( (*itRecordName)[0]=='@'){
//this is a 'hidden parameter' so skip it
continue;
}
//this should be a record name with its info
try {
std::vector<std::string> dataInfo = preferPSet.getParameter<vector<std::string> >(*itRecordName);

if(dataInfo.empty()) {
//FUTURE: empty should just mean all data
throw cms::Exception("Configuration")<<"The record named "<<*itRecordName<<" specifies no data items";
}
//FUTURE: 'any' should be a special name
for(std::vector<std::string>::iterator itDatum = dataInfo.begin();
itDatum != dataInfo.end();
++itDatum){
std::string datumName(*itDatum, 0, itDatum->find_first_of("/"));
std::string labelName;
if(itDatum->size() != datumName.size()) {
labelName = std::string(*itDatum, datumName.size()+1);
}
recordToData.insert(std::make_pair(std::string(*itRecordName),
std::make_pair(datumName,
labelName)));
}
} catch(const cms::Exception& iException) {
cms::Exception theError("ESPreferConfigurationError");
theError<<"While parsing the es_prefer statement for type="<<preferPSet.getParameter<std::string>("@module_type")
<<" label=\""<<preferPSet.getParameter<std::string>("@module_label")<<"\" an error occurred.";
theError.append(iException);
throw theError;
}
}
preferInfo[ComponentDescription(preferPSet.getParameter<std::string>("@module_type"),
preferPSet.getParameter<std::string>("@module_label"),
false)]
=recordToData;
}
return std::auto_ptr<EventSetupProvider>(new EventSetupProvider(&preferInfo));
}

void
fillEventSetupProvider(eventsetup::EventSetupProvider& cp,
fillEventSetupProvider(edm::eventsetup::EventSetupProvider& cp,
ParameterSet const& params,
const CommonParams& common)
{
Expand Down Expand Up @@ -185,7 +253,8 @@ namespace edm {
ServiceToken serviceToken_;
shared_ptr<InputSource> input_;
std::auto_ptr<ScheduleExecutor> runner_;
eventsetup::EventSetupProvider esp_;
std::auto_ptr<eventsetup::EventSetupProvider>
esp_;

bool emittedBeginJob_;
ActionTable act_table_;
Expand Down Expand Up @@ -247,8 +316,8 @@ namespace edm {
runner_->preModuleSignal.connect(actReg_.preModuleSignal_);
runner_->postModuleSignal.connect(actReg_.postModuleSignal_);

fillEventSetupProvider(esp_, *params_, common_);
esp_ = makeEventSetupProvider(*params_);
fillEventSetupProvider(*esp_, *params_, common_);
// initialize(iToken,iLegacy);
FDEBUG(2) << params_->toString() << std::endl;
}
Expand All @@ -273,7 +342,7 @@ namespace edm {

if(pep.get()==0) break;
IOVSyncValue ts(pep->id(), pep->time());
EventSetup const& es = esp_.eventSetupForInstance(ts);
EventSetup const& es = esp_->eventSetupForInstance(ts);

try
{
Expand Down Expand Up @@ -324,7 +393,7 @@ namespace edm {
// If it really means once per 'application' then this code will have to be changed.
// Also have to deal with case where have 'run' then new Module added and do 'run'
// again. In that case the newly added Module needs its 'beginJob' to be called.
EventSetup const& es = esp_.eventSetupForInstance(IOVSyncValue::beginOfTime());
EventSetup const& es = esp_->eventSetupForInstance(IOVSyncValue::beginOfTime());
PathList::iterator itWorkerList = workers_.begin();
PathList::iterator itEnd = workers_.end();
ESRefWrapper wrapper(es);
Expand Down

0 comments on commit 2529567

Please sign in to comment.