CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/TrackingTools/TrajectoryState/src/FreeTrajectoryStatePrint.cc

Go to the documentation of this file.
00001 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
00002 #include <iostream>
00003 
00004 using namespace std;
00005 
00006 ostream& operator<<(ostream& os, const FreeTrajectoryState& fts) {
00007   os << "parameters" << endl;
00008   { 
00009     const AlgebraicVector6 &v = fts.parameters().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 (fts.hasError()) { 
00026     os << "error" << endl;
00027     { 
00028       const AlgebraicSymMatrix55 &m = fts.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   else {
00038     os << "no error defined." << endl;
00039   }
00040   return os;
00041 }