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.
EvtTensorParticle.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"
24 #include "EvtGenBase/EvtPatches.hh"
25 #include "EvtGenBase/EvtReport.hh"
29 
30 #include <iostream>
31 #include <math.h>
32 #include <stdlib.h>
33 
34 void EvtTensorParticle::init( EvtId part_n, const EvtVector4R& p4 )
35 {
36  init( part_n, p4.get( 0 ), p4.get( 1 ), p4.get( 2 ), p4.get( 3 ) );
37 
38  setLifetime();
39 }
40 
41 void EvtTensorParticle::init( EvtId part_n, double e, double px, double py,
42  double pz )
43 {
44  _validP4 = true;
45  setp( e, px, py, pz );
46  setpart_num( part_n );
47 
48  eps[0].setdiag( 0.0, -1.0 / sqrt( 6.0 ), -1.0 / sqrt( 6.0 ),
49  2.0 / sqrt( 6.0 ) );
50  eps[1].setdiag( 0.0, 1.0 / sqrt( 2.0 ), -1.0 / sqrt( 2.0 ), 0.0 );
51  eps[2].setdiag( 0.0, 0.0, 0.0, 0.0 );
52  eps[3].setdiag( 0.0, 0.0, 0.0, 0.0 );
53  eps[4].setdiag( 0.0, 0.0, 0.0, 0.0 );
54 
55  eps[2].set( 1, 2, EvtComplex( 1.0 / sqrt( 2.0 ), 0.0 ) );
56  eps[2].set( 2, 1, EvtComplex( 1.0 / sqrt( 2.0 ), 0.0 ) );
57  eps[3].set( 1, 3, EvtComplex( 1.0 / sqrt( 2.0 ), 0.0 ) );
58  eps[3].set( 3, 1, EvtComplex( 1.0 / sqrt( 2.0 ), 0.0 ) );
59  eps[4].set( 2, 3, EvtComplex( 1.0 / sqrt( 2.0 ), 0.0 ) );
60  eps[4].set( 3, 2, EvtComplex( 1.0 / sqrt( 2.0 ), 0.0 ) );
61 
62  setLifetime();
63 }
64 
65 void EvtTensorParticle::init( EvtId part_n, const EvtVector4R& p4,
66  const EvtTensor4C& epsin1,
67  const EvtTensor4C& epsin2,
68  const EvtTensor4C& epsin3,
69  const EvtTensor4C& epsin4,
70  const EvtTensor4C& epsin5 )
71 {
72  _validP4 = true;
73  setp( p4 );
74  setpart_num( part_n );
75 
76  eps[0] = epsin1;
77  eps[1] = epsin2;
78  eps[2] = epsin3;
79  eps[3] = epsin4;
80  eps[4] = epsin5;
81 
82  setLifetime();
83 }
84 
86 {
87  EvtTensor4C temp = eps[i];
88 
89  temp.applyBoostTo( this->getP4() );
90  return temp;
91 
92 } //epsParent
93 
95 {
96  return eps[i];
97 
98 } //eps
99 
101 {
102  static EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
103  EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
104  static EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
105  static EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
106  EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
107 
108  static EvtTensor4C dPpp( EvtGenFunctions::directProd( eplus, eplus ) );
109  static EvtTensor4C dPp0( EvtGenFunctions::directProd( eplus, ezero ) );
110  static EvtTensor4C dP0p( EvtGenFunctions::directProd( ezero, eplus ) );
111  static EvtTensor4C dPpm( EvtGenFunctions::directProd( eplus, eminus ) );
112  static EvtTensor4C dP00( EvtGenFunctions::directProd( ezero, ezero ) );
113  static EvtTensor4C dPmp( EvtGenFunctions::directProd( eminus, eplus ) );
114  static EvtTensor4C dPmm( EvtGenFunctions::directProd( eminus, eminus ) );
115  static EvtTensor4C dPm0( EvtGenFunctions::directProd( eminus, ezero ) );
116  static EvtTensor4C dP0m( EvtGenFunctions::directProd( ezero, eminus ) );
117 
118  static EvtTensor4C es0( conj( dPpp ) );
119  static EvtTensor4C es1(
120  conj( ( 1 / sqrt( 2.0 ) ) * dPp0 + ( 1 / sqrt( 2.0 ) ) * dP0p ) );
121  static EvtTensor4C es2( conj( ( 1 / sqrt( 6.0 ) ) * dPpm +
122  ( 2 / sqrt( 6.0 ) ) * dP00 +
123  ( 1 / sqrt( 6.0 ) ) * dPmp ) );
124  static EvtTensor4C es3(
125  conj( ( 1 / sqrt( 2.0 ) ) * dPm0 + ( 1 / sqrt( 2.0 ) ) * dP0m ) );
126  static EvtTensor4C es4( conj( dPmm ) );
127 
128  EvtSpinDensity R;
129  R.setDim( 5 );
130 
131  for ( int j = 0; j < 5; j++ ) {
132  R.set( 0, j, cont( es0, eps[j] ) );
133  R.set( 1, j, cont( es1, eps[j] ) );
134  R.set( 2, j, cont( es2, eps[j] ) );
135  R.set( 3, j, cont( es3, eps[j] ) );
136  R.set( 4, j, cont( es4, eps[j] ) );
137  }
138  return R;
139 }
140 
142  double beta,
143  double gamma ) const
144 {
145  EvtTensor4C es[5];
146 
147  static EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
148  EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
149  static EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
150  static EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
151  EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
152 
153  eplus.applyRotateEuler( alpha, beta, gamma );
154  ezero.applyRotateEuler( alpha, beta, gamma );
155  eminus.applyRotateEuler( alpha, beta, gamma );
156 
157  for ( int i = 0; i < 5; i++ )
158  es[i].zero();
159 
160  es[0] = EvtGenFunctions::directProd( eplus, eplus );
161  es[1] = ( 1 / sqrt( 2.0 ) ) * EvtGenFunctions::directProd( eplus, ezero ) +
162  ( 1 / sqrt( 2.0 ) ) * EvtGenFunctions::directProd( ezero, eplus );
163  es[2] = ( 1 / sqrt( 6.0 ) ) * EvtGenFunctions::directProd( eplus, eminus ) +
164  ( 2 / sqrt( 6.0 ) ) * EvtGenFunctions::directProd( ezero, ezero ) +
165  ( 1 / sqrt( 6.0 ) ) * EvtGenFunctions::directProd( eminus, eplus );
166  es[3] = ( 1 / sqrt( 2.0 ) ) * EvtGenFunctions::directProd( eminus, ezero ) +
167  ( 1 / sqrt( 2.0 ) ) * EvtGenFunctions::directProd( ezero, eminus );
168  es[4] = EvtGenFunctions::directProd( eminus, eminus );
169 
170  for ( int i = 0; i < 5; i++ )
171  es[i] = conj( es[i] );
172 
173  EvtSpinDensity R;
174  R.setDim( 5 );
175 
176  for ( int i = 0; i < 5; i++ )
177  for ( int j = 0; j < 5; j++ )
178  R.set( i, j, cont( es[i], eps[j] ) );
179 
180  return R;
181 }
EvtTensor3C directProd(const EvtVector3C &c1, const EvtVector3C &c2)
void set(int i, int j, const EvtComplex &c)
Definition: EvtTensor4C.hh:107
void setdiag(double t00, double t11, double t22, double t33)
void applyRotateEuler(double alpha, double beta, double gamma)
void applyBoostTo(const EvtVector4R &p4)
Definition: EvtTensor4C.cpp:99
EvtTensor4C epsTensorParent(int i) const override
EvtComplex cont(const EvtTensor4C &t1, const EvtTensor4C &t2)
Evt3Rank3C conj(const Evt3Rank3C &t2)
Definition: Evt3Rank3C.cpp:172
EvtTensor4C epsTensor(int i) const override
Definition: EvtId.hh:27
void init(EvtId part_n, double e, double px, double py, double pz)
void setp(double e, double px, double py, double pz)
Definition: EvtParticle.hh:437
double get(int i) const
Definition: EvtVector4R.hh:162
EvtTensor4C eps[5]
void setLifetime()
const EvtVector4R & getP4() const
EvtSpinDensity rotateToHelicityBasis() const override
void set(int i, int j, const EvtComplex &rhoij)
void setDim(int n)
void setpart_num(EvtId particle_number)
Definition: EvtParticle.hh:449