Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fef2af5
commit 8971438
Showing
3 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<use name="boost"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="FWCore/ParameterSetReader"/> | ||
<bin file="edmConfigHash.cpp"> | ||
</bin> | ||
<bin file="edmParameterSetDump.cpp"> | ||
</bin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
// This will return the ParameterSetID of the parameter set | ||
// defined in the python file or configuration string. | ||
// Warning, this may not be the same as the ParameterSetID | ||
// of a cmsRun process, because validation code may insert | ||
// additional parameters into the configuration. | ||
|
||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/ParameterSetReader/interface/ParameterSetReader.h" | ||
#include "FWCore/Utilities/interface/Exception.h" | ||
|
||
#include <memory> | ||
|
||
#include <iostream> | ||
#include <string> | ||
|
||
int main(int argc, char **argv) try { | ||
// config can either be a name or a string | ||
std::string config; | ||
|
||
if(argc == 1) { | ||
// Read input from cin into configstring.. | ||
std::string line; | ||
while(std::getline(std::cin, line)) { | ||
config += line; | ||
config += '\n'; | ||
} | ||
} else if(argc == 2) { | ||
config = std::string(argv[1]); | ||
} | ||
|
||
std::shared_ptr<edm::ParameterSet> parameterSet = edm::readConfig(config); | ||
parameterSet->registerIt(); | ||
std::cout << parameterSet->id() << std::endl; | ||
return 0; | ||
} catch(cms::Exception const& e) { | ||
std::cout << e.explainSelf() << std::endl; | ||
return 1; | ||
} catch(std::exception const& e) { | ||
std::cout << e.what() << std::endl; | ||
return 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// -*- C++ -*- | ||
// | ||
// Package: PythonParameterSet | ||
// Class : edmParameterSetDump | ||
// | ||
// Implementation: | ||
// <Notes on implementation> | ||
// | ||
// Original Author: Rick Wilkinson | ||
// Created: Thu Aug 2 13:33:53 EDT 2007 | ||
// | ||
|
||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/ParameterSetReader/interface/ParameterSetReader.h" | ||
#include "FWCore/Utilities/interface/Exception.h" | ||
|
||
#include <memory> | ||
#include <iostream> | ||
#include <string> | ||
|
||
int main (int argc, char **argv) try { | ||
if(argc != 2) { | ||
std::cout << "Usage: edmParameterSetDump <cfgfile>" << std::endl; | ||
} | ||
std::string fileName(argv[1]); | ||
std::shared_ptr<edm::ParameterSet> parameterSet = edm::readConfig(fileName); | ||
std::cout << "====Main Process====" << std::endl; | ||
std::cout << parameterSet->dump() << std::endl; | ||
return 0; | ||
} catch(cms::Exception const& e) { | ||
std::cout << e.explainSelf() << std::endl; | ||
return 1; | ||
} catch(std::exception const& e) { | ||
std::cout << e.what() << std::endl; | ||
return 1; | ||
} |