CMS 3D CMS Logo

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