17 if (ps.
exists(
"RandomizedParameters")) {
18 std::vector<edm::ParameterSet> randomizedParameters = ps.
getParameter<std::vector<edm::ParameterSet> >(
"RandomizedParameters");
22 for (
unsigned int irand = 0; irand<randomizedParameters.size(); ++irand) {
23 randomInitWeights_[irand] = randomizedParameters[irand].getParameter<
double>(
"ConfigWeight");
24 if (randomizedParameters[irand].exists(
"ConfigDescription")) {
27 if (randomizedParameters[irand].exists(
"GridpackPath")) {
33 if (ps.
exists(
"GridpackPath")) {
57 return genLumiInfoHeader;
67 std::vector<long unsigned int> seeds = rengine->put();
68 seeds.push_back(lumi.
id().
run());
70 std::seed_seq seedseq(seeds.begin(),seeds.end());
71 std::mt19937 randgen(seedseq);
86 std::vector<long unsigned int> seeds = rengine->put();
87 seeds.push_back(lumi.
id().
run());
89 std::seed_seq seedseq(seeds.begin(),seeds.end());
90 std::array<unsigned int,1> lheseed;
91 seedseq.generate(lheseed.begin(),lheseed.end());
95 std::ostringstream nevStream;
98 std::ostringstream randomStream;
99 randomStream << lheseed[0];
101 edm::FileInPath script(
"GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh");
105 args[0] = strdup(script.
fullPath().c_str());
107 args[2] = strdup(nevStream.str().c_str());
108 args[3] = strdup(randomStream.str().c_str());
115 throw cms::Exception(
"BaseHadronizer::generateLHE") <<
"Unable to fork a child";
119 execvp(args[0],args);
125 waitpid(pid, &status, 0);
127 throw cms::Exception(
"BaseHadronizer::generateLHE") <<
"Failed to execute script";
130 FILE* lhef = std::fopen(outfilename,
"r");
132 throw cms::Exception(
"BaseHadronizer::generateLHE") <<
"Output file " << outfilename <<
" not found.";
137 for (
int iarg=0; iarg<4; ++iarg) {
const_reverse_iterator rbegin() const
LuminosityBlockID id() const
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< double > randomInitWeights_
void setFilterEfficiency(double effic)
BaseHadronizer(edm::ParameterSet const &ps)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
void generateLHE(edm::LuminosityBlock const &lumi, CLHEP::HepRandomEngine *rengine)
void randomizeIndex(edm::LuminosityBlock const &lumi, CLHEP::HepRandomEngine *rengine)
GenRunInfoProduct & runInfo()
ProcessHistory const & processHistory() const
const std::string & randomInitConfigDescription() const
bool getMapped(key_type const &k, value_type &result) const
std::vector< std::string > gridpackPaths_
std::vector< std::string > randomInitConfigDescriptions_
LuminosityBlockNumber_t luminosityBlock() const
const std::string & gridpackPath() const
std::string fullPath() const
void setExternalXSecNLO(const XSec &xsec)
void setExternalXSecLO(const XSec &xsec)
static const std::vector< std::string > theSharedResources
static Registry * instance()
virtual GenLumiInfoHeader * getGenLumiInfoHeader() const