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.
EvtSVSCP.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 
21 #include "EvtGenModels/EvtSVSCP.hh"
22 
23 #include "EvtGenBase/EvtCPUtil.hh"
24 #include "EvtGenBase/EvtConst.hh"
25 #include "EvtGenBase/EvtGenKine.hh"
26 #include "EvtGenBase/EvtPDL.hh"
28 #include "EvtGenBase/EvtPatches.hh"
29 #include "EvtGenBase/EvtReport.hh"
31 
32 #include <stdlib.h>
33 #include <string>
34 
35 std::string EvtSVSCP::getName()
36 {
37  return "SVS_CP";
38 }
39 
41 {
42  return new EvtSVSCP;
43 }
44 
46 {
47  // check that there are 7 arguments
48  checkNArg( 7 );
49  checkNDaug( 2 );
50 
52 
55 }
56 
58 {
59  //This is probably not quite right, but it should do as a start...
60  //Anders
61 
62  setProbMax( 2 * ( getArg( 3 ) * getArg( 3 ) + getArg( 5 ) * getArg( 5 ) ) );
63 }
64 
66 {
67  //added by Lange Jan4,2000
68  static EvtId B0 = EvtPDL::getId( "B0" );
69  static EvtId B0B = EvtPDL::getId( "anti-B0" );
70 
71  EvtParticle* v;
73  v = p->getDaug( 0 );
74  EvtVector4R momv = v->getP4();
75  EvtVector4R moms = p->getDaug( 1 )->getP4();
76  double massv = v->mass();
77  double t;
78  EvtId other_b;
79 
80  EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 );
81 
82  EvtComplex amp;
83 
84  EvtComplex A, Abar;
85 
86  A = EvtComplex( getArg( 3 ) * cos( getArg( 4 ) ),
87  getArg( 3 ) * sin( getArg( 4 ) ) );
88  Abar = EvtComplex( getArg( 5 ) * cos( getArg( 6 ) ),
89  getArg( 5 ) * sin( getArg( 6 ) ) );
90 
91  if ( other_b == B0B ) {
92  amp = A * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
93  EvtComplex( cos( -2.0 * getArg( 0 ) ), sin( -2.0 * getArg( 0 ) ) ) *
94  getArg( 2 ) * EvtComplex( 0.0, 1.0 ) * Abar *
95  sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
96  }
97  if ( other_b == B0 ) {
98  amp = A * EvtComplex( cos( 2.0 * getArg( 0 ) ), sin( 2.0 * getArg( 0 ) ) ) *
99  EvtComplex( 0.0, 1.0 ) *
100  sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
101  getArg( 2 ) * Abar * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
102  }
103 
104  EvtVector4R p4_parent;
105 
106  p4_parent = momv + moms;
107 
108  double norm = massv / ( momv.d3mag() * p4_parent.mass() );
109 
110  vertex( 0, amp * norm * p4_parent * ( v->epsParent( 0 ) ) );
111  vertex( 1, amp * norm * p4_parent * ( v->epsParent( 1 ) ) );
112  vertex( 2, amp * norm * p4_parent * ( v->epsParent( 2 ) ) );
113 
114  return;
115 }
116 
117 std::string EvtSVSCP::getParamName( int i )
118 {
119  switch ( i ) {
120  case 0:
121  return "weakPhase";
122  case 1:
123  return "deltaM";
124  case 2:
125  return "finalStateCP";
126  case 3:
127  return "Af";
128  case 4:
129  return "AfPhase";
130  case 5:
131  return "Abarf";
132  case 6:
133  return "AbarfPhase";
134  default:
135  return "";
136  }
137 }
138 
139 std::string EvtSVSCP::getParamDefault( int i )
140 {
141  switch ( i ) {
142  case 3:
143  return "1.0";
144  case 4:
145  return "0.0";
146  case 5:
147  return "1.0";
148  case 6:
149  return "0.0";
150  default:
151  return "";
152  }
153 }
std::string getName() override
Definition: EvtSVSCP.cpp:35
double getArg(unsigned int j)
double mass() const
Definition: EvtVector4R.cpp:49
void initProbMax() override
Definition: EvtSVSCP.cpp:57
void OtherB(EvtParticle *p, double &t, EvtId &otherb)
Definition: EvtCPUtil.cpp:372
EvtId * getDaugs()
Definition: EvtDecayBase.hh:66
void setProbMax(double prbmx)
Definition: EvtId.hh:27
void vertex(const EvtComplex &amp)
Definition: EvtDecayAmp.hh:37
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
std::string getParamName(int i) override
Definition: EvtSVSCP.cpp:117
void checkNDaug(int d1, int d2=-1)
void checkSpinParent(EvtSpinType::spintype sp)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static const double c
Definition: EvtConst.hh:30
static EvtId getId(const std::string &name)
Definition: EvtPDL.cpp:287
const EvtVector4R & getP4() const
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
double mass() const
double d3mag() const
int getNDaug() const
Definition: EvtDecayBase.hh:65
std::string getParamDefault(int i) override
Definition: EvtSVSCP.cpp:139
void decay(EvtParticle *p) override
Definition: EvtSVSCP.cpp:65
static EvtCPUtil * getInstance()
Definition: EvtCPUtil.cpp:43
EvtParticle * getDaug(int i)
Definition: EvtParticle.cpp:91
EvtDecayBase * clone() override
Definition: EvtSVSCP.cpp:40
void init() override
Definition: EvtSVSCP.cpp:45