HepMC3 event record library
testPythia3.cc
1 // -*- C++ -*-
2 //
3 // This file is part of HepMC
4 // Copyright (C) 2014-2019 The HepMC collaboration (see AUTHORS for details)
5 //
6 #include "ValidationControl.h"
7 #include <iostream>
8 #include <stdio.h>
9 int main(int argc, char **argv)
10 {
11  FILE* Finput=fopen("testPythia3.input","w");
12  fprintf(Finput,"\
13 #\n\
14 # Process: pp -> @ 14TeV\n\
15 #\n\
16 Beams:frameType = 3\n\
17 Beams:idA = 2212\n\
18 Beams:idB = 2212\n\
19 SoftQCD:singleDiffractive = on\n\
20 Beams:allowMomentumSpread = on\n\
21 \n");
22  fclose(Finput);
23 
24  FILE* Fconfig=fopen("testPythia3.config","w");
25  fprintf(Fconfig,"\
26 INPUT pythia8 testPythia3.input\n\
27 TOOL photos \n\
28 TOOL output \n\
29 EVENTS 10\n\
30 \n");
31  fclose(Fconfig);
32 
33  ValidationControl control;
34  control.read_file("testPythia3.config");
35  control.initialize();
36  while( control.new_event() )
37  {
38  GenEvent HepMCEvt(Units::GEV,Units::MM);
39  control.process(HepMCEvt);
40  }
41  control.finalize();
42  return 0;
43 }
void read_file(const std::string &filename)
Read file.
void initialize()
Init function.
Stores event-related information.
Definition: GenEvent.h:41
void finalize()
Finalize.
int main(int argc, char **argv)
bool new_event()
New event.
Runs multiple validation tools.
void process(GenEvent &hepmc)
Process event.