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 #include "tbb/task_group.h"
35 
36 #include "boost/ptr_container/ptr_deque.hpp"
37 
38 // user include files
42 
46 
49 
54 
58 
61 
63 
64 //
65 // class declaration
66 //
67 
68 class ExternalLHEProducer : public edm::one::EDProducer<edm::BeginRunProducer, edm::one::WatchRuns> {
69 public:
70  explicit ExternalLHEProducer(const edm::ParameterSet& iConfig);
71 
72  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
73 
74 private:
75  void produce(edm::Event&, const edm::EventSetup&) override;
76  void beginRunProduce(edm::Run& run, edm::EventSetup const& es) override;
77  void beginRun(edm::Run const&, edm::EventSetup const&) override;
78  void endRun(edm::Run const&, 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  std::unique_ptr<LHERunInfoProduct> generateRunInfo(std::vector<std::string> const& files) const;
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::LHEEvent> partonLevel_;
105 
110  public:
111  explicit FileCloseSentry(int fd) : fd_(fd){};
112 
113  ~FileCloseSentry() { close(fd_); }
114 
115  //Make this noncopyable
116  FileCloseSentry(const FileCloseSentry&) = delete;
117  FileCloseSentry& operator=(const FileCloseSentry&) = delete;
118 
119  private:
120  int fd_;
121  };
122 };
123 
124 //
125 // constructors and destructor
126 //
128  : scriptName_((iConfig.getParameter<edm::FileInPath>("scriptName")).fullPath()),
129  outputFile_(iConfig.getParameter<std::string>("outputFile")),
130  args_(iConfig.getParameter<std::vector<std::string>>("args")),
131  npars_(iConfig.getParameter<uint32_t>("numberOfParameters")),
132  nEvents_(iConfig.getUntrackedParameter<uint32_t>("nEvents")),
133  storeXML_(iConfig.getUntrackedParameter<bool>("storeXML")),
134  generateConcurrently_(iConfig.getUntrackedParameter<bool>("generateConcurrently")) {
135  if (npars_ != args_.size())
136  throw cms::Exception("ExternalLHEProducer")
137  << "Problem with configuration: " << args_.size() << " script arguments given, expected " << npars_;
138 
139  if (iConfig.exists("nPartonMapping")) {
140  auto& processMap(iConfig.getParameterSetVector("nPartonMapping"));
141  for (auto& cfg : processMap) {
142  unsigned processId(cfg.getParameter<unsigned>("idprup"));
143 
144  auto orderStr(cfg.getParameter<std::string>("order"));
145  unsigned order(0);
146  if (orderStr == "LO")
147  order = 0;
148  else if (orderStr == "NLO")
149  order = 1;
150  else
151  throw cms::Exception("ExternalLHEProducer")
152  << "Invalid order specification for process " << processId << ": " << orderStr;
153 
154  unsigned np(cfg.getParameter<unsigned>("np"));
155 
156  nPartonMapping_.emplace(processId, std::make_pair(order, np));
157  }
158  }
159 
160  xmlPutToken_ = produces<LHEXMLStringProduct, edm::Transition::BeginRun>("LHEScriptOutput");
161 
162  eventPutToken_ = produces<LHEEventProduct>();
163  beginRunPutToken_ = produces<LHERunInfoProduct, edm::Transition::BeginRun>();
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(eventPutToken_, std::move(product));
228 
229  partonLevel_.reset();
230  return;
231 }
232 
233 // ------------ method called when starting to processes a run ------------
235  // pass the number of events as previous to last argument
236 
237  // pass the random number generator seed as last argument
238 
240 
241  if (!rng.isAvailable()) {
242  throw cms::Exception("Configuration")
243  << "The ExternalLHEProducer module requires the RandomNumberGeneratorService\n"
244  "which is not present in the configuration file. You must add the service\n"
245  "in the configuration file if you want to run ExternalLHEProducer";
246  }
247 
248  std::vector<std::string> infiles;
249  auto const seed = rng->mySeed();
250  if (generateConcurrently_) {
251  infiles.resize(nThreads_);
252  auto const nEventsAve = nEvents_ / nThreads_;
253  unsigned int const overflow = nThreads_ - (nEvents_ % nThreads_);
254  std::exception_ptr except;
255  std::atomic<char> exceptSet{0};
256 
257  tbb::this_task_arena::isolate([this, &except, &infiles, &exceptSet, nEventsAve, overflow, seed]() {
258  tbb::task_group group;
259  for (unsigned int t = 0; t < nThreads_; ++t) {
260  uint32_t nEvents = nEventsAve;
261  if (nEvents_ % nThreads_ != 0 and t >= overflow) {
262  nEvents += 1;
263  }
264  group.run([t, this, &infiles, seed, nEvents, &except, &exceptSet]() {
265  CMS_SA_ALLOW try {
266  using namespace std::filesystem;
267  using namespace std::string_literals;
268  auto out = path("thread"s + std::to_string(t)) / path(outputFile_);
269  infiles[t] = out.native();
271  } catch (...) {
272  char expected = 0;
273  if (exceptSet.compare_exchange_strong(expected, 1)) {
274  except = std::current_exception();
275  exceptSet.store(2);
276  }
277  }
278  });
279  }
280  group.wait();
281  });
282  if (exceptSet != 0) {
283  std::rethrow_exception(except);
284  }
285  } else {
286  infiles = std::vector<std::string>(1, outputFile_);
288  }
289 
290  //fill LHEXMLProduct (streaming read directly into compressed buffer to save memory)
291  std::unique_ptr<LHEXMLStringProduct> p(new LHEXMLStringProduct);
292 
293  //store the XML file only if explictly requested
294  if (storeXML_) {
296  if (generateConcurrently_) {
297  using namespace std::filesystem;
298  file = (path("thread0") / path(outputFile_)).native();
299  } else {
300  file = outputFile_;
301  }
302  std::ifstream instream(file);
303  if (!instream) {
304  throw cms::Exception("OutputOpenError") << "Unable to open script output file " << outputFile_ << ".";
305  }
306  instream.seekg(0, instream.end);
307  int insize = instream.tellg();
308  instream.seekg(0, instream.beg);
309  p->fillCompressedContent(instream, 0.25 * insize);
310  instream.close();
311  }
312  run.put(xmlPutToken_, std::move(p));
313 
314  //Read the beginning of each file to get the run info in order to do the merge
315  auto runInfo = generateRunInfo(infiles);
316  if (runInfo) {
318  }
319 
320  // LHE C++ classes translation
321  // (read back uncompressed file from disk in streaming mode again to save memory)
322  unsigned int skip = 0;
323  reader_ = std::make_unique<lhef::LHEReader>(infiles, skip);
324 
325  nextEvent();
326 }
327 
329 // ------------ method called when ending the processing of a run ------------
331  nextEvent();
332  if (partonLevel_) {
334  << "Error in ExternalLHEProducer::endRunProduce(). "
335  << "Event loop is over, but there are still lhe events to process."
336  << "This could happen if lhe file contains more events than requested. This is never expected to happen.";
337  }
338 
339  reader_.reset();
340  if (generateConcurrently_) {
341  for (unsigned int t = 0; t < nThreads_; ++t) {
342  using namespace std::filesystem;
343  using namespace std::string_literals;
344  auto out = path("thread"s + std::to_string(t)) / path(outputFile_);
345  if (unlink(out.c_str())) {
346  throw cms::Exception("OutputDeleteError") << "Unable to delete original script output file " << out
347  << " (errno=" << errno << ", " << strerror(errno) << ").";
348  }
349  }
350  } else {
351  if (unlink(outputFile_.c_str())) {
352  throw cms::Exception("OutputDeleteError") << "Unable to delete original script output file " << outputFile_
353  << " (errno=" << errno << ", " << strerror(errno) << ").";
354  }
355  }
356 }
357 
358 std::vector<std::string> ExternalLHEProducer::makeArgs(uint32_t nEvents,
359  unsigned int nThreads,
360  std::uint32_t seed) const {
361  std::vector<std::string> args;
362  args.reserve(3 + args_.size());
363 
364  args.push_back(args_.front());
365  args.push_back(std::to_string(nEvents));
366 
367  args.push_back(std::to_string(seed));
368 
369  args.push_back(std::to_string(nThreads));
370  std::copy(args_.begin() + 1, args_.end(), std::back_inserter(args));
371 
372  for (unsigned int iArg = 0; iArg < args.size(); iArg++) {
373  LogDebug("LHEInputArgs") << "arg [" << iArg << "] = " << args[iArg];
374  }
375 
376  return args;
377 }
378 
379 // ------------ Close all the open file descriptors ------------
380 int ExternalLHEProducer::closeDescriptors(int preserve) const {
381  int maxfd = 1024;
382  int fd;
383 #ifdef __linux__
384  DIR* dir;
385  struct dirent* dp;
386  maxfd = preserve;
387  if ((dir = opendir("/proc/self/fd"))) {
388  errno = 0;
389  while ((dp = readdir(dir)) != nullptr) {
390  if ((strcmp(dp->d_name, ".") == 0) || (strcmp(dp->d_name, "..") == 0)) {
391  continue;
392  }
393  if (sscanf(dp->d_name, "%d", &fd) != 1) {
394  //throw cms::Exception("closeDescriptors") << "Found unexpected filename in /proc/self/fd: " << dp->d_name;
395  return -1;
396  }
397  if (fd > maxfd) {
398  maxfd = fd;
399  }
400  }
401  if (errno) {
402  //throw cms::Exception("closeDescriptors") << "Unable to determine the number of fd (errno=" << errno << ", " << strerror(errno) << ").";
403  return errno;
404  }
405  closedir(dir);
406  }
407 #endif
408  // TODO: assert for an unreasonable number of fds?
409  for (fd = 3; fd < maxfd + 1; fd++) {
410  if (fd != preserve)
411  close(fd);
412  }
413  return 0;
414 }
415 
416 // ------------ Execute the script associated with this producer ------------
417 void ExternalLHEProducer::executeScript(std::vector<std::string> const& args, int id) const {
418  // Fork a script, wait until it finishes.
419 
420  int rc = 0, rc2 = 0;
421  int filedes[2], fd_flags;
422 
423  if (pipe(filedes)) {
424  throw cms::Exception("Unable to create a new pipe");
425  }
426  FileCloseSentry sentry1(filedes[0]), sentry2(filedes[1]);
427 
428  if ((fd_flags = fcntl(filedes[1], F_GETFD, NULL)) == -1) {
429  throw cms::Exception("ExternalLHEProducer")
430  << "Failed to get pipe file descriptor flags (errno=" << rc << ", " << strerror(rc) << ")";
431  }
432  if (fcntl(filedes[1], F_SETFD, fd_flags | FD_CLOEXEC) == -1) {
433  throw cms::Exception("ExternalLHEProducer")
434  << "Failed to set pipe file descriptor flags (errno=" << rc << ", " << strerror(rc) << ")";
435  }
436 
437  unsigned int argc = 1 + args.size();
438  // TODO: assert that we have a reasonable number of arguments
439  char** argv = new char*[argc + 1];
440  argv[0] = strdup(scriptName_.c_str());
441  for (unsigned int i = 1; i < argc; i++) {
442  argv[i] = strdup(args[i - 1].c_str());
443  }
444  argv[argc] = nullptr;
445 
446  pid_t pid = fork();
447  if (pid == 0) {
448  // The child process
449  if (!(rc = closeDescriptors(filedes[1]))) {
450  if (generateConcurrently_) {
451  using namespace std::filesystem;
452  using namespace std::string_literals;
453  std::error_code ec;
454  auto newDir = path("thread"s + std::to_string(id));
455  create_directory(newDir, ec);
456  current_path(newDir, ec);
457  }
458  execvp(argv[0], argv); // If execv returns, we have an error.
459  rc = errno;
460  }
461  while ((write(filedes[1], &rc, sizeof(int)) == -1) && (errno == EINTR)) {
462  }
463  _exit(1);
464  }
465 
466  // Free the arg vector ASAP
467  for (unsigned int i = 0; i < args.size() + 1; i++) {
468  free(argv[i]);
469  }
470  delete[] argv;
471 
472  if (pid == -1) {
473  throw cms::Exception("ForkException")
474  << "Unable to fork a child (errno=" << errno << ", " << strerror(errno) << ")";
475  }
476 
477  close(filedes[1]);
478  // If the exec succeeds, the read will fail.
479  while (((rc2 = read(filedes[0], &rc, sizeof(int))) == -1) && (errno == EINTR)) {
480  rc2 = 0;
481  }
482  if ((rc2 == sizeof(int)) && rc) {
483  throw cms::Exception("ExternalLHEProducer")
484  << "Failed to execute script (errno=" << rc << ", " << strerror(rc) << ")";
485  }
486  close(filedes[0]);
487 
488  int status = 0;
489  errno = 0;
490  do {
491  if (waitpid(pid, &status, 0) < 0) {
492  if (errno == EINTR) {
493  continue;
494  } else {
495  throw cms::Exception("ExternalLHEProducer")
496  << "Failed to read child status (errno=" << errno << ", " << strerror(errno) << ")";
497  }
498  }
499  if (WIFSIGNALED(status)) {
500  throw cms::Exception("ExternalLHEProducer") << "Child exited due to signal " << WTERMSIG(status) << ".";
501  }
502  if (WIFEXITED(status)) {
503  rc = WEXITSTATUS(status);
504  break;
505  }
506  } while (true);
507  if (rc) {
508  throw cms::Exception("ExternalLHEProducer") << "Child failed with exit code " << rc << ".";
509  }
510 }
511 
512 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
514  //The following says we do not know what parameters are allowed so do no validation
515  // Please change this to state exactly what you do use, even if it is no parameters
517  desc.setComment("Executes an external script and places its output file into an EDM collection");
518 
519  edm::FileInPath thePath;
520  desc.add<edm::FileInPath>("scriptName", thePath);
521  desc.add<std::string>("outputFile", "myoutput");
522  desc.add<std::vector<std::string>>("args");
523  desc.add<uint32_t>("numberOfParameters");
524  desc.addUntracked<uint32_t>("nEvents");
525  desc.addUntracked<bool>("storeXML", false);
526  desc.addUntracked<bool>("generateConcurrently", false)
527  ->setComment("If true, run the script concurrently in separate processes.");
528 
529  edm::ParameterSetDescription nPartonMappingDesc;
530  nPartonMappingDesc.add<unsigned>("idprup");
531  nPartonMappingDesc.add<std::string>("order");
532  nPartonMappingDesc.add<unsigned>("np");
533  desc.addVPSetOptional("nPartonMapping", nPartonMappingDesc);
534 
535  descriptions.addDefault(desc);
536 }
537 
538 std::unique_ptr<LHERunInfoProduct> ExternalLHEProducer::generateRunInfo(std::vector<std::string> const& iFiles) const {
539  std::unique_ptr<LHERunInfoProduct> retValue;
540  //read each file in turn and only get the header info
541  for (auto const& file : iFiles) {
542  unsigned int skip = 0;
543  std::vector<std::string> infiles(1, file);
544  auto reader = std::make_unique<lhef::LHEReader>(infiles, skip);
545  auto parton = reader->next();
546  if (!parton) {
547  break;
548  }
549  auto runInfo = parton->getRunInfo();
550  LHERunInfoProduct product(*runInfo->getHEPRUP());
551 
552  std::for_each(runInfo->getHeaders().begin(),
553  runInfo->getHeaders().end(),
554  std::bind(&LHERunInfoProduct::addHeader, &product, std::placeholders::_1));
555  std::for_each(runInfo->getComments().begin(),
556  runInfo->getComments().end(),
557  std::bind(&LHERunInfoProduct::addComment, &product, std::placeholders::_1));
558  if (not retValue) {
559  retValue = std::make_unique<LHERunInfoProduct>(std::move(product));
560  } else {
561  retValue->mergeProduct(product);
562  }
563  }
564 
565  return retValue;
566 }
567 
569  if (partonLevel_)
570  return;
571 
572  if (not reader_) {
573  return;
574  }
575 
576  partonLevel_ = reader_->next();
577  if (!partonLevel_) {
578  //see if we have another file to read;
579  bool newFileOpened;
580  do {
581  newFileOpened = false;
582  partonLevel_ = reader_->next(&newFileOpened);
583  } while (newFileOpened && !partonLevel_);
584  }
585 }
586 
587 //define this as a plug-in
writedatasetfile.args
args
Definition: writedatasetfile.py:18
dqmPostProcessing_online.DIR
DIR
Definition: dqmPostProcessing_online.py:10
ExternalLHEProducer::endRun
void endRun(edm::Run const &, edm::EventSetup const &) override
Definition: ExternalLHEProducer.cc:330
cmsBatch.argv
argv
Definition: cmsBatch.py:279
electrons_cff.bool
bool
Definition: electrons_cff.py:366
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: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
ExternalLHEProducer::xmlPutToken_
edm::EDPutTokenT< LHEXMLStringProduct > xmlPutToken_
Definition: ExternalLHEProducer.cc:106
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
edm::EDPutTokenT< LHEXMLStringProduct >
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
np
int np
Definition: AMPTWrapper.h:43
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ExternalLHEProducer::beginRunPutToken_
edm::EDPutTokenT< LHERunInfoProduct > beginRunPutToken_
Definition: ExternalLHEProducer.cc:108
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:127
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:120
ExternalLHEProducer::closeDescriptors
int closeDescriptors(int preserve) const
Definition: ExternalLHEProducer.cc:380
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
ExternalLHEProducer::generateRunInfo
std::unique_ptr< LHERunInfoProduct > generateRunInfo(std::vector< std::string > const &files) const
Definition: ExternalLHEProducer.cc:538
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:358
LHERunInfoProduct
Definition: LHERunInfoProduct.h:13
LHEReader.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
submitPVResolutionJobs.files
files
Definition: submitPVResolutionJobs.py:373
ExternalLHEProducer::beginRun
void beginRun(edm::Run const &, edm::EventSetup const &) override
Definition: ExternalLHEProducer.cc:328
Calorimetry_cff.dp
dp
Definition: Calorimetry_cff.py:158
DQM.reader
reader
Definition: DQM.py:105
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
Run.h
ExternalLHEProducer::executeScript
void executeScript(std::vector< std::string > const &args, int id) const
Definition: ExternalLHEProducer.cc:417
runTheMatrix.nThreads
nThreads
Definition: runTheMatrix.py:370
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:234
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:681
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::ParameterSet
Definition: ParameterSet.h:47
LHEXMLStringProduct.h
Event.h
LHERunInfo.h
ExternalLHEProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: ExternalLHEProducer.cc:513
ExternalLHEProducer::wasMerged_
bool wasMerged_
Definition: ExternalLHEProducer.cc:104
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
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:58
ExternalLHEProducer::FileCloseSentry::operator=
FileCloseSentry & operator=(const FileCloseSentry &)=delete
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:68
readEcalDQMStatus.read
read
Definition: readEcalDQMStatus.py:38
writeEcalDQMStatus.write
write
Definition: writeEcalDQMStatus.py:48
LHEEventProduct.h
ExternalLHEProducer::FileCloseSentry
Definition: ExternalLHEProducer.cc:109
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:97
Frameworkfwd.h
Exception
Definition: hltDiff.cc:245
ExternalLHEProducer::reader_
std::unique_ptr< lhef::LHEReader > reader_
Definition: ExternalLHEProducer.cc:102
submitPVValidationJobs.runInfo
dictionary runInfo
Definition: submitPVValidationJobs.py:1013
ExternalLHEProducer::eventPutToken_
edm::EDPutTokenT< LHEEventProduct > eventPutToken_
Definition: ExternalLHEProducer.cc:107
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: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:568
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:40
ExternalLHEProducer::storeXML_
bool storeXML_
Definition: ExternalLHEProducer.cc:94
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:103
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
watchdog.group
group
Definition: watchdog.py:82
LHEEventProduct::addComment
void addComment(const std::string &line)
Definition: LHEEventProduct.h:32
LHEEventProduct::addWeight
void addWeight(const WGT &wgt)
Definition: LHEEventProduct.h:31