HepMC3 event record library
testPythia1.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("testPythia1.input","w");
12 fprintf(Finput,"\
13#\n\
14# Process: ee -> Z -> tau+ tau- @ 92GeV\n\
15#\n\
16\n\
17WeakSingleBoson:ffbar2gmZ = on\n\
18\n\
19Beams:idA = 11\n\
20Beams:idB = -11\n\
21Beams:eCM = 92.\n\
22\n\
23# Simplify event as much as possible\n\
24HadronLevel:all = off\n\
25HadronLevel:Hadronize = off\n\
26SpaceShower:QEDshowerByL = off\n\
27SpaceShower:QEDshowerByQ = off\n\
28PartonLevel:ISR = off\n\
29PartonLevel:FSR = off\n\
30\n\
31# Set Z properties\n\
3223:onMode = off\n\
3323:onIfAny = 15\n\
34\n\
35# Leave tau undecayed (tau decays are very slow in Pythia 8.185)\n\
3615:mayDecay = off\n\
37-15:mayDecay = off\n\
38\n");
39 fclose(Finput);
40
41 FILE* Fconfig=fopen("testPythia1.config","w");
42 fprintf(Fconfig,"\
43INPUT pythia8 testPythia1.input\n\
44TOOL photos \n\
45EVENTS 1000\n\
46\n");
47
48 fclose(Fconfig);
49
50 ValidationControl control;
51 control.read_file("testPythia1.config");
52 control.initialize();
53 int counter=0;
54 while( control.new_event() )
55 {
56 GenEvent HepMCEvt(Units::GEV,Units::MM);
57 control.process(HepMCEvt);
58 counter++;
59 }
60 control.finalize();
61 return 1*(counter-1000);
62}
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.