|
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 class ParticleDataTable; 00033 00035 00040 class IO_HEPEVT : public IO_BaseClass { 00041 public: 00042 IO_HEPEVT(); 00043 virtual ~IO_HEPEVT(); 00044 bool fill_next_event( GenEvent* ); 00045 void write_event( const GenEvent* ); 00046 void print( std::ostream& ostr = std::cout ) const; 00047 00048 // see comments below for these switches. 00050 bool trust_both_mothers_and_daughters() const; 00052 bool trust_mothers_before_daughters() const; 00054 bool print_inconsistency_errors() const; 00056 void set_trust_mothers_before_daughters( bool b = 1 ); 00058 void set_trust_both_mothers_and_daughters( bool b = 0 ); 00082 void set_print_inconsistency_errors( bool b = 1 ); 00083 00084 protected: // for internal use only 00086 GenParticle* build_particle( int index ); 00088 void build_production_vertex( 00089 int i,std::vector<HepMC::GenParticle*>& hepevt_particle, GenEvent* evt ); 00091 void build_end_vertex( 00092 int i, std::vector<HepMC::GenParticle*>& hepevt_particle, GenEvent* evt ); 00094 int find_in_map( 00095 const std::map<HepMC::GenParticle*,int>& m, GenParticle* p) const; 00096 00097 private: // following are not implemented for HEPEVT 00098 virtual void write_particle_data_table( const ParticleDataTable* ){} 00099 virtual bool fill_particle_data_table( ParticleDataTable* ) 00100 { return 0; } 00101 00102 private: // use of copy constructor is not allowed 00103 IO_HEPEVT( const IO_HEPEVT& ) : IO_BaseClass() {} 00104 00105 private: // data members 00106 00107 bool m_trust_mothers_before_daughters; 00108 bool m_trust_both_mothers_and_daughters; 00109 bool m_print_inconsistency_errors; 00110 }; 00111 00113 // INLINES access methods // 00115 inline bool IO_HEPEVT::trust_both_mothers_and_daughters() const 00116 { return m_trust_both_mothers_and_daughters; } 00117 00118 inline bool IO_HEPEVT::trust_mothers_before_daughters() const 00119 { return m_trust_mothers_before_daughters; } 00120 00121 inline bool IO_HEPEVT::print_inconsistency_errors() const 00122 { return m_print_inconsistency_errors; } 00123 00124 inline void IO_HEPEVT::set_trust_both_mothers_and_daughters( bool b ) 00125 { m_trust_both_mothers_and_daughters = b; } 00126 00127 inline void IO_HEPEVT::set_trust_mothers_before_daughters( bool b ) 00128 { m_trust_mothers_before_daughters = b; } 00129 00130 inline void IO_HEPEVT::set_print_inconsistency_errors( bool b ) 00131 { m_print_inconsistency_errors = b; } 00132 00133 } // HepMC 00134 00135 #endif // HEPMC_IO_HEPEVT_H 00136 //--------------------------------------------------------------------------
1.5.1-3