]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TEvtGen/EvtGenBase/EvtHighSpinParticle.cxx
coverity
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenBase / EvtHighSpinParticle.cxx
CommitLineData
da0e9ce3 1//--------------------------------------------------------------------------
2//
3// Environment:
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.
7//
8// Copyright Information: See EvtGen/COPYRIGHT
9// Copyright (C) 1998 Caltech, UCSB
10//
11// Module: EvtHighSpinParticle.cc
12//
13// Description: Class to describe particles with spin>2.
14//
15// Modification history:
16//
17// RYD August 8, 2000 Module created
18//
19//------------------------------------------------------------------------
20//
21#include "EvtGenBase/EvtPatches.hh"
22#include "EvtGenBase/EvtPatches.hh"
23#include <iostream>
24#include <math.h>
25#include <assert.h>
26#include "EvtGenBase/EvtHighSpinParticle.hh"
27#include "EvtGenBase/EvtVector4R.hh"
28#include "EvtGenBase/EvtPDL.hh"
29#include "EvtGenBase/EvtSpinDensity.hh"
30#include "EvtGenBase/EvtdFunction.hh"
31
32
33EvtHighSpinParticle::~EvtHighSpinParticle() {}
34
35
36void EvtHighSpinParticle::init(EvtId id,const EvtVector4R& p4){
37
38 _validP4=true;
39 setp(p4);
40 setpart_num(id);
41
42 setLifetime();
43
44}
45
46EvtSpinDensity EvtHighSpinParticle::rotateToHelicityBasis() const{
47
48 int n=EvtSpinType::getSpinStates(EvtPDL::getSpinType(getId()));
49
50 EvtSpinDensity R;
51 R.setDiag(n);
52
53 return R;
54
55}
56
57
58
59EvtSpinDensity EvtHighSpinParticle::rotateToHelicityBasis(double alpha,
60 double beta,
61 double gamma) const{
62
63 int i,j;
64
65 int n=EvtSpinType::getSpinStates(EvtPDL::getSpinType(getId()));
66
67 EvtSpinDensity R;
68
69 R.setDim(n);
70
71 int J2=EvtSpinType::getSpin2(EvtPDL::getSpinType(getId()));
72
73 assert(n==J2+1);
74
75 int *lambda2;
76
77 lambda2=new int[J2+1];
78
79 for(i=0;i<J2+1;i++){
80 lambda2[i]=J2-i*2;
81 }
82
83
84 for(i=0;i<n;i++){
85 for(j=0;j<n;j++){
86 R.set(i,j,EvtdFunction::d(J2,lambda2[j],lambda2[i],beta)*
87 exp(EvtComplex(0.0,0.5*(alpha*lambda2[i]-gamma*lambda2[j]))));
88 }
89 }
90
91 delete [] lambda2;
92
93 return R;
94
95
96}
97
98