00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef ATLFAST_TRACK_H
00029 #define ATLFAST_TRACK_H
00030
00031
00032
00033 #include "CLHEP/Vector/ThreeVector.h"
00034 #include "HepMC/GenParticle.h"
00035 #include "CLHEP/Matrix/Matrix.h"
00036
00037
00038 #include "AtlfastCode/ITrackTrajectory.h"
00039 #include "AtlfastCode/TrackTrajectory.h"
00040 #include "AtlfastCode/AssociationManager.h"
00041
00042
00043 #include "GaudiKernel/ContainedObject.h"
00044 #include "GaudiKernel/MsgStream.h"
00045
00046
00047
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
00064
00065
00066 TrackTrajectory m_trajectory;
00067 TrackTrajectory m_truthTrajectory;
00068
00069 const HepMC::GenParticle* m_truth ;
00070 HepMatrix m_smearMatrix;
00071
00072 public:
00073
00074
00075
00076
00077
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
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
00111
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
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139 ~Track() {}
00140
00141
00142
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
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
00171 static const CLID& classID() { return CLID_ATLFAST_Track; }
00172 virtual const CLID& clID() const { return CLID_ATLFAST_Track; }
00173
00174
00175 virtual StreamBuffer& serialize(StreamBuffer& s);
00176
00177
00178 virtual StreamBuffer& serialize(StreamBuffer& s) const;
00179
00180 };
00181
00182
00183
00184
00185
00186 MsgStream& operator << ( MsgStream& s, const Track& t ) ;
00187 MsgStream& operator << ( MsgStream& s, const Track* t ) ;
00188
00189
00190 }
00191
00192
00193 #endif