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.
EvtTVSPwave.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/EvtGenKine.hh"
24 #include "EvtGenBase/EvtPDL.hh"
26 #include "EvtGenBase/EvtPatches.hh"
27 #include "EvtGenBase/EvtReport.hh"
30 
31 #include <stdlib.h>
32 #include <string>
33 
34 std::string EvtTVSPwave::getName()
35 {
36  return "TVS_PWAVE";
37 }
38 
40 {
41  return new EvtTVSPwave;
42 }
43 
45 {
46  // check that there are 6 arguments
47  checkNArg( 6 );
48  checkNDaug( 2 );
49 
51 
54 }
55 
57 {
58  setProbMax( 0.5 );
59 }
60 
62 {
63  EvtComplex ap( getArg( 0 ) * cos( getArg( 1 ) ),
64  getArg( 0 ) * sin( getArg( 1 ) ) );
65  EvtComplex ad( getArg( 2 ) * cos( getArg( 3 ) ),
66  getArg( 2 ) * sin( getArg( 3 ) ) );
67  EvtComplex af( getArg( 4 ) * cos( getArg( 5 ) ),
68  getArg( 4 ) * sin( getArg( 5 ) ) );
69 
70  if ( ap != EvtComplex( 0.0, 0.0 ) || af != EvtComplex( 0.0, 0.0 ) ) {
71  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
72  << "dfslkh8945wqh:In EvtTensorToVectorScalar.c\n";
73  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
74  << "P or F wave not yet implemented!! (ryd) \n";
75  }
76 
78 
79  EvtParticle* v;
80  v = p->getDaug( 0 );
81  EvtVector4R momv = v->getP4();
82  double massv = v->mass();
83 
84  EvtComplex temp;
85  temp = ad;
86  double m_parent = p->mass();
87 
88  EvtVector4R p_parent;
89 
90  p_parent.set( m_parent, 0.0, 0.0, 0.0 );
91 
92  EvtVector4C pep0, pep1, pep2, pep3, pep4;
93  EvtTensor4C pdual;
94 
95  EvtVector4C epsdual0, epsdual1, epsdual2;
96 
97  double norm = massv /
98  ( m_parent * momv.get( 0 ) * momv.d3mag() * momv.d3mag() );
99  pdual = dual( EvtGenFunctions::directProd( norm * p_parent, momv ) );
100 
101  epsdual0 = pdual.cont1( v->epsParent( 0 ).conj() );
102  epsdual1 = pdual.cont1( v->epsParent( 1 ).conj() );
103  epsdual2 = pdual.cont1( v->epsParent( 2 ).conj() );
104 
105  pep0 = p->epsTensor( 0 ).cont1( momv );
106  pep1 = p->epsTensor( 1 ).cont1( momv );
107  pep2 = p->epsTensor( 2 ).cont1( momv );
108  pep3 = p->epsTensor( 3 ).cont1( momv );
109  pep4 = p->epsTensor( 4 ).cont1( momv );
110 
111  vertex( 0, 0, pep0 * epsdual0 );
112  vertex( 1, 0, pep1 * epsdual0 );
113  vertex( 2, 0, pep2 * epsdual0 );
114  vertex( 3, 0, pep3 * epsdual0 );
115  vertex( 4, 0, pep4 * epsdual0 );
116 
117  vertex( 0, 1, pep0 * epsdual1 );
118  vertex( 1, 1, pep1 * epsdual1 );
119  vertex( 2, 1, pep2 * epsdual1 );
120  vertex( 3, 1, pep3 * epsdual1 );
121  vertex( 4, 1, pep4 * epsdual1 );
122 
123  vertex( 0, 2, pep0 * epsdual2 );
124  vertex( 1, 2, pep1 * epsdual2 );
125  vertex( 2, 2, pep2 * epsdual2 );
126  vertex( 3, 2, pep3 * epsdual2 );
127  vertex( 4, 2, pep4 * epsdual2 );
128 
129  return;
130 }
131 
132 std::string EvtTVSPwave::getParamName( int i )
133 {
134  switch ( i ) {
135  case 0:
136  return "PWave";
137  case 1:
138  return "PWavePhase";
139  case 2:
140  return "DWave";
141  case 3:
142  return "DWavePhase";
143  case 4:
144  return "FWave";
145  case 5:
146  return "FWavePhase";
147  default:
148  return "";
149  }
150 }
151 
152 std::string EvtTVSPwave::getParamDefault( int i )
153 {
154  switch ( i ) {
155  case 0:
156  return "0.0";
157  case 1:
158  return "0.0";
159  case 2:
160  return "1.0";
161  case 3:
162  return "0.0";
163  case 4:
164  return "0.0";
165  case 5:
166  return "0.0";
167  default:
168  return "";
169  }
170 }
EvtTensor3C directProd(const EvtVector3C &c1, const EvtVector3C &c2)
std::string getParamDefault(int i) override
double getArg(unsigned int j)
EvtTensor4C dual(const EvtTensor4C &t2)
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
Definition: EvtReport.cpp:33
EvtDecayBase * clone() override
Definition: EvtTVSPwave.cpp:39
void init() override
Definition: EvtTVSPwave.cpp:44
std::string getParamName(int i) override
void initProbMax() override
Definition: EvtTVSPwave.cpp:56
EvtVector4C cont1(const EvtVector4C &v4) const
void set(int i, double d)
Definition: EvtVector4R.hh:167
EvtId * getDaugs()
Definition: EvtDecayBase.hh:66
void setProbMax(double prbmx)
void vertex(const EvtComplex &amp)
Definition: EvtDecayAmp.hh:37
double get(int i) const
Definition: EvtVector4R.hh:162
double initializePhaseSpace(unsigned int numdaughter, EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
virtual EvtVector4C epsParent(int i) const
void checkNDaug(int d1, int d2=-1)
void decay(EvtParticle *p) override
Definition: EvtTVSPwave.cpp:61
void checkSpinParent(EvtSpinType::spintype sp)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
const EvtVector4R & getP4() const
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
double mass() const
virtual EvtTensor4C epsTensor(int i) const
double d3mag() const
int getNDaug() const
Definition: EvtDecayBase.hh:65
EvtParticle * getDaug(int i)
Definition: EvtParticle.cpp:91
EvtVector4C conj() const
Definition: EvtVector4C.hh:202
std::string getName() override
Definition: EvtTVSPwave.cpp:34