CMS 3D CMS Logo

Classes | Functions

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h File Reference

#include "TrackingTools/TrajectoryState/interface/BasicTrajectoryState.h"
#include "TrackingTools/TrajectoryState/interface/SurfaceSideDefinition.h"
#include <iosfwd>

Go to the source code of this file.

Classes

class  TrajectoryStateOnSurface

Functions

std::ostream & operator<< (std::ostream &os, const TrajectoryStateOnSurface &tsos)
void swap (TrajectoryStateOnSurface &rh, TrajectoryStateOnSurface &lh)

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const TrajectoryStateOnSurface tsos 
)

Definition at line 6 of file TrajectoryStateOnSurfacePrint.cc.

References SurfaceSideDefinition::afterSurface, SurfaceSideDefinition::beforeSurface, LocalTrajectoryParameters::charge(), TrajectoryStateOnSurface::curvilinearError(), TrajectoryStateOnSurface::globalParameters(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::hasError(), i, j, TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localParameters(), m, GlobalTrajectoryParameters::magneticFieldInInverseGeV(), CurvilinearTrajectoryError::matrix(), LocalTrajectoryError::matrix(), LocalTrajectoryParameters::mixedFormatVector(), TrajectoryStateOnSurface::surfaceSide(), findQualityFiles::v, and GlobalTrajectoryParameters::vector().

                                                                          {
  os << "global parameters" << endl;
  {
    const AlgebraicVector6 &v = tsos.globalParameters().vector();
    os << "x = ";
    {
      for (int i = 0; i < 3; i++) {
        os.precision(6); os.width(13); os<<v[i];
      }
    }
    os << endl;
    os << "p = ";
    {
      for (int i = 3; i < 6; i++) {
        os.precision(6); os.width(13); os<<v[i];
      }
    }
    os << endl;
  }
  if ( tsos.hasError()) {
    os << "global error" << endl;
    {
      const AlgebraicSymMatrix55 &m = tsos.curvilinearError().matrix();
      for (int i = 0; i < 5; i++) {
        for (int j = 0; j < 5; j++) {
          os.precision(6); os.width(13); os<<m(i,j);
        }
        os << endl;
      }
    }
  }
  if ( tsos.localParameters().charge()!=0 )
    os << "local parameters (q/p,v',w',v,w)" << endl;
  else
    os << "local parameters for neutral (1/p,v',w',v,w)" << endl;
  {
    const AlgebraicVector5 &v = tsos.localParameters().mixedFormatVector();
    for (int i = 0; i < 5; i++) {
      os.precision(6); os.width(13); os<<v[i];
    }
    os << endl;
  }
  if ( tsos.hasError()) {
    os << "local error" << endl;
    {
      const AlgebraicSymMatrix55 &m = tsos.localError().matrix();
      for (int i = 0; i < 5; i++) {
        for (int j = 0; j < 5; j++) {
          os.precision(6); os.width(13); os<<m(i,j);
        }
        os << endl;
      }
    }
  }
  os << "Defined at ";
  if ( tsos.surfaceSide()==SurfaceSideDefinition::beforeSurface )  os << "beforeSurface";
  else if ( tsos.surfaceSide()==SurfaceSideDefinition::afterSurface )  os << "afterSurface";
  else  os << "atCenterOfSurface";
  os << endl;

  // magnetic field
  os << "Magnetic field in inverse GeV: " << tsos.globalParameters().magneticFieldInInverseGeV(tsos.globalPosition());
  os <<endl;

  return os;
}
void swap ( TrajectoryStateOnSurface rh,
TrajectoryStateOnSurface lh 
) [inline]

Definition at line 236 of file TrajectoryStateOnSurface.h.

References TrajectoryStateOnSurface::swap().

                                                                                 {
  // use base swap
  rh.swap(lh);
}