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.
EvtSVSCPiso.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"
33 
34 #include <stdlib.h>
35 #include <string>
36 
37 std::string EvtSVSCPiso::getName()
38 {
39  return "SVS_CP_ISO";
40 }
41 
43 {
44  return new EvtSVSCPiso;
45 }
46 
48 {
49  // check that there are 27 arguments
50  checkNArg( 27 );
51  checkNDaug( 2 );
52 
54 
57 }
58 
60 {
61  //this might need some revision..
62 
63  if ( ( EvtPDL::chg3( getDaug( 0 ) ) > 0 ) &&
64  ( EvtPDL::chg3( getDaug( 1 ) ) == 0 ) ) {
65  setProbMax( 2.0 * ( getArg( 3 ) * getArg( 3 ) +
66  4.0 * getArg( 23 ) * getArg( 23 ) ) );
67  }
68 
69  if ( ( EvtPDL::chg3( getDaug( 0 ) ) < 0 ) &&
70  ( EvtPDL::chg3( getDaug( 1 ) ) == 0 ) ) {
71  setProbMax( 2.0 * ( getArg( 5 ) * getArg( 5 ) +
72  4.0 * getArg( 25 ) * getArg( 25 ) ) );
73  }
74 
75  if ( ( EvtPDL::chg3( getDaug( 0 ) ) == 0 ) &&
76  ( EvtPDL::chg3( getDaug( 1 ) ) > 0 ) ) {
77  setProbMax( 2.0 * ( getArg( 7 ) * getArg( 7 ) +
78  4.0 * getArg( 23 ) * getArg( 23 ) ) );
79  }
80 
81  if ( ( EvtPDL::chg3( getDaug( 0 ) ) == 0 ) &&
82  ( EvtPDL::chg3( getDaug( 1 ) ) < 0 ) ) {
83  setProbMax( 2.0 * ( getArg( 9 ) * getArg( 9 ) +
84  4.0 * getArg( 25 ) * getArg( 25 ) ) );
85  }
86 
87  if ( ( EvtPDL::chg3( getDaug( 0 ) ) > 0 ) &&
88  ( EvtPDL::chg3( getDaug( 1 ) ) < 0 ) ) {
89  setProbMax(
90  2.0 * ( getArg( 11 ) * getArg( 11 ) + getArg( 23 ) * getArg( 23 ) +
91  getArg( 19 ) * getArg( 19 ) + getArg( 13 ) * getArg( 13 ) +
92  getArg( 25 ) * getArg( 25 ) + getArg( 21 ) * getArg( 21 ) ) );
93  }
94 
95  if ( ( EvtPDL::chg3( getDaug( 0 ) ) < 0 ) &&
96  ( EvtPDL::chg3( getDaug( 1 ) ) > 0 ) ) {
97  setProbMax(
98  2.0 * ( getArg( 15 ) * getArg( 15 ) + getArg( 23 ) * getArg( 23 ) +
99  getArg( 19 ) * getArg( 19 ) + getArg( 17 ) * getArg( 17 ) +
100  getArg( 25 ) * getArg( 25 ) + getArg( 21 ) * getArg( 21 ) ) );
101  }
102 
103  if ( ( EvtPDL::chg3( getDaug( 0 ) ) == 0 ) &&
104  ( EvtPDL::chg3( getDaug( 1 ) ) == 0 ) ) {
105  setProbMax(
106  2.0 * ( getArg( 7 ) * getArg( 7 ) + getArg( 3 ) * getArg( 3 ) +
107  getArg( 11 ) * getArg( 11 ) + getArg( 15 ) * getArg( 15 ) +
108  4.0 * getArg( 19 ) * getArg( 19 ) +
109  getArg( 9 ) * getArg( 9 ) + getArg( 5 ) * getArg( 5 ) +
110  getArg( 13 ) * getArg( 13 ) + getArg( 17 ) * getArg( 17 ) +
111  4.0 * getArg( 21 ) * getArg( 21 ) ) );
112  }
113 }
114 
116 {
117  //added by Lange Jan4,2000
118  static EvtId B0 = EvtPDL::getId( "B0" );
119  static EvtId B0B = EvtPDL::getId( "anti-B0" );
120 
121  double t;
122  EvtId other_b;
123  int charged( 0 );
124 
125  int first_time = 0;
126  int flip = 0;
127  EvtId ds[2];
128 
129  //randomly generate the tag (B0 or B0B)
130 
131  double tag = EvtRandom::Flat( 0.0, 1.0 );
132  if ( tag < 0.5 ) {
133  EvtCPUtil::getInstance()->OtherB( p, t, other_b, 1.0 );
134  other_b = B0;
135  } else {
136  EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.0 );
137  other_b = B0B;
138  }
139 
140  if ( p->getNDaug() == 0 )
141  first_time = 1;
142 
143  if ( first_time ) {
144  if ( EvtRandom::Flat( 0.0, 1.0 ) < getArg( 2 ) )
145  flip = 1;
146  } else {
147  if ( getDaug( 0 ) != p->getDaug( 0 )->getId() )
148  flip = 1;
149  }
150 
151  if ( !flip ) {
152  ds[0] = getDaug( 0 );
153  ds[1] = getDaug( 1 );
154  } else {
155  ds[0] = EvtPDL::chargeConj( getDaug( 0 ) );
156  ds[1] = EvtPDL::chargeConj( getDaug( 1 ) );
157  }
158 
159  p->initializePhaseSpace( getNDaug(), ds );
160 
161  EvtParticle *v, *s;
162  v = p->getDaug( 0 );
163  s = p->getDaug( 1 );
164 
165  EvtComplex amp;
166 
167  EvtComplex A_f, Abar_f;
168  EvtComplex A_fbar, Abar_fbar;
169  EvtComplex Apm, Apm_bar, Amp, Amp_bar;
170 
171  EvtComplex Tp0, Tp0_bar, T0p, T0p_bar, Tpm, Tpm_bar, Tmp, Tmp_bar;
172  EvtComplex P1, P1_bar, P0, P0_bar;
173 
174  Tp0 = EvtComplex( getArg( 3 ) * cos( getArg( 4 ) ),
175  getArg( 3 ) * sin( getArg( 4 ) ) );
176  Tp0_bar = EvtComplex( getArg( 5 ) * cos( getArg( 6 ) ),
177  getArg( 5 ) * sin( getArg( 6 ) ) );
178  T0p = EvtComplex( getArg( 7 ) * cos( getArg( 8 ) ),
179  getArg( 7 ) * sin( getArg( 8 ) ) );
180  T0p_bar = EvtComplex( getArg( 9 ) * cos( getArg( 10 ) ),
181  getArg( 9 ) * sin( getArg( 10 ) ) );
182  Tpm = EvtComplex( getArg( 11 ) * cos( getArg( 12 ) ),
183  getArg( 11 ) * sin( getArg( 12 ) ) );
184  Tpm_bar = EvtComplex( getArg( 13 ) * cos( getArg( 14 ) ),
185  getArg( 13 ) * sin( getArg( 14 ) ) );
186  Tmp = EvtComplex( getArg( 15 ) * cos( getArg( 16 ) ),
187  getArg( 15 ) * sin( getArg( 16 ) ) );
188  Tmp_bar = EvtComplex( getArg( 17 ) * cos( getArg( 18 ) ),
189  getArg( 17 ) * sin( getArg( 18 ) ) );
190  P0 = EvtComplex( getArg( 19 ) * cos( getArg( 20 ) ),
191  getArg( 19 ) * sin( getArg( 20 ) ) );
192  P0_bar = EvtComplex( getArg( 21 ) * cos( getArg( 22 ) ),
193  getArg( 21 ) * sin( getArg( 22 ) ) );
194  P1 = EvtComplex( getArg( 23 ) * cos( getArg( 24 ) ),
195  getArg( 23 ) * sin( getArg( 24 ) ) );
196  P1_bar = EvtComplex( getArg( 25 ) * cos( getArg( 26 ) ),
197  getArg( 25 ) * sin( getArg( 26 ) ) );
198 
199  //***********************charged modes****************************
200 
201  if ( ( EvtPDL::chg3( getDaug( 0 ) ) > 0 ) &&
202  ( EvtPDL::chg3( getDaug( 1 ) ) == 0 ) ) {
203  //V+ S0, so T+0 + 2 P1
204 
205  charged = 1;
206  A_f = Tp0 + 2.0 * P1;
207  }
208 
209  if ( ( EvtPDL::chg3( getDaug( 0 ) ) < 0 ) &&
210  ( EvtPDL::chg3( getDaug( 1 ) ) == 0 ) ) {
211  //V- S0, so T+0_bar + 2P1_bar
212 
213  charged = 1;
214  A_f = Tp0_bar + 2.0 * P1_bar;
215  }
216 
217  if ( ( EvtPDL::chg3( getDaug( 0 ) ) == 0 ) &&
218  ( EvtPDL::chg3( getDaug( 1 ) ) > 0 ) ) {
219  //V0 S+, so T0+ - 2 P1
220 
221  charged = 1;
222  A_f = T0p - 2.0 * P1;
223  }
224 
225  if ( ( EvtPDL::chg3( getDaug( 0 ) ) == 0 ) &&
226  ( EvtPDL::chg3( getDaug( 1 ) ) < 0 ) ) {
227  //V0 S-, so T0+_bar - 2 P1_bar
228 
229  charged = 1;
230  A_f = T0p_bar - 2.0 * P1_bar;
231  }
232 
233  //***********************neutral modes***************************
234 
235  //V+ S-, so Af = T+- + P1 + P0
236  Apm = Tpm + P1 + P0;
237  Apm_bar = Tpm_bar + P1_bar + P0_bar;
238 
239  //V- S+, so Af = T-+ - P1 + P0
240  Amp = Tmp - P1 + P0;
241  Amp_bar = Tmp_bar - P1_bar + P0;
242 
243  if ( ( EvtPDL::chg3( getDaug( 0 ) ) > 0 ) &&
244  ( EvtPDL::chg3( getDaug( 1 ) ) < 0 ) ) {
245  //V+ S-
246  charged = 0;
247  A_f = Apm;
248  Abar_f = Apm_bar;
249  A_fbar = Amp;
250  Abar_fbar = Amp_bar;
251  }
252 
253  if ( ( EvtPDL::chg3( getDaug( 0 ) ) < 0 ) &&
254  ( EvtPDL::chg3( getDaug( 1 ) ) > 0 ) ) {
255  //V- S+
256  charged = 0;
257  A_f = Amp;
258  Abar_f = Amp_bar;
259  A_fbar = Apm;
260  Abar_fbar = Apm_bar;
261  }
262 
263  if ( ( EvtPDL::chg3( getDaug( 0 ) ) == 0 ) &&
264  ( EvtPDL::chg3( getDaug( 1 ) ) == 0 ) ) {
265  //V0 S0
266  charged = 0;
267  A_f = T0p + Tp0 - Tpm - Tmp - 2.0 * P0;
268  Abar_f = T0p_bar + Tp0_bar - Tpm_bar - Tmp_bar - 2.0 * P0_bar;
269  A_fbar = A_f;
270  Abar_fbar = Abar_f;
271  }
272 
273  if ( charged == 0 ) {
274  if ( !flip ) {
275  if ( other_b == B0B ) {
276  amp = A_f * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
277  EvtComplex( cos( -2.0 * getArg( 0 ) ),
278  sin( -2.0 * getArg( 0 ) ) ) *
279  EvtComplex( 0.0, 1.0 ) * Abar_f *
280  sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
281  }
282  if ( other_b == B0 ) {
283  amp = A_f *
284  EvtComplex( cos( 2.0 * getArg( 0 ) ),
285  sin( 2.0 * getArg( 0 ) ) ) *
286  EvtComplex( 0.0, 1.0 ) *
287  sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
288  Abar_f * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
289  }
290  } else {
291  if ( other_b == B0B ) {
292  amp = A_fbar * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
293  EvtComplex( cos( -2.0 * getArg( 0 ) ),
294  sin( -2.0 * getArg( 0 ) ) ) *
295  EvtComplex( 0.0, 1.0 ) * Abar_fbar *
296  sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
297  }
298  if ( other_b == B0 ) {
299  amp = A_fbar *
300  EvtComplex( cos( 2.0 * getArg( 0 ) ),
301  sin( 2.0 * getArg( 0 ) ) ) *
302  EvtComplex( 0.0, 1.0 ) *
303  sin( getArg( 1 ) * t / ( 2 * EvtConst::c ) ) +
304  Abar_fbar * cos( getArg( 1 ) * t / ( 2 * EvtConst::c ) );
305  }
306  }
307 
308  } else
309  amp = A_f;
310 
311  EvtVector4R p4_parent;
312 
313  p4_parent = v->getP4() + s->getP4();
314 
315  double norm = 1.0 / v->getP4().d3mag();
316 
317  vertex( 0, amp * norm * p4_parent * ( v->epsParent( 0 ) ) );
318  vertex( 1, amp * norm * p4_parent * ( v->epsParent( 1 ) ) );
319  vertex( 2, amp * norm * p4_parent * ( v->epsParent( 2 ) ) );
320 
321  return;
322 }
void initProbMax() override
Definition: EvtSVSCPiso.cpp:59
double getArg(unsigned int j)
std::string getName() override
Definition: EvtSVSCPiso.cpp:37
EvtId getId() const
void OtherB(EvtParticle *p, double &t, EvtId &otherb)
Definition: EvtCPUtil.cpp:372
static int chg3(EvtId i)
Definition: EvtPDL.cpp:372
void setProbMax(double prbmx)
Definition: EvtId.hh:27
size_t getNDaug() const
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
void checkNDaug(int d1, int d2=-1)
void checkSpinParent(EvtSpinType::spintype sp)
static double Flat()
Definition: EvtRandom.cpp:72
void decay(EvtParticle *p) override
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static const double c
Definition: EvtConst.hh:30
EvtDecayBase * clone() override
Definition: EvtSVSCPiso.cpp:42
static EvtId getId(const std::string &name)
Definition: EvtPDL.cpp:287
const EvtVector4R & getP4() const
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
double d3mag() const
int getNDaug() const
Definition: EvtDecayBase.hh:65
static EvtCPUtil * getInstance()
Definition: EvtCPUtil.cpp:43
EvtParticle * getDaug(int i)
Definition: EvtParticle.cpp:91
static EvtId chargeConj(EvtId id)
Definition: EvtPDL.cpp:207
void init() override
Definition: EvtSVSCPiso.cpp:47
EvtId getDaug(int i) const
Definition: EvtDecayBase.hh:67