|
HepMC Reference DocumentationHepMC |
00001 //-------------------------------------------------------------------------- 00002 #ifndef HEPMC_IO_HEPEVT_H 00003 #define HEPMC_IO_HEPEVT_H 00004 00006 // Matt.Dobbs@Cern.CH, January 2000, refer to: 00007 // M. Dobbs and J.B. Hansen, "The HepMC C++ Monte Carlo Event Record for 00008 // High Energy Physics", Computer Physics Communications (to be published). 00009 // 00010 // HEPEVT IO class 00012 // 00013 // Important note: This class uses HepMC::HEPEVT_Wrapper which is an 00014 // interface to the fortran77 HEPEVT common block. 00015 // The precision and number of entries in the F77 common 00016 // block can be specified. See HepMC/HEPEVT_Wrapper.h. 00017 // You will very likely have to specify these values for your 00018 // application. 00019 // 00020 // 00021 00022 #include <map> 00023 #include <vector> 00024 #include "HepMC/IO_BaseClass.h" 00025 #include "HepMC/HEPEVT_Wrapper.h" 00026 00027 namespace HepMC { 00028 00029 class GenEvent; 00030 class GenVertex; 00031 class GenParticle; 00032 00034 00039 class IO_HEPEVT : public IO_BaseClass { 00040 public: 00041 IO_HEPEVT(); 00042 virtual ~IO_HEPEVT(); 00043 bool fill_next_event( GenEvent* ); 00044 void write_event( const GenEvent* ); 00045 void print( std::ostream& ostr = std::cout ) const; 00046 00047 // see comments below for these switches. 00049 bool trust_both_mothers_and_daughters() const; 00051 bool trust_mothers_before_daughters() const; 00053 bool print_inconsistency_errors() const; 00055 bool trust_beam_particles() const; 00057 void set_trust_mothers_before_daughters( bool b = true ); 00059 void set_trust_both_mothers_and_daughters( bool b = false ); 00083 void set_print_inconsistency_errors( bool b = true ); 00085 void set_trust_beam_particles( bool b = true ); 00086 00087 protected: // for internal use only 00089 GenParticle* build_particle( int index ); 00091 void build_production_vertex( 00092 int i,std::vector<HepMC::GenParticle*>& hepevt_particle, GenEvent* evt ); 00094 void build_end_vertex( 00095 int i, std::vector<HepMC::GenParticle*>& hepevt_particle, GenEvent* evt ); 00097 int find_in_map( 00098 const std::map<HepMC::GenParticle*,int>& m, GenParticle* p) const; 00099 00100 private: // use of copy constructor is not allowed 00101 IO_HEPEVT( const IO_HEPEVT& ) : IO_BaseClass() {} 00102 00103 private: // data members 00104 00105 bool m_trust_mothers_before_daughters; 00106 bool m_trust_both_mothers_and_daughters; 00107 bool m_print_inconsistency_errors; 00108 bool m_trust_beam_particles; 00109 }; 00110 00112 // INLINES access methods // 00114 inline bool IO_HEPEVT::trust_both_mothers_and_daughters() const 00115 { return m_trust_both_mothers_and_daughters; } 00116 00117 inline bool IO_HEPEVT::trust_mothers_before_daughters() const 00118 { return m_trust_mothers_before_daughters; } 00119 00120 inline bool IO_HEPEVT::print_inconsistency_errors() const 00121 { return m_print_inconsistency_errors; } 00122 00123 inline void IO_HEPEVT::set_trust_both_mothers_and_daughters( bool b ) 00124 { m_trust_both_mothers_and_daughters = b; } 00125 00126 inline void IO_HEPEVT::set_trust_mothers_before_daughters( bool b ) 00127 { m_trust_mothers_before_daughters = b; } 00128 00129 inline void IO_HEPEVT::set_print_inconsistency_errors( bool b ) 00130 { m_print_inconsistency_errors = b; } 00131 00132 inline bool IO_HEPEVT::trust_beam_particles() const 00133 { return m_trust_beam_particles; } 00134 00135 inline void IO_HEPEVT::set_trust_beam_particles( bool b ) 00136 { m_trust_beam_particles = b; } 00137 00138 } // HepMC 00139 00140 #endif // HEPMC_IO_HEPEVT_H 00141 //--------------------------------------------------------------------------
1.4.7