Skip to content

Commit

Permalink
Merge pull request cms-sw#280 from wmtan/calculateIDofEmptyParameterSet
Browse files Browse the repository at this point in the history
Add function to calculate ID of empty parameter set without registering ...
  • Loading branch information
ktf committed Aug 11, 2013
2 parents 631bb66 + 5b77329 commit 3ad8dae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions FWCore/ParameterSet/interface/ParameterSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ namespace edm {
void
registerFromString(std::string const& rep);

// return ID of empty parameter set without registering it.
static
ParameterSetID
emptyParameterSetID();

private:
// construct from coded string and id.
ParameterSet(std::string const& rep, ParameterSetID const& id);
Expand Down
7 changes: 7 additions & 0 deletions FWCore/ParameterSet/src/ParameterSet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ namespace edm {
pset::Registry::instance()->insertMapped(ps);
}

ParameterSetID
ParameterSet::emptyParameterSetID() { // const
cms::Digest newDigest;
ParameterSet().toDigest(newDigest);
return ParameterSetID(newDigest.digest().toString());
}

ParameterSet::ParameterSet(ParameterSet const& other)
: tbl_(other.tbl_),
psetTable_(other.psetTable_),
Expand Down
4 changes: 1 addition & 3 deletions IOPool/SecondaryInput/test/SecondaryProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ namespace edm {
firstEvent_(true),
firstLoop_(true),
expectedEventNumber_(1) {
ParameterSet emptyPSet;
emptyPSet.registerIt();
processConfiguration_->setParameterSetID(emptyPSet.id());
processConfiguration_->setParameterSetID(ParameterSet::emptyParameterSetID());
processConfiguration_->setProcessConfigurationID();

productRegistry_->setFrozen();
Expand Down

0 comments on commit 3ad8dae

Please sign in to comment.