BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
BesVectorErr.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: BesVectorErr.h,v 1.5 2010/03/25 09:55:57 zhangy Exp $
4//
5// Description:
6// Add errors to a vector. Used for direction errors
7// BaBar native class
8//
9// Environment:
10// Software developed for the BaBar Detector at the SLAC B-Factory.
11//
12// Author List:
13// Forest Rouse February 1996
14// Victoria Novotny August 1996
15// Ed Frank University of Pennsylvania, [email protected]
16//
17// History
18// 14 Oct 96 Ed Frank Simple mod to make unary - compile under
19// Sun's CC 4.0.1
20// 19 Jan 2002 Sasha Telnov Added operator * (scaling by a real number)
21//
22// Copyright Information:
23// Copyright (C) 1996
24//
25// History:
26// Migration for BESIII MDC
27//
28//------------------------------------------------------------------------
29#ifndef BESVECTORERR_H
30#define BESVECTORERR_H
31
32#include <iosfwd>
34#include "CLHEP/Vector/Rotation.h"
35
36using namespace CLHEP;
37
38
39class BesVectorErr : public Hep3Vector {
40
41public:
42 // polar coordinates
44 Rho = 0,
45 Theta = 1,
46 Phi = 2,
48 };
49
51 C_Rho = 0,
52 C_Zeta = 1,
53 C_Phi = 2,
55 };
56 // argumentless constructor:
57 BesVectorErr() : Hep3Vector(), _covMatrix(NUM_COORDINATES) {}
58
59 // auto casting constructor
60 BesVectorErr(const Hep3Vector &p) : Hep3Vector(p), _covMatrix(NUM_COORDINATES) {}
61 BesVectorErr(const Hep3Vector &p, const BesError& covMat) : Hep3Vector(p),
62 _covMatrix(NUM_COORDINATES) { _covMatrix=covMat; }
63
64 // copy constructor:
65 BesVectorErr(const BesVectorErr& v) : Hep3Vector(v),
66 _covMatrix(v.covMatrix()) {}
67
68 // destructor MAY be needed later
69 // virtual ~BesVectorErr() {};
70
71 // assignment operator:
73 {
74 if (this != &v) {
75 Hep3Vector::operator=(v);
76 _covMatrix = v.covMatrix();
77 }
78 return *this;
79 }
80
82 Hep3Vector t = *this;
83 return BesVectorErr( -t, _covMatrix); // _covMatrix remains unaltered
84 }
85
87 Hep3Vector::operator+=(v);
88 _covMatrix += v.covMatrix();
89 return *this;
90 }
91
93 Hep3Vector::operator-=(v);
94 _covMatrix += v.covMatrix();
95 return *this;
96 }
97/*
98 BesVectorErr& transform(const HepTranslation& trans){
99 Hep3Vector::transform(trans);
100 return *this;
101 }
102
103 BesVectorErr& transform(const HepRotation& rot){
104 Hep3Vector::transform(rot);
105 _covMatrix = _covMatrix.similarity(rot);
106 return *this;
107 }
108
109 BesVectorErr& transform(const HepTransformation& transf){
110 Hep3Vector::transform(transf);
111 _covMatrix = _covMatrix.similarity(transf.rot_mat());
112 return *this;
113 }
114*/
115 double determineChisq(const Hep3Vector& refVector) const;
116 // returns Chisquare
117 // refVector refers to the same origin as the Hep3Vector of this
118 // ie refVector is not relative to this Vector
119
120
121 inline const BesError & covMatrix() const { return _covMatrix; }
122
123 BesError covRTPMatrix() const;
124 // returns the covariance Matrix in spherical coordinate
125 // use PolarCoordinateIndex enum to get the components
126
127 BesError covRZPMatrix() const;
128 // returns the covariance Matrix in cylindrical coordinate
129 // use CylindricalCoordinateIndex enum to get the components
130
131 inline void setCovMatrix(const BesError& v) { _covMatrix = v; }
132
133// void printOn(ostream& out=cout) const;
134
135private:
136
137 BesError _covMatrix;
138};
139
140
142
144
145// Added by Sasha Telnov
146BesVectorErr operator * (const BesVectorErr &, double a);
147BesVectorErr operator * (double a, const BesVectorErr &);
148
149std::ostream & operator<<(std::ostream & stream, const BesVectorErr & verr);
150std::istream & operator>>(std::istream & stream, BesVectorErr & verr);
151
152#endif
153
154
155
156
157
158
std::ostream & operator<<(std::ostream &stream, const BesVectorErr &verr)
std::istream & operator>>(std::istream &stream, BesVectorErr &verr)
BesVectorErr operator+(const BesVectorErr &, const BesVectorErr &)
BesVectorErr operator-(const BesVectorErr &, const BesVectorErr &)
BesVectorErr operator*(const BesVectorErr &, double a)
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition: KarLud.h:35
TTree * t
Definition: binning.cxx:23
BesError covRZPMatrix() const
const BesError & covMatrix() const
Definition: BesVectorErr.h:121
void setCovMatrix(const BesError &v)
Definition: BesVectorErr.h:131
CylindricalCoordinateIndex
Definition: BesVectorErr.h:50
BesVectorErr(const Hep3Vector &p, const BesError &covMat)
Definition: BesVectorErr.h:61
BesVectorErr operator-()
Definition: BesVectorErr.h:81
BesVectorErr(const BesVectorErr &v)
Definition: BesVectorErr.h:65
double determineChisq(const Hep3Vector &refVector) const
BesVectorErr(const Hep3Vector &p)
Definition: BesVectorErr.h:60
BesVectorErr & operator+=(const BesVectorErr &v)
Definition: BesVectorErr.h:86
BesError covRTPMatrix() const
BesVectorErr & operator=(const BesVectorErr &v)
Definition: BesVectorErr.h:72
BesVectorErr & operator-=(const BesVectorErr &v)
Definition: BesVectorErr.h:92