1 // HepMCInterface.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2008 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 //--------------------------------------------------------------------------
7 #ifndef Pythia8_HepMCInterface_H
8 #define Pythia8_HepMCInterface_H
10 //////////////////////////////////////////////////////////////////////////
11 // Mikhail.Kirsanov@Cern.CH
13 //////////////////////////////////////////////////////////////////////////
18 #include "HepMC/IO_BaseClass.h"
26 class ParticleDataTable;
28 class I_Pythia8 : public IO_BaseClass {
32 bool fill_next_event( Pythia8::Event& pyev, GenEvent* evt,
34 bool fill_next_event( Pythia8::Pythia& pythia, GenEvent* evt,
36 bool convertGluonTo0 = false );
37 void put_pdf_info( GenEvent* evt, Pythia8::Pythia& pythia,
38 bool convertGluonTo0 = false );
40 // see comments below for these switches.
41 bool trust_both_mothers_and_daughters() const;
42 bool trust_mothers_before_daughters() const;
43 bool print_inconsistency_errors() const;
44 void set_trust_mothers_before_daughters( bool b = 1 );
45 void set_trust_both_mothers_and_daughters( bool b = 0 );
46 void set_print_inconsistency_errors( bool b = 1 );
47 void set_crash_on_problem( bool b = 1 );
48 void set_convert_to_mev( bool b = 1 );
50 private: // following are not (yet?) implemented for this class
51 virtual bool fill_next_event( GenEvent* ) { return 0; }
52 virtual void write_event( const GenEvent* ) {;}
53 virtual void write_particle_data_table( const ParticleDataTable* ){}
54 virtual bool fill_particle_data_table( ParticleDataTable* )
57 private: // use of copy constructor is not allowed
58 I_Pythia8( const I_Pythia8& ) : IO_BaseClass() {}
60 private: // data members
62 bool m_trust_mothers_before_daughters;
63 bool m_trust_both_mothers_and_daughters;
64 bool m_print_inconsistency_errors;
65 int m_internal_event_number;
66 bool m_crash_on_problem;
67 bool m_convert_to_mev;
68 float m_mom_scale_factor;
72 ////////////////////////////
73 // INLINES access methods //
74 ////////////////////////////
75 inline bool I_Pythia8::trust_both_mothers_and_daughters() const
76 { return m_trust_both_mothers_and_daughters; }
78 inline bool I_Pythia8::trust_mothers_before_daughters() const
79 { return m_trust_mothers_before_daughters; }
81 inline bool I_Pythia8::print_inconsistency_errors() const
82 { return m_print_inconsistency_errors; }
84 inline void I_Pythia8::set_trust_both_mothers_and_daughters( bool b )
85 { m_trust_both_mothers_and_daughters = b; }
87 inline void I_Pythia8::set_trust_mothers_before_daughters( bool b )
88 { m_trust_mothers_before_daughters = b; }
90 inline void I_Pythia8::set_print_inconsistency_errors( bool b )
91 { m_print_inconsistency_errors = b; }
93 inline void I_Pythia8::set_crash_on_problem( bool b )
94 { m_crash_on_problem = b; }
96 inline void I_Pythia8::set_convert_to_mev( bool b )
97 { m_convert_to_mev = b; m_mom_scale_factor = 1000.; }
101 #endif // Pythia8_HepMCInterface_H
103 //--------------------------------------------------------------------------