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
35 public:
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 
48 private:
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
PythiaValidationTool::m_pythia
Pythia8::Pythia m_pythia
Pythia8 instance.
Definition: PythiaValidationTool.h:49
GenEvent.h
Definition of class GenEvent.
ValidationTool
Virtual Interface to validation tools.
Definition: ValidationTool.h:26
PythiaValidationTool::PythiaValidationTool
PythiaValidationTool(const std::string &filename)
Constructor.
Definition: PythiaValidationTool.cc:8
PythiaValidationTool
Interface for validatio to Pythia.
Definition: PythiaValidationTool.h:34
HepMC3::GenEvent
Stores event-related information.
Definition: GenEvent.h:41
PythiaValidationTool::finalize
void finalize()
Finalize.
Definition: PythiaValidationTool.cc:26
HepMC3::Pythia8ToHepMC3
Definition: Pythia8ToHepMC3.h:20
PythiaValidationTool::m_filename
std::string m_filename
Used file.
Definition: PythiaValidationTool.h:50
PythiaValidationTool::tool_modifies_event
bool tool_modifies_event()
Get information if this tool modifies the event.
Definition: PythiaValidationTool.h:41
Timer
Used to benchmark MC generators.
Definition: Timer.h:38
PythiaValidationTool::initialize
void initialize()
Initialize.
Definition: PythiaValidationTool.cc:12
PythiaValidationTool::long_name
const std::string long_name()
Get long name of the tool.
Definition: PythiaValidationTool.h:39
PythiaValidationTool::m_timer
Timer m_timer
Timer.
Definition: PythiaValidationTool.h:51
WriterAsciiHepMC2.h
Definition of class WriterAsciiHepMC2.
PythiaValidationTool::process
int process(GenEvent &hepmc)
Process event.
Definition: PythiaValidationTool.cc:16
PythiaValidationTool::name
const std::string name()
Get name of the tool.
Definition: PythiaValidationTool.h:38
PythiaValidationTool::timer
Timer * timer()
Get timer for this tool (if this tool is being timed)
Definition: PythiaValidationTool.h:42