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 #include "Pythia8ToHepMC3.h"
22 #endif
23 
24 #include "ValidationTool.h"
25 #include "Timer.h"
26 
27 #include "Pythia8/Pythia.h"
28 /// @class PythiaValidationTool
29 /// @brief Interface for validatio to Pythia
31 public:
32  PythiaValidationTool( const std::string &filename ); ///< Constructor
33 
34  const std::string name() { return "pythia8"; }
35  const std::string long_name() { return name() + " config file: " + m_filename; }
36 
37  bool tool_modifies_event() { return true; }
38  Timer* timer() { return &m_timer; }
39 
40  void initialize();
41  int process(GenEvent &hepmc);
42  void finalize();
43 
44 private:
45  Pythia8::Pythia m_pythia; ///< Pythia8 instance
46  std::string m_filename; ///< Used file
47  Timer m_timer; ///< Timer
48  HEPMC2CODE( Pythia8ToHepMC m_tohepmc; )
49  HEPMC3CODE( Pythia8ToHepMC3 m_tohepmc; )
50 };
51 
52 #endif
bool tool_modifies_event()
Get information if this tool modifies the event.
void initialize()
Initialize.
Timer * timer()
Get timer for this tool (if this tool is being timed)
Stores event-related information.
Definition: GenEvent.h:41
Pythia8::Pythia m_pythia
Pythia8 instance.
Interface for validatio to Pythia.
Virtual Interface to validation tools.
int process(GenEvent &hepmc)
Process event.
Definition of class WriterAsciiHepMC2.
PythiaValidationTool(const std::string &filename)
Constructor.
std::string m_filename
Used file.
Definition of class GenEvent.
Used to benchmark MC generators.
Definition: Timer.h:38
const std::string name()
Get name of the tool.
const std::string long_name()
Get long name of the tool.