CGEM BOSS 6.6.5.g
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
24
26 :_xnew(1.0,0.0,0.0),_ynew(0.0,1.0,0.0),_znew(0.0,0.0,1.0)
27{
28}
29
31(const DifNumber& alpha,const DifNumber& beta,const DifNumber& gamma)
32{
33
34 //active transformation - move the vector (reverse sines)
35 DifNumber calpha=cos(alpha); DifNumber salpha=-sin(alpha);
36 DifNumber cbeta=cos(beta); DifNumber sbeta=-sin(beta);
37 DifNumber cgamma=cos(gamma); DifNumber sgamma=-sin(gamma);
38
39 _xnew.x=cbeta*calpha*cgamma-salpha*sgamma;
40 _xnew.y=cbeta*salpha*cgamma+calpha*sgamma;
41 _xnew.z=-sbeta*cgamma;
42
43 _ynew.x=-cbeta*calpha*sgamma-salpha*cgamma;
44 _ynew.y=-cbeta*salpha*sgamma+calpha*cgamma;
45 _ynew.z=sbeta*sgamma;
46
47 _znew.x=sbeta*calpha;
48 _znew.y=sbeta*salpha;
49 _znew.z=cbeta;
50}
51
53(const DifVector& xp,const DifVector& yp,const DifVector &zp)
54 :_xnew(xp),_ynew(yp),_znew(zp)
55{}
56
58(const DifVector& xp,const DifVector& yp)
59 :_xnew(xp),_ynew(yp),_znew()
60{
61 _znew=cross(_xnew,_ynew);
62}
63
65 return 0;
66}
67
69 DifNumber xcomp=xnew()*v;
70 DifNumber ycomp=ynew()*v;
71 DifNumber zcomp=znew()*v;
72 v.x=xcomp; v.y=ycomp; v.z=zcomp;
73}
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
EvtVector3R cross(const EvtVector3R &p1, const EvtVector3R &p2)
Definition: EvtVector3R.cc:84
const double alpha
**********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
DifVector xnew() const
Definition: DifRotation.h:47
void rotate(DifVector &v) const
Definition: DifRotation.cxx:68
DifVector ynew() const
Definition: DifRotation.h:48
DifVector znew() const
Definition: DifRotation.h:49
int fail() const
Definition: DifRotation.cxx:64
DifNumber y
Definition: DifVector.h:149
DifNumber x
Definition: DifVector.h:148
DifNumber z
Definition: DifVector.h:150