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