BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
DifFourVector.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: DifFourVector.h,v 1.3 2009/12/23 02:59:56 zhangy Exp $
4//
5// Description:
6// Class Header for |DifVector|
7// A 4-vector based on differential numbers
8//
9// Environment:
10// Software developed for the BaBar Detector at the SLAC B-Factory.
11//
12// Author List:
13// A. Snyder
14//
15// Copyright Information:
16// Copyright (C) 2002 SLAC
17//
18// History:
19// Migration for BESIII MDC
20//
21//------------------------------------------------------------------------
22
23#ifndef DifFourVector_H
24#define DifFourVector_H
25
26#include <vector>
27
30#include "CLHEP/Vector/ThreeVector.h"
31#include <iosfwd>
32class DifRotation;
33using CLHEP::Hep3Vector;
35
36public:
37
38 //constructors
39 DifFourVector(); // null - default
40 DifFourVector // construct from components
41 (const DifNumber& mass,const DifVector& p);
42 DifFourVector // construct from components
43 (const double& mass,const DifVector& p);
44
45 DifFourVector(const DifFourVector& v); // copy
46
47 //destructor
48 ~DifFourVector() {} // destroy
49
50 //given error on parameters calculate error on vector
51 HepSymMatrix errorMatrix // caclulate error matrix
52 (const HepSymMatrix& e)const;
53
54 //give jacobian transformation matrix wrt independent parameters;
55 HepMatrix jacobian()const;
56
57 //operators
61 inline DifFourVector operator-()const;
62
63 inline friend DifFourVector operator+ // vector sum
64 (const DifFourVector& a,const DifFourVector& b);
65 inline friend DifFourVector operator- // vector difference
66 (const DifFourVector& a,const DifFourVector& b);
67 inline friend DifNumber operator* // scalar product
68 (const DifFourVector& a,const DifFourVector& b);
69
70
71
72 //access
73 inline int nPar()const; // return number of params
74 inline DifVector direction()const;
75 inline DifNumber pMag()const {return P.length();}
76 inline DifNumber massSq()const {return E*E-P*P;}
77 inline DifNumber mass()const {
78 DifNumber temp=massSq();
79 if(temp>=0) return sqrt(temp);
80 return -sqrt(-massSq());
81 }
82
83
84 //i/o
85 void print(/*std::ostream& o*/)const; // print out
86
87
88 //manipulations
89
90 //misc
91 inline DifFourVector& zeroDerivatives(); // zero derivatives
92
93
94 //boost
95
96
97 void boostTo(const DifFourVector&);
98 void boostFrom(const DifFourVector&);
99
100 void boostToMe
101 (std::vector<DifFourVector*>& listToBoost)const;
102 void boostFromMe
103 (std::vector<DifFourVector*>& listToBoost)const;
104
105
106 //algebra
107
108
109 //data members - public .. yes, folks that's intentional!
110public:
111
112 // energy-momentum components of a 4-vector
113
114 DifNumber E; // energy-like component
115 DifVector P; // momentum-like compoent
116
117
118};
119
120//io
121/*SKIP
122inline std::ostream& operator<<(std::ostream& o,const DifFourVector& n) {
123 n.print(o);
124 return o;
125}
126*/
127#include "MdcRecoUtil/DifFourVector.icc"
128
129#endif
130
131
132
133
134
135
136
137
138
**********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
void boostFromMe(std::vector< DifFourVector * > &listToBoost) const
DifNumber massSq() const
Definition: DifFourVector.h:76
HepMatrix jacobian() const
DifFourVector operator-() const
DifFourVector & operator=(const DifFourVector &v)
DifNumber mass() const
Definition: DifFourVector.h:77
DifFourVector & operator-=(const DifFourVector &v)
void boostFrom(const DifFourVector &)
DifFourVector & operator+=(const DifFourVector &v)
int nPar() const
DifFourVector & zeroDerivatives()
DifNumber pMag() const
Definition: DifFourVector.h:75
void boostTo(const DifFourVector &)
void boostToMe(std::vector< DifFourVector * > &listToBoost) const
HepSymMatrix errorMatrix(const HepSymMatrix &e) const
DifVector direction() const
void print() const
DifNumber length() const
const double b
Definition: slope.cxx:9