]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PYTHIA8/pythia8130/include/HepMCInterface.h
pythia8130 distributed with AliRoot
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8130 / include / HepMCInterface.h
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.
5
6 //--------------------------------------------------------------------------
7 #ifndef Pythia8_HepMCInterface_H
8 #define Pythia8_HepMCInterface_H
9
10 //////////////////////////////////////////////////////////////////////////
11 // Mikhail.Kirsanov@Cern.CH
12 // Pythia8 I class
13 //////////////////////////////////////////////////////////////////////////
14 //
15
16 #include <set>
17 #include <vector>
18 #include "HepMC/IO_BaseClass.h"
19 #include "Pythia.h"
20
21 namespace HepMC {
22
23   class GenEvent;
24   class GenVertex;
25   class GenParticle;
26   class ParticleDataTable;
27
28   class I_Pythia8 : public IO_BaseClass {
29     public:
30                         I_Pythia8();
31       virtual           ~I_Pythia8();
32       bool              fill_next_event( Pythia8::Event& pyev, GenEvent* evt,
33                                          int ievnum = -1 );
34       bool              fill_next_event( Pythia8::Pythia& pythia, GenEvent* evt,
35                                          int ievnum = -1,
36                                          bool convertGluonTo0 = false );
37       void              put_pdf_info( GenEvent* evt, Pythia8::Pythia& pythia,
38                                       bool convertGluonTo0 = false );
39
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 );
49
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* )
55         { return 0; }
56
57     private: // use of copy constructor is not allowed
58       I_Pythia8( const I_Pythia8& ) : IO_BaseClass() {}
59
60     private: // data members
61
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;
69
70   };
71
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; }
77     
78   inline bool I_Pythia8::trust_mothers_before_daughters() const 
79   { return m_trust_mothers_before_daughters; }
80
81   inline bool I_Pythia8::print_inconsistency_errors() const
82   { return m_print_inconsistency_errors; }
83  
84   inline void I_Pythia8::set_trust_both_mothers_and_daughters( bool b )
85   { m_trust_both_mothers_and_daughters = b; }
86
87   inline void I_Pythia8::set_trust_mothers_before_daughters( bool b )
88   { m_trust_mothers_before_daughters = b; }
89
90   inline void I_Pythia8::set_print_inconsistency_errors( bool b  )
91   { m_print_inconsistency_errors = b; }
92
93   inline void I_Pythia8::set_crash_on_problem( bool b  )
94   { m_crash_on_problem = b; }
95
96   inline void I_Pythia8::set_convert_to_mev( bool b  )
97   { m_convert_to_mev = b; m_mom_scale_factor = 1000.; }
98
99 } // HepMC
100
101 #endif  // Pythia8_HepMCInterface_H
102
103 //--------------------------------------------------------------------------