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