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
25 : _xnew( 1.0, 0.0, 0.0 ), _ynew( 0.0, 1.0, 0.0 ), _znew( 0.0, 0.0, 1.0 ) {}
26
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
51DifRotation::DifRotation( const DifVector& xp, const DifVector& yp, const DifVector& zp )
52 : _xnew( xp ), _ynew( yp ), _znew( zp ) {}
53
55 : _xnew( xp ), _ynew( yp ), _znew() {
56 _znew = cross( _xnew, _ynew );
57}
58
59int DifRotation::fail() const { return 0; }
60
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}
double alpha
EvtVector3R cross(const EvtVector3R &p1, const EvtVector3R &p2)
**********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 rotate(DifVector &v) const
int fail() const