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.
EvtVPHOtoVISR.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/EvtGenKine.hh"
24 #include "EvtGenBase/EvtPDL.hh"
26 #include "EvtGenBase/EvtRandom.hh"
27 #include "EvtGenBase/EvtReport.hh"
30 
31 #include <stdlib.h>
32 #include <string>
33 
35 {
36  return "VPHOTOVISR";
37 }
38 
40 {
41  return new EvtVPHOtoVISR;
42 }
43 
45 {
46  // check that there are 0 or 2 arguments
47  checkNArg( 0, 2 );
48 
49  // check that there are 2 daughters
50  checkNDaug( 2 );
51 
52  // check the parent and daughter spins
56 }
57 
59 {
60  //setProbMax(100000.0);
61 }
62 
64 {
65  //take photon along z-axis, either forward or backward.
66  //Implement this as generating the photon momentum along
67  //the z-axis uniformly
68 
69  double w = p->mass();
70  double s = w * w;
71 
72  double L = 2.0 * log( w / 0.000511 );
73  double alpha = 1 / 137.0;
74  double beta = ( L - 1 ) * 2.0 * alpha / EvtConst::pi;
75 
76  //This uses the fact that there is a daughter of the
77  //psi(3770)
78  assert( p->getDaug( 0 )->getDaug( 0 ) != 0 );
79  double md = EvtPDL::getMeanMass( p->getDaug( 0 )->getDaug( 0 )->getId() );
80 
81  static double mD0 = EvtPDL::getMeanMass( EvtPDL::getId( "D0" ) );
82  static double mDp = EvtPDL::getMeanMass( EvtPDL::getId( "D+" ) );
83 
84  double pgmax = ( s - 4.0 * md * md ) / ( 2.0 * w );
85 
86  assert( pgmax > 0.0 );
87 
88  double pgz = 0.99 * pgmax * exp( log( EvtRandom::Flat( 1.0 ) ) / beta );
89 
90  if ( EvtRandom::Flat( 1.0 ) < 0.5 )
91  pgz = -pgz;
92 
93  double k = fabs( pgz );
94 
95  EvtVector4R p4g( k, 0.0, 0.0, pgz );
96 
97  EvtVector4R p4res = p->getP4Restframe() - p4g;
98 
99  double mres = p4res.mass();
100 
101  double ed = mres / 2.0;
102 
103  assert( ed > md );
104 
105  double pd = sqrt( ed * ed - md * md );
106 
107  //std::cout << "k, mres, w, md, ed, pd:"<<k<<" "<<mres<<" "<<w<<" "<<md<<" "<<ed<<" "<<pd<<std::endl;
108 
109  p->getDaug( 0 )->init( getDaug( 0 ), p4res );
110  p->getDaug( 1 )->init( getDaug( 1 ), p4g );
111 
112  double sigma =
113  beta * pow( 2 / w, beta ) *
114  ( 1 + alpha * ( 1.5 * L - 2.0 + EvtConst::pi * EvtConst::pi / 3.0 ) /
115  EvtConst::pi );
116 
117  double m = EvtPDL::getMeanMass( p->getDaug( 0 )->getId() );
118  double Gamma = EvtPDL::getWidth( p->getDaug( 0 )->getId() );
119 
120  //mres is the energy of the psi(3770)
121 
122  double p0 = 0.0;
123  if ( ed > mD0 )
124  p0 = sqrt( ed * ed - mD0 * mD0 );
125  double pp = 0.0;
126  if ( ed > mDp )
127  pp = sqrt( ed * ed - mDp * mDp );
128 
129  double p0norm = sqrt( 0.25 * m * m - mD0 * mD0 );
130  double ppnorm = sqrt( 0.25 * m * m - mDp * mDp );
131 
132  double r0 = 12.7;
133  double rp = 12.7;
134 
135  if ( getNArg() == 2 ) {
136  r0 = getArg( 0 );
137  rp = getArg( 1 );
138  }
139 
140  double GammaTot =
141  Gamma *
142  ( pp * pp * pp / ( 1 + pp * pp * rp * rp ) +
143  p0 * p0 * p0 / ( 1 + p0 * p0 * r0 * r0 ) ) /
144  ( ppnorm * ppnorm * ppnorm / ( 1 + ppnorm * ppnorm * rp * rp ) +
145  p0norm * p0norm * p0norm / ( 1 + p0norm * p0norm * r0 * r0 ) );
146 
147  sigma *= pd * pd * pd /
148  ( ( mres - m ) * ( mres - m ) + 0.25 * GammaTot * GammaTot );
149 
150  assert( sigma > 0.0 );
151 
152  static double sigmax = sigma;
153 
154  if ( sigma > sigmax ) {
155  sigmax = sigma;
156  }
157 
158  static int count = 0;
159 
160  count++;
161 
162  //if (count%10000==0){
163  // std::cout << "sigma :"<<sigma<<std::endl;
164  // std::cout << "sigmax:"<<sigmax<<std::endl;
165  //}
166 
167  double norm = sqrt( sigma );
168 
169  vertex( 0, 0, 0, norm * p->eps( 0 ) * p->epsParent( 0 ).conj() );
170  vertex( 1, 0, 0, norm * p->eps( 1 ) * p->epsParent( 0 ).conj() );
171  vertex( 2, 0, 0, norm * p->eps( 2 ) * p->epsParent( 0 ).conj() );
172 
173  vertex( 0, 1, 0, norm * p->eps( 0 ) * p->epsParent( 1 ).conj() );
174  vertex( 1, 1, 0, norm * p->eps( 1 ) * p->epsParent( 1 ).conj() );
175  vertex( 2, 1, 0, norm * p->eps( 2 ) * p->epsParent( 1 ).conj() );
176 
177  vertex( 0, 2, 0, norm * p->eps( 0 ) * p->epsParent( 2 ).conj() );
178  vertex( 1, 2, 0, norm * p->eps( 1 ) * p->epsParent( 2 ).conj() );
179  vertex( 2, 2, 0, norm * p->eps( 2 ) * p->epsParent( 2 ).conj() );
180 
181  vertex( 0, 0, 1, norm * p->eps( 0 ) * p->epsParent( 0 ).conj() );
182  vertex( 1, 0, 1, norm * p->eps( 1 ) * p->epsParent( 0 ).conj() );
183  vertex( 2, 0, 1, norm * p->eps( 2 ) * p->epsParent( 0 ).conj() );
184 
185  vertex( 0, 1, 1, norm * p->eps( 0 ) * p->epsParent( 1 ).conj() );
186  vertex( 1, 1, 1, norm * p->eps( 1 ) * p->epsParent( 1 ).conj() );
187  vertex( 2, 1, 1, norm * p->eps( 2 ) * p->epsParent( 1 ).conj() );
188 
189  vertex( 0, 2, 1, norm * p->eps( 0 ) * p->epsParent( 2 ).conj() );
190  vertex( 1, 2, 1, norm * p->eps( 1 ) * p->epsParent( 2 ).conj() );
191  vertex( 2, 2, 1, norm * p->eps( 2 ) * p->epsParent( 2 ).conj() );
192 
193  return;
194 }
std::string getName() override
void initProbMax() override
virtual EvtVector4C eps(int i) const
double getArg(unsigned int j)
void decay(EvtParticle *p) override
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
double mass() const
Definition: EvtVector4R.cpp:49
static double getMeanMass(EvtId i)
Definition: EvtPDL.cpp:314
EvtId getId() const
static const double pi
Definition: EvtConst.hh:26
void vertex(const EvtComplex &amp)
Definition: EvtDecayAmp.hh:37
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 checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
static EvtId getId(const std::string &name)
Definition: EvtPDL.cpp:287
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
double mass() const
static double getWidth(EvtId i)
Definition: EvtPDL.cpp:352
EvtComplex exp(const EvtComplex &c)
Definition: EvtComplex.hh:240
void init() override
EvtParticle * getDaug(int i)
Definition: EvtParticle.cpp:91
EvtVector4C conj() const
Definition: EvtVector4C.hh:202
EvtDecayBase * clone() override
EvtVector4R getP4Restframe() const
int getNArg() const
Definition: EvtDecayBase.hh:68
EvtId getDaug(int i) const
Definition: EvtDecayBase.hh:67