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.
EvtVectorParticle.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/EvtPDL.hh"
25 #include "EvtGenBase/EvtPatches.hh"
26 #include "EvtGenBase/EvtReport.hh"
28 
29 #include <iostream>
30 #include <math.h>
31 #include <stdlib.h>
32 
33 void EvtVectorParticle::init( EvtId part_n, double e, double px, double py,
34  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 
76 {
77  static EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
78  EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
79  static EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
80  static EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
81  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 
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 
100  double beta,
101  double gamma ) const
102 {
103  EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
104  EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
105  EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
106  EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
107  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  for ( int i = 0; i < 3; i++ ) {
117  R.set( 0, i, ( eplus.conj() ) * _eps[i] );
118  R.set( 1, i, ( ezero.conj() ) * _eps[i] );
119  R.set( 2, i, ( eminus.conj() ) * _eps[i] );
120  }
121 
122  return R;
123 }
void init(EvtId part_n, double e, double px, double py, double pz)
void applyRotateEuler(double alpha, double beta, double gamma)
EvtVector4C _eps[3]
void set(int, const EvtComplex &)
Definition: EvtVector4C.hh:98
EvtSpinDensity rotateToHelicityBasis() const override
Definition: EvtId.hh:27
void setp(double e, double px, double py, double pz)
Definition: EvtParticle.hh:437
void setLifetime()
EvtVector4C conj() const
Definition: EvtVector4C.hh:202
void set(int i, int j, const EvtComplex &rhoij)
void setDim(int n)
void setpart_num(EvtId particle_number)
Definition: EvtParticle.hh:449