gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
mainEWinos_bino_winos_higgsinos.cc
Go to the documentation of this file.
1 // mainEwinos_bino_winos_higgsinos.cc.
2 
3 // Author: Tomas Gonzalo (tomas.gonzalo@monash.edu)
4 
5 // This program illustrates how HepMC can be interfaced to Pythia8.
6 // It uses the SLHA file for the best fit point from EWMSSM
7 // arXiv:1809.02097
8 
9 // WARNING: the default version generateds 30k events, including ISR, FSR and Hadronization. HepMC files can weight over 2G
10 
11 #include "Pythia8/Pythia.h"
12 #include "Pythia8Plugins/HepMC2.h"
13 
14 using namespace Pythia8;
15 
16 int main() {
17  // Interface for conversion from Pythia8::Event to HepMC event.
18  HepMC::Pythia8ToHepMC ToHepMC;
19 
20  // Specify file where HepMC events will be stored.
21  HepMC::IO_GenEvent ascii_io("hepmcEWinos_bino_winos_higgsinos.dat", std::ios::out);
22 
23  // Generator. Shorthand for the event.
24  Pythia pythia;
25 // Event& event = pythia.event;
26 
27  // Read in commands from external file.
28  pythia.readFile("mainEWinos_bino_winos_higgsinos.cmnd");
29 
30  // Initialize
31  pythia.init();
32 
33  // Extract settings to be used in the main program.
34  int nEvent = pythia.mode("Main:numberOfEvents");
35 
36  // Begin event loop. Generate event. Skip if error.
37  for (int iEvent = 0; iEvent < nEvent; ++iEvent)
38  {
39  if (!pythia.next()) continue;
40 
41  // Construct new empty HepMC event and fill it.
42  // Units will be as chosen for HepMC build; but can be changed
43  // by arguments, e.g. GenEvt( HepMC::Units::GEV, HepMC::Units::MM)
44  HepMC::GenEvent* hepmcevt = new HepMC::GenEvent();
45  ToHepMC.fill_next_event( pythia, hepmcevt );
46 
47  // Write the HepMC event to file. Done with it.
48  ascii_io << hepmcevt;
49  delete hepmcevt;
50 
51  // End of event loop. Statistics. Histogram.
52  }
53  pythia.stat();
54 
55  // Done.
56  return 0;
57 }