CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/TrackingTools/TrajectoryState/src/TrajectoryStateOnSurfacePrint.cc

Go to the documentation of this file.
00001 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00002 #include <ostream>
00003 
00004 using namespace std;
00005 
00006 ostream& operator<<(std::ostream& os, const TrajectoryStateOnSurface& tsos) {
00007   os << "global parameters" << endl;
00008   {
00009     const AlgebraicVector6 &v = tsos.globalParameters().vector();
00010     os << "x = ";
00011     {
00012       for (int i = 0; i < 3; i++) {
00013         os.precision(6); os.width(13); os<<v[i];
00014       }
00015     }
00016     os << endl;
00017     os << "p = ";
00018     {
00019       for (int i = 3; i < 6; i++) {
00020         os.precision(6); os.width(13); os<<v[i];
00021       }
00022     }
00023     os << endl;
00024   }
00025   if ( tsos.hasError()) {
00026     os << "global error" << endl;
00027     {
00028       const AlgebraicSymMatrix55 &m = tsos.curvilinearError().matrix();
00029       for (int i = 0; i < 5; i++) {
00030         for (int j = 0; j < 5; j++) {
00031           os.precision(6); os.width(13); os<<m(i,j);
00032         }
00033         os << endl;
00034       }
00035     }
00036   }
00037   if ( tsos.localParameters().charge()!=0 )
00038     os << "local parameters (q/p,v',w',v,w)" << endl;
00039   else
00040     os << "local parameters for neutral (1/p,v',w',v,w)" << endl;
00041   {
00042     const AlgebraicVector5 &v = tsos.localParameters().mixedFormatVector();
00043     for (int i = 0; i < 5; i++) {
00044       os.precision(6); os.width(13); os<<v[i];
00045     }
00046     os << endl;
00047   }
00048   if ( tsos.hasError()) {
00049     os << "local error" << endl;
00050     {
00051       const AlgebraicSymMatrix55 &m = tsos.localError().matrix();
00052       for (int i = 0; i < 5; i++) {
00053         for (int j = 0; j < 5; j++) {
00054           os.precision(6); os.width(13); os<<m(i,j);
00055         }
00056         os << endl;
00057       }
00058     }
00059   }
00060   os << "Defined at ";
00061   if ( tsos.surfaceSide()==SurfaceSideDefinition::beforeSurface )  os << "beforeSurface";
00062   else if ( tsos.surfaceSide()==SurfaceSideDefinition::afterSurface )  os << "afterSurface";
00063   else  os << "atCenterOfSurface";
00064   os << endl;
00065 
00066   // magnetic field
00067   os << "Magnetic field in inverse GeV: " << tsos.globalParameters().magneticFieldInInverseGeV(tsos.globalPosition());
00068   os <<endl;
00069 
00070   return os;
00071 }