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.
EvtBTo3piCP.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/EvtId.hh"
26 #include "EvtGenBase/EvtPDL.hh"
28 #include "EvtGenBase/EvtPatches.hh"
29 #include "EvtGenBase/EvtReport.hh"
30 
31 #include <stdlib.h>
32 #include <string>
33 
34 std::string EvtBTo3piCP::getName()
35 {
36  return "BTO3PI_CP";
37 }
38 
40 {
41  return new EvtBTo3piCP;
42 }
43 
45 {
46  // check that there are 2 arguments
47  checkNArg( 2 );
48  checkNDaug( 3 );
49 
51 
55 }
56 
58 {
59  // perform common blocks initialization before
60  // first use
61  double alpha = getArg( 1 );
62  int iset;
63 
64  iset = 10000;
65 
66  EvtVector4R p4piplus, p4piminus, p4gamm1, p4gamm2;
67 
68  double realA, imgA, realbarA, imgbarA;
69 
70  generator.Evt3pi( alpha, iset, p4piplus, p4piminus, p4gamm1, p4gamm2, realA,
71  imgA, realbarA, imgbarA );
72 
73  setProbMax( 1.5 );
74 }
75 
77 {
78  //added by Lange Jan4,2000
79  static EvtId B0 = EvtPDL::getId( "B0" );
80  static EvtId B0B = EvtPDL::getId( "anti-B0" );
81 
82  double t;
83  EvtId other_b;
84 
85  EvtCPUtil::getInstance()->OtherB( p, t, other_b, 0.5 );
86 
87  EvtParticle *pip, *pim, *pi0;
88 
89  p->makeDaughters( getNDaug(), getDaugs() );
90 
91  // p->init_daug(SCALAR,&pip,SCALAR,&pim,SCALAR,&pi0);
92  pip = p->getDaug( 0 );
93  pim = p->getDaug( 1 );
94  pi0 = p->getDaug( 2 );
95 
96  EvtVector4R p4[3];
97 
98  double dm = getArg( 0 );
99  double alpha = getArg( 1 );
100  int iset;
101 
102  iset = 0;
103 
104  EvtVector4R p4piplus, p4piminus, p4gamm1, p4gamm2;
105 
106  double realA, imgA, realbarA, imgbarA;
107 
108  generator.Evt3pi( alpha, iset, p4[0], p4[1], p4gamm1, p4gamm2, realA, imgA,
109  realbarA, imgbarA );
110 
111  p4[2] = p4gamm1 + p4gamm2;
112 
113  if ( pip->getId() == EvtPDL::getId( "pi+" ) ) {
114  pip->init( getDaug( 0 ), p4[0] );
115  pim->init( getDaug( 1 ), p4[1] );
116  } else {
117  pip->init( getDaug( 0 ), p4[1] );
118  pim->init( getDaug( 1 ), p4[0] );
119  }
120 
121  pi0->init( getDaug( 2 ), p4[2] );
122 
123  EvtComplex amp;
124 
125  EvtComplex A( realA, imgA );
126  EvtComplex Abar( realbarA, imgbarA );
127 
128  if ( other_b == B0B ) {
129  amp = A * cos( dm * t / ( 2 * EvtConst::c ) ) +
130  EvtComplex( 0., 1. ) * Abar * sin( dm * t / ( 2 * EvtConst::c ) );
131  }
132  if ( other_b == B0 ) {
133  amp = Abar * cos( dm * t / ( 2 * EvtConst::c ) ) +
134  EvtComplex( 0., 1. ) * A * sin( dm * t / ( 2 * EvtConst::c ) );
135  }
136 
137  vertex( amp );
138 
139  return;
140 }
double getArg(unsigned int j)
void decay(EvtParticle *p) override
Definition: EvtBTo3piCP.cpp:76
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtId getId() const
void makeDaughters(unsigned int ndaug, EvtId *id)
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 Evt3pi(double alpha, int iset, EvtVector4R &p_K_plus, EvtVector4R &p_pi_minus, EvtVector4R &p_gamma_1, EvtVector4R &p_gamma_2, double &Real_B0, double &Imag_B0, double &Real_B0bar, double &Imag_B0bar)
Definition: EvtBTo3hCP.cpp:133
void checkNDaug(int d1, int d2=-1)
void checkSpinParent(EvtSpinType::spintype sp)
void initProbMax() override
Definition: EvtBTo3piCP.cpp:57
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static const double c
Definition: EvtConst.hh:30
EvtBTo3hCP generator
Definition: EvtBTo3piCP.hh:44
static EvtId getId(const std::string &name)
Definition: EvtPDL.cpp:287
std::string getName() override
Definition: EvtBTo3piCP.cpp:34
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
int getNDaug() const
Definition: EvtDecayBase.hh:65
static EvtCPUtil * getInstance()
Definition: EvtCPUtil.cpp:43
EvtBTo3piCP * clone() override
Definition: EvtBTo3piCP.cpp:39
void init() override
Definition: EvtBTo3piCP.cpp:44
EvtParticle * getDaug(int i)
Definition: EvtParticle.cpp:91
EvtId getDaug(int i) const
Definition: EvtDecayBase.hh:67