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

McParticle.h

Go to the documentation of this file.
00001 // $Header: /nfs/slac/g/glast/ground/cvs/GlastEvent/GlastEvent/MonteCarlo/McParticle.h,v 1.8 2001/05/18 22:48:32 burnett Exp $
00002 #ifndef GlastEvent_McParticle_H
00003 #define GlastEvent_McParticle_H 1
00004 
00005 // If you wish to introduce the namespace `GlastEvent', uncomment
00006 // the lines commented as `NameSpace'.
00007 
00008 
00009 // Include files
00010 #include <iostream>
00011 #include "GaudiKernel/Kernel.h"
00012 #include "GaudiKernel/ContainedObject.h"
00013 #include "GaudiKernel/SmartRef.h"
00014 #include "GaudiKernel/SmartRefVector.h"
00015 #include "GlastEvent/MonteCarlo/McVertex.h"
00016 #include "GlastEvent/MonteCarlo/McConstants.h"
00017 #include "GlastEvent/TopLevel/Definitions.h"
00018 #include "GlastEvent/Utilities/ParticleID.h"
00019 #include "CLHEP/Vector/LorentzVector.h"
00020 #include "GlastEvent/Utilities/CLHEPStreams.h"
00021 // Include all Glast container types here
00022 //   to simplify inlude statements in algorithms
00023 #include "GaudiKernel/ObjectVector.h"
00024 #include "GaudiKernel/ObjectList.h"
00025 
00026 
00027 
00046 //namespace GlastEvent {  // NameSpace
00047 
00048 // Forward declarations
00049 class McVertex;
00050 
00051 extern const CLID& CLID_McParticle;
00052 
00053 class McParticle  : virtual public ContainedObject  {
00054   public:
00055     typedef int  StdHepId;
00056 
00057     virtual const CLID& clID() const   { return McParticle::classID(); }
00058     static const CLID& classID()       { return CLID_McParticle; }
00060     McParticle() :
00061      m_subEvtID(0),
00062 //   m_primaryParticle(false),
00063      m_statusFlags(0)
00064     {}
00066     virtual ~McParticle() {}
00067 
00069     ParticleID particleID() const;
00071     void setParticleID( ParticleID value );
00072 
00074     StdHepId particleProperty() const;
00076     void setParticleProperty( StdHepId value );
00077 
00079     bool primaryParticle() const;
00081     void setPrimaryParticleFlag( bool value );
00082 
00084     const McVertex* mcVertex() const;
00085           McVertex* mcVertex();
00087     void setMcVertex( McVertex* value );
00088     void setMcVertex( SmartRef<McVertex> value );
00089 
00091     short subEvtID() const;
00093     void setSubEvtID( short value );
00094 
00096     virtual StreamBuffer& serialize( StreamBuffer& s ) const ;
00098     virtual StreamBuffer& serialize( StreamBuffer& s );
00100     virtual std::ostream& fillStream( std::ostream& s ) const;
00101 
00102   private:
00104     ParticleID                m_particleID;
00106     StdHepId                  m_particleProperty;
00108     short                     m_subEvtID;
00110     unsigned long             m_statusFlags;
00112     SmartRef<McVertex>        m_mcVertex;
00113 };
00114 
00115 
00116 // Definition of all container types of McParticle
00117 //template <class TYPE> class ObjectVector;
00118 //typedef ObjectVector<McParticle>     McParticleVector;
00119 
00120 template <class TYPE> class ObjectList;
00121 typedef ObjectList<McParticle>       McParticleList;
00122 typedef ObjectList<McParticle>       McParticleCol;
00123 
00124 inline StreamBuffer& McParticle::serialize( StreamBuffer& s ) const
00125 {
00126   ContainedObject::serialize(s);
00127   return s
00128     << m_particleID
00129     << m_particleProperty
00130     << m_subEvtID
00131     << m_statusFlags
00132     << m_mcVertex(this);
00133 }
00134 
00135 
00137 inline StreamBuffer& McParticle::serialize( StreamBuffer& s )
00138 {
00139   ContainedObject::serialize(s);
00140   s
00141     >> m_particleID
00142     >> m_particleProperty
00143     >> m_subEvtID
00144     >> m_statusFlags
00145     >> m_mcVertex(this);
00146   return s;
00147 }
00148 
00149 
00151 inline std::ostream& McParticle::fillStream( std::ostream& s ) const
00152 {
00153   s << "class McParticle"
00154     << " (SubEvent:" << m_subEvtID << ")"
00155     << " :"
00156     << "\n    Particle ID                = " << m_particleID
00157     << "\n    Particle Property          = " << m_particleProperty
00158     << "\n    Sub Event ID               = " << m_subEvtID
00159     << "\n    McVertex                   = " << m_mcVertex(this);
00160   return s;
00161 }
00162 
00163 
00164 //} // NameSpace GlastEvent
00165 
00166 
00167 #endif    // GlastEvent_McParticle_H

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