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 "AtlfastEvent/ITrackTrajectory.h"
00039 #include "AtlfastEvent/TrackTrajectory.h"
00040 #include "AtlfastEvent/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 using ::HepMatrix;
00051 
00052 namespace Atlfast {
00053 
00054 
00055   //........................................
00056   class Track : 
00057     virtual public ITrackTrajectory, 
00058     virtual public ContainedObject, 
00059     public AssociationManager
00060     {
00061       
00062     private:
00063       
00064       // A representation of the kinematic information assocated with 
00065       // this Track. This can be anthing suitable, all that is important is
00066       // that it can be used to honour the ITrackTrajectory interface.
00067       TrackTrajectory m_trajectory;
00068       TrackTrajectory m_truthTrajectory;
00069       // Mc truth particle from which this was created
00070       const HepMC::GenParticle* m_truth ;
00071       HepMatrix m_smearMatrix;
00072       
00073     public:
00074       
00075       // -----------------------------------
00076       // Constructors
00077       
00078       // Meaningful constructor to be used by clients
00079       Track( const TrackTrajectory& trajectory, 
00080              const HepMC::GenParticle* progenitor  ) 
00081         : ContainedObject(),
00082         AssociationManager(),
00083         m_trajectory(trajectory),
00084         m_truthTrajectory(trajectory),
00085         m_truth( progenitor ),
00086         m_smearMatrix(HepMatrix(5,5,0.))
00087         { }
00088       
00089       Track( const TrackTrajectory& truthTrajectory, 
00090              const TrackTrajectory& smearTrajectory,
00091              const HepMC::GenParticle* progenitor,
00092              const HepMatrix& matrix  ) 
00093         : ContainedObject(),
00094         AssociationManager(),
00095         m_trajectory(smearTrajectory),
00096         m_truthTrajectory(truthTrajectory),
00097         m_truth( progenitor ),
00098         m_smearMatrix(matrix)
00099         { }
00100       
00101       // Copy
00102       Track( const Track& src  ) 
00103         : ContainedObject( ),
00104         AssociationManager(src),
00105         m_trajectory(src.m_trajectory),
00106         m_truthTrajectory(src.m_truthTrajectory),
00107         m_truth( src.m_truth ),
00108         m_smearMatrix(src.m_smearMatrix)
00109         { }
00110       
00111       // Default which seems to be required by Athena, although doesnt have any 
00112       // meaning for the Track class. Hence a bogus trajectory has to be invented.
00113       Track() 
00114         : ContainedObject(), 
00115         AssociationManager(),
00116         m_trajectory( TrackTrajectory( 0,0,Phi(),0,0,0,HepPoint3D()
00117                                        ) 
00118                       ),
00119         m_truthTrajectory( TrackTrajectory( 0,0,Phi(),0,0,0,HepPoint3D()
00120                                             ) 
00121                            ),
00122         m_truth(NULL),
00123         m_smearMatrix(HepMatrix(5,5,0.))
00124         { }
00125       
00126       // Destructor
00127       //  Track() 
00128       //   : ContainedObject(), 
00129       //     AssociationManager(),
00130       //     m_trajectory( TrackTrajectory( Hep3Vector(1.,1.,1.), 
00131       //                                       Hep3Vector(0,0,0), 
00132       //                                       1., 
00133       //                                       0. 
00134       //                                      ) 
00135       //                    ),
00136       //     m_truth(NULL)
00137       //   { }
00138       
00139       // Destructor
00140       ~Track() {}
00141       
00142       // ------------------------------------------------
00143       // Methods to honour ITrackTrajectory interface 
00144       virtual Hep3Vector threeMomentum() const { 
00145         return Hep3Vector(m_trajectory); }
00146       virtual operator Hep3Vector() const { return Hep3Vector(m_trajectory); }
00147       virtual double  eta() const { return m_trajectory.eta() ;}
00148       virtual double  phi() const { return m_trajectory.phi() ;} 
00149       virtual double  pT()  const { return m_trajectory.pT() ;}
00150       virtual double  impactParameter() const { 
00151         return m_trajectory.impactParameter() ;}
00152       virtual double  zPerigee()     const { return m_trajectory.zPerigee() ;}
00153       virtual double  cotTheta()     const { return m_trajectory.cotTheta() ;}
00154       virtual double  invPtCharge()  const { 
00155         return m_trajectory.invPtCharge();}  
00156       virtual double  radius()       const { return m_trajectory.radius() ;}
00157       virtual HepPoint3D startPoint() const { 
00158         return m_trajectory.startPoint(); }
00159       virtual int     signOfCharge() const { 
00160         return m_trajectory.signOfCharge() ;}
00161       virtual TrackTrajectory trajectory() const {return m_trajectory;}
00162       virtual double  curvature() const {return m_trajectory.curvature() ;}
00163       
00164       // --------------------------------------------------
00165       // Access to MC truth particle from which this was created
00166       const HepMC::GenParticle* truth() const { return m_truth ; }
00167       const HepMatrix smearMatrix() const {return m_smearMatrix;}
00168       void setMatrix(const HepMatrix& matrix) {m_smearMatrix = matrix;}
00169       const TrackTrajectory truthTrajectory() const {return m_truthTrajectory;}
00170       // --------------------------------
00171       // Athena mandatory methods
00172       static const CLID& classID() { return CLID_ATLFAST_Track; }
00173       virtual const CLID& clID() const {  return CLID_ATLFAST_Track; }
00174       
00175     };
00176   
00177   
00178   // ................................................
00179   // Message stream operator for simple debug output
00180   
00181   MsgStream& operator << ( MsgStream& s, const Track& t ) ;
00182   MsgStream& operator << ( MsgStream& s, const Track* t ) ;
00183   
00184   
00185 } // end of namespace 
00186 
00187 
00188 #endif

Generated on Wed May 1 14:35:47 2002 for AtlfastEvent by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001