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
EvtBto2piCPiso.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
26#include "EvtGenBase/EvtId.hh"
27#include "EvtGenBase/EvtPDL.hh"
31
32#include <stdlib.h>
33#include <string>
34
35std::string EvtBto2piCPiso::getName() const
36{
37 return "BTO2PI_CP_ISO";
38}
39
41{
42 return new EvtBto2piCPiso;
43}
44
46{
47 // check that there are 10 arguments
48
49 checkNArg( 10 );
50 checkNDaug( 2 );
51
53
56}
57
59{
60 //added by Lange Jan4,2000
61 static const EvtId PI0 = EvtPDL::getId( "pi0" );
62 static const EvtId PIP = EvtPDL::getId( "pi+" );
63 static const EvtId PIM = EvtPDL::getId( "pi-" );
64
65 //this may need to be revised
66
67 if ( ( ( getDaugs()[0] == PIP ) && ( getDaugs()[1] == PIM ) ) ||
68 ( ( getDaugs()[0] == PIM ) && ( getDaugs()[1] == PIP ) ) ) {
69 setProbMax( 4.0 *
70 ( getArg( 2 ) * getArg( 2 ) + getArg( 4 ) * getArg( 4 ) ) );
71 }
72
73 if ( ( getDaugs()[0] == PI0 ) && ( getDaugs()[1] == PI0 ) ) {
74 setProbMax( 2.0 * ( 4.0 * getArg( 2 ) * getArg( 2 ) +
75 getArg( 4 ) * getArg( 4 ) ) );
76 }
77
78 if ( ( ( getDaugs()[0] == PIP ) && ( getDaugs()[1] == PI0 ) ) ||
79 ( ( getDaugs()[0] == PI0 ) && ( getDaugs()[1] == PIP ) ) ) {
80 setProbMax( 6.0 * getArg( 2 ) * getArg( 2 ) );
81 }
82
83 if ( ( ( getDaugs()[0] == PI0 ) && ( getDaugs()[1] == PIM ) ) ||
84 ( ( getDaugs()[0] == PIM ) && ( getDaugs()[1] == PI0 ) ) ) {
85 setProbMax( 6.0 * getArg( 4 ) * getArg( 4 ) );
86 }
87}
88
90{
92
93 //added by Lange Jan4,2000
94 static const EvtId B0 = EvtPDL::getId( "B0" );
95 static const EvtId B0B = EvtPDL::getId( "anti-B0" );
96 static const EvtId PI0 = EvtPDL::getId( "pi0" );
97 static const EvtId PIP = EvtPDL::getId( "pi+" );
98 static const EvtId PIM = EvtPDL::getId( "pi-" );
99
100 double t;
101 EvtId other_b;
102 int charged = 0;
103
104 //randomly generate the tag (B0 or B0B)
105
106 double tag = EvtRandom::Flat( 0.0, 1.0 );
107 if ( tag < 0.5 ) {
108 EvtCPUtil::getInstance()->OtherB( p, t, other_b, 1.0 );
109 other_b = B0;
110 } else {
111 EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.0 );
112 other_b = B0B;
113 }
114
115 EvtComplex amp;
116
117 EvtComplex A, Abar;
118 EvtComplex A2, A2_bar, A0, A0_bar;
119
120 A2 = EvtComplex( getArg( 2 ) * cos( getArg( 3 ) ),
121 getArg( 2 ) * sin( getArg( 3 ) ) );
122 A2_bar = EvtComplex( getArg( 4 ) * cos( getArg( 5 ) ),
123 getArg( 4 ) * sin( getArg( 5 ) ) );
124
125 A0 = EvtComplex( getArg( 6 ) * cos( getArg( 7 ) ),
126 getArg( 6 ) * sin( getArg( 7 ) ) );
127 A0_bar = EvtComplex( getArg( 8 ) * cos( getArg( 9 ) ),
128 getArg( 8 ) * sin( getArg( 9 ) ) );
129
130 //depending on what combination of pi pi we have, there will be different
131 //A and Abar
132
133 if ( ( ( getDaugs()[0] == PIP ) && ( getDaugs()[1] == PI0 ) ) ||
134 ( ( getDaugs()[0] == PI0 ) && ( getDaugs()[1] == PIP ) ) ) {
135 //pi+ pi0, so just A_2
136
137 charged = 1;
138 A = 3.0 * A2;
139 }
140
141 if ( ( ( getDaugs()[0] == PI0 ) && ( getDaugs()[1] == PIM ) ) ||
142 ( ( getDaugs()[0] == PIM ) && ( getDaugs()[1] == PI0 ) ) ) {
143 //pi- pi0, so just A2_bar
144
145 charged = 1;
146 A = 3.0 * A2_bar;
147 }
148
149 if ( ( ( getDaugs()[0] == PIP ) && ( getDaugs()[1] == PIM ) ) ||
150 ( ( getDaugs()[0] == PIM ) && ( getDaugs()[1] == PIP ) ) ) {
151 //pi+ pi-, so A_2 - A_0
152
153 charged = 0;
154 A = sqrt( 2.0 ) * ( A2 - A0 );
155 Abar = sqrt( 2.0 ) * ( A2_bar - A0_bar );
156 }
157
158 if ( ( getDaugs()[0] == PI0 ) && ( getDaugs()[1] == PI0 ) ) {
159 //pi0 pi0, so 2*A_2 + A_0
160
161 charged = 0;
162 A = 2.0 * A2 + A0;
163 Abar = 2.0 * A2_bar + A0_bar;
164 }
165
166 if ( charged == 0 ) {
167 if ( other_b == B0B ) {
168 amp = A * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
169 EvtComplex( cos( -2.0 * getArg( 0 ) ),
170 sin( -2.0 * getArg( 0 ) ) ) *
171 EvtComplex( 0.0, 1.0 ) * Abar *
172 sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
173 }
174 if ( other_b == B0 ) {
175 amp = A *
176 EvtComplex( cos( 2.0 * getArg( 0 ) ),
177 sin( 2.0 * getArg( 0 ) ) ) *
178 EvtComplex( 0.0, 1.0 ) *
179 sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
180 Abar * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
181 }
182 } else
183 amp = A;
184
185 vertex( amp );
186
187 return;
188}
189
191{
192 switch ( i ) {
193 case 0:
194 return "weakPhase";
195 case 1:
196 return "deltaM";
197 case 2:
198 return "A2";
199 case 3:
200 return "A2Phase";
201 case 4:
202 return "A2bar";
203 case 5:
204 return "A2barPhase";
205 case 6:
206 return "A0";
207 case 7:
208 return "A0Phase";
209 case 8:
210 return "A0bar";
211 case 9:
212 return "A0barPhase";
213 default:
214 return "";
215 }
216}
217
219{
220 switch ( i ) {
221 case 2:
222 return "1.0";
223 case 3:
224 return "0.0";
225 case 4:
226 return "1.0";
227 case 5:
228 return "0.0";
229 case 6:
230 return "1.0";
231 case 7:
232 return "0.0";
233 case 8:
234 return "1.0";
235 case 9:
236 return "0.0";
237 default:
238 return "";
239 }
240}
std::string getParamName(int i) override
std::string getParamDefault(int i) override
void decay(EvtParticle *p) override
void initProbMax() override
EvtDecayBase * clone() const override
std::string getName() const override
void init() override
static EvtCPUtil * getInstance()
Definition EvtCPUtil.cpp:42
void OtherB(EvtParticle *p, double &t, EvtId &otherb)
static const double c
Definition EvtConst.hh:30
void vertex(const EvtComplex &amp)
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
EvtDecayBase()=default
int getNDaug() const
void checkSpinParent(EvtSpinType::spintype sp)
double getArg(unsigned int j)
void setProbMax(double prbmx)
void checkNDaug(int d1, int d2=-1)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
const EvtId * getDaugs() const
Definition EvtId.hh:27
static EvtId getId(const std::string &name)
Definition EvtPDL.cpp:283
double initializePhaseSpace(size_t numdaughter, const EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
static double Flat()
Definition EvtRandom.cpp:95