CMS 3D CMS Logo

Pythia8Hadronizer.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <sstream>
3 #include <string>
4 #include <memory>
5 #include <cstdint>
6 #include <vector>
7 
8 #include "HepMC/GenEvent.h"
9 #include "HepMC/GenParticle.h"
10 
11 #include "Pythia8/Pythia.h"
12 #include "Pythia8Plugins/HepMC2.h"
13 
14 #include "Pythia8/Vincia.h"
15 #include "Dire/Dire.h"
16 
17 using namespace Pythia8;
18 
20 
22 
23 // PS matchning prototype
24 //
26 #include "Pythia8Plugins/JetMatching.h"
27 #include "Pythia8Plugins/aMCatNLOHooks.h"
28 
30 
31 // Emission Veto Hooks
32 //
33 #include "Pythia8Plugins/PowhegHooks.h"
35 
36 // Resonance scale hook
39 
40 //biased tau decayer
42 
43 //decay filter hook
45 
46 //decay filter hook
48 
49 // EvtGen plugin
50 //
51 #include "Pythia8Plugins/EvtGen.h"
52 
58 
61 
65 
67 
68 #include "HepPID/ParticleIDTranslations.hh"
69 
72 
73 namespace CLHEP {
74  class HepRandomEngine;
75 }
76 
77 using namespace gen;
78 
80 public:
82  ~Pythia8Hadronizer() override;
83 
84  bool initializeForInternalPartons() override;
85  bool initializeForExternalPartons();
86 
87  bool generatePartonsAndHadronize() override;
88  bool hadronize();
89 
90  virtual bool residualDecay();
91 
92  void finalizeEvent() override;
93 
94  void statistics() override;
95 
96  const char *classname() const override { return "Pythia8Hadronizer"; }
97 
98  std::unique_ptr<GenLumiInfoHeader> getGenLumiInfoHeader() const override;
99 
100 private:
101  std::unique_ptr<Pythia8::VinciaPlugin> fvincia;
102  std::unique_ptr<Pythia8::Dire> fDire;
103 
104  void doSetRandomEngine(CLHEP::HepRandomEngine *v) override { p8SetRandomEngine(v); }
105  std::vector<std::string> const &doSharedResources() const override { return p8SharedResources; }
106 
108  double comEnergy;
109 
111  std::unique_ptr<LHAupLesHouches> lhaUP;
112 
113  enum { PP, PPbar, ElectronPositron };
114  int fInitialState; // pp, ppbar, or e-e+
115 
116  double fBeam1PZ;
117  double fBeam2PZ;
118 
119  //helper class to allow multiple user hooks simultaneously
120  std::unique_ptr<MultiUserHook> fMultiUserHook;
121 
122  // Reweight user hooks
123  //
124  std::unique_ptr<UserHooks> fReweightUserHook;
125  std::unique_ptr<UserHooks> fReweightEmpUserHook;
126  std::unique_ptr<UserHooks> fReweightRapUserHook;
127  std::unique_ptr<UserHooks> fReweightPtHatRapUserHook;
128 
129  // PS matching prototype
130  //
131  std::unique_ptr<JetMatchingHook> fJetMatchingHook;
132  std::unique_ptr<Pythia8::JetMatchingMadgraph> fJetMatchingPy8InternalHook;
133  std::unique_ptr<Pythia8::amcnlo_unitarised_interface> fMergingHook;
134 
135  // Emission Veto Hooks
136  //
137  std::unique_ptr<PowhegHooks> fEmissionVetoHook;
138  std::unique_ptr<EmissionVetoHook1> fEmissionVetoHook1;
139 
140  // Resonance scale hook
141  std::unique_ptr<PowhegResHook> fPowhegResHook;
142  std::unique_ptr<PowhegHooksBB4L> fPowhegHooksBB4L;
143 
144  // biased tau decayer
145  std::unique_ptr<BiasedTauDecayer> fBiasedTauDecayer;
146 
147  //resonance decay filter hook
148  std::unique_ptr<ResonanceDecayFilterHook> fResonanceDecayFilterHook;
149 
150  //PT filter hook
151  std::unique_ptr<PTFilterHook> fPTFilterHook;
152 
163 
164  static const std::vector<std::string> p8SharedResources;
165 
166  vector<float> DJR;
167  int nME;
169 
170  int nISRveto;
171  int nFSRveto;
172 };
173 
175 
178  comEnergy(params.getParameter<double>("comEnergy")),
179  LHEInputFileName(params.getUntrackedParameter<std::string>("LHEInputFileName", "")),
180  fInitialState(PP),
181  nME(-1),
182  nMEFiltered(-1),
183  nISRveto(0),
184  nFSRveto(0) {
185  // J.Y.: the following 3 parameters are hacked "for a reason"
186  //
187  if (params.exists("PPbarInitialState")) {
188  if (fInitialState == PP) {
190  edm::LogImportant("GeneratorInterface|Pythia8Interface")
191  << "Pythia8 will be initialized for PROTON-ANTIPROTON INITIAL STATE. "
192  << "This is a user-request change from the DEFAULT PROTON-PROTON initial state.";
193  } else {
194  // probably need to throw on attempt to override ?
195  }
196  } else if (params.exists("ElectronPositronInitialState")) {
197  if (fInitialState == PP) {
199  edm::LogInfo("GeneratorInterface|Pythia8Interface")
200  << "Pythia8 will be initialized for ELECTRON-POSITRON INITIAL STATE. "
201  << "This is a user-request change from the DEFAULT PROTON-PROTON initial state.";
202  } else {
203  // probably need to throw on attempt to override ?
204  }
205  } else if (params.exists("ElectronProtonInitialState") || params.exists("PositronProtonInitialState")) {
206  // throw on unknown initial state !
207  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
208  << " UNKNOWN INITIAL STATE. \n The allowed initial states are: PP, PPbar, ElectronPositron \n";
209  }
210 
211  // Reweight user hook
212  //
213  if (params.exists("reweightGen")) {
214  edm::LogInfo("Pythia8Interface") << "Start setup for reweightGen";
215  edm::ParameterSet rgParams = params.getParameter<edm::ParameterSet>("reweightGen");
216  fReweightUserHook.reset(
217  new PtHatReweightUserHook(rgParams.getParameter<double>("pTRef"), rgParams.getParameter<double>("power")));
218  edm::LogInfo("Pythia8Interface") << "End setup for reweightGen";
219  }
220  if (params.exists("reweightGenEmp")) {
221  edm::LogInfo("Pythia8Interface") << "Start setup for reweightGenEmp";
222  edm::ParameterSet rgeParams = params.getParameter<edm::ParameterSet>("reweightGenEmp");
223 
224  std::string tuneName = "";
225  if (rgeParams.exists("tune"))
226  tuneName = rgeParams.getParameter<std::string>("tune");
227  fReweightEmpUserHook.reset(new PtHatEmpReweightUserHook(tuneName));
228  edm::LogInfo("Pythia8Interface") << "End setup for reweightGenEmp";
229  }
230  if (params.exists("reweightGenRap")) {
231  edm::LogInfo("Pythia8Interface") << "Start setup for reweightGenRap";
232  edm::ParameterSet rgrParams = params.getParameter<edm::ParameterSet>("reweightGenRap");
233  fReweightRapUserHook.reset(new RapReweightUserHook(rgrParams.getParameter<std::string>("yLabSigmaFunc"),
234  rgrParams.getParameter<double>("yLabPower"),
235  rgrParams.getParameter<std::string>("yCMSigmaFunc"),
236  rgrParams.getParameter<double>("yCMPower"),
237  rgrParams.getParameter<double>("pTHatMin"),
238  rgrParams.getParameter<double>("pTHatMax")));
239  edm::LogInfo("Pythia8Interface") << "End setup for reweightGenRap";
240  }
241  if (params.exists("reweightGenPtHatRap")) {
242  edm::LogInfo("Pythia8Interface") << "Start setup for reweightGenPtHatRap";
243  edm::ParameterSet rgrParams = params.getParameter<edm::ParameterSet>("reweightGenPtHatRap");
244  fReweightPtHatRapUserHook.reset(new PtHatRapReweightUserHook(rgrParams.getParameter<std::string>("yLabSigmaFunc"),
245  rgrParams.getParameter<double>("yLabPower"),
246  rgrParams.getParameter<std::string>("yCMSigmaFunc"),
247  rgrParams.getParameter<double>("yCMPower"),
248  rgrParams.getParameter<double>("pTHatMin"),
249  rgrParams.getParameter<double>("pTHatMax")));
250  edm::LogInfo("Pythia8Interface") << "End setup for reweightGenPtHatRap";
251  }
252 
253  if (params.exists("useUserHook"))
254  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
255  << " Obsolete parameter: useUserHook \n Please use the actual one instead \n";
256 
257  // PS matching prototype
258  //
259  if (params.exists("jetMatching")) {
260  edm::ParameterSet jmParams = params.getUntrackedParameter<edm::ParameterSet>("jetMatching");
261  std::string scheme = jmParams.getParameter<std::string>("scheme");
262  if (scheme == "Madgraph" || scheme == "MadgraphFastJet") {
263  fJetMatchingHook.reset(new JetMatchingHook(jmParams, &fMasterGen->info));
264  }
265  }
266 
267  // Pythia8Interface emission veto
268  //
269  if (params.exists("emissionVeto1")) {
270  EV1_nFinal = -1;
271  if (params.exists("EV1_nFinal"))
272  EV1_nFinal = params.getParameter<int>("EV1_nFinal");
273  EV1_vetoOn = true;
274  if (params.exists("EV1_vetoOn"))
275  EV1_vetoOn = params.getParameter<bool>("EV1_vetoOn");
276  EV1_maxVetoCount = 10;
277  if (params.exists("EV1_maxVetoCount"))
278  EV1_maxVetoCount = params.getParameter<int>("EV1_maxVetoCount");
279  EV1_pThardMode = 1;
280  if (params.exists("EV1_pThardMode"))
281  EV1_pThardMode = params.getParameter<int>("EV1_pThardMode");
282  EV1_pTempMode = 0;
283  if (params.exists("EV1_pTempMode"))
284  EV1_pTempMode = params.getParameter<int>("EV1_pTempMode");
285  if (EV1_pTempMode > 2 || EV1_pTempMode < 0)
286  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface") << " Wrong value for EV1_pTempMode code\n";
287  EV1_emittedMode = 0;
288  if (params.exists("EV1_emittedMode"))
289  EV1_emittedMode = params.getParameter<int>("EV1_emittedMode");
290  EV1_pTdefMode = 1;
291  if (params.exists("EV1_pTdefMode"))
292  EV1_pTdefMode = params.getParameter<int>("EV1_pTdefMode");
293  EV1_MPIvetoOn = false;
294  if (params.exists("EV1_MPIvetoOn"))
295  EV1_MPIvetoOn = params.getParameter<bool>("EV1_MPIvetoOn");
296  EV1_QEDvetoMode = 0;
297  if (params.exists("EV1_QEDvetoMode"))
298  EV1_QEDvetoMode = params.getParameter<int>("EV1_QEDvetoMode");
299  EV1_nFinalMode = 0;
300  if (params.exists("EV1_nFinalMode"))
301  EV1_nFinalMode = params.getParameter<int>("EV1_nFinalMode");
303  EV1_vetoOn,
312  0));
313  }
314 
315  if (params.exists("VinciaPlugin")) {
316  fMasterGen.reset(new Pythia);
317  fvincia.reset(new Pythia8::VinciaPlugin(fMasterGen.get()));
318  }
319  if (params.exists("DirePlugin")) {
320  fMasterGen.reset(new Pythia);
321  fDire.reset(new Pythia8::Dire());
322  fDire->initSettings(*fMasterGen.get());
323  fDire->initShowersAndWeights(*fMasterGen.get(), nullptr, nullptr);
324  }
325 }
326 
328 
330  bool status = false, status1 = false;
331 
332  if (lheFile_.empty()) {
333  if (fInitialState == PP) // default
334  {
335  fMasterGen->settings.mode("Beams:idA", 2212);
336  fMasterGen->settings.mode("Beams:idB", 2212);
337  } else if (fInitialState == PPbar) {
338  fMasterGen->settings.mode("Beams:idA", 2212);
339  fMasterGen->settings.mode("Beams:idB", -2212);
340  } else if (fInitialState == ElectronPositron) {
341  fMasterGen->settings.mode("Beams:idA", 11);
342  fMasterGen->settings.mode("Beams:idB", -11);
343  } else {
344  // throw on unknown initial state !
345  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
346  << " UNKNOWN INITIAL STATE. \n The allowed initial states are: PP, PPbar, ElectronPositron \n";
347  }
348  fMasterGen->settings.parm("Beams:eCM", comEnergy);
349  } else {
350  fMasterGen->settings.mode("Beams:frameType", 4);
351  fMasterGen->settings.word("Beams:LHEF", lheFile_);
352  }
353 
354  fMultiUserHook.reset(new MultiUserHook);
355 
356  if (fReweightUserHook.get())
357  fMultiUserHook->addHook(fReweightUserHook.get());
358  if (fReweightEmpUserHook.get())
359  fMultiUserHook->addHook(fReweightEmpUserHook.get());
360  if (fReweightRapUserHook.get())
361  fMultiUserHook->addHook(fReweightRapUserHook.get());
362  if (fReweightPtHatRapUserHook.get())
364  if (fJetMatchingHook.get())
365  fMultiUserHook->addHook(fJetMatchingHook.get());
366  if (fEmissionVetoHook1.get()) {
367  edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook 1 from CMSSW Pythia8Interface";
368  fMultiUserHook->addHook(fEmissionVetoHook1.get());
369  }
370 
371  if (fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) {
372  if (fJetMatchingHook.get() || fEmissionVetoHook1.get())
373  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
374  << " Attempt to turn on PowhegHooks by pythia8 settings but there are incompatible hooks on \n Incompatible "
375  "are : jetMatching, emissionVeto1 \n";
376 
377  fEmissionVetoHook.reset(new PowhegHooks());
378 
379  edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook from pythia8 code";
380  fMultiUserHook->addHook(fEmissionVetoHook.get());
381  }
382 
383  bool PowhegRes = fMasterGen->settings.flag("POWHEGres:calcScales");
384  if (PowhegRes) {
385  edm::LogInfo("Pythia8Interface") << "Turning on resonance scale setting from CMSSW Pythia8Interface";
386  fPowhegResHook.reset(new PowhegResHook());
387  fMultiUserHook->addHook(fPowhegResHook.get());
388  }
389 
390  bool PowhegBB4L = fMasterGen->settings.flag("POWHEG:bb4l");
391  if (PowhegBB4L) {
392  edm::LogInfo("Pythia8Interface") << "Turning on BB4l hook from CMSSW Pythia8Interface";
393  fPowhegHooksBB4L.reset(new PowhegHooksBB4L());
394  fMultiUserHook->addHook(fPowhegHooksBB4L.get());
395  }
396 
397  //adapted from main89.cc in pythia8 examples
398  bool internalMatching = fMasterGen->settings.flag("JetMatching:merge");
399  bool internalMerging = !(fMasterGen->settings.word("Merging:Process") == "void");
400 
401  if (internalMatching && internalMerging) {
402  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
403  << " Only one jet matching/merging scheme can be used at a time. \n";
404  }
405 
406  if (internalMatching) {
407  fJetMatchingPy8InternalHook.reset(new Pythia8::JetMatchingMadgraph);
409  }
410 
411  if (internalMerging) {
412  int scheme = (fMasterGen->settings.flag("Merging:doUMEPSTree") || fMasterGen->settings.flag("Merging:doUMEPSSubt"))
413  ? 1
414  : ((fMasterGen->settings.flag("Merging:doUNLOPSTree") ||
415  fMasterGen->settings.flag("Merging:doUNLOPSSubt") ||
416  fMasterGen->settings.flag("Merging:doUNLOPSLoop") ||
417  fMasterGen->settings.flag("Merging:doUNLOPSSubtNLO"))
418  ? 2
419  : 0);
420  fMergingHook.reset(new Pythia8::amcnlo_unitarised_interface(scheme));
421  fMultiUserHook->addHook(fMergingHook.get());
422  }
423  bool biasedTauDecayer = fMasterGen->settings.flag("BiasedTauDecayer:filter");
424  if (biasedTauDecayer) {
425  fBiasedTauDecayer.reset(new BiasedTauDecayer(&(fMasterGen->info),
426  &(fMasterGen->settings),
427  &(fMasterGen->particleData),
428  &(fMasterGen->rndm),
429  &(fMasterGen->couplings)));
430  std::vector<int> handledParticles;
431  handledParticles.push_back(15);
432  fMasterGen->setDecayPtr(fBiasedTauDecayer.get(), handledParticles);
433  }
434 
435  bool resonanceDecayFilter = fMasterGen->settings.flag("ResonanceDecayFilter:filter");
436  if (resonanceDecayFilter) {
439  }
440 
441  bool PTFilter = fMasterGen->settings.flag("PTFilter:filter");
442  if (PTFilter) {
443  fPTFilterHook.reset(new PTFilterHook);
444  fMultiUserHook->addHook(fPTFilterHook.get());
445  }
446 
447  if (fMultiUserHook->nHooks() > 0) {
448  fMasterGen->setUserHooksPtr(fMultiUserHook.get());
449  }
450 
451  edm::LogInfo("Pythia8Interface") << "Initializing MasterGen";
452  if (fvincia.get()) {
453  fvincia->init();
454  status = true;
455  } else if (fDire.get()) {
456  //fDire->initTune(*fMasterGen.get());
457  fDire->weightsPtr->setup();
458  fMasterGen->init();
459  fDire->setup(*fMasterGen.get());
460  status = true;
461  } else {
462  status = fMasterGen->init();
463  }
464 
465  //clean up temp file
466  if (!slhafile_.empty()) {
467  std::remove(slhafile_.c_str());
468  }
469 
470  if (pythiaPylistVerbosity > 10) {
471  if (pythiaPylistVerbosity == 11 || pythiaPylistVerbosity == 13)
472  fMasterGen->settings.listAll();
473  if (pythiaPylistVerbosity == 12 || pythiaPylistVerbosity == 13)
474  fMasterGen->particleData.listAll();
475  }
476 
477  // init decayer
478  fDecayer->settings.flag("ProcessLevel:all", false); // trick
479  fDecayer->settings.flag("ProcessLevel:resonanceDecays", true);
480  edm::LogInfo("Pythia8Interface") << "Initializing Decayer";
481  status1 = fDecayer->init();
482 
483  if (useEvtGen) {
484  edm::LogInfo("Pythia8Hadronizer") << "Creating and initializing pythia8 EvtGen plugin";
485  evtgenDecays.reset(new EvtGenDecays(fMasterGen.get(), evtgenDecFile, evtgenPdlFile));
486  for (unsigned int i = 0; i < evtgenUserFiles.size(); i++)
487  evtgenDecays->readDecayFile(evtgenUserFiles.at(i));
488  }
489 
490  return (status && status1);
491 }
492 
494  edm::LogInfo("Pythia8Interface") << "Initializing for external partons";
495 
496  bool status = false, status1 = false;
497 
498  fMultiUserHook.reset(new MultiUserHook);
499 
500  if (fReweightUserHook.get())
501  fMultiUserHook->addHook(fReweightUserHook.get());
502  if (fReweightEmpUserHook.get())
503  fMultiUserHook->addHook(fReweightEmpUserHook.get());
504  if (fReweightRapUserHook.get())
505  fMultiUserHook->addHook(fReweightRapUserHook.get());
506  if (fReweightPtHatRapUserHook.get())
508  if (fJetMatchingHook.get())
509  fMultiUserHook->addHook(fJetMatchingHook.get());
510  if (fEmissionVetoHook1.get()) {
511  edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook 1 from CMSSW Pythia8Interface";
512  fMultiUserHook->addHook(fEmissionVetoHook1.get());
513  }
514 
515  if (fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) {
516  if (fJetMatchingHook.get() || fEmissionVetoHook1.get())
517  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
518  << " Attempt to turn on PowhegHooks by pythia8 settings but there are incompatible hooks on \n Incompatible "
519  "are : jetMatching, emissionVeto1 \n";
520 
521  fEmissionVetoHook.reset(new PowhegHooks());
522 
523  edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook from pythia8 code";
524  fMultiUserHook->addHook(fEmissionVetoHook.get());
525  }
526 
527  bool PowhegRes = fMasterGen->settings.flag("POWHEGres:calcScales");
528  if (PowhegRes) {
529  edm::LogInfo("Pythia8Interface") << "Turning on resonance scale setting from CMSSW Pythia8Interface";
530  fPowhegResHook.reset(new PowhegResHook());
531  fMultiUserHook->addHook(fPowhegResHook.get());
532  }
533 
534  bool PowhegBB4L = fMasterGen->settings.flag("POWHEG:bb4l");
535  if (PowhegBB4L) {
536  edm::LogInfo("Pythia8Interface") << "Turning on BB4l hook from CMSSW Pythia8Interface";
537  fPowhegHooksBB4L.reset(new PowhegHooksBB4L());
538  fMultiUserHook->addHook(fPowhegHooksBB4L.get());
539  }
540 
541  //adapted from main89.cc in pythia8 examples
542  bool internalMatching = fMasterGen->settings.flag("JetMatching:merge");
543  bool internalMerging = !(fMasterGen->settings.word("Merging:Process") == "void");
544 
545  if (internalMatching && internalMerging) {
546  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
547  << " Only one jet matching/merging scheme can be used at a time. \n";
548  }
549 
550  if (internalMatching) {
551  fJetMatchingPy8InternalHook.reset(new Pythia8::JetMatchingMadgraph);
553  }
554 
555  if (internalMerging) {
556  int scheme = (fMasterGen->settings.flag("Merging:doUMEPSTree") || fMasterGen->settings.flag("Merging:doUMEPSSubt"))
557  ? 1
558  : ((fMasterGen->settings.flag("Merging:doUNLOPSTree") ||
559  fMasterGen->settings.flag("Merging:doUNLOPSSubt") ||
560  fMasterGen->settings.flag("Merging:doUNLOPSLoop") ||
561  fMasterGen->settings.flag("Merging:doUNLOPSSubtNLO"))
562  ? 2
563  : 0);
564  fMergingHook.reset(new Pythia8::amcnlo_unitarised_interface(scheme));
565  fMultiUserHook->addHook(fMergingHook.get());
566  }
567 
568  bool biasedTauDecayer = fMasterGen->settings.flag("BiasedTauDecayer:filter");
569  if (biasedTauDecayer) {
570  fBiasedTauDecayer.reset(new BiasedTauDecayer(&(fMasterGen->info),
571  &(fMasterGen->settings),
572  &(fMasterGen->particleData),
573  &(fMasterGen->rndm),
574  &(fMasterGen->couplings)));
575  std::vector<int> handledParticles;
576  handledParticles.push_back(15);
577  fMasterGen->setDecayPtr(fBiasedTauDecayer.get(), handledParticles);
578  }
579 
580  bool resonanceDecayFilter = fMasterGen->settings.flag("ResonanceDecayFilter:filter");
581  if (resonanceDecayFilter) {
584  }
585 
586  bool PTFilter = fMasterGen->settings.flag("PTFilter:filter");
587  if (PTFilter) {
588  fPTFilterHook.reset(new PTFilterHook);
589  fMultiUserHook->addHook(fPTFilterHook.get());
590  }
591 
592  if (fMultiUserHook->nHooks() > 0) {
593  fMasterGen->setUserHooksPtr(fMultiUserHook.get());
594  }
595 
596  if (!LHEInputFileName.empty()) {
597  edm::LogInfo("Pythia8Interface") << "Initialize direct pythia8 reading from LHE file " << LHEInputFileName;
598  edm::LogInfo("Pythia8Interface") << "Some LHE information can be not stored";
599  fMasterGen->settings.mode("Beams:frameType", 4);
600  fMasterGen->settings.word("Beams:LHEF", LHEInputFileName);
601  status = fMasterGen->init();
602 
603  } else {
604  lhaUP.reset(new LHAupLesHouches());
605  lhaUP->setScalesFromLHEF(fMasterGen->settings.flag("Beams:setProductionScalesFromLHEF"));
606  lhaUP->loadRunInfo(lheRunInfo());
607 
608  if (fJetMatchingHook.get()) {
609  fJetMatchingHook->init(lheRunInfo());
610  }
611 
612  fMasterGen->settings.mode("Beams:frameType", 5);
613  fMasterGen->setLHAupPtr(lhaUP.get());
614  edm::LogInfo("Pythia8Interface") << "Initializing MasterGen";
615  status = fMasterGen->init();
616  }
617 
618  //clean up temp file
619  if (!slhafile_.empty()) {
620  std::remove(slhafile_.c_str());
621  }
622 
623  if (pythiaPylistVerbosity > 10) {
624  if (pythiaPylistVerbosity == 11 || pythiaPylistVerbosity == 13)
625  fMasterGen->settings.listAll();
626  if (pythiaPylistVerbosity == 12 || pythiaPylistVerbosity == 13)
627  fMasterGen->particleData.listAll();
628  }
629 
630  // init decayer
631  fDecayer->settings.flag("ProcessLevel:all", false); // trick
632  fDecayer->settings.flag("ProcessLevel:resonanceDecays", true);
633  edm::LogInfo("Pythia8Interface") << "Initializing Decayer";
634  status1 = fDecayer->init();
635 
636  if (useEvtGen) {
637  edm::LogInfo("Pythia8Hadronizer") << "Creating and initializing pythia8 EvtGen plugin";
638  evtgenDecays.reset(new EvtGenDecays(fMasterGen.get(), evtgenDecFile, evtgenPdlFile));
639  for (unsigned int i = 0; i < evtgenUserFiles.size(); i++)
640  evtgenDecays->readDecayFile(evtgenUserFiles.at(i));
641  }
642 
643  return (status && status1);
644 }
645 
647  fMasterGen->stat();
648 
649  if (fEmissionVetoHook.get()) {
650  edm::LogPrint("Pythia8Interface") << "\n"
651  << "Number of ISR vetoed = " << nISRveto;
652  edm::LogPrint("Pythia8Interface") << "Number of FSR vetoed = " << nFSRveto;
653  }
654 
655  double xsec = fMasterGen->info.sigmaGen(); // cross section in mb
656  xsec *= 1.0e9; // translate to pb (CMS/Gen "convention" as of May 2009)
657  double err = fMasterGen->info.sigmaErr(); // cross section err in mb
658  err *= 1.0e9; // translate to pb (CMS/Gen "convention" as of May 2009)
660 }
661 
663  DJR.resize(0);
664  nME = -1;
665  nMEFiltered = -1;
666 
667  if (fJetMatchingHook.get()) {
668  fJetMatchingHook->resetMatchingStatus();
669  fJetMatchingHook->beforeHadronization(lheEvent());
670  }
671 
672  if (!fMasterGen->next())
673  return false;
674 
675  double mergeweight = fMasterGen.get()->info.mergingWeightNLO();
676  if (fMergingHook.get()) {
677  mergeweight *= fMergingHook->getNormFactor();
678  }
679 
680  //protect against 0-weight from ckkw or similar
681  if (std::abs(mergeweight) == 0.) {
682  event().reset();
683  return false;
684  }
685 
686  if (fJetMatchingPy8InternalHook.get()) {
687  const std::vector<double> djrmatch = fJetMatchingPy8InternalHook->getDJR();
688  //cap size of djr vector to save storage space (keep only up to first 6 elements)
689  unsigned int ndjr = std::min(djrmatch.size(), std::vector<double>::size_type(6));
690  for (unsigned int idjr = 0; idjr < ndjr; ++idjr) {
691  DJR.push_back(djrmatch[idjr]);
692  }
693 
694  nME = fJetMatchingPy8InternalHook->nMEpartons().first;
695  nMEFiltered = fJetMatchingPy8InternalHook->nMEpartons().second;
696  }
697 
698  if (evtgenDecays.get())
699  evtgenDecays->decay();
700 
701  event().reset(new HepMC::GenEvent);
702  bool py8hepmc = toHepMC.fill_next_event(*(fMasterGen.get()), event().get());
703 
704  if (!py8hepmc) {
705  return false;
706  }
707 
708  //add ckkw/umeps/unlops merging weight
709  if (mergeweight != 1.) {
710  event()->weights()[0] *= mergeweight;
711  }
712 
713  if (fEmissionVetoHook.get()) {
714  nISRveto += fEmissionVetoHook->getNISRveto();
715  nFSRveto += fEmissionVetoHook->getNFSRveto();
716  }
717 
718  //fill additional weights for systematic uncertainties
719  if (fMasterGen->info.getWeightsDetailedSize() > 0) {
720  for (const string &key : fMasterGen->info.initrwgt->weightsKeys) {
721  double wgt = (*fMasterGen->info.weights_detailed)[key];
722  event()->weights().push_back(wgt);
723  }
724  } else if (fMasterGen->info.getWeightsCompressedSize() > 0) {
725  for (unsigned int i = 0; i < fMasterGen->info.getWeightsCompressedSize(); i++) {
726  double wgt = fMasterGen->info.getWeightsCompressedValue(i);
727  event()->weights().push_back(wgt);
728  }
729  }
730 
731  // fill shower weights
732  // http://home.thep.lu.se/~torbjorn/pythia82html/Variations.html
733  if (fMasterGen->info.nWeights() > 1) {
734  for (int i = 0; i < fMasterGen->info.nWeights(); ++i) {
735  double wgt = fMasterGen->info.weight(i);
736  event()->weights().push_back(wgt);
737  }
738  }
739 
740  // VINCIA shower weights
741  // http://vincia.hepforge.org/current/share/Vincia/htmldoc/VinciaUncertainties.html
742  if (fvincia.get()) {
743  event()->weights()[0] *= fvincia->weight(0);
744  for (int iVar = 1; iVar < fvincia->nWeights(); iVar++) {
745  event()->weights().push_back(fvincia->weight(iVar));
746  }
747  }
748 
749  // Retrieve Dire shower weights
750  if (fDire.get()) {
751  fDire->weightsPtr->calcWeight(0.);
752  fDire->weightsPtr->reset();
753 
754  //Make sure the base weight comes first
755  event()->weights()[0] *= fDire->weightsPtr->getShowerWeight("base");
756 
757  unordered_map<string, double>::iterator it;
758  for (it = fDire->weightsPtr->getShowerWeights()->begin(); it != fDire->weightsPtr->getShowerWeights()->end();
759  it++) {
760  if (it->first == "base")
761  continue;
762  event()->weights().push_back(it->second);
763  }
764  }
765 
766  return true;
767 }
768 
770  DJR.resize(0);
771  nME = -1;
772  nMEFiltered = -1;
773  if (LHEInputFileName.empty())
774  lhaUP->loadEvent(lheEvent());
775 
776  if (fJetMatchingHook.get()) {
777  fJetMatchingHook->resetMatchingStatus();
778  fJetMatchingHook->beforeHadronization(lheEvent());
779  }
780 
781  bool py8next = fMasterGen->next();
782 
783  double mergeweight = fMasterGen.get()->info.mergingWeightNLO();
784  if (fMergingHook.get()) {
785  mergeweight *= fMergingHook->getNormFactor();
786  }
787 
788  //protect against 0-weight from ckkw or similar
789  if (!py8next || std::abs(mergeweight) == 0.) {
790  lheEvent()->count(lhef::LHERunInfo::kSelected, 1.0, mergeweight);
791  event().reset();
792  return false;
793  }
794 
795  if (fJetMatchingPy8InternalHook.get()) {
796  const std::vector<double> djrmatch = fJetMatchingPy8InternalHook->getDJR();
797  //cap size of djr vector to save storage space (keep only up to first 6 elements)
798  unsigned int ndjr = std::min(djrmatch.size(), std::vector<double>::size_type(6));
799  for (unsigned int idjr = 0; idjr < ndjr; ++idjr) {
800  DJR.push_back(djrmatch[idjr]);
801  }
802 
803  nME = fJetMatchingPy8InternalHook->nMEpartons().first;
804  nMEFiltered = fJetMatchingPy8InternalHook->nMEpartons().second;
805  }
806 
807  // update LHE matching statistics
808  //
809  lheEvent()->count(lhef::LHERunInfo::kAccepted, 1.0, mergeweight);
810 
811  if (evtgenDecays.get())
812  evtgenDecays->decay();
813 
814  event().reset(new HepMC::GenEvent);
815  bool py8hepmc = toHepMC.fill_next_event(*(fMasterGen.get()), event().get());
816  if (!py8hepmc) {
817  return false;
818  }
819 
820  //add ckkw/umeps/unlops merging weight
821  if (mergeweight != 1.) {
822  event()->weights()[0] *= mergeweight;
823  }
824 
825  if (fEmissionVetoHook.get()) {
826  nISRveto += fEmissionVetoHook->getNISRveto();
827  nFSRveto += fEmissionVetoHook->getNFSRveto();
828  }
829 
830  // fill shower weights
831  // http://home.thep.lu.se/~torbjorn/pythia82html/Variations.html
832  if (fMasterGen->info.nWeights() > 1) {
833  for (int i = 0; i < fMasterGen->info.nWeights(); ++i) {
834  double wgt = fMasterGen->info.weight(i);
835  event()->weights().push_back(wgt);
836  }
837  }
838 
839  return true;
840 }
841 
843  Event *pythiaEvent = &(fMasterGen->event);
844 
845  int NPartsBeforeDecays = pythiaEvent->size();
846  int NPartsAfterDecays = event().get()->particles_size();
847 
848  if (NPartsAfterDecays == NPartsBeforeDecays)
849  return true;
850 
851  bool result = true;
852 
853  for (int ipart = NPartsAfterDecays; ipart > NPartsBeforeDecays; ipart--) {
854  HepMC::GenParticle *part = event().get()->barcode_to_particle(ipart);
855 
856  if (part->status() == 1 && (fDecayer->particleData).canDecay(part->pdg_id())) {
857  fDecayer->event.reset();
858  Particle py8part(part->pdg_id(),
859  93,
860  0,
861  0,
862  0,
863  0,
864  0,
865  0,
866  part->momentum().x(),
867  part->momentum().y(),
868  part->momentum().z(),
869  part->momentum().t(),
870  part->generated_mass());
871  HepMC::GenVertex *ProdVtx = part->production_vertex();
872  py8part.vProd(ProdVtx->position().x(), ProdVtx->position().y(), ProdVtx->position().z(), ProdVtx->position().t());
873  py8part.tau((fDecayer->particleData).tau0(part->pdg_id()));
874  fDecayer->event.append(py8part);
875  int nentries = fDecayer->event.size();
876  if (!fDecayer->event[nentries - 1].mayDecay())
877  continue;
878  fDecayer->next();
879  int nentries1 = fDecayer->event.size();
880  if (nentries1 <= nentries)
881  continue; //same number of particles, no decays...
882 
883  part->set_status(2);
884 
885  result = toHepMC.fill_next_event(*(fDecayer.get()), event().get(), -1, true, part);
886  }
887  }
888 
889  return result;
890 }
891 
893  bool lhe = lheEvent() != nullptr;
894 
895  // now create the GenEventInfo product from the GenEvent and fill
896  // the missing pieces
897  eventInfo().reset(new GenEventInfoProduct(event().get()));
898 
899  // in pythia pthat is used to subdivide samples into different bins
900  // in LHE mode the binning is done by the external ME generator
901  // which is likely not pthat, so only filling it for Py6 internal mode
902  if (!lhe) {
903  eventInfo()->setBinningValues(std::vector<double>(1, fMasterGen->info.pTHat()));
904  }
905 
906  eventInfo()->setDJR(DJR);
907  eventInfo()->setNMEPartons(nME);
908  eventInfo()->setNMEPartonsFiltered(nMEFiltered);
909 
910  //******** Verbosity ********
911 
914  if (pythiaPylistVerbosity) {
915  fMasterGen->info.list();
916  fMasterGen->event.list();
917  }
918 
919  if (pythiaHepMCVerbosity) {
920  std::cout << "Event process = " << fMasterGen->info.code() << "\n"
921  << "----------------------" << std::endl;
922  event()->print();
923  }
925  std::cout << "Event process = " << fMasterGen->info.code() << "\n"
926  << "----------------------" << std::endl;
927  ascii_io->write_event(event().get());
928  }
929  }
930 }
931 
932 std::unique_ptr<GenLumiInfoHeader> Pythia8Hadronizer::getGenLumiInfoHeader() const {
933  auto genLumiInfoHeader = BaseHadronizer::getGenLumiInfoHeader();
934 
935  //fill lhe headers
936  //*FIXME* initrwgt header is corrupt due to pythia bug
937  for (const std::string &key : fMasterGen->info.headerKeys()) {
938  genLumiInfoHeader->lheHeaders().emplace_back(key, fMasterGen->info.header(key));
939  }
940 
941  //check, if it is not only nominal weight
942  int weights_number = fMasterGen->info.nWeights();
943  if (fMasterGen->info.initrwgt)
944  weights_number += fMasterGen->info.initrwgt->weightsKeys.size();
945  if (weights_number > 1) {
946  genLumiInfoHeader->weightNames().reserve(weights_number + 1);
947  genLumiInfoHeader->weightNames().push_back("nominal");
948  }
949 
950  //fill weight names
951  if (fMasterGen->info.initrwgt) {
952  for (const std::string &key : fMasterGen->info.initrwgt->weightsKeys) {
953  std::string weightgroupname;
954  for (const auto &wgtgrp : fMasterGen->info.initrwgt->weightgroups) {
955  const auto &wgtgrpwgt = wgtgrp.second.weights.find(key);
956  if (wgtgrpwgt != wgtgrp.second.weights.end()) {
957  weightgroupname = wgtgrp.first;
958  }
959  }
960 
961  std::ostringstream weightname;
962  weightname << "LHE, id = " << key << ", ";
963  if (!weightgroupname.empty()) {
964  weightname << "group = " << weightgroupname << ", ";
965  }
966  weightname << fMasterGen->info.initrwgt->weights[key].contents;
967  genLumiInfoHeader->weightNames().push_back(weightname.str());
968  }
969  }
970 
971  //fill shower labels
972  // http://home.thep.lu.se/~torbjorn/pythia82html/Variations.html
973  // http://home.thep.lu.se/~torbjorn/doxygen/classPythia8_1_1Info.html
974  if (fMasterGen->info.nWeights() > 1) {
975  for (int i = 0; i < fMasterGen->info.nWeights(); ++i) {
976  genLumiInfoHeader->weightNames().push_back(fMasterGen->info.weightLabel(i));
977  }
978  }
979 
980  // VINCIA shower weights
981  // http://vincia.hepforge.org/current/share/Vincia/htmldoc/VinciaUncertainties.html
982  if (fvincia.get()) {
983  for (int iVar = 0; iVar < fvincia->nWeights(); iVar++) {
984  genLumiInfoHeader->weightNames().push_back(fvincia->weightLabel(iVar));
985  }
986  }
987 
988  if (fDire.get()) {
989  //Make sure the base weight comes first
990  genLumiInfoHeader->weightNames().push_back("base");
991 
992  unordered_map<string, double>::iterator it;
993  for (it = fDire->weightsPtr->getShowerWeights()->begin(); it != fDire->weightsPtr->getShowerWeights()->end();
994  it++) {
995  if (it->first == "base")
996  continue;
997  genLumiInfoHeader->weightNames().push_back(it->first);
998  }
999  }
1000 
1001  return genLumiInfoHeader;
1002 }
1003 
1006 
1009 
GenEventInfoProduct
Definition: GenEventInfoProduct.h:17
lhef::LHERunInfo::kAccepted
Definition: LHERunInfo.h:64
gen::Py8InterfaceBase::fMasterGen
std::unique_ptr< Pythia8::Pythia > fMasterGen
Definition: Py8InterfaceBase.h:44
Pythia8Hadronizer::~Pythia8Hadronizer
~Pythia8Hadronizer() override
Definition: Pythia8Hadronizer.cc:327
gen::BaseHadronizer::lheRunInfo
lhef::LHERunInfo * lheRunInfo()
Definition: BaseHadronizer.h:90
gen::BaseHadronizer::lheEvent
lhef::LHEEvent * lheEvent()
Definition: BaseHadronizer.h:89
Pythia8Hadronizer::comEnergy
double comEnergy
Center-of-Mass energy.
Definition: Pythia8Hadronizer.cc:108
mps_fire.i
i
Definition: mps_fire.py:355
MessageLogger.h
LHAupLesHouches.h
gen::Py8InterfaceBase::ascii_io
HepMC::IO_AsciiParticles * ascii_io
Definition: Py8InterfaceBase.h:54
PowhegHooksBB4L.h
Pythia8Hadronizer::fDire
std::unique_ptr< Pythia8::Dire > fDire
Definition: Pythia8Hadronizer.cc:102
ResonanceDecayFilterHook
Definition: ResonanceDecayFilterHook.h:5
mps_update.status
status
Definition: mps_update.py:69
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
min
T min(T a, T b)
Definition: MathUtil.h:58
JetMatchingHook.h
Pythia8Hadronizer::fEmissionVetoHook
std::unique_ptr< PowhegHooks > fEmissionVetoHook
Definition: Pythia8Hadronizer.cc:137
Pythia8Hadronizer::fReweightEmpUserHook
std::unique_ptr< UserHooks > fReweightEmpUserHook
Definition: Pythia8Hadronizer.cc:125
RandomNumberGenerator.h
Pythia8Hadronizer::fJetMatchingPy8InternalHook
std::unique_ptr< Pythia8::JetMatchingMadgraph > fJetMatchingPy8InternalHook
Definition: Pythia8Hadronizer.cc:132
Pythia8Hadronizer::fBeam1PZ
double fBeam1PZ
Definition: Pythia8Hadronizer.cc:116
ExternalDecayDriver.h
gather_cfg.cout
cout
Definition: gather_cfg.py:144
Pythia8ConcurrentHadronizerFilter
edm::ConcurrentHadronizerFilter< Pythia8Hadronizer, ConcurrentExternalDecayDriver > Pythia8ConcurrentHadronizerFilter
Definition: Pythia8Hadronizer.cc:1011
edm::LogInfo
Definition: MessageLogger.h:254
Pythia8GeneratorFilter
edm::GeneratorFilter< Pythia8Hadronizer, ExternalDecayDriver > Pythia8GeneratorFilter
Definition: Pythia8Hadronizer.cc:1004
Pythia8Hadronizer::doSharedResources
const std::vector< std::string > & doSharedResources() const override
Definition: Pythia8Hadronizer.cc:105
Pythia8Hadronizer::fBeam2PZ
double fBeam2PZ
Definition: Pythia8Hadronizer.cc:117
Pythia8Hadronizer::classname
const char * classname() const override
Definition: Pythia8Hadronizer.cc:96
Pythia8Hadronizer::nISRveto
int nISRveto
Definition: Pythia8Hadronizer.cc:170
EmissionVetoHook1
Definition: EmissionVetoHook1.h:3
Pythia8Hadronizer::doSetRandomEngine
void doSetRandomEngine(CLHEP::HepRandomEngine *v) override
Definition: Pythia8Hadronizer.cc:104
edm::LogImportant
Definition: MessageLogger.h:428
Pythia8Hadronizer::fReweightRapUserHook
std::unique_ptr< UserHooks > fReweightRapUserHook
Definition: Pythia8Hadronizer.cc:126
ResonanceDecayFilterHook.h
Pythia8Hadronizer::EV1_pThardMode
int EV1_pThardMode
Definition: Pythia8Hadronizer.cc:156
Pythia8Hadronizer::fPTFilterHook
std::unique_ptr< PTFilterHook > fPTFilterHook
Definition: Pythia8Hadronizer.cc:151
GenRunInfoProduct::setInternalXSec
void setInternalXSec(const XSec &xsec)
Definition: GenRunInfoProduct.h:26
Pythia8Hadronizer::PP
Definition: Pythia8Hadronizer.cc:113
findQualityFiles.v
v
Definition: findQualityFiles.py:179
Pythia8Hadronizer::fReweightPtHatRapUserHook
std::unique_ptr< UserHooks > fReweightPtHatRapUserHook
Definition: Pythia8Hadronizer.cc:127
ConcurrentHadronizerFilter.h
Pythia8Hadronizer::EV1_pTempMode
int EV1_pTempMode
Definition: Pythia8Hadronizer.cc:157
GenRunInfoProduct.h
gen::Py8InterfaceBase::evtgenDecays
std::shared_ptr< EvtGenDecays > evtgenDecays
Definition: Py8InterfaceBase.h:59
Pythia8Hadronizer::DJR
vector< float > DJR
Definition: Pythia8Hadronizer.cc:166
HepMC::GenEvent
Definition: hepmc_rootio.cc:9
FileInPath.h
edm::Exception
Definition: EDMException.h:77
Pythia8Hadronizer::EV1_pTdefMode
int EV1_pTdefMode
Definition: Pythia8Hadronizer.cc:159
edm::SharedResourceNames::kPythia8
static const std::string kPythia8
Definition: SharedResourceNames.h:27
lhef::LHERunInfo::kSelected
Definition: LHERunInfo.h:64
nano_cff.genLumiInfoHeader
genLumiInfoHeader
Definition: nano_cff.py:98
Pythia8Hadronizer::fReweightUserHook
std::unique_ptr< UserHooks > fReweightUserHook
Definition: Pythia8Hadronizer.cc:124
part
part
Definition: HCALResponse.h:20
Pythia8
Definition: PythiaDecays.h:21
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Pythia8Hadronizer::fJetMatchingHook
std::unique_ptr< JetMatchingHook > fJetMatchingHook
Definition: Pythia8Hadronizer.cc:131
edm::GeneratorFilter
Definition: GeneratorFilter.h:40
Service.h
Pythia8Hadronizer::nME
int nME
Definition: Pythia8Hadronizer.cc:167
gen::Py8InterfaceBase::useEvtGen
bool useEvtGen
Definition: Py8InterfaceBase.h:58
PtHatEmpReweightUserHook
Definition: ReweightUserHooks.h:27
Pythia8Hadronizer::residualDecay
virtual bool residualDecay()
Definition: Pythia8Hadronizer.cc:842
gen::Py8InterfaceBase::pythiaHepMCVerbosityParticles
bool pythiaHepMCVerbosityParticles
Definition: Py8InterfaceBase.h:52
PTFilterHook.h
Pythia8Hadronizer::fPowhegResHook
std::unique_ptr< PowhegResHook > fPowhegResHook
Definition: Pythia8Hadronizer.cc:141
gen::BaseHadronizer::eventInfo
std::unique_ptr< GenEventInfoProduct > & eventInfo()
Definition: BaseHadronizer.h:87
Pythia8Hadronizer::finalizeEvent
void finalizeEvent() override
Definition: Pythia8Hadronizer.cc:892
gen::BaseHadronizer::lheFile_
std::string lheFile_
Definition: BaseHadronizer.h:92
Pythia8::PowhegHooksBB4L
Definition: PowhegHooksBB4L.h:18
SharedResourceNames.h
gen
Definition: PythiaDecays.h:13
Pythia8Hadronizer::EV1_MPIvetoOn
bool EV1_MPIvetoOn
Definition: Pythia8Hadronizer.cc:160
gen::Py8InterfaceBase::evtgenUserFiles
std::vector< std::string > evtgenUserFiles
Definition: Py8InterfaceBase.h:62
gen::Py8InterfaceBase::pythiaPylistVerbosity
unsigned int pythiaPylistVerbosity
Definition: Py8InterfaceBase.h:50
CLHEP
Definition: CocoaGlobals.h:27
generator_cfi.comEnergy
comEnergy
Definition: generator_cfi.py:9
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Pythia8Hadronizer::getGenLumiInfoHeader
std::unique_ptr< GenLumiInfoHeader > getGenLumiInfoHeader() const override
Definition: Pythia8Hadronizer.cc:932
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:674
Pythia8Hadronizer::initializeForInternalPartons
bool initializeForInternalPartons() override
Definition: Pythia8Hadronizer.cc:329
edm::ParameterSet
Definition: ParameterSet.h:36
Pythia8Hadronizer::PPbar
Definition: Pythia8Hadronizer.cc:113
gen::Py8InterfaceBase::evtgenPdlFile
std::string evtgenPdlFile
Definition: Py8InterfaceBase.h:61
GenRunInfoProduct::XSec
Definition: GenRunInfoProduct.h:32
PtHatRapReweightUserHook
Definition: ReweightUserHooks.h:116
gen::Py8InterfaceBase::maxEventsToPrint
unsigned int maxEventsToPrint
Definition: Py8InterfaceBase.h:53
LHAupLesHouches
Definition: LHAupLesHouches.h:20
runTheMatrix.err
err
Definition: runTheMatrix.py:288
EmissionVetoHook1.h
Pythia8Hadronizer::p8SharedResources
static const std::vector< std::string > p8SharedResources
Definition: Pythia8Hadronizer.cc:164
GeneratorFilter.h
Pythia8Hadronizer::EV1_maxVetoCount
int EV1_maxVetoCount
Definition: Pythia8Hadronizer.cc:155
BiasedTauDecayer
Definition: BiasedTauDecayer.h:9
ConcurrentExternalDecayDriver.h
edm::LogPrint
Definition: MessageLogger.h:342
PowhegResHook.h
Pythia8Hadronizer::initializeForExternalPartons
bool initializeForExternalPartons()
Definition: Pythia8Hadronizer.cc:493
ReweightUserHooks.h
RapReweightUserHook
Definition: ReweightUserHooks.h:67
Pythia8Hadronizer::EV1_QEDvetoMode
int EV1_QEDvetoMode
Definition: Pythia8Hadronizer.cc:161
get
#define get
BiasedTauDecayer.h
Pythia8Hadronizer::statistics
void statistics() override
Definition: Pythia8Hadronizer.cc:646
generator_cfi.scheme
scheme
Definition: generator_cfi.py:22
Pythia8Hadronizer::EV1_vetoOn
bool EV1_vetoOn
Definition: Pythia8Hadronizer.cc:154
Pythia8Hadronizer::LHEInputFileName
std::string LHEInputFileName
Definition: Pythia8Hadronizer.cc:110
JetMatchingHook
Definition: JetMatchingHook.h:18
HadronizerFilter.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
MultiUserHook
Definition: MultiUserHook.h:6
PowhegResHook
Definition: PowhegResHook.h:6
Pythia8Hadronizer::EV1_nFinalMode
int EV1_nFinalMode
Definition: Pythia8Hadronizer.cc:162
Py8InterfaceBase.h
GenParticle.GenParticle
GenParticle
Definition: GenParticle.py:18
std
Definition: JetResolutionObject.h:76
gen::BaseHadronizer::event
std::unique_ptr< HepMC::GenEvent > & event()
Definition: BaseHadronizer.h:86
Pythia8Hadronizer::ElectronPositron
Definition: Pythia8Hadronizer.cc:113
gen::Py8InterfaceBase::pythiaHepMCVerbosity
bool pythiaHepMCVerbosity
Definition: Py8InterfaceBase.h:51
Pythia8Hadronizer::fMergingHook
std::unique_ptr< Pythia8::amcnlo_unitarised_interface > fMergingHook
Definition: Pythia8Hadronizer.cc:133
Pythia8Hadronizer::fEmissionVetoHook1
std::unique_ptr< EmissionVetoHook1 > fEmissionVetoHook1
Definition: Pythia8Hadronizer.cc:138
Pythia8Hadronizer::lhaUP
std::unique_ptr< LHAupLesHouches > lhaUP
Definition: Pythia8Hadronizer.cc:111
Exception
Definition: hltDiff.cc:246
gen::Py8InterfaceBase::toHepMC
HepMC::Pythia8ToHepMC toHepMC
Definition: Py8InterfaceBase.h:46
Pythia8Hadronizer::fvincia
std::unique_ptr< Pythia8::VinciaPlugin > fvincia
Definition: Pythia8Hadronizer.cc:101
edm::ConcurrentHadronizerFilter
Definition: ConcurrentHadronizerFilter.h:79
MatrixUtil.remove
def remove(d, key, TELL=False)
Definition: MatrixUtil.py:212
Pythia8Hadronizer::Pythia8Hadronizer
Pythia8Hadronizer(const edm::ParameterSet &params)
Definition: Pythia8Hadronizer.cc:176
Pythia8Hadronizer
Definition: Pythia8Hadronizer.cc:79
edm::HadronizerFilter
Definition: HadronizerFilter.h:53
Particle
Definition: Particle.py:1
Pythia8Hadronizer::nFSRveto
int nFSRveto
Definition: Pythia8Hadronizer.cc:171
Pythia8Hadronizer::EV1_emittedMode
int EV1_emittedMode
Definition: Pythia8Hadronizer.cc:158
PtHatReweightUserHook
Definition: ReweightUserHooks.h:4
MultiUserHook.h
Pythia8Hadronizer::fInitialState
int fInitialState
Definition: Pythia8Hadronizer.cc:114
lhef::LHEEvent::count
void count(LHERunInfo::CountMode count, double weight=1.0, double matchWeight=1.0)
Definition: LHEEvent.cc:182
Pythia8Hadronizer::fResonanceDecayFilterHook
std::unique_ptr< ResonanceDecayFilterHook > fResonanceDecayFilterHook
Definition: Pythia8Hadronizer.cc:148
Pythia8Hadronizer::nMEFiltered
int nMEFiltered
Definition: Pythia8Hadronizer.cc:168
mps_fire.result
result
Definition: mps_fire.py:303
myMessageLogger_cff.statistics
statistics
Definition: myMessageLogger_cff.py:9
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Pythia8HadronizerFilter
edm::HadronizerFilter< Pythia8Hadronizer, ExternalDecayDriver > Pythia8HadronizerFilter
Definition: Pythia8Hadronizer.cc:1007
HepMCProduct.h
PTFilterHook
Definition: PTFilterHook.h:4
Pythia8Hadronizer::hadronize
bool hadronize()
Definition: Pythia8Hadronizer.cc:769
Pythia8Hadronizer::fBiasedTauDecayer
std::unique_ptr< BiasedTauDecayer > fBiasedTauDecayer
Definition: Pythia8Hadronizer.cc:145
Pythia8Hadronizer::fMultiUserHook
std::unique_ptr< MultiUserHook > fMultiUserHook
Definition: Pythia8Hadronizer.cc:120
crabWrapper.key
key
Definition: crabWrapper.py:19
gen::BaseHadronizer::runInfo
GenRunInfoProduct & runInfo()
Definition: BaseHadronizer.h:85
gen::Py8InterfaceBase
Definition: Py8InterfaceBase.h:25
edm::errors::Configuration
Definition: EDMException.h:36
Pythia8Hadronizer::fPowhegHooksBB4L
std::unique_ptr< PowhegHooksBB4L > fPowhegHooksBB4L
Definition: Pythia8Hadronizer.cc:142
gen::Py8InterfaceBase::fDecayer
std::unique_ptr< Pythia8::Pythia > fDecayer
Definition: Py8InterfaceBase.h:45
Pythia8Hadronizer::generatePartonsAndHadronize
bool generatePartonsAndHadronize() override
Definition: Pythia8Hadronizer.cc:662
gen::Py8InterfaceBase::evtgenDecFile
std::string evtgenDecFile
Definition: Py8InterfaceBase.h:60
gen::Py8InterfaceBase::slhafile_
std::string slhafile_
Definition: Py8InterfaceBase.h:64
Pythia8Hadronizer::EV1_nFinal
int EV1_nFinal
Definition: Pythia8Hadronizer.cc:153