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>
9int 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\
16Beams:frameType = 3\n\
17Beams:idA = 2212\n\
18Beams:idB = 2212\n\
19SoftQCD:singleDiffractive = on\n\
20Beams:allowMomentumSpread = on\n\
21\n");
22 fclose(Finput);
23
24 FILE* Fconfig=fopen("testPythia3.config","w");
25 fprintf(Fconfig,"\
26INPUT pythia8 testPythia3.input\n\
27TOOL photos \n\
28TOOL output \n\
29EVENTS 10\n\
30\n");
31 fclose(Fconfig);
32
33 ValidationControl control;
34 control.read_file("testPythia3.config");
35 control.initialize();
36 int counter=0;
37 while( control.new_event() )
38 {
39 GenEvent HepMCEvt(Units::GEV,Units::MM);
40 control.process(HepMCEvt);
41 counter++;
42 }
43 control.finalize();
44 return 1*(counter-10);
45}
Stores event-related information.
Definition: GenEvent.h:41
Runs multiple validation tools.
bool new_event()
New event.
void initialize()
Init function.
void process(GenEvent &hepmc)
Process event.
void finalize()
Finalize.
void read_file(const std::string &filename)
Read file.