CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrajectoryStateOnSurfacePrint.cc
Go to the documentation of this file.
2 #include <ostream>
3 
4 using namespace std;
5 
6 ostream& operator<<(std::ostream& os, const TrajectoryStateOnSurface& tsos) {
7  os << "global parameters" << endl;
8  {
9  const AlgebraicVector6 &v = tsos.globalParameters().vector();
10  os << "x = ";
11  {
12  for (int i = 0; i < 3; i++) {
13  os.precision(6); os.width(13); os<<v[i];
14  }
15  }
16  os << endl;
17  os << "p = ";
18  {
19  for (int i = 3; i < 6; i++) {
20  os.precision(6); os.width(13); os<<v[i];
21  }
22  }
23  os << endl;
24  }
25  if ( tsos.hasError()) {
26  os << "global error" << endl;
27  {
29  for (int i = 0; i < 5; i++) {
30  for (int j = 0; j < 5; j++) {
31  os.precision(6); os.width(13); os<<m(i,j);
32  }
33  os << endl;
34  }
35  }
36  }
37  if ( tsos.localParameters().charge()!=0 )
38  os << "local parameters (q/p,v',w',v,w)" << endl;
39  else
40  os << "local parameters for neutral (1/p,v',w',v,w)" << endl;
41  {
43  for (int i = 0; i < 5; i++) {
44  os.precision(6); os.width(13); os<<v[i];
45  }
46  os << endl;
47  }
48  if ( tsos.hasError()) {
49  os << "local error" << endl;
50  {
51  const AlgebraicSymMatrix55 &m = tsos.localError().matrix();
52  for (int i = 0; i < 5; i++) {
53  for (int j = 0; j < 5; j++) {
54  os.precision(6); os.width(13); os<<m(i,j);
55  }
56  os << endl;
57  }
58  }
59  }
60  os << "Defined at ";
61  if ( tsos.surfaceSide()==SurfaceSideDefinition::beforeSurface ) os << "beforeSurface";
62  else if ( tsos.surfaceSide()==SurfaceSideDefinition::afterSurface ) os << "afterSurface";
63  else os << "atCenterOfSurface";
64  os << endl;
65 
66  // magnetic field
67  os << "Magnetic field in inverse GeV: " << tsos.globalParameters().magneticFieldInInverseGeV(tsos.globalPosition());
68  os <<endl;
69 
70  return os;
71 }
int i
Definition: DBlmapReader.cc:9
const LocalTrajectoryParameters & localParameters() const
const CurvilinearTrajectoryError & curvilinearError() const
GlobalPoint globalPosition() const
ostream & operator<<(std::ostream &o, vector< std::string > const &iValue)
Definition: refresh.cc:45
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
GlobalVector magneticFieldInInverseGeV(const GlobalPoint &x) const
ROOT::Math::SVector< double, 6 > AlgebraicVector6
SurfaceSide surfaceSide() const
Position relative to material, defined relative to momentum vector.
int j
Definition: DBlmapReader.cc:9
const AlgebraicSymMatrix55 & matrix() const
const LocalTrajectoryError & localError() const
ROOT::Math::SVector< double, 5 > AlgebraicVector5
const GlobalTrajectoryParameters & globalParameters() const
AlgebraicVector5 mixedFormatVector() const
TrackCharge charge() const
Charge (-1, 0 or 1)
const AlgebraicSymMatrix55 & matrix() const
AlgebraicVector6 vector() const