CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/DataFormats/TrackReco/src/print.cc

Go to the documentation of this file.
00001 #include "DataFormats/TrackReco/interface/print.h"
00002 #include "DataFormats/TrackReco/interface/Track.h"
00003 #include <sstream>
00004 
00005 using namespace std;
00006 
00007 namespace reco {
00008   string print( const Track & trk, edm::Verbosity v ) {
00009     ostringstream out;
00010     if ( v > edm::Silent ) {
00011       out << "track parameters: " 
00012           << " vtx = " << trk.vertex()
00013           << " p = " << trk.momentum()
00014           << endl;
00015     }
00016     if ( v >= edm::Detailed ) {
00017       out << "covariance" << endl;
00018       for ( int i = 0; i < 5; i++ ) {
00019         for ( int j = 0; j < 5; j++ ) {
00020           out.precision(6); out.width(13); out << trk.covariance( i, j );
00021         }
00022         out << endl;
00023       }
00024       out << endl;
00025     }
00026     return out.str();
00027   }
00028 }