HepMC3 event record library
PythiaValidationTool.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 "PythiaValidationTool.h"
7
8PythiaValidationTool::PythiaValidationTool( const std::string &filename ):m_filename(filename),m_timer("pythia8 conversion time") {
9 m_pythia.readFile(m_filename);
10}
11
13 m_pythia.init();
14}
15
17 if( !m_pythia.next() ) return 1;
18
19 // Exclude generation time
20 m_timer.start();
21
22 m_tohepmc.fill_next_event(m_pythia.event, &hepmc, -1, &m_pythia.info);
23 return 0;
24}
25
27 /* The condition below is true at least for 8.209+. 8.209- will probably fail */
28#if defined(PYTHIA_VERSION_INTEGER) || defined (PYTHIA_VERSION)
29 m_pythia.stat();
30#else
31 m_pythia.statistics();
32#endif
33}
Stores event-related information.
Definition: GenEvent.h:41
PythiaValidationTool(const std::string &filename)
Constructor.
void initialize()
Initialize.
Pythia8::Pythia m_pythia
Pythia8 instance.
std::string m_filename
Used file.
int process(GenEvent &hepmc)
Process event.
void start()
Definition: Timer.h:44