Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ParticleID.h

Go to the documentation of this file.
00001 // $Header: /nfs/slac/g/glast/ground/cvs/GlastEvent/GlastEvent/Utilities/ParticleID.h,v 1.3 2001/08/27 04:09:35 burnett Exp $
00002 #ifndef LHCBEVENT_PARTICLEID_H
00003 #define LHCBEVENT_PARTICLEID_H 1
00004 
00005 
00006 // Include files
00007 #include <iostream>
00008 #include "GaudiKernel/StreamBuffer.h"
00009 #include "GlastEvent/TopLevel/Definitions.h"
00010 
00011 
00012 //------------------------------------------------------------------------------
00013 //
00014 // ClassName:   ParticleID
00015 //  
00016 // Description: Particle identifier
00017 //              (corresponding to the particle identification table)
00018 //
00019 // Author:      Pavel Binko
00020 // Changes:     P.Binko 19/10/1999 : Formating of ASCII output
00021 //
00022 //------------------------------------------------------------------------------
00023 
00024 
00025 class ParticleID                                                               {
00026 
00027 public:
00028 
00030   ParticleID( long id )
00031     : m_id(id)                                                               { }
00032   ParticleID()
00033     : m_id(0)                                                                { }
00035   ~ParticleID()                                                              { }
00036 
00038   long id () const                                                             {
00039     return m_id;
00040   }
00042   operator long()const{return m_id;}
00043 
00045   void setID (long value)                                                      {
00046     m_id = value;
00047   }
00048 
00050   friend StreamBuffer& operator<< ( StreamBuffer& s, const ParticleID& obj )   {
00051     return s << obj.m_id;
00052   }
00054   friend StreamBuffer& operator>> ( StreamBuffer& s, ParticleID& obj )         {
00055     return s >> obj.m_id;
00056   }
00057 
00059   friend std::ostream& operator<< ( std::ostream& s, const ParticleID& obj )   {
00060     return obj.fillStream(s);
00061   }
00063   std::ostream& fillStream( std::ostream& s ) const                            {
00064     return s << "class ParticleID : "
00065       << GlastEventField( GlastEvent::field4 )
00066       << m_id;
00067   }
00068 
00069 private:
00070 
00072   long m_id;
00073 
00074 };
00075 
00076 
00077 #endif    // LHCBEVENT_PARTICLEID_H

Generated at Wed Nov 21 12:22:49 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000