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

McPositionHit.h

Go to the documentation of this file.
00001 // $Header: /nfs/slac/g/glast/ground/cvs/GlastEvent/GlastEvent/MonteCarlo/McPositionHit.h,v 1.6 2001/04/18 19:07:25 igable Exp $
00002 #ifndef GlastEvent_McPositionHit_H
00003 #define GlastEvent_McPositionHit_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 <math.h>
00012 #include "GaudiKernel/Kernel.h"
00013 #include "GaudiKernel/ContainedObject.h"
00014 #include "GaudiKernel/SmartRef.h"
00015 #include "GlastEvent/TopLevel/Definitions.h"
00016 #include "CLHEP/Geometry/Point3D.h"
00017 #include "GlastEvent/Utilities/CLHEPStreams.h"
00018 // Include all Gaudi container types here
00019 //   to simplify inlude statements in algorithms
00020 #include "GaudiKernel/ObjectVector.h"
00021 #include "GaudiKernel/ObjectList.h"
00022 #include "GlastEvent/Utilities/VolumeID.h"
00023 
00024 
00025 #include "GlastEvent/MonteCarlo/McParticle.h"
00026 #include "GlastEvent/MonteCarlo/McConstants.h"
00027 
00028 
00029 
00049 //namespace GlastEvent { // NameSpace
00050 
00051 // Forward declarations
00052 class McParticle;
00053 
00054 extern const CLID& CLID_McPositionHit;
00055 
00056 class McPositionHit : virtual public ContainedObject {
00057   public:
00058 
00059     virtual const CLID& clID() const   { return McPositionHit::classID(); }
00060     static const CLID& classID()       { return CLID_McPositionHit; }
00062     McPositionHit()
00063       : m_depositedEnergy(0.),
00064         m_timeOfFlight(0.)
00065     {}
00067     virtual ~McPositionHit() { }
00068 
00069 
00071     const VolumeID volumeID() const;
00073     void setVolumeID( VolumeID value );
00074 
00076     const HepPoint3D& entryPoint() const;
00077           HepPoint3D& entryPoint();
00079     void setEntryPoint( const HepPoint3D& value );
00080 
00082     const HepPoint3D& exitPoint() const;
00083           HepPoint3D& exitPoint();
00085     void setExitPoint( const HepPoint3D& value );
00086 
00088     double depositedEnergy() const;
00090     void setDepositedEnergy( double value );
00092     double particleEnergy() const;
00094     void setParticleEnergy( double value );
00095 
00097     bool primaryOrigin() const;
00099     void setPrimaryOrigin( bool value );
00101     bool caloShowerOrigin() const;
00103     void setCaloShowerOrigin( bool value );
00104 
00106     bool needDigi() const;
00108     void setNeedDigi( bool value );
00109 
00111     double directionCosine() const;
00112 
00114     double timeOfFlight() const;
00116     void setTimeOfFlight( double value );
00117 
00119     const McParticle* mcParticle() const;
00120           McParticle* mcParticle();
00122     void setMcParticle( McParticle* value );
00123     void setMcParticle( SmartRef<McParticle> value );
00124 
00126     const McParticle* originMcParticle() const;
00127           McParticle* originMcParticle();
00129     void setOriginMcParticle( McParticle* value );
00130     void setOriginMcParticle( SmartRef<McParticle> value );
00131 
00133     virtual StreamBuffer& serialize( StreamBuffer& s ) const;
00135     virtual StreamBuffer& serialize( StreamBuffer& s );
00137     virtual std::ostream& fillStream( std::ostream& s ) const;
00138 
00139   private:
00141     VolumeID                m_volumeID;
00143     HepPoint3D              m_entry;
00145     HepPoint3D              m_exit;
00147     double                  m_depositedEnergy;
00149     double                  m_particleEnergy;
00151     double                  m_timeOfFlight;
00153     SmartRef<McParticle>    m_mcParticle;
00155     SmartRef<McParticle>    m_originMcParticle;
00157     unsigned long           m_packedFlags;
00158 };
00159 
00160 
00161 typedef ObjectVector<McPositionHit> McPositionHitVector;
00162 typedef ObjectList<McPositionHit>   McPositionHitList;
00163 
00165 inline StreamBuffer& McPositionHit::serialize( StreamBuffer& s ) const
00166 {
00167   ContainedObject::serialize(s);
00168   return s
00169     << m_volumeID
00170     << m_entry
00171     << m_exit
00172     << m_depositedEnergy
00173     << m_particleEnergy
00174     << m_timeOfFlight
00175     << m_mcParticle(this)
00176     << m_originMcParticle(this)
00177     << m_packedFlags;
00178 }
00179 
00180 
00182 inline StreamBuffer& McPositionHit::serialize( StreamBuffer& s )
00183 {
00184   ContainedObject::serialize(s);
00185   return s
00186     >> m_volumeID
00187     >> m_entry
00188     >> m_exit
00189     >> m_depositedEnergy
00190     >> m_particleEnergy
00191     >> m_timeOfFlight
00192     >> m_mcParticle(this)
00193     >> m_originMcParticle(this)
00194     >> m_packedFlags;
00195 }
00196 
00197 
00199 inline std::ostream& McPositionHit::fillStream( std::ostream& s ) const
00200 {
00201   return s
00202     << "    base class McPositionHit :"
00203     << "\n        Volume ID             = " << m_volumeID
00204     << "\n        Entry point (x, y, z) = ( "
00205     << GlastEventFloatFormat( GlastEvent::width, GlastEvent::precision )
00206     << m_entry.x() << ", "
00207     << GlastEventFloatFormat( GlastEvent::width, GlastEvent::precision )
00208     << m_entry.y() << ", "
00209     << GlastEventFloatFormat( GlastEvent::width, GlastEvent::precision )
00210     << m_entry.z() << " )"
00211     << "\n        Deposited Energy      = "
00212     << GlastEventFloatFormat( GlastEvent::width, GlastEvent::precision )
00213     << m_depositedEnergy
00214     << "\n        Particle Energy       = "
00215     << GlastEventFloatFormat( GlastEvent::width, GlastEvent::precision )
00216     << m_particleEnergy
00217     << "\n        Time of flight        = "
00218     << GlastEventFloatFormat( GlastEvent::width, GlastEvent::precision )
00219     << m_timeOfFlight
00220     << "\n        Exit point (x, y, z)  = ( "
00221     << GlastEventFloatFormat( GlastEvent::width, GlastEvent::precision )
00222     << m_exit.x() << ", "
00223     << GlastEventFloatFormat( GlastEvent::width, GlastEvent::precision )
00224     << m_exit.y() << ", "
00225     << GlastEventFloatFormat( GlastEvent::width, GlastEvent::precision )
00226     << m_exit.z() << " )"
00227     << "\n        McParticle            = " << m_mcParticle(this)
00228     << "\n        ancestor McParticle   = " << m_originMcParticle(this);
00229 }
00230 
00231 #endif    // GlastEvent_McPositionHit_H

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