BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/MdcRecoUtil/include/MdcRecoUtil/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
28#include "CLHEP/Vector/ThreeVector.h"
29#include "MdcRecoUtil/DifNumber.h"
30#include "MdcRecoUtil/DifVector.h"
31#include <iosfwd>
32class DifRotation;
33using CLHEP::Hep3Vector;
34class DifFourVector {
35
36public:
37 // constructors
38 DifFourVector(); // null - default
39 DifFourVector // construct from components
40 ( const DifNumber& mass, const DifVector& p );
41 DifFourVector // construct from components
42 ( const double& mass, const DifVector& p );
43
44 DifFourVector( const DifFourVector& v ); // copy
45
46 // destructor
47 ~DifFourVector() {} // destroy
48
49 // given error on parameters calculate error on vector
50 HepSymMatrix errorMatrix // caclulate error matrix
51 ( const HepSymMatrix& e ) const;
52
53 // give jacobian transformation matrix wrt independent parameters;
54 HepMatrix jacobian() const;
55
56 // operators
60 inline DifFourVector operator-() const;
61
62 inline friend DifFourVector operator+ // vector sum
63 ( const DifFourVector& a, const DifFourVector& b );
64 inline friend DifFourVector operator- // vector difference
65 ( const DifFourVector& a, const DifFourVector& b );
66 inline friend DifNumber operator* // scalar product
67 ( const DifFourVector& a, const DifFourVector& b );
68
69 // access
70 inline int nPar() const; // return number of params
71 inline DifVector direction() const;
72 inline DifNumber pMag() const { return P.length(); }
73 inline DifNumber massSq() const { return E * E - P * P; }
74 inline DifNumber mass() const {
75 DifNumber temp = massSq();
76 if ( temp >= 0 ) return sqrt( temp );
77 return -sqrt( -massSq() );
78 }
79
80 // i/o
81 void print( /*std::ostream& o*/ ) const; // print out
82
83 // manipulations
84
85 // misc
86 inline DifFourVector& zeroDerivatives(); // zero derivatives
87
88 // boost
89
90 void boostTo( const DifFourVector& );
91 void boostFrom( const DifFourVector& );
92
93 void boostToMe( std::vector<DifFourVector*>& listToBoost ) const;
94 void boostFromMe( std::vector<DifFourVector*>& listToBoost ) const;
95
96 // algebra
97
98 // data members - public .. yes, folks that's intentional!
99public:
100 // energy-momentum components of a 4-vector
101
102 DifNumber E; // energy-like component
103 DifVector P; // momentum-like compoent
104};
105
106// io
107/*SKIP
108inline std::ostream& operator<<(std::ostream& o,const DifFourVector& n) {
109 n.print(o);
110 return o;
111}
112*/
113#include "MdcRecoUtil/DifFourVector.icc"
114
115#endif
**********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
HepMatrix jacobian() const
DifFourVector operator-() const
DifFourVector & operator=(const DifFourVector &v)
DifFourVector & operator-=(const DifFourVector &v)
void boostFrom(const DifFourVector &)
DifFourVector & operator+=(const DifFourVector &v)
int nPar() const
DifFourVector & zeroDerivatives()
DifFourVector(const DifFourVector &v)
void boostTo(const DifFourVector &)
void boostToMe(std::vector< DifFourVector * > &listToBoost) const
HepSymMatrix errorMatrix(const HepSymMatrix &e) const
DifVector direction() const
void print() const