CMS 3D CMS Logo

ExternalLHEProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: ExternalLHEProducer
4 // Class: ExternalLHEProducer
5 //
13 //
14 // Original Author: Brian Paul Bockelman,8 R-018,+41227670861,
15 // Created: Fri Oct 21 11:37:26 CEST 2011
16 //
17 //
18 
19 // system include files
20 #include <cstdio>
21 #include <memory>
22 #include <vector>
23 #include <string>
24 #include <fstream>
25 #include "boost/filesystem.hpp"
26 #include <unistd.h>
27 #include <dirent.h>
28 #include <fcntl.h>
29 #include <sys/wait.h>
30 #include <sys/time.h>
31 #include <sys/resource.h>
32 #include "tbb/task_arena.h"
33 
34 #include "boost/bind.hpp"
35 
36 #include "boost/ptr_container/ptr_deque.hpp"
37 
38 // user include files
42 
46 
48 
51 
56 
60 
63 
65 
66 //
67 // class declaration
68 //
69 
70 class ExternalLHEProducer : public edm::one::EDProducer<edm::BeginRunProducer, edm::EndRunProducer> {
71 public:
72  explicit ExternalLHEProducer(const edm::ParameterSet& iConfig);
73 
74  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
75 
76 private:
77  void produce(edm::Event&, const edm::EventSetup&) override;
78  void beginRunProduce(edm::Run& run, edm::EventSetup const& es) override;
79  void endRunProduce(edm::Run&, edm::EventSetup const&) override;
80  void preallocThreads(unsigned int) override;
81 
82  std::vector<std::string> makeArgs(uint32_t nEvents, unsigned int nThreads, std::uint32_t seed) const;
83  int closeDescriptors(int preserve) const;
84  void executeScript(std::vector<std::string> const& args, int id) const;
85 
86  void nextEvent();
87 
88  // ----------member data ---------------------------
91  const std::vector<std::string> args_;
92  uint32_t npars_;
93  uint32_t nEvents_;
94  bool storeXML_;
95  unsigned int nThreads_{1};
97  bool generateConcurrently_{false};
98 
99  // Used only if nPartonMapping is in the configuration
100  std::map<unsigned, std::pair<unsigned, unsigned>> nPartonMapping_{};
101 
102  std::unique_ptr<lhef::LHEReader> reader_;
103  std::shared_ptr<lhef::LHERunInfo> runInfoLast_;
104  std::shared_ptr<lhef::LHERunInfo> runInfo_;
105  std::shared_ptr<lhef::LHEEvent> partonLevel_;
106  boost::ptr_deque<LHERunInfoProduct> runInfoProducts_;
107  bool wasMerged;
108 
109  class FileCloseSentry : private boost::noncopyable {
110  public:
111  explicit FileCloseSentry(int fd) : fd_(fd){};
112 
113  ~FileCloseSentry() { close(fd_); }
114 
115  private:
116  int fd_;
117  };
118 };
119 
120 //
121 // constructors and destructor
122 //
124  : scriptName_((iConfig.getParameter<edm::FileInPath>("scriptName")).fullPath()),
125  outputFile_(iConfig.getParameter<std::string>("outputFile")),
126  args_(iConfig.getParameter<std::vector<std::string>>("args")),
127  npars_(iConfig.getParameter<uint32_t>("numberOfParameters")),
128  nEvents_(iConfig.getUntrackedParameter<uint32_t>("nEvents")),
129  storeXML_(iConfig.getUntrackedParameter<bool>("storeXML")),
130  generateConcurrently_(iConfig.getUntrackedParameter<bool>("generateConcurrently")) {
131  if (npars_ != args_.size())
132  throw cms::Exception("ExternalLHEProducer")
133  << "Problem with configuration: " << args_.size() << " script arguments given, expected " << npars_;
134 
135  if (iConfig.exists("nPartonMapping")) {
136  auto& processMap(iConfig.getParameterSetVector("nPartonMapping"));
137  for (auto& cfg : processMap) {
138  unsigned processId(cfg.getParameter<unsigned>("idprup"));
139 
140  auto orderStr(cfg.getParameter<std::string>("order"));
141  unsigned order(0);
142  if (orderStr == "LO")
143  order = 0;
144  else if (orderStr == "NLO")
145  order = 1;
146  else
147  throw cms::Exception("ExternalLHEProducer")
148  << "Invalid order specification for process " << processId << ": " << orderStr;
149 
150  unsigned np(cfg.getParameter<unsigned>("np"));
151 
152  nPartonMapping_.emplace(processId, std::make_pair(order, np));
153  }
154  }
155 
156  produces<LHEXMLStringProduct, edm::Transition::BeginRun>("LHEScriptOutput");
157 
158  produces<LHEEventProduct>();
159  produces<LHERunInfoProduct, edm::Transition::BeginRun>();
160  produces<LHERunInfoProduct, edm::Transition::EndRun>();
161 }
162 
163 //
164 // member functions
165 //
166 
167 // ------------ method called with number of threads in job --
168 void ExternalLHEProducer::preallocThreads(unsigned int iThreads) { nThreads_ = iThreads; }
169 
170 // ------------ method called to produce the data ------------
172  nextEvent();
173  if (!partonLevel_) {
175  << "No lhe event found in ExternalLHEProducer::produce(). "
176  << "The likely cause is that the lhe file contains fewer events than were requested, which is possible "
177  << "in case of phase space integration or uneweighting efficiency problems.";
178  }
179 
180  std::unique_ptr<LHEEventProduct> product(
181  new LHEEventProduct(*partonLevel_->getHEPEUP(), partonLevel_->originalXWGTUP()));
182  if (partonLevel_->getPDF()) {
183  product->setPDF(*partonLevel_->getPDF());
184  }
185  std::for_each(partonLevel_->weights().begin(),
186  partonLevel_->weights().end(),
187  boost::bind(&LHEEventProduct::addWeight, product.get(), _1));
188  product->setScales(partonLevel_->scales());
189  if (nPartonMapping_.empty()) {
190  product->setNpLO(partonLevel_->npLO());
191  product->setNpNLO(partonLevel_->npNLO());
192  } else {
193  // overwrite npLO and npNLO values by user-specified mapping
194  unsigned processId(partonLevel_->getHEPEUP()->IDPRUP);
195  unsigned order(0);
196  unsigned np(0);
197  try {
198  auto procDef(nPartonMapping_.at(processId));
199  order = procDef.first;
200  np = procDef.second;
201  } catch (std::out_of_range&) {
202  throw cms::Exception("ExternalLHEProducer")
203  << "Unexpected IDPRUP encountered: " << partonLevel_->getHEPEUP()->IDPRUP;
204  }
205 
206  switch (order) {
207  case 0:
208  product->setNpLO(np);
209  product->setNpNLO(-1);
210  break;
211  case 1:
212  product->setNpLO(-1);
213  product->setNpNLO(np);
214  break;
215  default:
216  break;
217  }
218  }
219 
220  std::for_each(partonLevel_->getComments().begin(),
221  partonLevel_->getComments().end(),
222  boost::bind(&LHEEventProduct::addComment, product.get(), _1));
223 
224  iEvent.put(std::move(product));
225 
226  if (runInfo_) {
227  std::unique_ptr<LHERunInfoProduct> product(new LHERunInfoProduct(*runInfo_->getHEPRUP()));
228  std::for_each(runInfo_->getHeaders().begin(),
229  runInfo_->getHeaders().end(),
230  boost::bind(&LHERunInfoProduct::addHeader, product.get(), _1));
231  std::for_each(runInfo_->getComments().begin(),
232  runInfo_->getComments().end(),
233  boost::bind(&LHERunInfoProduct::addComment, product.get(), _1));
234 
235  if (!runInfoProducts_.empty()) {
236  runInfoProducts_.front().mergeProduct(*product);
237  if (!wasMerged) {
238  runInfoProducts_.pop_front();
239  runInfoProducts_.push_front(product.release());
240  wasMerged = true;
241  }
242  }
243 
244  runInfo_.reset();
245  }
246 
247  partonLevel_.reset();
248  return;
249 }
250 
251 // ------------ method called when starting to processes a run ------------
253  // pass the number of events as previous to last argument
254 
255  // pass the random number generator seed as last argument
256 
258 
259  if (!rng.isAvailable()) {
260  throw cms::Exception("Configuration")
261  << "The ExternalLHEProducer module requires the RandomNumberGeneratorService\n"
262  "which is not present in the configuration file. You must add the service\n"
263  "in the configuration file if you want to run ExternalLHEProducer";
264  }
265 
266  std::vector<std::string> infiles;
267  auto const seed = rng->mySeed();
268  if (generateConcurrently_) {
269  infiles.resize(nThreads_);
270  auto const nEventsAve = nEvents_ / nThreads_;
271  unsigned int const overflow = nThreads_ - (nEvents_ % nThreads_);
272  std::exception_ptr except;
273  std::atomic<char> exceptSet{0};
274 
275  tbb::this_task_arena::isolate([this, &except, &infiles, &exceptSet, nEventsAve, overflow, seed]() {
276  tbb::empty_task* waitTask = new (tbb::task::allocate_root()) tbb::empty_task;
277  waitTask->set_ref_count(1 + nThreads_);
278 
279  for (unsigned int t = 0; t < nThreads_; ++t) {
280  uint32_t nEvents = nEventsAve;
281  if (nEvents_ % nThreads_ != 0 and t >= overflow) {
282  nEvents += 1;
283  }
284  auto task = edm::make_functor_task(tbb::task::allocate_root(),
285  [t, this, &infiles, seed, nEvents, &except, &exceptSet, waitTask]() {
286  CMS_SA_ALLOW try {
287  using namespace boost::filesystem;
288  using namespace std::string_literals;
289  auto out = path("thread"s + std::to_string(t)) / path(outputFile_);
290  infiles[t] = out.native();
292  } catch (...) {
293  char expected = 0;
294  if (exceptSet.compare_exchange_strong(expected, 1)) {
295  except = std::current_exception();
296  exceptSet.store(2);
297  }
298  }
299  waitTask->decrement_ref_count();
300  });
301  tbb::task::spawn(*task);
302  }
303  waitTask->wait_for_all();
304  tbb::task::destroy(*waitTask);
305  });
306  if (exceptSet != 0) {
307  std::rethrow_exception(except);
308  }
309  } else {
310  infiles = std::vector<std::string>(1, outputFile_);
312  }
313 
314  //fill LHEXMLProduct (streaming read directly into compressed buffer to save memory)
315  std::unique_ptr<LHEXMLStringProduct> p(new LHEXMLStringProduct);
316 
317  //store the XML file only if explictly requested
318  if (storeXML_) {
320  if (generateConcurrently_) {
321  using namespace boost::filesystem;
322  file = (path("thread0") / path(outputFile_)).native();
323  } else {
324  file = outputFile_;
325  }
326  std::ifstream instream(file);
327  if (!instream) {
328  throw cms::Exception("OutputOpenError") << "Unable to open script output file " << outputFile_ << ".";
329  }
330  instream.seekg(0, instream.end);
331  int insize = instream.tellg();
332  instream.seekg(0, instream.beg);
333  p->fillCompressedContent(instream, 0.25 * insize);
334  instream.close();
335  }
336  run.put(std::move(p), "LHEScriptOutput");
337 
338  // LHE C++ classes translation
339  // (read back uncompressed file from disk in streaming mode again to save memory)
340 
341  unsigned int skip = 0;
342  reader_ = std::make_unique<lhef::LHEReader>(infiles, skip);
343 
344  nextEvent();
345  if (runInfoLast_) {
347 
348  std::unique_ptr<LHERunInfoProduct> product(new LHERunInfoProduct(*runInfo_->getHEPRUP()));
349  std::for_each(runInfo_->getHeaders().begin(),
350  runInfo_->getHeaders().end(),
351  boost::bind(&LHERunInfoProduct::addHeader, product.get(), _1));
352  std::for_each(runInfo_->getComments().begin(),
353  runInfo_->getComments().end(),
354  boost::bind(&LHERunInfoProduct::addComment, product.get(), _1));
355 
356  // keep a copy around in case of merging
357  runInfoProducts_.push_back(new LHERunInfoProduct(*product));
358  wasMerged = false;
359 
360  run.put(std::move(product));
361 
362  runInfo_.reset();
363  }
364 }
365 
366 // ------------ method called when ending the processing of a run ------------
368  if (!runInfoProducts_.empty()) {
369  std::unique_ptr<LHERunInfoProduct> product(runInfoProducts_.pop_front().release());
370  run.put(std::move(product));
371  }
372 
373  nextEvent();
374  if (partonLevel_) {
376  << "Error in ExternalLHEProducer::endRunProduce(). "
377  << "Event loop is over, but there are still lhe events to process."
378  << "This could happen if lhe file contains more events than requested. This is never expected to happen.";
379  }
380 
381  reader_.reset();
382  if (generateConcurrently_) {
383  for (unsigned int t = 0; t < nThreads_; ++t) {
384  using namespace boost::filesystem;
385  using namespace std::string_literals;
386  auto out = path("thread"s + std::to_string(t)) / path(outputFile_);
387  if (unlink(out.c_str())) {
388  throw cms::Exception("OutputDeleteError") << "Unable to delete original script output file " << out
389  << " (errno=" << errno << ", " << strerror(errno) << ").";
390  }
391  }
392  } else {
393  if (unlink(outputFile_.c_str())) {
394  throw cms::Exception("OutputDeleteError") << "Unable to delete original script output file " << outputFile_
395  << " (errno=" << errno << ", " << strerror(errno) << ").";
396  }
397  }
398 }
399 
400 std::vector<std::string> ExternalLHEProducer::makeArgs(uint32_t nEvents,
401  unsigned int nThreads,
402  std::uint32_t seed) const {
403  std::vector<std::string> args;
404  args.reserve(3 + args_.size());
405 
406  args.push_back(args_.front());
407  args.push_back(std::to_string(nEvents));
408 
409  args.push_back(std::to_string(seed));
410 
411  args.push_back(std::to_string(nThreads));
412  std::copy(args_.begin() + 1, args_.end(), std::back_inserter(args));
413 
414  for (unsigned int iArg = 0; iArg < args.size(); iArg++) {
415  LogDebug("LHEInputArgs") << "arg [" << iArg << "] = " << args[iArg];
416  }
417 
418  return args;
419 }
420 
421 // ------------ Close all the open file descriptors ------------
422 int ExternalLHEProducer::closeDescriptors(int preserve) const {
423  int maxfd = 1024;
424  int fd;
425 #ifdef __linux__
426  DIR* dir;
427  struct dirent* dp;
428  maxfd = preserve;
429  if ((dir = opendir("/proc/self/fd"))) {
430  errno = 0;
431  while ((dp = readdir(dir)) != nullptr) {
432  if ((strcmp(dp->d_name, ".") == 0) || (strcmp(dp->d_name, "..") == 0)) {
433  continue;
434  }
435  if (sscanf(dp->d_name, "%d", &fd) != 1) {
436  //throw cms::Exception("closeDescriptors") << "Found unexpected filename in /proc/self/fd: " << dp->d_name;
437  return -1;
438  }
439  if (fd > maxfd) {
440  maxfd = fd;
441  }
442  }
443  if (errno) {
444  //throw cms::Exception("closeDescriptors") << "Unable to determine the number of fd (errno=" << errno << ", " << strerror(errno) << ").";
445  return errno;
446  }
447  closedir(dir);
448  }
449 #endif
450  // TODO: assert for an unreasonable number of fds?
451  for (fd = 3; fd < maxfd + 1; fd++) {
452  if (fd != preserve)
453  close(fd);
454  }
455  return 0;
456 }
457 
458 // ------------ Execute the script associated with this producer ------------
459 void ExternalLHEProducer::executeScript(std::vector<std::string> const& args, int id) const {
460  // Fork a script, wait until it finishes.
461 
462  int rc = 0, rc2 = 0;
463  int filedes[2], fd_flags;
464 
465  if (pipe(filedes)) {
466  throw cms::Exception("Unable to create a new pipe");
467  }
468  FileCloseSentry sentry1(filedes[0]), sentry2(filedes[1]);
469 
470  if ((fd_flags = fcntl(filedes[1], F_GETFD, NULL)) == -1) {
471  throw cms::Exception("ExternalLHEProducer")
472  << "Failed to get pipe file descriptor flags (errno=" << rc << ", " << strerror(rc) << ")";
473  }
474  if (fcntl(filedes[1], F_SETFD, fd_flags | FD_CLOEXEC) == -1) {
475  throw cms::Exception("ExternalLHEProducer")
476  << "Failed to set pipe file descriptor flags (errno=" << rc << ", " << strerror(rc) << ")";
477  }
478 
479  unsigned int argc = 1 + args.size();
480  // TODO: assert that we have a reasonable number of arguments
481  char** argv = new char*[argc + 1];
482  argv[0] = strdup(scriptName_.c_str());
483  for (unsigned int i = 1; i < argc; i++) {
484  argv[i] = strdup(args[i - 1].c_str());
485  }
486  argv[argc] = nullptr;
487 
488  pid_t pid = fork();
489  if (pid == 0) {
490  // The child process
491  if (!(rc = closeDescriptors(filedes[1]))) {
492  if (generateConcurrently_) {
493  using namespace boost::filesystem;
494  using namespace std::string_literals;
495  boost::system::error_code ec;
496  auto newDir = path("thread"s + std::to_string(id));
497  create_directory(newDir, ec);
498  current_path(newDir, ec);
499  }
500  execvp(argv[0], argv); // If execv returns, we have an error.
501  rc = errno;
502  }
503  while ((write(filedes[1], &rc, sizeof(int)) == -1) && (errno == EINTR)) {
504  }
505  _exit(1);
506  }
507 
508  // Free the arg vector ASAP
509  for (unsigned int i = 0; i < args.size() + 1; i++) {
510  free(argv[i]);
511  }
512  delete[] argv;
513 
514  if (pid == -1) {
515  throw cms::Exception("ForkException")
516  << "Unable to fork a child (errno=" << errno << ", " << strerror(errno) << ")";
517  }
518 
519  close(filedes[1]);
520  // If the exec succeeds, the read will fail.
521  while (((rc2 = read(filedes[0], &rc, sizeof(int))) == -1) && (errno == EINTR)) {
522  rc2 = 0;
523  }
524  if ((rc2 == sizeof(int)) && rc) {
525  throw cms::Exception("ExternalLHEProducer")
526  << "Failed to execute script (errno=" << rc << ", " << strerror(rc) << ")";
527  }
528  close(filedes[0]);
529 
530  int status = 0;
531  errno = 0;
532  do {
533  if (waitpid(pid, &status, 0) < 0) {
534  if (errno == EINTR) {
535  continue;
536  } else {
537  throw cms::Exception("ExternalLHEProducer")
538  << "Failed to read child status (errno=" << errno << ", " << strerror(errno) << ")";
539  }
540  }
541  if (WIFSIGNALED(status)) {
542  throw cms::Exception("ExternalLHEProducer") << "Child exited due to signal " << WTERMSIG(status) << ".";
543  }
544  if (WIFEXITED(status)) {
545  rc = WEXITSTATUS(status);
546  break;
547  }
548  } while (true);
549  if (rc) {
550  throw cms::Exception("ExternalLHEProducer") << "Child failed with exit code " << rc << ".";
551  }
552 }
553 
554 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
556  //The following says we do not know what parameters are allowed so do no validation
557  // Please change this to state exactly what you do use, even if it is no parameters
559  desc.setComment("Executes an external script and places its output file into an EDM collection");
560 
561  edm::FileInPath thePath;
562  desc.add<edm::FileInPath>("scriptName", thePath);
563  desc.add<std::string>("outputFile", "myoutput");
564  desc.add<std::vector<std::string>>("args");
565  desc.add<uint32_t>("numberOfParameters");
566  desc.addUntracked<uint32_t>("nEvents");
567  desc.addUntracked<bool>("storeXML", false);
568  desc.addUntracked<bool>("generateConcurrently", false)
569  ->setComment("If true, run the script concurrently in separate processes.");
570 
571  edm::ParameterSetDescription nPartonMappingDesc;
572  nPartonMappingDesc.add<unsigned>("idprup");
573  nPartonMappingDesc.add<std::string>("order");
574  nPartonMappingDesc.add<unsigned>("np");
575  desc.addVPSetOptional("nPartonMapping", nPartonMappingDesc);
576 
577  descriptions.addDefault(desc);
578 }
579 
581  if (partonLevel_)
582  return;
583 
584  if (not reader_) {
585  return;
586  }
587 
588  partonLevel_ = reader_->next();
589  if (!partonLevel_) {
590  //see if we have another file to read;
591  bool newFileOpened;
592  do {
593  newFileOpened = false;
594  partonLevel_ = reader_->next(&newFileOpened);
595  } while (newFileOpened && !partonLevel_);
596  }
597  if (!partonLevel_)
598  return;
599 
600  std::shared_ptr<lhef::LHERunInfo> runInfoThis = partonLevel_->getRunInfo();
601  if (runInfoThis != runInfoLast_) {
602  runInfo_ = runInfoThis;
603  runInfoLast_ = runInfoThis;
604  }
605 }
606 
607 //define this as a plug-in
writedatasetfile.args
args
Definition: writedatasetfile.py:18
dqmPostProcessing_online.DIR
DIR
Definition: dqmPostProcessing_online.py:10
cmsBatch.argv
argv
Definition: cmsBatch.py:279
electrons_cff.bool
bool
Definition: electrons_cff.py:372
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
EDProducer.h
ExternalLHEProducer::nEvents_
uint32_t nEvents_
Definition: ExternalLHEProducer.cc:93
MessageLogger.h
ExternalLHEProducer::FileCloseSentry::~FileCloseSentry
~FileCloseSentry()
Definition: ExternalLHEProducer.cc:113
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
ExternalLHEProducer::outputContents_
std::string outputContents_
Definition: ExternalLHEProducer.cc:96
dir2webdir.argc
argc
Definition: dir2webdir.py:39
mps_update.status
status
Definition: mps_update.py:69
edm::Run
Definition: Run.h:45
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
LuminosityBlock.h
edm
HLT enums.
Definition: AlignableModifier.h:19
RandomNumberGenerator.h
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
np
int np
Definition: AMPTWrapper.h:43
ExternalLHEProducer::runInfo_
std::shared_ptr< lhef::LHERunInfo > runInfo_
Definition: ExternalLHEProducer.cc:104
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
FunctorTask.h
edm::make_functor_task
FunctorTask< F > * make_functor_task(ALLOC &&iAlloc, F f)
Definition: FunctorTask.h:47
edm::errors::EventGenerationFailure
Definition: EDMException.h:70
ExternalLHEProducer::FileCloseSentry::FileCloseSentry
FileCloseSentry(int fd)
Definition: ExternalLHEProducer.cc:111
ExternalLHEProducer::ExternalLHEProducer
ExternalLHEProducer(const edm::ParameterSet &iConfig)
Definition: ExternalLHEProducer.cc:123
edm::one::EDProducer
Definition: EDProducer.h:30
edm::RandomNumberGenerator::mySeed
virtual std::uint32_t mySeed() const =0
ExternalLHEProducer::FileCloseSentry::fd_
int fd_
Definition: ExternalLHEProducer.cc:116
lhe2HepMCConverter_cff.LHERunInfoProduct
LHERunInfoProduct
Definition: lhe2HepMCConverter_cff.py:5
ExternalLHEProducer::closeDescriptors
int closeDescriptors(int preserve) const
Definition: ExternalLHEProducer.cc:422
LHERunInfoProduct::addHeader
void addHeader(const Header &header)
Definition: LHERunInfoProduct.h:52
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
CMS_SA_ALLOW
#define CMS_SA_ALLOW
Definition: thread_safety_macros.h:5
FileInPath.h
lhe2HepMCConverter_cff.LHEEventProduct
LHEEventProduct
Definition: lhe2HepMCConverter_cff.py:4
ExternalLHEProducer::runInfoProducts_
boost::ptr_deque< LHERunInfoProduct > runInfoProducts_
Definition: ExternalLHEProducer.cc:106
edm::FileInPath
Definition: FileInPath.h:64
LHERunInfoProduct.h
optionsL1T.skip
skip
Definition: optionsL1T.py:30
MakerMacros.h
ztee.fd
fd
Definition: ztee.py:136
alignCSCRings.s
s
Definition: alignCSCRings.py:92
ExternalLHEProducer::makeArgs
std::vector< std::string > makeArgs(uint32_t nEvents, unsigned int nThreads, std::uint32_t seed) const
Definition: ExternalLHEProducer.cc:400
LHEReader.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ExternalLHEProducer::endRunProduce
void endRunProduce(edm::Run &, edm::EventSetup const &) override
Definition: ExternalLHEProducer.cc:367
Calorimetry_cff.dp
dp
Definition: Calorimetry_cff.py:157
ExternalLHEProducer::preallocThreads
void preallocThreads(unsigned int) override
Definition: ExternalLHEProducer.cc:168
LHERunInfoProduct::addComment
void addComment(const std::string &line)
Definition: LHERunInfoProduct.h:53
Service.h
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:252
Run.h
ExternalLHEProducer::executeScript
void executeScript(std::vector< std::string > const &args, int id) const
Definition: ExternalLHEProducer.cc:459
runTheMatrix.nThreads
nThreads
Definition: runTheMatrix.py:344
OrderedSet.t
t
Definition: OrderedSet.py:90
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ExternalLHEProducer::beginRunProduce
void beginRunProduce(edm::Run &run, edm::EventSetup const &es) override
Definition: ExternalLHEProducer.cc:252
ExternalLHEProducer::args_
const std::vector< std::string > args_
Definition: ExternalLHEProducer.cc:91
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:674
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
edm::ParameterSetDescription::setComment
void setComment(std::string const &value)
Definition: ParameterSetDescription.cc:33
LHEXMLStringProduct.h
Event.h
LHERunInfo.h
ExternalLHEProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: ExternalLHEProducer.cc:555
ExternalLHEProducer::scriptName_
std::string scriptName_
Definition: ExternalLHEProducer.cc:89
eventshapeDQM_cfi.order
order
Definition: eventshapeDQM_cfi.py:8
ExternalLHEProducer::outputFile_
std::string outputFile_
Definition: ExternalLHEProducer.cc:90
edm::Service< edm::RandomNumberGenerator >
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
iEvent
int iEvent
Definition: GenABIO.cc:224
ExternalLHEProducer::wasMerged
bool wasMerged
Definition: ExternalLHEProducer.cc:107
ExternalLHEProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: ExternalLHEProducer.cc:171
edm::EventSetup
Definition: EventSetup.h:57
ExternalLHEProducer::nThreads_
unsigned int nThreads_
Definition: ExternalLHEProducer.cc:95
LesHouches.h
NULL
#define NULL
Definition: scimark2.h:8
ExternalLHEProducer::nPartonMapping_
std::map< unsigned, std::pair< unsigned, unsigned > > nPartonMapping_
Definition: ExternalLHEProducer.cc:100
looper.cfg
cfg
Definition: looper.py:297
ExternalLHEProducer
Definition: ExternalLHEProducer.cc:70
readEcalDQMStatus.read
read
Definition: readEcalDQMStatus.py:38
writeEcalDQMStatus.write
write
Definition: writeEcalDQMStatus.py:48
LHEEventProduct.h
ExternalLHEProducer::FileCloseSentry
Definition: ExternalLHEProducer.cc:109
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
writedatasetfile.run
run
Definition: writedatasetfile.py:27
ExternalLHEProducer::generateConcurrently_
bool generateConcurrently_
Definition: ExternalLHEProducer.cc:97
Frameworkfwd.h
Exception
Definition: hltDiff.cc:246
ExternalLHEProducer::reader_
std::unique_ptr< lhef::LHEReader > reader_
Definition: ExternalLHEProducer.cc:102
LHEEvent.h
ExternalLHEProducer::npars_
uint32_t npars_
Definition: ExternalLHEProducer.cc:92
edm::ParameterSet::getParameterSetVector
VParameterSet const & getParameterSetVector(std::string const &name) const
Definition: ParameterSet.cc:2153
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
cms::Exception
Definition: Exception.h:70
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
ExternalLHEProducer::nextEvent
void nextEvent()
Definition: ExternalLHEProducer.cc:580
pipe.pipe
def pipe(cmdline, input=None)
Definition: pipe.py:5
ParameterSet.h
LHEXMLStringProduct
Definition: LHEXMLStringProduct.h:12
nEvents
UInt_t nEvents
Definition: hcalCalib.cc:41
ExternalLHEProducer::storeXML_
bool storeXML_
Definition: ExternalLHEProducer.cc:94
edm::Event
Definition: Event.h:73
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
ExternalLHEProducer::partonLevel_
std::shared_ptr< lhef::LHEEvent > partonLevel_
Definition: ExternalLHEProducer.cc:105
edm::ParameterSetDescription::addVPSetOptional
ParameterDescriptionBase * addVPSetOptional(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
Definition: ParameterSetDescription.h:163
ExternalLHEProducer::runInfoLast_
std::shared_ptr< lhef::LHERunInfo > runInfoLast_
Definition: ExternalLHEProducer.cc:103
SurveyInfoScenario_cff.seed
seed
Definition: SurveyInfoScenario_cff.py:295
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
LHEEventProduct::addComment
void addComment(const std::string &line)
Definition: LHEEventProduct.h:32
LHEEventProduct::addWeight
void addWeight(const WGT &wgt)
Definition: LHEEventProduct.h:31