]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TEvtGen/EvtGenBase/EvtVectorParticle.cxx
Removing the flat makefiles
[u/mrichter/AliRoot.git] / TEvtGen / EvtGenBase / EvtVectorParticle.cxx
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: EvtVectorParticle.cc
12 //
13 // Description: Class to describe spin 1 particles
14 //
15 // Modification history:
16 //
17 //    DJL/RYD   September 25, 1996           Module created
18 //
19 //------------------------------------------------------------------------
20 // 
21 #include "EvtGenBase/EvtPatches.hh"
22 #include <stdlib.h>
23 #include <iostream>
24 #include <math.h>
25 #include "EvtGenBase/EvtComplex.hh"
26 #include "EvtGenBase/EvtVectorParticle.hh"
27 #include "EvtGenBase/EvtVector4C.hh"
28 #include "EvtGenBase/EvtPDL.hh"
29 #include "EvtGenBase/EvtReport.hh"
30
31 EvtVectorParticle::~EvtVectorParticle(){}
32
33
34 void EvtVectorParticle::init(EvtId part_n,double e,double px,double py,double pz){
35
36   _validP4=true;
37   setp(e,px,py,pz);
38   setpart_num(part_n);
39   
40   _eps[0].set(0.0,1.0,0.0,0.0);
41   _eps[1].set(0.0,0.0,1.0,0.0);
42   _eps[2].set(0.0,0.0,0.0,1.0);
43
44   setLifetime();
45 }
46
47 void EvtVectorParticle::init(EvtId part_n,const EvtVector4R& p4){
48
49   _validP4=true;
50   setp(p4);
51   setpart_num(part_n);
52   
53   _eps[0].set(0.0,1.0,0.0,0.0);
54   _eps[1].set(0.0,0.0,1.0,0.0);
55   _eps[2].set(0.0,0.0,0.0,1.0);
56   setLifetime();
57 }
58
59 void EvtVectorParticle::init(EvtId part_n,const EvtVector4R& p4,
60                              const EvtVector4C & epsin1,
61                              const EvtVector4C & epsin2,
62                              const EvtVector4C & epsin3){
63
64   _validP4=true;
65   setp(p4);
66   setpart_num(part_n);
67   
68   _eps[0]=epsin1;
69   _eps[1]=epsin2;
70   _eps[2]=epsin3;
71
72   setLifetime();
73 }
74
75
76
77 EvtSpinDensity EvtVectorParticle::rotateToHelicityBasis() const{
78
79   static EvtVector4C eplus(0.0,-1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0);
80   static EvtVector4C ezero(0.0,0.0,0.0,1.0);
81   static EvtVector4C eminus(0.0,1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0);
82   
83   static EvtVector4C eplusC(eplus.conj());
84   static EvtVector4C ezeroC(ezero.conj());
85   static EvtVector4C eminusC(eminus.conj());
86
87   EvtSpinDensity R;
88   R.setDim(3);
89
90   for ( int i=0; i<3; i++ ) {
91     R.set(0,i,(eplusC)*_eps[i]);
92     R.set(1,i,(ezeroC)*_eps[i]);
93     R.set(2,i,(eminusC)*_eps[i]);
94   }
95
96   return R;
97
98 }
99
100
101 EvtSpinDensity EvtVectorParticle::rotateToHelicityBasis(double alpha,
102                                                         double beta,
103                                                         double gamma) const{
104
105   EvtVector4C eplus(0.0,-1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0);
106   EvtVector4C ezero(0.0,0.0,0.0,1.0);
107   EvtVector4C eminus(0.0,1.0/sqrt(2.0),EvtComplex(0.0,-1.0/sqrt(2.0)),0.0);
108   
109   eplus.applyRotateEuler(alpha,beta,gamma);
110   ezero.applyRotateEuler(alpha,beta,gamma);
111   eminus.applyRotateEuler(alpha,beta,gamma);
112
113   EvtSpinDensity R;
114   R.setDim(3);
115
116
117   for ( int i=0; i<3; i++ ) {
118     R.set(0,i,(eplus.conj())*_eps[i]);
119     R.set(1,i,(ezero.conj())*_eps[i]);
120     R.set(2,i,(eminus.conj())*_eps[i]);
121   }
122
123   return R;
124
125 }
126
127