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#ifdef PYTHIA_VERSION_INTEGER
13#include "Pythia8Plugins/HepMC2.h"
14#else
15#include "Pythia8/Pythia8ToHepMC.h"
16#endif
17#else
18#include "HepMC3/GenEvent.h"
19#include "HepMC3/Selector.h"
20#include "Pythia8ToHepMC3.h"
21#endif
22
23#include "ValidationTool.h"
24#include "Timer.h"
25
26#include "Pythia8/Pythia.h"
27/// @class PythiaValidationTool
28/// @brief Interface for validatio to Pythia
30public:
31 PythiaValidationTool( const std::string &filename ); ///< Constructor
32
33 const std::string name() { return "pythia8"; }
34 const std::string long_name() { return name() + " config file: " + m_filename; }
35
36 bool tool_modifies_event() { return true; }
37 Timer* timer() { return &m_timer; }
38
39 void initialize();
40 int process(GenEvent &hepmc);
41 void finalize();
42
43private:
44 Pythia8::Pythia m_pythia; ///< Pythia8 instance
45 std::string m_filename; ///< Used file
46 Timer m_timer; ///< Timer
47 HEPMC2CODE( Pythia8ToHepMC m_tohepmc; )
48 HEPMC3CODE( Pythia8ToHepMC3 m_tohepmc; )
49};
50
51#endif
Definition of class GenEvent.
definition of /b Selector class
Stores event-related information.
Definition GenEvent.h:42
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.