1
// HepMCInterface.h is a part of the PYTHIA event generator.
2
// Copyright (C) 2012 Mikhail Kirsanov, Torbjorn Sjostrand.
3
// PYTHIA is licenced under the GNU GPL version 2, see COPYING for details.
4
// Please respect the MCnet Guidelines, see GUIDELINES for details.
6
// Header file for I_Pythia8 class,
7
// which converts a PYTHIA event record to the standard HepMC format.
9
#ifndef Pythia8_HepMCInterface_H
10
#define Pythia8_HepMCInterface_H
14
#include "HepMC/IO_BaseClass.h"
19
// Forward references to some classes.
23
class ParticleDataTable;
25
//==========================================================================
27
// The I_Pythia8 class.
29
class I_Pythia8 : public IO_BaseClass {
33
// Constructor and destructor.
37
// The key methods to convert Pythia events into HepMC ones.
38
bool fill_next_event( Pythia8::Event& pyev, GenEvent* evt,
40
bool fill_next_event( Pythia8::Pythia& pythia, GenEvent* evt,
41
int ievnum = -1, bool convertGluonTo0 = false );
42
void put_pdf_info( GenEvent* evt, Pythia8::Pythia& pythia,
43
bool convertGluonTo0 = false );
45
// Read out values for some switches.
46
bool trust_both_mothers_and_daughters() const;
47
bool trust_mothers_before_daughters() const;
48
bool print_inconsistency_errors() const;
50
// Set values for some switches.
51
void set_trust_mothers_before_daughters( bool b = true );
52
void set_trust_both_mothers_and_daughters( bool b = false );
53
void set_print_inconsistency_errors( bool b = true );
54
void set_crash_on_problem( bool b = false );
55
void set_freepartonwarnings( bool b = true );
56
void set_convert_to_mev( bool b = false );
60
// Following are not (yet?) implemented for this class.
61
virtual bool fill_next_event( GenEvent* ) { return 0; }
62
virtual void write_event( const GenEvent* ) {;}
63
virtual void write_particle_data_table( const ParticleDataTable* ) {}
64
virtual bool fill_particle_data_table( ParticleDataTable* ) { return 0; }
66
// Use of copy constructor is not allowed
67
I_Pythia8( const I_Pythia8& ) : IO_BaseClass() {}
70
bool m_trust_mothers_before_daughters;
71
bool m_trust_both_mothers_and_daughters;
72
bool m_print_inconsistency_errors;
73
bool m_crash_on_problem;
74
bool m_freepartonwarnings;
75
bool m_convert_to_mev;
76
double m_mom_scale_factor;
77
int m_internal_event_number;
81
// Inline access methods.
83
inline bool I_Pythia8::trust_both_mothers_and_daughters() const
84
{ return m_trust_both_mothers_and_daughters; }
86
inline bool I_Pythia8::trust_mothers_before_daughters() const
87
{ return m_trust_mothers_before_daughters; }
89
inline bool I_Pythia8::print_inconsistency_errors() const
90
{ return m_print_inconsistency_errors; }
92
inline void I_Pythia8::set_trust_both_mothers_and_daughters( bool b )
93
{ m_trust_both_mothers_and_daughters = b; }
95
inline void I_Pythia8::set_trust_mothers_before_daughters( bool b )
96
{ m_trust_mothers_before_daughters = b; }
98
inline void I_Pythia8::set_print_inconsistency_errors( bool b )
99
{ m_print_inconsistency_errors = b; }
101
inline void I_Pythia8::set_crash_on_problem( bool b )
102
{ m_crash_on_problem = b; }
104
inline void I_Pythia8::set_convert_to_mev( bool b )
105
{ m_convert_to_mev = b; m_mom_scale_factor = (b) ? 1000. : 1.; }
107
inline void I_Pythia8::set_freepartonwarnings( bool b )
108
{ m_freepartonwarnings = b; }
110
//==========================================================================
112
} // end namespace HepMC
114
#endif // end Pythia8_HepMCInterface_H