HepMC3 event record library
PythiaValidationTool.h
1// -*- C++ -*-
2//
3// This file is part of HepMC
4// Copyright (C) 2014-2019 The HepMC collaboration (see AUTHORS for details)
5//
6#ifndef PYTHIA_VALIDATION_TOOL_H
7#define PYTHIA_VALIDATION_TOOL_H
8
9#ifdef HEPMC2
10#include "HepMC/GenEvent.h"
11#include "Pythia8/Pythia.h"
12/* The condition below is true at least for 8.209+. 8.209- will probably fail */
13#if defined(PYTHIA_VERSION_INTEGER) || defined (PYTHIA_VERSION)
14#include "Pythia8Plugins/HepMC2.h"
15#else
16#include "Pythia8/Pythia8ToHepMC.h"
17#endif
18#else
19#include "HepMC3/GenEvent.h"
21#ifdef HEPMC3_USE_INTERFACE_FROM_PYTHIA8
22#include "Pythia8Plugins/HepMC3.h"
23#else
24#include "Pythia8ToHepMC3.h"
25#endif
26#endif
27
28#include "ValidationTool.h"
29#include "Timer.h"
30
31#include "Pythia8/Pythia.h"
32/// @class PythiaValidationTool
33/// @brief Interface for validatio to Pythia
35public:
36 PythiaValidationTool( const std::string &filename ); ///< Constructor
37
38 const std::string name() { return "pythia8"; }
39 const std::string long_name() { return name() + " config file: " + m_filename; }
40
41 bool tool_modifies_event() { return true; }
42 Timer* timer() { return &m_timer; }
43
44 void initialize();
45 int process(GenEvent &hepmc);
46 void finalize();
47
48private:
49 Pythia8::Pythia m_pythia; ///< Pythia8 instance
50 std::string m_filename; ///< Used file
51 Timer m_timer; ///< Timer
52 HEPMC2CODE( Pythia8ToHepMC m_tohepmc; )
53 HEPMC3CODE( Pythia8ToHepMC3 m_tohepmc; )
54};
55
56#endif
Definition of class GenEvent.
Definition of class WriterAsciiHepMC2.
Stores event-related information.
Definition: GenEvent.h:41
Interface for validatio to Pythia.
void initialize()
Initialize.
Pythia8::Pythia m_pythia
Pythia8 instance.
bool tool_modifies_event()
Get information if this tool modifies the event.
Timer * timer()
Get timer for this tool (if this tool is being timed)
std::string m_filename
Used file.
int process(GenEvent &hepmc)
Process event.
const std::string name()
Get name of the tool.
const std::string long_name()
Get long name of the tool.
Used to benchmark MC generators.
Definition: Timer.h:38
Virtual Interface to validation tools.