1 //--------------------------------------------------------------------------
4 // This software is part of the EvtGen package developed jointly
5 // for the BaBar and CLEO collaborations. If you use all or part
6 // of it, please give an appropriate acknowledgement.
8 // Copyright Information: See EvtGen/COPYRIGHT
9 // Copyright (C) 2000 Caltech, UCSB
11 // Module: EvtGen/EvtRaritaSchwing.hh
13 // Description:Class to handle spin 3/2
15 // Modification history:
17 // RYD April 23, 2000 Module created
19 //------------------------------------------------------------------------
20 #include "EvtGenBase/EvtPatches.hh"
23 #include "EvtGenBase/EvtRaritaSchwinger.hh"
27 EvtRaritaSchwinger::~EvtRaritaSchwinger(){}
30 EvtRaritaSchwinger rotateEuler(const EvtRaritaSchwinger& rs,
31 double alpha,double beta,double gamma){
33 EvtRaritaSchwinger tmp(rs);
34 tmp.applyRotateEuler(alpha,beta,gamma);
39 EvtRaritaSchwinger boostTo(const EvtRaritaSchwinger& rs,
40 const EvtVector4R p4){
42 EvtRaritaSchwinger tmp(rs);
48 EvtRaritaSchwinger boostTo(const EvtRaritaSchwinger& rs,
49 const EvtVector3R boost){
51 EvtRaritaSchwinger tmp(rs);
52 tmp.applyBoostTo(boost);
58 void EvtRaritaSchwinger::set(int i,int j,const EvtComplex& sp){_rs[i][j]=sp;}
60 EvtComplex EvtRaritaSchwinger::get(int i,int j) const {return _rs[i][j];}
62 void EvtRaritaSchwinger::applyRotateEuler(double alpha,double beta,
65 //inefficient but simple to code...
66 EvtVector4C v0=getVector(0);
67 EvtVector4C v1=getVector(1);
68 EvtVector4C v2=getVector(2);
69 EvtVector4C v3=getVector(3);
70 v0.applyRotateEuler(alpha,beta,gamma);
71 v1.applyRotateEuler(alpha,beta,gamma);
72 v2.applyRotateEuler(alpha,beta,gamma);
73 v3.applyRotateEuler(alpha,beta,gamma);
78 EvtDiracSpinor sp0=getSpinor(0);
79 EvtDiracSpinor sp1=getSpinor(1);
80 EvtDiracSpinor sp2=getSpinor(2);
81 EvtDiracSpinor sp3=getSpinor(3);
82 sp0.applyRotateEuler(alpha,beta,gamma);
83 sp1.applyRotateEuler(alpha,beta,gamma);
84 sp2.applyRotateEuler(alpha,beta,gamma);
85 sp3.applyRotateEuler(alpha,beta,gamma);
94 void EvtRaritaSchwinger::applyBoostTo(const EvtVector4R p4){
98 EvtVector3R boost(p4.get(1)/e,p4.get(2)/e,p4.get(3)/e);
107 void EvtRaritaSchwinger::applyBoostTo(const EvtVector3R boost){
109 //inefficient but simple to code...
110 EvtVector4C v0=getVector(0);
111 EvtVector4C v1=getVector(1);
112 EvtVector4C v2=getVector(2);
113 EvtVector4C v3=getVector(3);
114 v0.applyBoostTo(boost);
115 v1.applyBoostTo(boost);
116 v2.applyBoostTo(boost);
117 v3.applyBoostTo(boost);
122 EvtDiracSpinor sp0=getSpinor(0);
123 EvtDiracSpinor sp1=getSpinor(1);
124 EvtDiracSpinor sp2=getSpinor(2);
125 EvtDiracSpinor sp3=getSpinor(3);
126 sp0.applyBoostTo(boost);
127 sp1.applyBoostTo(boost);
128 sp2.applyBoostTo(boost);
129 sp3.applyBoostTo(boost);
139 ostream& operator<<(ostream& s, const EvtRaritaSchwinger& rs){
155 EvtVector4C EvtRaritaSchwinger::getVector(int i) const{
157 EvtVector4C tmp(_rs[i][0],_rs[i][1],_rs[i][2],_rs[i][3]);
162 EvtDiracSpinor EvtRaritaSchwinger::getSpinor(int i) const{
165 tmp.set(_rs[0][i],_rs[1][i],_rs[2][i],_rs[3][i]);
170 void EvtRaritaSchwinger::setVector(int i,const EvtVector4C& v){
179 void EvtRaritaSchwinger::setSpinor(int i,const EvtDiracSpinor& sp){
181 _rs[0][i]=sp.get_spinor(0);
182 _rs[1][i]=sp.get_spinor(1);
183 _rs[2][i]=sp.get_spinor(2);
184 _rs[3][i]=sp.get_spinor(3);
189 EvtRaritaSchwinger dirProd(EvtVector4R v,EvtDiracSpinor u){
193 EvtRaritaSchwinger tmp;
197 tmp._rs[i][j]=u.get_spinor(i)*v.get(j);
206 EvtRaritaSchwinger dirProd(EvtVector4C v,EvtDiracSpinor u){
210 EvtRaritaSchwinger tmp;
214 tmp._rs[i][j]=u.get_spinor(i)*v.get(j);
223 EvtComplex operator*(const EvtRaritaSchwinger& u1,
224 const EvtRaritaSchwinger& u2){
231 tmp+=conj(u1._rs[i][j])*u2._rs[i][j];
241 EvtRaritaSchwinger& EvtRaritaSchwinger::operator+=(const EvtRaritaSchwinger& u2){
247 _rs[i][j]+=u2._rs[i][j];
254 EvtRaritaSchwinger operator+(const EvtRaritaSchwinger& u1,
255 const EvtRaritaSchwinger& u2){
257 return EvtRaritaSchwinger(u1)+=u2;
261 EvtRaritaSchwinger& EvtRaritaSchwinger::operator-=(const EvtRaritaSchwinger& u2){
267 _rs[i][j]+=u2._rs[i][j];
274 EvtRaritaSchwinger operator-(const EvtRaritaSchwinger& u1,
275 const EvtRaritaSchwinger& u2){
277 return EvtRaritaSchwinger(u1)-=u2;