BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtHelSys.cc
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2//
3// Environment:
4// This software is part of models developed at BES collaboration
5// based on the EvtGen framework. If you use all or part
6// of it, please give an appropriate acknowledgement.
7//
8// Copyright Information: See EvtGen/BesCopyright
9// Copyright (A) 2006 Ping Rong-Gang @IHEP
10//
11// Module: EvtDIY.cc
12//
13// Description: Class to boost a daughter momentum into the mother helicity system
14//
15// Modification history:
16//
17// Ping R.-G. December, 2006 Module created
18//
19//------------------------------------------------------------------------
20//
21
23#include <iostream>
24#include <math.h>
25#include <fstream>
26#include <stdio.h>
27#include <stdlib.h>
28#include <sys/stat.h>
29#include <strstream>
36#include "EvtGenBase/EvtKine.hh"
38using namespace std; //::endl;
39
40//using std::fstream;
41//using std::strstream;
42
44}
45
46 EvtHelSys::EvtHelSys( const EvtVector4R& p4p, const EvtVector4R& p4d) {
47 _p4parent=p4p; // parent momentum in its parent CM system
48 _p4daug =p4d; // daughter momentum in its parent CM system
49 }
50
52 }
53
54 double EvtHelSys::getHelAng(int i) {
55 EvtVector4R b_p4p,rp4p, rp4d,boostdaug;
56 EvtVector3R GetHelAng;
57 while (_p4parent.d3mag()!=0) {
58
59 // b_p4p=-1 * _p4parent; //boost from Lab to HEL sys. required to reverse mom.Vec.
60 // b_p4p.set(0,_p4parent.get(0));
61 // _bp4p=b_p4p;
62
63// first to rotate the mother and daugher momentum to the helicity system
64 double theta=Angles(_p4parent,1);
65 double phi=Angles(_p4parent,2);
66
67
68 rp4p=Helrotate(_p4parent,phi,theta);
69 rp4d=Helrotate(_p4daug, phi,theta);
70
71// then boos to the CM system
72// EvtVector4R r_p4p=-1*rp4p; //boost from Lab to HEL sys. required to reverse mom.Vec.
73// r_p4p.set(0,rp4p.get(0));
74// boostdaug=boostTo(rp4d,r_p4p);
75
76 _rotatep4p=rp4p;
77 _rotatep4d=rp4d;
78 _bst=rp4d;
79 // _bp4p=r_p4p;
80 return Angles(_bst,i); //_bst:daughter momentum in helicity system, i=0==>|_bst|;i=1,2==>(theta,phi)
81 }
82 return Angles(_p4daug,i);
83}
84
88getHelAng(1);
89if(i==0) return _bp4p; //parent momentum used to boost the daughter to the CM sys.
90if(i==1) return _rotatep4p; //the parent momentum in Hel system by rotation
91if(i==2) return _rotatep4d; //the daughter momentum in Hel. system by rotation
92if(i==3) return _bst; //_bst:daughter momentum in helicity system
93}
94
95
96EvtVector4R EvtHelSys::Helrotate(EvtVector4R p1, double phi, double theta){
98double cp=cos(phi);
99double sp=sin(phi);
100double ct=cos(theta);
101double st=sin(theta);
102double t=p1.get(0),x=p1.get(1), y=p1.get(2), z=p1.get(3);
103double xp=x*cp*ct+y*sp*ct-z*st,yp= -x*sp+y*cp,zp=x*cp*st+y*sp*st+z*ct;
104 Rp.set(t,xp,yp,zp);
105 return Rp;
106}
107
109
110double rxy=sqrt(pow(bbst.get(1),2.)+pow(bbst.get(2),2.));
111 if(bbst.d3mag()<=1e-10) {
112 if(i==0) return 0.;
113 else if (i==1) return 0.;
114 else if (i==2) return 0.;
115 else {cout<<"Angles(i): i<=2"<<endl;abort();}
116 }
117 else if(rxy<=1e-10){
118 if(i==0) return bbst.d3mag();
119 if(i==1) return 0.;
120 if(i==2) return 0.;
121 else {cout<<"Angles(i): i<=2"<<endl;abort();}
122 }
123 else {
124 double theta=acos(bbst.get(3)/bbst.d3mag());
125 double csphi=bbst.get(1)/bbst.d3mag()/sin(theta);
126 if(fabs(csphi)>1.0) csphi=csphi/fabs(csphi);
127 double phi=acos(csphi);
128 if(bbst.get(2)<0.0) phi=2*3.1415926-phi;
129 if(i==0) return bbst.d3mag();
130 else if (i==1) return theta;
131 else if (i==2) return phi;
132 else {cout<<"Angles(i): i<=2"<<endl;abort();}
133 }
134
135}
136
137
138double djmn(int j, int m, int n, double theta){
139int j2=j*2,m2=m*2,n2=n*2;
140double temp=EvtdFunction::d(j2,m2,n2,theta);
141return temp;
142}
143
144double djmn(double j, double m, double n, double theta){
145int j2=(int)(j*2*1.1),m2=(int)(m*2*1.1),n2=(int)(n*2*1.1);
146double temp=EvtdFunction::d(j2,m2,n2,theta);
147return temp;
148}
149
150
151EvtComplex Djmn(int j, int m, int n, double phi,double theta, double gamma){
152int j2=j*2,m2=m*2,n2=n*2;
153EvtComplex gp(cos(-phi*m ), -sin(phi*m));
154EvtComplex gm(cos(-gamma*n), -sin(gamma*n));
155double tp3=EvtdFunction::d(j2,m2,n2,theta);
156
157//EvtComplex temp=wignerD(j2,m2,n2,phi,theta,gamma); //wignerD is corrected by pingrg, 2007,04,28, it gives the same result as this definition
158
159EvtComplex temp=gp * tp3 * gm;
160
161return temp;
162}
163
164
165EvtComplex Djmn(double j, double m, double n, double phi,double theta, double gamma){
166int j2=(int)(j*2*1.1),m2=(int)(m*2*1.1),n2=(int)(n*2*1.1);
167EvtComplex gp(cos(-phi*m ), -sin(phi*m));
168EvtComplex gm(cos(-gamma*n), -sin(gamma*n));
169double tp3=EvtdFunction::d(j2,m2,n2,theta);
170EvtComplex temp=gp * tp3 * gm;
171return temp;
172}
173
const Int_t n
Double_t x[10]
EvtComplex Djmn(int j, int m, int n, double phi, double theta, double gamma)
Definition: EvtHelSys.cc:151
double djmn(int j, int m, int n, double theta)
Definition: EvtHelSys.cc:138
double sin(const BesAngle a)
double cos(const BesAngle a)
int n2
Definition: SD0Tag.cxx:55
EvtVector4R checkst(int i)
Definition: EvtHelSys.cc:87
EvtVector4R Helrotate(EvtVector4R p1, double phi, double theta)
Definition: EvtHelSys.cc:96
double getHelAng(int i)
Definition: EvtHelSys.cc:54
EvtVector4R checkdaug()
Definition: EvtHelSys.cc:86
EvtVector4R checkparent()
Definition: EvtHelSys.cc:85
virtual ~EvtHelSys()
Definition: EvtHelSys.cc:43
double Angles(EvtVector4R, int)
Definition: EvtHelSys.cc:108
double get(int i) const
Definition: EvtVector4R.hh:179
double d3mag() const
Definition: EvtVector4R.cc:186
void set(int i, double d)
Definition: EvtVector4R.hh:183
static double d(int j, int m1, int m2, double theta)
Definition: EvtdFunction.cc:30
int t()
Definition: t.c:1