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.
EvtHighSpinParticle.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/EvtPDL.hh"
24 #include "EvtGenBase/EvtPatches.hh"
28 
29 #include <assert.h>
30 #include <iostream>
31 #include <math.h>
32 
34 {
35  _validP4 = true;
36  setp( p4 );
37  setpart_num( id );
38 
39  setLifetime();
40 }
41 
43 {
45 
47  R.setDiag( n );
48 
49  return R;
50 }
51 
53  double beta,
54  double gamma ) const
55 {
56  int i, j;
57 
59 
61 
62  R.setDim( n );
63 
65 
66  assert( n == J2 + 1 );
67 
68  auto lambda2 = [J2]( int i ) { return J2 - i * 2; };
69 
70  for ( i = 0; i < n; i++ ) {
71  for ( j = 0; j < n; j++ ) {
72  R.set( i, j,
73  EvtdFunction::d( J2, lambda2( j ), lambda2( i ), beta ) *
74  exp( EvtComplex( 0.0, 0.5 * ( alpha * lambda2( i ) -
75  gamma * lambda2( j ) ) ) ) );
76  }
77  }
78 
79  return R;
80 }
void setDiag(int n)
static EvtSpinType::spintype getSpinType(EvtId i)
Definition: EvtPDL.cpp:377
EvtId getId() const
static int getSpinStates(spintype stype)
Definition: EvtSpinType.cpp:57
EvtSpinDensity rotateToHelicityBasis() const override
Definition: EvtId.hh:27
void init(EvtId id, const EvtVector4R &p) override
void setp(double e, double px, double py, double pz)
Definition: EvtParticle.hh:437
void setLifetime()
static int getSpin2(spintype stype)
Definition: EvtSpinType.cpp:26
EvtComplex exp(const EvtComplex &c)
Definition: EvtComplex.hh:240
void set(int i, int j, const EvtComplex &rhoij)
void setDim(int n)
static double d(int j, int m1, int m2, double theta)
void setpart_num(EvtId particle_number)
Definition: EvtParticle.hh:449