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

Track.h

Go to the documentation of this file.
00001 // ================================================
00002 // Track class description
00003 // ================================================
00004 //
00005 // THIS TEXT TO BE REPLACED BY ATLAS STANDARD FORMAT
00006 //
00007 // Namespace Atlfast::
00008 //
00009 // class: Track
00010 //
00011 // Authors: P.Clarke, H.Phillips, E.Richter-Was, P.Sherwood, R.Steward
00012 //
00013 // Description: 
00014 //
00015 //  Class to represent Tracks 
00016 //
00017 //  NOT included yet are:
00018 //
00019 //    1. Up to 6 mothers ? as I didnt understand how there could be more
00020 //       than 1 ?
00021 //    
00022 //    2. Correlation coefficients. The thought is that if these go in they
00023 //       go into ITrackTrajectory. Need to understand their use more.
00024 //
00025 //..................................................
00026 
00027 
00028 #ifndef ATLFAST_TRACK_H
00029 #define ATLFAST_TRACK_H
00030 
00031 
00032 // CLHEP, HepMC
00033 #include "CLHEP/Vector/ThreeVector.h"
00034 #include "HepMC/GenParticle.h"
00035 #include "CLHEP/Matrix/Matrix.h"
00036 
00037 // Atlfast classes.
00038 #include "AtlfastCode/ITrackTrajectory.h"
00039 #include "AtlfastCode/TrackTrajectory.h"
00040 #include "AtlfastCode/AssociationManager.h"
00041 
00042 // Gaudi
00043 #include "GaudiKernel/ContainedObject.h"
00044 #include "GaudiKernel/MsgStream.h"
00045 
00046 
00047 //Class ID for Track class
00048 static const CLID CLID_ATLFAST_Track=2306 ;
00049 
00050 
00051 namespace Atlfast {
00052 
00053 
00054   //........................................
00055   class Track : 
00056     virtual public ITrackTrajectory, 
00057     virtual public ContainedObject, 
00058     public AssociationManager
00059     {
00060       
00061     private:
00062       
00063       // A representation of the kinematic information assocated with 
00064       // this Track. This can be anthing suitable, all that is important is
00065       // that it can be used to honour the ITrackTrajectory interface.
00066       TrackTrajectory m_trajectory;
00067       TrackTrajectory m_truthTrajectory;
00068       // Mc truth particle from which this was created
00069       const HepMC::GenParticle* m_truth ;
00070       HepMatrix m_smearMatrix;
00071       
00072     public:
00073       
00074       // -----------------------------------
00075       // Constructors
00076       
00077       // Meaningful constructor to be used by clients
00078       Track( const TrackTrajectory& trajectory, 
00079              const HepMC::GenParticle* progenitor  ) 
00080         : ContainedObject(),
00081         AssociationManager(),
00082         m_trajectory(trajectory),
00083         m_truthTrajectory(trajectory),
00084         m_truth( progenitor ),
00085         m_smearMatrix(HepMatrix(5,5,0.))
00086         { }
00087       
00088       Track( const TrackTrajectory& truthTrajectory, 
00089              const TrackTrajectory& smearTrajectory,
00090              const HepMC::GenParticle* progenitor,
00091              const HepMatrix& matrix  ) 
00092         : ContainedObject(),
00093         AssociationManager(),
00094         m_trajectory(smearTrajectory),
00095         m_truthTrajectory(truthTrajectory),
00096         m_truth( progenitor ),
00097         m_smearMatrix(matrix)
00098         { }
00099       
00100       // Copy
00101       Track( const Track& src  ) 
00102         : ContainedObject( ),
00103         AssociationManager(src),
00104         m_trajectory(src.m_trajectory),
00105         m_truthTrajectory(src.m_truthTrajectory),
00106         m_truth( src.m_truth ),
00107         m_smearMatrix(src.m_smearMatrix)
00108         { }
00109       
00110       // Default which seems to be required by Athena, although doesnt have any 
00111       // meaning for the Track class. Hence a bogus trajectory has to be invented.
00112       Track() 
00113         : ContainedObject(), 
00114         AssociationManager(),
00115         m_trajectory( TrackTrajectory( 0,0,Phi(),0,0,0,HepPoint3D()
00116                                        ) 
00117                       ),
00118         m_truthTrajectory( TrackTrajectory( 0,0,Phi(),0,0,0,HepPoint3D()
00119                                             ) 
00120                            ),
00121         m_truth(NULL),
00122         m_smearMatrix(HepMatrix(5,5,0.))
00123         { }
00124       
00125       // Destructor
00126       //  Track() 
00127       //   : ContainedObject(), 
00128       //     AssociationManager(),
00129       //     m_trajectory( TrackTrajectory( Hep3Vector(1.,1.,1.), 
00130       //                                       Hep3Vector(0,0,0), 
00131       //                                       1., 
00132       //                                       0. 
00133       //                                      ) 
00134       //                    ),
00135       //     m_truth(NULL)
00136       //   { }
00137       
00138       // Destructor
00139       ~Track() {}
00140       
00141       // ------------------------------------------------
00142       // Methods to honour ITrackTrajectory interface 
00143       virtual Hep3Vector threeMomentum() const { 
00144         return Hep3Vector(m_trajectory); }
00145       virtual operator Hep3Vector() const { return Hep3Vector(m_trajectory); }
00146       virtual double  eta() const { return m_trajectory.eta() ;}
00147       virtual double  phi() const { return m_trajectory.phi() ;} 
00148       virtual double  pT()  const { return m_trajectory.pT() ;}
00149       virtual double  impactParameter() const { 
00150         return m_trajectory.impactParameter() ;}
00151       virtual double  zPerigee()     const { return m_trajectory.zPerigee() ;}
00152       virtual double  cotTheta()     const { return m_trajectory.cotTheta() ;}
00153       virtual double  invPtCharge()  const { 
00154         return m_trajectory.invPtCharge();}  
00155       virtual double  radius()       const { return m_trajectory.radius() ;}
00156       virtual HepPoint3D startPoint() const { 
00157         return m_trajectory.startPoint(); }
00158       virtual int     signOfCharge() const { 
00159         return m_trajectory.signOfCharge() ;}
00160       virtual TrackTrajectory trajectory() const {return m_trajectory;}
00161       virtual double  curvature() const {return m_trajectory.curvature() ;}
00162       
00163       // --------------------------------------------------
00164       // Access to MC truth particle from which this was created
00165       const HepMC::GenParticle* truth() const { return m_truth ; }
00166       const HepMatrix smearMatrix() const {return m_smearMatrix;}
00167       void setMatrix(const HepMatrix& matrix) {m_smearMatrix = matrix;}
00168       const TrackTrajectory truthTrajectory() const {return m_truthTrajectory;}
00169       // --------------------------------
00170       // Athena mandatory methods
00171       static const CLID& classID() { return CLID_ATLFAST_Track; }
00172       virtual const CLID& clID() const {  return CLID_ATLFAST_Track; }
00173       
00174       // Input streamer
00175       virtual StreamBuffer& serialize(StreamBuffer& s);
00176       
00177       // Output streamer
00178       virtual StreamBuffer& serialize(StreamBuffer& s) const;
00179       
00180     };
00181   
00182   
00183   // ................................................
00184   // Message stream operator for simple debug output
00185   
00186   MsgStream& operator << ( MsgStream& s, const Track& t ) ;
00187   MsgStream& operator << ( MsgStream& s, const Track* t ) ;
00188   
00189   
00190 } // end of namespace 
00191 
00192 
00193 #endif

Generated on Thu Feb 21 14:30:47 2002 for Atlfast by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001