Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:41

0001 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0002 #include <ostream>
0003 
0004 using namespace std;
0005 
0006 ostream &operator<<(std::ostream &os, const TrajectoryStateOnSurface &tsos) {
0007   os << "global parameters" << endl;
0008   {
0009     const AlgebraicVector6 &v = tsos.globalParameters().vector();
0010     os << "x = ";
0011     {
0012       for (int i = 0; i < 3; i++) {
0013         os.precision(6);
0014         os.width(13);
0015         os << v[i];
0016       }
0017     }
0018     os << endl;
0019     os << "p = ";
0020     {
0021       for (int i = 3; i < 6; i++) {
0022         os.precision(6);
0023         os.width(13);
0024         os << v[i];
0025       }
0026     }
0027     os << endl;
0028   }
0029   if (tsos.hasError()) {
0030     os << "global error" << endl;
0031     {
0032       const AlgebraicSymMatrix55 &m = tsos.curvilinearError().matrix();
0033       for (int i = 0; i < 5; i++) {
0034         for (int j = 0; j < 5; j++) {
0035           os.precision(6);
0036           os.width(13);
0037           os << m(i, j);
0038         }
0039         os << endl;
0040       }
0041     }
0042   }
0043   if (tsos.localParameters().charge() != 0)
0044     os << "local parameters (q/p,v',w',v,w)" << endl;
0045   else
0046     os << "local parameters for neutral (1/p,v',w',v,w)" << endl;
0047   {
0048     const AlgebraicVector5 &v = tsos.localParameters().mixedFormatVector();
0049     for (int i = 0; i < 5; i++) {
0050       os.precision(6);
0051       os.width(13);
0052       os << v[i];
0053     }
0054     os << endl;
0055   }
0056   if (tsos.hasError()) {
0057     os << "local error" << endl;
0058     {
0059       const AlgebraicSymMatrix55 &m = tsos.localError().matrix();
0060       for (int i = 0; i < 5; i++) {
0061         for (int j = 0; j < 5; j++) {
0062           os.precision(6);
0063           os.width(13);
0064           os << m(i, j);
0065         }
0066         os << endl;
0067       }
0068     }
0069   }
0070   os << "Defined at ";
0071   if (tsos.surfaceSide() == SurfaceSideDefinition::beforeSurface)
0072     os << "beforeSurface";
0073   else if (tsos.surfaceSide() == SurfaceSideDefinition::afterSurface)
0074     os << "afterSurface";
0075   else
0076     os << "atCenterOfSurface";
0077   os << endl;
0078 
0079   // magnetic field
0080   os << "Magnetic field in inverse GeV: " << tsos.globalParameters().magneticFieldInInverseGeV(tsos.globalPosition());
0081   os << endl;
0082 
0083   return os;
0084 }