evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtRaritaSchwingerParticle.cpp
Go to the documentation of this file.
1 
2 /***********************************************************************
3 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4 * *
5 * This file is part of EvtGen. *
6 * *
7 * EvtGen is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * EvtGen is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19 ***********************************************************************/
20 
22 
23 #include "EvtGenBase/EvtComplex.hh"
25 #include "EvtGenBase/EvtPDL.hh"
26 #include "EvtGenBase/EvtPatches.hh"
27 #include "EvtGenBase/EvtReport.hh"
29 
30 #include <iostream>
31 #include <math.h>
32 #include <stdlib.h>
33 using std::endl;
34 
36 {
37  _validP4 = true;
38  setp( p4 );
39  setpart_num( id );
40 
41  if ( EvtPDL::getStdHep( id ) == 0 ) {
42  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
43  << "Error in EvtRaritaSchwingerParticle::init, part_n=" << id.getId()
44  << endl;
45  ::abort();
46  }
47 
48  double sqmt2 = sqrt( 2.0 * ( this->getP4().mass() ) );
49 
50  EvtDiracSpinor spplus;
51  EvtDiracSpinor spminus;
52 
53  if ( EvtPDL::getStdHep( getId() ) > 0 ) {
54  spplus.set( sqmt2, 0.0, 0.0, 0.0 );
55  spminus.set( 0.0, sqmt2, 0.0, 0.0 );
56  } else {
57  spplus.set( 0.0, 0.0, sqmt2, 0.0 );
58  spminus.set( 0.0, 0.0, 0.0, sqmt2 );
59  }
60 
61  static EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
62  EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
63  static EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
64  static EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
65  EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
66 
67  _spinorRest[0] = dirProd( eplus, spplus );
68  _spinorRest[1] = dirProd( sqrt( 2.0 / 3.0 ) * ezero, spplus ) +
69  dirProd( sqrt( 1.0 / 3.0 ) * eplus, spminus );
70  _spinorRest[2] = dirProd( sqrt( 2.0 / 3.0 ) * ezero, spminus ) +
71  dirProd( sqrt( 1.0 / 3.0 ) * eminus, spplus );
72  _spinorRest[3] = dirProd( eminus, spminus );
73 
74  _spinor[0] = boostTo( _spinorRest[0], p4 );
75  _spinor[1] = boostTo( _spinorRest[1], p4 );
76  _spinor[2] = boostTo( _spinorRest[2], p4 );
77  _spinor[3] = boostTo( _spinorRest[3], p4 );
78 
79  setLifetime();
80 }
81 
83  EvtId id, const EvtVector4R& p4, const EvtRaritaSchwinger& prod1,
84  const EvtRaritaSchwinger& prod2, const EvtRaritaSchwinger& prod3,
85  const EvtRaritaSchwinger& prod4, const EvtRaritaSchwinger& rest1,
86  const EvtRaritaSchwinger& rest2, const EvtRaritaSchwinger& rest3,
87  const EvtRaritaSchwinger& rest4 )
88 {
89  _validP4 = true;
90  setp( p4 );
91  setpart_num( id );
92 
93  if ( EvtPDL::getStdHep( id ) == 0 ) {
94  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
95  << "Error in EvtRaritaSchwingerParticle::init, part_n=" << id.getId()
96  << std::endl;
97  ::abort();
98  }
99  _spinorRest[0] = rest1;
100  _spinorRest[1] = rest2;
101  _spinorRest[2] = rest3;
102  _spinorRest[3] = rest4;
103 
104  _spinor[0] = prod1;
105  _spinor[1] = prod2;
106  _spinor[2] = prod3;
107  _spinor[3] = prod4;
108 
109  setLifetime();
110 }
111 
113 {
114  return _spinor[i];
115 }
116 
118 {
119  return _spinorRest[i];
120 }
121 
123 {
124  double sqmt2 = sqrt( 2.0 * ( this->getP4().mass() ) );
125 
126  EvtDiracSpinor spplus;
127  EvtDiracSpinor spminus;
128 
129  if ( EvtPDL::getStdHep( getId() ) > 0 ) {
130  spplus.set( 1.0, 0.0, 0.0, 0.0 );
131  spminus.set( 0.0, 1.0, 0.0, 0.0 );
132  } else {
133  spplus.set( 0.0, 0.0, 1.0, 0.0 );
134  spminus.set( 0.0, 0.0, 0.0, 1.0 );
135  }
136 
137  EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
138  EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
139  EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
140  EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
141  EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
142 
143  EvtRaritaSchwinger sppp = dirProd( eplus, spplus );
144  EvtRaritaSchwinger spp = dirProd( sqrt( 2.0 / 3.0 ) * ezero, spplus ) +
145  dirProd( sqrt( 1.0 / 3.0 ) * eplus, spminus );
146  EvtRaritaSchwinger spm = dirProd( sqrt( 2.0 / 3.0 ) * ezero, spminus ) +
147  dirProd( sqrt( 1.0 / 3.0 ) * eminus, spplus );
148  EvtRaritaSchwinger spmm = dirProd( eminus, spminus );
149 
150  EvtSpinDensity R;
151  R.setDim( 4 );
152 
153  for ( int i = 0; i < 4; i++ ) {
154  R.set( 0, i, ( sppp * _spinorRest[i] ) / sqmt2 );
155  R.set( 1, i, ( spp * _spinorRest[i] ) / sqmt2 );
156  R.set( 2, i, ( spm * _spinorRest[i] ) / sqmt2 );
157  R.set( 3, i, ( spmm * _spinorRest[i] ) / sqmt2 );
158  }
159 
160  return R;
161 }
162 
164  double alpha, double beta, double gamma ) const
165 {
166  EvtDiracSpinor spplus;
167  EvtDiracSpinor spminus;
168 
169  if ( EvtPDL::getStdHep( getId() ) > 0 ) {
170  spplus.set( 1.0, 0.0, 0.0, 0.0 );
171  spminus.set( 0.0, 1.0, 0.0, 0.0 );
172  } else {
173  spplus.set( 0.0, 0.0, 1.0, 0.0 );
174  spminus.set( 0.0, 0.0, 0.0, 1.0 );
175  }
176 
177  EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
178  EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
179  EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
180  EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
181  EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
182 
183  EvtRaritaSchwinger sppp = dirProd( eplus, spplus );
184  EvtRaritaSchwinger spp = dirProd( sqrt( 2.0 / 3.0 ) * ezero, spplus ) +
185  dirProd( sqrt( 1.0 / 3.0 ) * eplus, spminus );
186  EvtRaritaSchwinger spm = dirProd( sqrt( 2.0 / 3.0 ) * ezero, spminus ) +
187  dirProd( sqrt( 1.0 / 3.0 ) * eminus, spplus );
188  EvtRaritaSchwinger spmm = dirProd( eminus, spminus );
189 
190  sppp.applyRotateEuler( alpha, beta, gamma );
191  spp.applyRotateEuler( alpha, beta, gamma );
192  spm.applyRotateEuler( alpha, beta, gamma );
193  spmm.applyRotateEuler( alpha, beta, gamma );
194 
195  EvtSpinDensity R;
196  R.setDim( 4 );
197 
198  double sqmt2 = sqrt( 2.0 * ( this->getP4().mass() ) );
199 
200  for ( int i = 0; i < 4; i++ ) {
201  R.set( 0, i, ( sppp * _spinorRest[i] ) / sqmt2 );
202  R.set( 1, i, ( spp * _spinorRest[i] ) / sqmt2 );
203  R.set( 2, i, ( spm * _spinorRest[i] ) / sqmt2 );
204  R.set( 3, i, ( spmm * _spinorRest[i] ) / sqmt2 );
205  }
206 
207  return R;
208 }
EvtRaritaSchwinger spRSParent(int) const override
void applyRotateEuler(double alpha, double beta, double gamma)
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
Definition: EvtReport.cpp:33
EvtRaritaSchwinger spRS(int) const override
EvtId getId() const
EvtRaritaSchwinger boostTo(const EvtRaritaSchwinger &rs, const EvtVector4R p4)
void init(EvtId id, const EvtVector4R &p4) override
Definition: EvtId.hh:27
EvtSpinDensity rotateToHelicityBasis() const override
void setp(double e, double px, double py, double pz)
Definition: EvtParticle.hh:437
void setLifetime()
const EvtVector4R & getP4() const
void set(const EvtComplex &sp0, const EvtComplex &sp1, const EvtComplex &sp2, const EvtComplex &sp3)
double mass() const
void set(int i, int j, const EvtComplex &rhoij)
EvtRaritaSchwinger dirProd(EvtVector4R v, EvtDiracSpinor u)
void setDim(int n)
static int getStdHep(EvtId id)
Definition: EvtPDL.cpp:362
void setpart_num(EvtId particle_number)
Definition: EvtParticle.hh:449