Skip to content

Commit

Permalink
restore lost execs
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlange6 committed Apr 7, 2019
1 parent fef2af5 commit 8971438
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
7 changes: 7 additions & 0 deletions FWCore/ParameterSetReader/bin/BuildFile.xml
@@ -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>
42 changes: 42 additions & 0 deletions FWCore/ParameterSetReader/bin/edmConfigHash.cpp
@@ -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;
}
36 changes: 36 additions & 0 deletions FWCore/ParameterSetReader/bin/edmParameterSetDump.cpp
@@ -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;
}

0 comments on commit 8971438

Please sign in to comment.