BOSS
8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
DifRotation.cxx
Go to the documentation of this file.
1
//--------------------------------------------------------------------------
2
// File and Version Information:
3
// $Id: DifRotation.cxx,v 1.2 2009/12/23 02:59:56 zhangy Exp $
4
//
5
// Description:
6
// Class Implementation for |DifRotation|
7
// Rotates things
8
// Environment:
9
// Software developed for the BaBar Detector at the SLAC B-Factory.
10
//
11
// Author List:
12
// A. Snyder
13
//
14
// Copyright Information:
15
// Copyright (C) 1996 SLAC
16
//
17
// History:
18
// Migration for BESIII MDC
19
//
20
//------------------------------------------------------------------------
21
22
#include "MdcRecoUtil/DifRotation.h"
23
24
DifRotation::DifRotation
()
25
: _xnew( 1.0, 0.0, 0.0 ), _ynew( 0.0, 1.0, 0.0 ), _znew( 0.0, 0.0, 1.0 ) {}
26
27
DifRotation::DifRotation
(
const
DifNumber
&
alpha
,
const
DifNumber
& beta,
28
const
DifNumber
& gamma ) {
29
30
// active transformation - move the vector (reverse sines)
31
DifNumber
calpha =
cos
(
alpha
);
32
DifNumber
salpha = -
sin
(
alpha
);
33
DifNumber
cbeta =
cos
( beta );
34
DifNumber
sbeta = -
sin
( beta );
35
DifNumber
cgamma =
cos
( gamma );
36
DifNumber
sgamma = -
sin
( gamma );
37
38
_xnew.x = cbeta * calpha * cgamma - salpha * sgamma;
39
_xnew.y = cbeta * salpha * cgamma + calpha * sgamma;
40
_xnew.z = -sbeta * cgamma;
41
42
_ynew.x = -cbeta * calpha * sgamma - salpha * cgamma;
43
_ynew.y = -cbeta * salpha * sgamma + calpha * cgamma;
44
_ynew.z = sbeta * sgamma;
45
46
_znew.x = sbeta * calpha;
47
_znew.y = sbeta * salpha;
48
_znew.z = cbeta;
49
}
50
51
DifRotation::DifRotation
(
const
DifVector
& xp,
const
DifVector
& yp,
const
DifVector
& zp )
52
: _xnew( xp ), _ynew( yp ), _znew( zp ) {}
53
54
DifRotation::DifRotation
(
const
DifVector
& xp,
const
DifVector
& yp )
55
: _xnew( xp ), _ynew( yp ), _znew() {
56
_znew =
cross
( _xnew, _ynew );
57
}
58
59
int
DifRotation::fail
()
const
{
return
0; }
60
61
void
DifRotation::rotate
(
DifVector
&
v
)
const
{
62
DifNumber
xcomp =
xnew
() *
v
;
63
DifNumber
ycomp =
ynew
() *
v
;
64
DifNumber
zcomp =
znew
() *
v
;
65
v
.x = xcomp;
66
v
.y = ycomp;
67
v
.z = zcomp;
68
}
alpha
double alpha
Definition
EvtPhokharaDef.hh:17
cross
EvtVector3R cross(const EvtVector3R &p1, const EvtVector3R &p2)
Definition
EvtVector3R.cc:76
sin
double sin(const BesAngle a)
Definition
InstallArea/x86_64-el9-gcc13-dbg/include/MdcGeom/BesAngle.h:185
cos
double cos(const BesAngle a)
Definition
InstallArea/x86_64-el9-gcc13-dbg/include/MdcGeom/BesAngle.h:187
v
**********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
DifNumber
Definition
InstallArea/x86_64-el9-gcc13-dbg/include/MdcRecoUtil/DifNumber.h:41
DifRotation::DifRotation
DifRotation()
Definition
DifRotation.cxx:24
DifRotation::xnew
DifVector xnew() const
Definition
InstallArea/x86_64-el9-gcc13-dbg/include/MdcRecoUtil/DifRotation.h:44
DifRotation::rotate
void rotate(DifVector &v) const
Definition
DifRotation.cxx:61
DifRotation::ynew
DifVector ynew() const
Definition
InstallArea/x86_64-el9-gcc13-dbg/include/MdcRecoUtil/DifRotation.h:45
DifRotation::znew
DifVector znew() const
Definition
InstallArea/x86_64-el9-gcc13-dbg/include/MdcRecoUtil/DifRotation.h:46
DifRotation::fail
int fail() const
Definition
DifRotation.cxx:59
DifVector
Definition
InstallArea/x86_64-el9-gcc13-dbg/include/MdcRecoUtil/DifVector.h:32
8.0.0
BOSS_Source
Reconstruction
MdcPatRec
MdcRecoUtil
src
DifRotation.cxx
Generated by
1.16.1