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 
8 PythiaValidationTool::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 }
void start()
Definition: Timer.h:44
void initialize()
Initialize.
Stores event-related information.
Definition: GenEvent.h:41
Pythia8::Pythia m_pythia
Pythia8 instance.
int process(GenEvent &hepmc)
Process event.
PythiaValidationTool(const std::string &filename)
Constructor.
std::string m_filename
Used file.