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

Track.cxx

Go to the documentation of this file.
00001 #include "AtlfastEvent/Track.h"
00002 
00003 #include "GaudiKernel/MsgStream.h"
00004 
00005 #include "GaudiKernel/ObjectList.h"
00006 #include "GaudiKernel/ObjectVector.h"
00007 #include "GaudiKernel/ObjectFactory.h"
00008 
00009 #include <iomanip>
00010 #include <iostream>
00011 
00012 static ContainedObjectFactory < Atlfast::Track > s_AtlfastTrackFactory;
00013 const IFactory& AtlfastTrackFactory = s_AtlfastTrackFactory;
00014 
00015 namespace Atlfast {
00016   using std::setw;
00017   using std::setprecision;
00018   using std::setiosflags;
00019   using std::ios;
00020 
00021 // ................................................
00022 // Message stream operator for simple debug output
00023 
00024 MsgStream& operator << ( MsgStream& s, const Track& t ) 
00025 {
00026   if (t.truth()) {
00027     s << "Track created from particle " << t.pdg_id() << endreq << " with (px,py,pz) " 
00028     <<t.truth()->momentum().px() <<" "
00029     <<t.truth()->momentum().py() <<" "
00030     <<t.truth()->momentum().pz() <<" "
00031     <<endreq<<endreq;
00032   } 
00033   TrackTrajectory traj = t.trajectory();
00034   TrackParameters param = traj.parameters();
00035   TrackTrajectory truthTraj = t.truthTrajectory();
00036   TrackParameters truthParam = truthTraj.parameters();
00037   
00038   s << "     unsmeared Track       smeared Track"<<endreq; 
00039 
00040     s<<setiosflags(ios::fixed);
00041     s<<setprecision(7);
00042     s<<setw(20);
00043 
00044     s <<setw(20)<< truthParam.pT() 
00045       <<setw(20)<< param.pT()
00046       << "        pT"<<endreq;
00047     s <<setw(20)<< truthParam.eta() 
00048       <<setw(20)<< param.eta()
00049       << "        eta"<<endreq;
00050     s << "------------------  -------------------" << endreq;
00051 
00052     s <<setw(20)<< truthParam.impactParameter() 
00053       <<setw(20)<< param.impactParameter()
00054       << "        d0"<<endreq; 
00055     s <<setw(20)<< truthParam.zPerigee() 
00056       <<setw(20)<< param.zPerigee()
00057       << "        z0" << endreq;  
00058     s <<setw(20)<< truthParam.phi().val()
00059       <<setw(20)<< param.phi().val()
00060       << "       phi" <<endreq;
00061      s <<setw(20)<< truthParam.cotTheta()
00062       <<setw(20)<<param.cotTheta()
00063       << " cot Theta" << endreq;
00064     s <<setw(20)<< truthParam.invPtCharge()
00065       <<setw(20)<< param.invPtCharge()
00066       << "  1/(q.PT)" <<endreq;
00067     s << "-------------------  -------------------" << endreq;
00068     s <<setw(20)<< truthTraj.radius()
00069       <<setw(20)<< traj.radius()
00070       << "    radius" <<endreq;
00071     s <<setw(20)<< truthTraj.curvature()
00072       <<setw(20)<< traj.curvature()
00073       << " curvature" <<endreq<<endreq;
00074         
00075     s << "Matrix used"<<endreq ;
00076     s << setiosflags(2048);
00077     for (int a = 1; a<6; a++)
00078       {
00079         for (int b=1; b<6; b++)
00080           {
00081             s <<setw(10)<< t.smearMatrix() (a,b);
00082           }
00083         s <<endreq;
00084       }
00085 
00086   
00087   return s ;
00088 }
00089 
00090 MsgStream& operator << ( MsgStream& s, const Track* t ) 
00091 {
00092   return s << *t ;
00093 }
00094 
00095 } // end namespace
00096 
00097 
00098 
00099 
00100 
00101 
00102 
00103 
00104 
00105 
00106 
00107 
00108 
00109 
00110 
00111 

Generated on Fri Nov 29 12:55:12 2002 by doxygen1.3-rc1