Line data Source code
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: EvtDiracParticle.cc
12 : //
13 : // Description: Class to describe spin 1/2 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/EvtDiracParticle.hh"
27 : #include "EvtGenBase/EvtVector4R.hh"
28 : #include "EvtGenBase/EvtPDL.hh"
29 : #include "EvtGenBase/EvtReport.hh"
30 : #include "EvtGenBase/EvtSpinDensity.hh"
31 : #include "EvtGenBase/EvtGammaMatrix.hh"
32 : using std::endl;
33 :
34 0 : EvtDiracParticle::~EvtDiracParticle(){}
35 :
36 :
37 0 : EvtDiracParticle::EvtDiracParticle(){
38 :
39 0 : return;
40 :
41 0 : }
42 :
43 : void EvtDiracParticle::init(EvtId part_n,const EvtVector4R& p4){
44 :
45 0 : _validP4=true;
46 0 : setp(p4);
47 0 : setpart_num(part_n);
48 :
49 0 : if (EvtPDL::getStdHep(part_n)==0){
50 0 : report(Severity::Error,"EvtGen") << "Error in EvtDiracParticle::init, part_n="
51 0 : << part_n.getId()<<endl;
52 0 : ::abort();
53 : }
54 :
55 0 : if (EvtPDL::getStdHep(part_n)>0){
56 :
57 0 : _spinorRest[0].set(EvtComplex(sqrt(2.0*mass()),0.0),EvtComplex(0.0,0.0),
58 0 : EvtComplex(0.0,0.0),EvtComplex(0.0,0.0));
59 0 : _spinorRest[1].set(EvtComplex(0.0,0.0),EvtComplex(sqrt(2.0*mass()),0.0),
60 0 : EvtComplex(0.0,0.0),EvtComplex(0.0,0.0));
61 :
62 0 : _spinorParent[0]=boostTo(_spinorRest[0],p4);
63 0 : _spinorParent[1]=boostTo(_spinorRest[1],p4);
64 :
65 :
66 0 : }
67 : else{
68 :
69 0 : _spinorRest[0].set(EvtComplex(0.0,0.0),EvtComplex(0.0,0.0),
70 0 : EvtComplex(sqrt(2.0*mass()),0.0),EvtComplex(0.0,0.0));
71 0 : _spinorRest[1].set(EvtComplex(0.0,0.0),EvtComplex(0.0,0.0),
72 0 : EvtComplex(0.0,0.0),EvtComplex(sqrt(2.0*mass()),0.0));
73 :
74 0 : _spinorParent[0]=boostTo(_spinorRest[0],p4);
75 0 : _spinorParent[1]=boostTo(_spinorRest[1],p4);
76 :
77 :
78 :
79 : }
80 :
81 0 : setLifetime();
82 0 : }
83 :
84 :
85 : void EvtDiracParticle::init(EvtId part_n,const EvtVector4R& p4,
86 : const EvtDiracSpinor & prod1,
87 : const EvtDiracSpinor & prod2,
88 : const EvtDiracSpinor & rest1,
89 : const EvtDiracSpinor & rest2){
90 :
91 0 : _validP4=true;
92 0 : setp(p4);
93 0 : setpart_num(part_n);
94 :
95 0 : if (EvtPDL::getStdHep(part_n)==0){
96 0 : report(Severity::Error,"EvtGen") << "Error in EvtDiracParticle::init, part_n="
97 0 : << part_n.getId()<<std::endl;
98 0 : ::abort();
99 : }
100 0 : _spinorRest[0]=rest1;
101 0 : _spinorRest[1]=rest2;
102 0 : _spinorParent[0]=prod1;
103 0 : _spinorParent[1]=prod2;
104 :
105 0 : setLifetime();
106 0 : }
107 :
108 :
109 :
110 : EvtSpinDensity EvtDiracParticle::rotateToHelicityBasis() const{
111 :
112 0 : EvtDiracSpinor spplus;
113 0 : EvtDiracSpinor spminus;
114 :
115 0 : double sqmt2=sqrt(2.*(getP4().mass()));
116 :
117 0 : if (EvtPDL::getStdHep(getId())>0){
118 0 : spplus.set(1.0,0.0,0.0,0.0);
119 0 : spminus.set(0.0,1.0,0.0,0.0);
120 : } else {
121 0 : spplus.set(0.0,0.0,0.0,1.0);
122 0 : spminus.set(0.0,0.0,1.0,0.0);
123 : }
124 :
125 :
126 0 : EvtSpinDensity R;
127 0 : R.setDim(2);
128 :
129 0 : for (int i=0; i<2; i++) {
130 0 : if (EvtPDL::getStdHep(getId())>0){
131 0 : R.set(0,i,(spplus*_spinorRest[i])/sqmt2);
132 0 : R.set(1,i,(spminus*_spinorRest[i])/sqmt2);
133 : } else {
134 0 : R.set(0,i,(_spinorRest[i]*spplus)/sqmt2);
135 0 : R.set(1,i,(_spinorRest[i]*spminus)/sqmt2);
136 : }
137 : }
138 :
139 : return R;
140 :
141 0 : }
142 :
143 :
144 : EvtSpinDensity EvtDiracParticle::rotateToHelicityBasis(double alpha,
145 : double beta,
146 : double gamma) const{
147 :
148 :
149 0 : EvtDiracSpinor spplus;
150 0 : EvtDiracSpinor spminus;
151 :
152 0 : double sqmt2=sqrt(2.*(getP4().mass()));
153 :
154 0 : if (EvtPDL::getStdHep(getId())>0){
155 0 : spplus.set(1.0,0.0,0.0,0.0);
156 0 : spminus.set(0.0,1.0,0.0,0.0);
157 : } else {
158 0 : spplus.set(0.0,0.0,0.0,1.0);
159 0 : spminus.set(0.0,0.0,1.0,0.0);
160 : }
161 :
162 0 : spplus.applyRotateEuler(alpha,beta,gamma);
163 0 : spminus.applyRotateEuler(alpha,beta,gamma);
164 :
165 0 : EvtSpinDensity R;
166 0 : R.setDim(2);
167 :
168 0 : for (int i=0; i<2; i++) {
169 0 : if (EvtPDL::getStdHep(getId())>0){
170 0 : R.set(0,i,(spplus*_spinorRest[i])/sqmt2);
171 0 : R.set(1,i,(spminus*_spinorRest[i])/sqmt2);
172 : } else {
173 0 : R.set(0,i,(_spinorRest[i]*spplus)/sqmt2);
174 0 : R.set(1,i,(_spinorRest[i]*spminus)/sqmt2);
175 : }
176 : }
177 :
178 : return R;
179 :
180 0 : }
181 :
182 :
183 :
|