BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkExchangePar.cxx
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: TrkExchangePar.cxx,v 1.2 2005/07/18 02:56:08 zhangy Exp $
4//
5// Description:
6//
7//
8// Environment:
9// Software developed for the BaBar Detector at the SLAC B-Factory.
10//
11// Authors: Steve Schaffner
12//------------------------------------------------------------------------
13#include "TrkBase/TrkExchangePar.h"
14#include "MdcGeom/BesAngle.h"
15#include <assert.h>
16#include <iostream>
17using std::endl;
18using std::ostream;
19
20//----------------------------------------------------------------------
21TrkExchangePar::TrkExchangePar(const HepVector& inV, const HepMatrix& inErr)
22 : paramVec(inV) {
23//----------------------------------------------------------------------
24 assert(paramVec.num_row() == nParam);
25 assert(inErr.num_row() == nParam);
26 assert(inErr.num_col() == nParam);
27 paramErr.assign(inErr);
28 paramVec[ex_phi0] = BesAngle(paramVec[ex_phi0]).rad();
29}
30
31//----------------------------------------------------------------------
32TrkExchangePar::TrkExchangePar(const HepVector& inV, const HepSymMatrix& err)
33 : paramVec(inV), paramErr(err) {
34//----------------------------------------------------------------------
35 assert(paramVec.num_row() == nParam);
36 assert(paramErr.num_row() == nParam);
37 paramVec[ex_phi0] = BesAngle(paramVec[ex_phi0]).rad();
38}
39
40//----------------------------------------------------------------------
41TrkExchangePar::TrkExchangePar(const HepVector& inV)
42 : paramVec(inV), paramErr(nParam, 1) {
43//----------------------------------------------------------------------
44 assert(paramVec.num_row() == nParam);
45 paramVec[ex_phi0] = BesAngle(paramVec[ex_phi0]).rad();
46}
47
48//----------------------------------------------------------------------
49TrkExchangePar::TrkExchangePar(double d0In, double phi0In, double omegaIn,
50 double z0In, double tanDipIn)
51 : paramVec(nParam), paramErr(nParam, 1) {
52//----------------------------------------------------------------------
53 paramVec[ex_d0] = d0In;
54 paramVec[ex_phi0] = phi0In;
55 paramVec[ex_omega] = omegaIn;
56 paramVec[ex_z0] = z0In;
57 paramVec[ex_tanDip] = tanDipIn;
58 paramVec[ex_phi0] = BesAngle(paramVec[ex_phi0]).rad();
59}
60
61//----------------------------------------------------------------------
63
64//----------------------------------------------------------------------
65// Output functions: simple, detailed, and stream
66
67void TrkExchangePar::print(ostream& o) const {
68 o << "d0=" << d0() << " phi0=" << phi0() << " omega=" << omega()
69 << " z0=" << z0() << " tanDip=" << tanDip();
70}
71
72void TrkExchangePar::printAll(ostream& o) const {
73 print(o);
74 o << endl << covariance() << endl;
75}
76
77
78
79ostream& operator<<(ostream& o, const TrkExchangePar& helix) {
80 helix.print(o);
81 return o;
82}
83
ostream & operator<<(ostream &o, const TrkExchangePar &helix)
void print(std::ostream &o) const
void printAll(std::ostream &o) const
TrkExchangePar(const HepVector &, const HepMatrix &)