- Update to pythia8140
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8140 / include / HepMCInterface.h
1 // HepMCInterface.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2010 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.
5
6 // Header file for I_Pythia8 class,
7 // which converts a PYTHIA event record to the standard HepMC format.
8
9 #ifndef Pythia8_HepMCInterface_H
10 #define Pythia8_HepMCInterface_H
11
12 #include <set>
13 #include <vector>
14 #include "HepMC/IO_BaseClass.h"
15 #include "Pythia.h"
16
17 namespace HepMC {
18
19   class GenEvent;
20   class GenVertex;
21   class GenParticle;
22   class ParticleDataTable;
23
24 //==========================================================================
25
26   class I_Pythia8 : public IO_BaseClass {
27     public:
28                         I_Pythia8();
29       virtual           ~I_Pythia8();
30       bool              fill_next_event( Pythia8::Event& pyev, GenEvent* evt,
31                                          int ievnum = -1 );
32       bool              fill_next_event( Pythia8::Pythia& pythia, GenEvent* evt,
33                                          int ievnum = -1,
34                                          bool convertGluonTo0 = false );
35       void              put_pdf_info( GenEvent* evt, Pythia8::Pythia& pythia,
36                                       bool convertGluonTo0 = false );
37
38       // See comments below for these switches.
39       bool              trust_both_mothers_and_daughters() const;
40       bool              trust_mothers_before_daughters() const;
41       bool              print_inconsistency_errors() const;
42       void              set_trust_mothers_before_daughters( bool b = 1 );
43       void              set_trust_both_mothers_and_daughters( bool b = 0 );
44       void              set_print_inconsistency_errors( bool b = 1 );
45       void              set_crash_on_problem( bool b = 1 );
46       void              set_convert_to_mev( bool b = 1 );
47       void              set_nofreepartonwarnings( bool b = 0 );
48
49     private: // following are not (yet?) implemented for this class
50       virtual bool fill_next_event( GenEvent*  ) { return 0; }
51       virtual void write_event( const GenEvent* ) {;}
52       virtual void write_particle_data_table( const ParticleDataTable* ){}
53       virtual bool fill_particle_data_table( ParticleDataTable* )
54         { return 0; }
55
56     private: // use of copy constructor is not allowed
57       I_Pythia8( const I_Pythia8& ) : IO_BaseClass() {}
58
59     private: // data members
60
61       bool m_trust_mothers_before_daughters;
62       bool m_trust_both_mothers_and_daughters;
63       bool m_print_inconsistency_errors; 
64       int m_internal_event_number;
65       bool m_crash_on_problem;
66       bool m_convert_to_mev;
67       float m_mom_scale_factor;
68       bool m_freepartonwarnings;
69
70   };
71
72   // INLINES access methods.
73
74   inline bool I_Pythia8::trust_both_mothers_and_daughters() const 
75   { return m_trust_both_mothers_and_daughters; }
76     
77   inline bool I_Pythia8::trust_mothers_before_daughters() const 
78   { return m_trust_mothers_before_daughters; }
79
80   inline bool I_Pythia8::print_inconsistency_errors() const
81   { return m_print_inconsistency_errors; }
82  
83   inline void I_Pythia8::set_trust_both_mothers_and_daughters( bool b )
84   { m_trust_both_mothers_and_daughters = b; }
85
86   inline void I_Pythia8::set_trust_mothers_before_daughters( bool b )
87   { m_trust_mothers_before_daughters = b; }
88
89   inline void I_Pythia8::set_print_inconsistency_errors( bool b  )
90   { m_print_inconsistency_errors = b; }
91
92   inline void I_Pythia8::set_crash_on_problem( bool b  )
93   { m_crash_on_problem = b; }
94
95   inline void I_Pythia8::set_convert_to_mev( bool b  )
96   { m_convert_to_mev = b; m_mom_scale_factor = 1000.; }
97
98   inline void I_Pythia8::set_nofreepartonwarnings( bool b  )
99   { m_freepartonwarnings = b; }
100
101 //==========================================================================
102
103 } // end namespace HepMC
104
105 #endif  // end Pythia8_HepMCInterface_H