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