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.
EvtHypNonLepton.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/EvtComplex.hh"
26 #include "EvtGenBase/EvtPDL.hh"
31 
33 {
34  return new EvtHypNonLepton;
35 }
36 
38 {
39  return "HypNonLepton";
40 }
41 
43 {
44  if ( getNArg() < 2 || getNArg() > 3 ) { // alpha phi gamma delta
45  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
46  << " ERROR: EvtHypNonLepton generator expected 2 or 3 arguments but found: "
47  << getNArg() << std::endl;
48  EvtGenReport( EVTGEN_INFO, "EvtGen" )
49  << " 1. Decay asymmetry parameter - alpha" << std::endl;
50  EvtGenReport( EVTGEN_INFO, "EvtGen" )
51  << " 2. Parameter phi - in degrees (not radians)" << std::endl;
52  EvtGenReport( EVTGEN_INFO, "EvtGen" )
53  << " 3. Note on every x-th decay" << std::endl;
54  ::abort();
55  }
56 
57  if ( getNDaug() != 2 ) { // Check that there are 2 daughters only
58  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
59  << " ERROR: EvtHypNonLepton generator expected 2 daughters but found: "
60  << getNDaug() << std::endl;
61  ::abort();
62  }
63 
64  // Check particles spins
66  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
67  << " ERROR: EvtHypNonLepton generator expected dirac parent particle, but found "
69  << " spin degrees of freedom" << std::endl;
70  ::abort();
71  }
72  if ( EvtSpinType::getSpin2( EvtPDL::getSpinType( getDaug( 0 ) ) ) != 1 ) {
73  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
74  << " ERROR: EvtHypNonLepton generator expected the first child to be dirac particle, but found "
76  << " spin degrees of freedom" << std::endl;
77  ::abort();
78  }
79  if ( EvtSpinType::getSpin2( EvtPDL::getSpinType( getDaug( 1 ) ) ) != 0 ) {
80  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
81  << " ERROR: EvtHypNonLepton generator expected the second child to be scalar particle, but found "
83  << " spin degrees of freedom" << std::endl;
84  ::abort();
85  }
86 
87  // Read all parameters
88  m_alpha = getArg( 0 );
89  m_phi = getArg( 1 ) * EvtConst::pi / 180;
90  if ( getNArg() == 3 )
91  m_noTries = static_cast<long>( getArg( 2 ) );
92  else
93  m_noTries = 0;
94 
95  // calculate additional parameters
96  double p, M, m1, m2;
97  double p_to_s, beta, delta, gamma;
98 
100  m1 = EvtPDL::getMass( getDaug( 0 ) );
101  m2 = EvtPDL::getMass( getDaug( 1 ) );
102 
103  if ( m1 + m2 >= M ) {
104  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
105  << " ERROR: EvtHypNonLepton found impossible decay: " << M
106  << " --> " << m1 << " + " << m2 << " GeV\n"
107  << std::endl;
108  ::abort();
109  }
110 
111  p = sqrt( M * M - ( m1 + m2 ) * ( m1 + m2 ) ) *
112  sqrt( M * M - ( m1 - m2 ) * ( m1 - m2 ) ) / 2. / M;
113 
114  beta = sqrt( 1. - m_alpha * m_alpha ) * sin( m_phi );
115  delta = -atan2( beta, m_alpha );
116  gamma = sqrt( 1. - m_alpha * m_alpha - beta * beta );
117  p_to_s = sqrt( ( 1. - gamma ) / ( 1. + gamma ) );
118 
119  m_B_to_A = p_to_s * ( m1 + sqrt( p * p + m1 * m1 ) ) / p *
120  EvtComplex( cos( delta ), sin( delta ) );
121 }
122 
124 {
125  double maxProb, m1, m2, M, p;
126 
127  M = EvtPDL::getMass( getParentId() );
128  m1 = EvtPDL::getMass( getDaug( 0 ) );
129  m2 = EvtPDL::getMass( getDaug( 1 ) );
130 
131  if ( m1 + m2 >= M ) {
132  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
133  << " ERROR: EvtHypNonLepton found impossible decay: " << M
134  << " --> " << m1 << " + " << m2 << " GeV\n"
135  << std::endl;
136  ::abort();
137  }
138 
139  p = sqrt( M * M - ( m1 + m2 ) * ( m1 + m2 ) ) *
140  sqrt( M * M - ( m1 - m2 ) * ( m1 - m2 ) ) / 2 / M;
141  maxProb = 16 * M *
142  ( sqrt( p * p + m1 * m1 ) + m1 +
143  abs( m_B_to_A ) * abs( m_B_to_A ) *
144  ( sqrt( p * p + m1 * m1 ) - m1 ) );
145  //maxProb *= G_F*M_pi*M_pi;
146 
147  setProbMax( maxProb );
148  EvtGenReport( EVTGEN_INFO, "EvtGen" )
149  << " EvtHypNonLepton set up maximum probability to " << maxProb
150  << std::endl;
151 }
152 
154 {
155  parent->initializePhaseSpace( getNDaug(), getDaugs() );
156  calcAmp( &_amp2, parent );
157 }
158 
160 {
161  static long noTries = 0;
162  int i;
163  EvtComplex Matrix[2][2];
164 
165  //G_F = 1.16637e-5;
166  //M_pi = 0.13957;
167 
168  for ( i = 0; i < 4; i++ ) {
169  //std::cout << "--------------------------------------------------" << std::endl;
170  Matrix[i / 2][i % 2] = EvtLeptonSCurrent(
171  parent->sp( i / 2 ), parent->getDaug( 0 )->spParent( i % 2 ) );
172  //std::cout << "Matrix = " << Matrix[i/2][i%2] << std::endl;
173  Matrix[i / 2][i % 2] -=
174  m_B_to_A *
175  EvtLeptonPCurrent( parent->sp( i / 2 ),
176  parent->getDaug( 0 )->spParent( i % 2 ) );
177  //std::cout << "Matrix = " << Matrix[i/2][i%2] << std::endl;
178  //Matrix[i/2][i%2] *= G_F*M_pi*M_pi;
179  //std::cout << "Matrix = " << Matrix[i/2][i%2] << std::endl;
180  //std::cout << "--------------------------------------------------" << std::endl;
181  amp->vertex( i / 2, i % 2, Matrix[i / 2][i % 2] );
182  }
183 
184  if ( m_noTries > 0 )
185  if ( !( ( ++noTries ) % m_noTries ) )
186  EvtGenReport( EVTGEN_DEBUG, "EvtGen" )
187  << " EvtHypNonLepton already finished " << noTries
188  << " matrix element calculations" << std::endl;
189 }
void calcAmp(EvtAmp *amp, EvtParticle *parent)
virtual EvtDiracSpinor sp(int) const
double getArg(unsigned int j)
static EvtSpinType::spintype getSpinType(EvtId i)
Definition: EvtPDL.cpp:377
EvtComplex EvtLeptonPCurrent(const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
Definition: EvtReport.cpp:33
EvtComplex m_B_to_A
virtual EvtDiracSpinor spParent(int) const
EvtId * getDaugs()
Definition: EvtDecayBase.hh:66
void setProbMax(double prbmx)
void vertex(const EvtComplex &amp)
Definition: EvtAmp.cpp:454
static const double pi
Definition: EvtConst.hh:26
EvtId getParentId() const
Definition: EvtDecayBase.hh:61
double initializePhaseSpace(unsigned int numdaughter, EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
Definition: EvtAmp.hh:30
EvtDecayBase * clone() override
std::string getName() override
double abs(const EvtComplex &c)
Definition: EvtComplex.hh:201
static int getSpin2(spintype stype)
Definition: EvtSpinType.cpp:26
int getNDaug() const
Definition: EvtDecayBase.hh:65
void decay(EvtParticle *p) override
EvtParticle * getDaug(int i)
Definition: EvtParticle.cpp:91
EvtAmp _amp2
Definition: EvtDecayAmp.hh:73
static double getMass(EvtId i)
Definition: EvtPDL.cpp:319
EvtComplex EvtLeptonSCurrent(const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
int getNArg() const
Definition: EvtDecayBase.hh:68
void init() override
void initProbMax() override
EvtId getDaug(int i) const
Definition: EvtDecayBase.hh:67