BOSS 8.0.0
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
22#include "EvtHelSys.hh"
23#include "EvtCPUtil.hh"
24#include "EvtKine.hh"
25#include "EvtParticle.hh"
26#include "EvtPatches.hh"
27#include "EvtReport.hh"
28#include "EvtVector3R.hh"
29#include "EvtVector4R.hh"
30#include "EvtdFunction.hh"
31#include <fstream>
32#include <iostream>
33#include <math.h>
34#include <stdio.h>
35#include <stdlib.h>
36#include <strstream>
37#include <sys/stat.h>
38using namespace std; //::endl;
39
40// using std::fstream;
41// using std::strstream;
42
44
45EvtHelSys::EvtHelSys( const EvtVector4R& p4p, const EvtVector4R& p4d ) {
46 _p4parent = p4p; // parent momentum in its parent CM system
47 _p4daug = p4d; // daughter momentum in its parent CM system
49
51
52double EvtHelSys::getHelAng( int i ) {
53 EvtVector4R b_p4p, rp4p, rp4d, boostdaug;
54 EvtVector3R GetHelAng;
55 while ( _p4parent.d3mag() != 0 )
56 {
57
58 // b_p4p=-1 * _p4parent; //boost from Lab to HEL sys. required to reverse mom.Vec.
59 // b_p4p.set(0,_p4parent.get(0));
60 // _bp4p=b_p4p;
61
62 // first to rotate the mother and daugher momentum to the helicity system
63 double theta = Angles( _p4parent, 1 );
64 double phi = Angles( _p4parent, 2 );
65
66 rp4p = Helrotate( _p4parent, phi, theta );
67 rp4d = Helrotate( _p4daug, phi, theta );
68
69 // then boos to the CM system
70 // EvtVector4R r_p4p=-1*rp4p; //boost from Lab to HEL sys. required to reverse mom.Vec.
71 // r_p4p.set(0,rp4p.get(0));
72 // boostdaug=boostTo(rp4d,r_p4p);
73
74 _rotatep4p = rp4p;
75 _rotatep4d = rp4d;
76 _bst = rp4d;
77 // _bp4p=r_p4p;
78 return Angles( _bst, i ); //_bst:daughter momentum in helicity system,
79 // i=0==>|_bst|;i=1,2==>(theta,phi)
80 }
81 return Angles( _p4daug, i );
82}
83
84EvtVector4R EvtHelSys::checkparent() { return _p4parent; }
85EvtVector4R EvtHelSys::checkdaug() { return _p4daug; }
87 getHelAng( 1 );
88 if ( i == 0 ) return _bp4p; // parent momentum used to boost the daughter to the CM sys.
89 if ( i == 1 ) return _rotatep4p; // the parent momentum in Hel system by rotation
90 if ( i == 2 ) return _rotatep4d; // the daughter momentum in Hel. system by rotation
91 if ( i == 3 ) return _bst; //_bst:daughter momentum in helicity system
92
93 std::cerr << __FILE__ << ":" << __LINE__ << ": should not reach here" << std::endl;
94 exit( 1 );
95}
96
97EvtVector4R EvtHelSys::Helrotate( EvtVector4R p1, double phi, double theta ) {
98 EvtVector4R Rp;
99 double cp = cos( phi );
100 double sp = sin( phi );
101 double ct = cos( theta );
102 double st = sin( theta );
103 double t = p1.get( 0 ), x = p1.get( 1 ), y = p1.get( 2 ), z = p1.get( 3 );
104 double xp = x * cp * ct + y * sp * ct - z * st, yp = -x * sp + y * cp,
105 zp = x * cp * st + y * sp * st + z * ct;
106 Rp.set( t, xp, yp, zp );
107 return Rp;
108}
109
110double EvtHelSys::Angles( EvtVector4R bbst, int i ) {
111
112 double rxy = sqrt( pow( bbst.get( 1 ), 2. ) + pow( bbst.get( 2 ), 2. ) );
113 if ( bbst.d3mag() <= 1e-10 )
114 {
115 if ( i == 0 ) return 0.;
116 else if ( i == 1 ) return 0.;
117 else if ( i == 2 ) return 0.;
118 else
119 {
120 cout << "Angles(i): i<=2" << endl;
121 abort();
122 }
123 }
124 else if ( rxy <= 1e-10 )
125 {
126 if ( i == 0 ) return bbst.d3mag();
127 if ( i == 1 ) return 0.;
128 if ( i == 2 ) return 0.;
129 else
130 {
131 cout << "Angles(i): i<=2" << endl;
132 abort();
133 }
134 }
135 else
136 {
137 double theta = acos( bbst.get( 3 ) / bbst.d3mag() );
138 double csphi = bbst.get( 1 ) / bbst.d3mag() / sin( theta );
139 if ( fabs( csphi ) > 1.0 ) csphi = csphi / fabs( csphi );
140 double phi = acos( csphi );
141 if ( bbst.get( 2 ) < 0.0 ) phi = 2 * 3.1415926 - phi;
142 if ( i == 0 ) return bbst.d3mag();
143 else if ( i == 1 ) return theta;
144 else if ( i == 2 ) return phi;
145 else
146 {
147 cout << "Angles(i): i<=2" << endl;
148 abort();
149 }
150 }
151}
152
153double djmn( int j, int m, int n, double theta ) {
154 int j2 = j * 2, m2 = m * 2, n2 = n * 2;
155 double temp = EvtdFunction::d( j2, m2, n2, theta );
156 return temp;
157}
158
159double djmn( double j, double m, double n, double theta ) {
160 int j2 = (int)( j * 2 * 1.1 ), m2 = (int)( m * 2 * 1.1 ), n2 = (int)( n * 2 * 1.1 );
161 double temp = EvtdFunction::d( j2, m2, n2, theta );
162 return temp;
163}
164
165EvtComplex Djmn( int j, int m, int n, double phi, double theta, double gamma ) {
166 int j2 = j * 2, m2 = m * 2, n2 = n * 2;
167 EvtComplex gp( cos( -phi * m ), -sin( phi * m ) );
168 EvtComplex gm( cos( -gamma * n ), -sin( gamma * n ) );
169 double tp3 = EvtdFunction::d( j2, m2, n2, theta );
170
171 // EvtComplex temp=wignerD(j2,m2,n2,phi,theta,gamma); //wignerD is corrected by pingrg,
172 // 2007,04,28, it gives the same result as this definition
173
174 EvtComplex temp = gp * tp3 * gm;
175
176 return temp;
177}
178
179EvtComplex Djmn( double j, double m, double n, double phi, double theta, double gamma ) {
180 int j2 = (int)( j * 2 * 1.1 ), m2 = (int)( m * 2 * 1.1 ), n2 = (int)( n * 2 * 1.1 );
181 EvtComplex gp( cos( -phi * m ), -sin( phi * m ) );
182 EvtComplex gm( cos( -gamma * n ), -sin( gamma * n ) );
183 double tp3 = EvtdFunction::d( j2, m2, n2, theta );
184 EvtComplex temp = gp * tp3 * gm;
185 return temp;
186}
double p1[4]
const Int_t n
EvtComplex Djmn(int j, int m, int n, double phi, double theta, double gamma)
Definition EvtHelSys.cc:165
double djmn(int j, int m, int n, double theta)
Definition EvtHelSys.cc:153
int n2
Definition SD0Tag.cxx:59
EvtVector4R checkst(int i)
Definition EvtHelSys.cc:86
EvtVector4R Helrotate(EvtVector4R p1, double phi, double theta)
Definition EvtHelSys.cc:97
double getHelAng(int i)
Definition EvtHelSys.cc:52
EvtVector4R checkdaug()
Definition EvtHelSys.cc:85
EvtVector4R checkparent()
Definition EvtHelSys.cc:84
virtual ~EvtHelSys()
Definition EvtHelSys.cc:43
double Angles(EvtVector4R, int)
Definition EvtHelSys.cc:110
double get(int i) const
double d3mag() const
void set(int i, double d)
static double d(int j, int m1, int m2, double theta)
double double * m2
Definition qcdloop1.h:83
int t()
Definition t.c:1