HepMC Reference Documentation

HepMC

StreamInfo.h

Go to the documentation of this file.
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 
00091 private: // data members
00092     bool        m_finished_first_event_io;
00093     // GenEvent I/O method keys
00094     std::string m_io_genevent_start;
00095     std::string m_io_ascii_start;
00096     std::string m_io_extendedascii_start;
00097     std::string m_io_genevent_end;
00098     std::string m_io_ascii_end;
00099     std::string m_io_extendedascii_end;
00100     // particle data I/O method keys
00101     std::string m_io_ascii_pdt_start;
00102     std::string m_io_extendedascii_pdt_start;
00103     std::string m_io_ascii_pdt_end;
00104     std::string m_io_extendedascii_pdt_end;
00105     // io information
00106     int         m_io_type;
00107     bool        m_has_key;
00108     // default io units - used only when reading a file with no units
00109     Units::MomentumUnit m_io_momentum_unit;
00110     Units::LengthUnit   m_io_position_unit;
00111     // used to keep identify the I/O stream
00112     unsigned int m_stream_id;
00113     static unsigned int m_stream_counter;
00114 
00115 };
00116 
00117 } // HepMC
00118 
00119 #endif  // HEPMC_STREAM_INFO_H
00120 //--------------------------------------------------------------------------

Generated on Thu Jan 7 13:10:16 2010 for HepMC by  doxygen 1.4.7