EvtGen 2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Loading...
Searching...
No Matches
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
24#include "EvtGenBase/EvtPDL.hh"
27
28#include <iostream>
29#include <math.h>
30#include <stdlib.h>
31
32void EvtVectorParticle::init( EvtId part_n, double e, double px, double py,
33 double pz )
34{
35 m_validP4 = true;
36 setp( e, px, py, pz );
37 setpart_num( part_n );
38
39 m_eps[0].set( 0.0, 1.0, 0.0, 0.0 );
40 m_eps[1].set( 0.0, 0.0, 1.0, 0.0 );
41 m_eps[2].set( 0.0, 0.0, 0.0, 1.0 );
42
44}
45
46void EvtVectorParticle::init( EvtId part_n, const EvtVector4R& p4 )
47{
48 m_validP4 = true;
49 setp( p4 );
50 setpart_num( part_n );
51
52 m_eps[0].set( 0.0, 1.0, 0.0, 0.0 );
53 m_eps[1].set( 0.0, 0.0, 1.0, 0.0 );
54 m_eps[2].set( 0.0, 0.0, 0.0, 1.0 );
56}
57
59 const EvtVector4C& epsin1,
60 const EvtVector4C& epsin2,
61 const EvtVector4C& epsin3 )
62{
63 m_validP4 = true;
64 setp( p4 );
65 setpart_num( part_n );
66
67 m_eps[0] = epsin1;
68 m_eps[1] = epsin2;
69 m_eps[2] = epsin3;
70
72}
73
75{
76 static const EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
77 EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
78 static const EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
79 static const EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
80 EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
81
82 static const EvtVector4C eplusC( eplus.conj() );
83 static const EvtVector4C ezeroC( ezero.conj() );
84 static const EvtVector4C eminusC( eminus.conj() );
85
87 R.setDim( 3 );
88
89 for ( int i = 0; i < 3; i++ ) {
90 R.set( 0, i, eplusC * m_eps[i] );
91 R.set( 1, i, ezeroC * m_eps[i] );
92 R.set( 2, i, eminusC * m_eps[i] );
93 }
94
95 return R;
96}
97
99 double beta,
100 double gamma ) const
101{
102 EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ),
103 EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
104 EvtVector4C ezero( 0.0, 0.0, 0.0, 1.0 );
105 EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ),
106 EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
107
108 eplus.applyRotateEuler( alpha, beta, gamma );
109 ezero.applyRotateEuler( alpha, beta, gamma );
110 eminus.applyRotateEuler( alpha, beta, gamma );
111
113 R.setDim( 3 );
114
115 for ( int i = 0; i < 3; i++ ) {
116 R.set( 0, i, eplus.conj() * m_eps[i] );
117 R.set( 1, i, ezero.conj() * m_eps[i] );
118 R.set( 2, i, eminus.conj() * m_eps[i] );
119 }
120
121 return R;
122}
Definition EvtId.hh:27
void setLifetime()
void setp(double e, double px, double py, double pz)
void setpart_num(EvtId particle_number)
void setDim(int n)
void set(int i, int j, const EvtComplex &rhoij)
void applyRotateEuler(double alpha, double beta, double gamma)
EvtVector4C conj() const
EvtSpinDensity rotateToHelicityBasis() const override
std::array< EvtVector4C, 3 > m_eps
void init(EvtId part_n, double e, double px, double py, double pz)