|
HepMC Reference DocumentationHepMC |
00001 //-------------------------------------------------------------------------- 00002 #ifndef HEPMC_STREAM_INFO_H 00003 #define HEPMC_STREAM_INFO_H 00004 00006 // garren@fnal.gov, March 2009 00007 // 00008 // This class contains the extra information needed when using streaming IO 00010 00011 #include <string> 00012 #include "HepMC/Units.h" 00013 00014 namespace HepMC { 00015 00017 enum known_io { gen=1, ascii, extascii, ascii_pdt, extascii_pdt }; 00018 00020 00026 class StreamInfo { 00027 public: 00029 StreamInfo( ); 00031 ~StreamInfo() {} 00032 00034 std::string IO_GenEvent_Key() const { return m_io_genevent_start; } 00036 std::string IO_GenEvent_End() const { return m_io_genevent_end; } 00037 00041 std::string IO_Ascii_Key() const { return m_io_ascii_start; } 00043 std::string IO_Ascii_End() const { return m_io_ascii_end; } 00045 std::string IO_Ascii_PDT_Key() const { return m_io_ascii_pdt_start; } 00047 std::string IO_Ascii_PDT_End() const { return m_io_ascii_pdt_end; } 00048 00052 std::string IO_ExtendedAscii_Key() const { return m_io_extendedascii_start; } 00054 std::string IO_ExtendedAscii_End() const { return m_io_extendedascii_end; } 00056 std::string IO_ExtendedAscii_PDT_Key() const { return m_io_extendedascii_pdt_start; } 00058 std::string IO_ExtendedAscii_PDT_End() const { return m_io_extendedascii_pdt_end; } 00059 00061 int io_type() const { return m_io_type; } 00063 void set_io_type( int ); 00064 00067 bool has_key() const { return m_has_key; } 00069 void set_has_key( bool ); 00070 00072 Units::MomentumUnit io_momentum_unit() const { return m_io_momentum_unit; } 00074 Units::LengthUnit io_position_unit() const { return m_io_position_unit; } 00075 00078 int stream_id() const { return m_stream_id; } 00079 00081 bool finished_first_event() const { return m_finished_first_event_io; } 00083 void set_finished_first_event( bool b ) { m_finished_first_event_io = b; } 00084 00089 void use_input_units( Units::MomentumUnit, Units::LengthUnit ); 00090 00093 bool reading_event_header(); 00095 void set_reading_event_header(bool); 00096 00097 private: // data members 00098 bool m_finished_first_event_io; 00099 // GenEvent I/O method keys 00100 std::string m_io_genevent_start; 00101 std::string m_io_ascii_start; 00102 std::string m_io_extendedascii_start; 00103 std::string m_io_genevent_end; 00104 std::string m_io_ascii_end; 00105 std::string m_io_extendedascii_end; 00106 // particle data I/O method keys 00107 std::string m_io_ascii_pdt_start; 00108 std::string m_io_extendedascii_pdt_start; 00109 std::string m_io_ascii_pdt_end; 00110 std::string m_io_extendedascii_pdt_end; 00111 // io information 00112 int m_io_type; 00113 bool m_has_key; 00114 // default io units - used only when reading a file with no units 00115 Units::MomentumUnit m_io_momentum_unit; 00116 Units::LengthUnit m_io_position_unit; 00117 // used to keep identify the I/O stream 00118 unsigned int m_stream_id; 00119 static unsigned int m_stream_counter; 00120 // used to keep track when reading event 00121 bool m_reading_event_header; 00122 00123 }; 00124 00125 } // HepMC 00126 00127 #endif // HEPMC_STREAM_INFO_H 00128 //--------------------------------------------------------------------------
1.4.7