EvtGen 2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Loading...
Searching...
No Matches
EvtPi0Dalitz.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
25#include "EvtGenBase/EvtPDL.hh"
30
31#include <fstream>
32#include <stdio.h>
33#include <stdlib.h>
34#include <string>
35using std::fstream;
36
37std::string EvtPi0Dalitz::getName() const
38{
39 return "PI0_DALITZ";
40}
41
43{
44 return new EvtPi0Dalitz;
45}
46
48{
49 // Search for maximum probability. In order to avoid setting up all
50 // particles with spinors and four-momenta, we use result after all
51 // contractions, which is:
52 // 1/((m_R^2-q^2)^2+m_R^2 Gamma_R^2) 1/(2q^2) (M^2-q^2)^2 beta_l
53 // (1+cos(theta)^2) where we set cos(theta)=1
54 auto daughter1 = getDaug( 0 );
55 auto daughter2 = getDaug( 1 );
56 double q2Min = EvtPDL::getMass( daughter1 ) + EvtPDL::getMass( daughter2 );
57 q2Min *= q2Min;
58 double q2Max = EvtPDL::getMass( getParentId() );
59 q2Max *= q2Max;
60 const int steps = 20000;
61 const double step = ( q2Max - q2Min ) / steps;
62 double maxProb = 0;
63 for ( int ii = 0; ii < steps; ++ii ) {
64 double q2 = q2Min + ii * step;
65 const double mSqDiff = m_m0Sq - q2;
66 const double q2Sq = q2 * q2;
67 double prob = ( q2Max - q2 ) * ( q2Max - q2 ) * ( q2 - q2Min ) / ( q2Sq );
68 prob *= ( 1.0 / ( mSqDiff * mSqDiff + m_m0SqG0Sq ) );
69 // When generating events, we do not start from phase-space, but
70 // add some pole to it, weight of which is taken into account
71 // elsewhere
72 prob /= 1.0 + m_poleSize / ( q2Sq );
73 if ( prob > maxProb ) {
74 maxProb = prob;
75 }
76 }
77 setProbMax( maxProb * 1.05 );
78}
79
81{
82 // check that there are 0 arguments
83 checkNArg( 0 );
84 checkNDaug( 3 );
85
87
91
92 // Rescale pole size to improve efficiency. Not sure about exact
93 // factor, but this seem to be best simple rescaling for
94 // eta-->e+e-gamma.
95 const double parentMass = EvtPDL::getMass( getParentId() );
96 m_poleSize *= parentMass * parentMass / ( 0.135 * 0.135 );
97}
98
100{
101 EvtParticle *ep, *em, *gamma;
103 m_poleSize, 0, 1 ) );
104 ep = p->getDaug( 0 );
105 em = p->getDaug( 1 );
106 gamma = p->getDaug( 2 );
107
108 // the next four lines generates events with a weight such that
109 // the efficiency for selecting them is good. The parameter below of
110 // 0.1 is the size of the peak at low q^2 (in arbitrary units).
111 // The value of 0.1 is appropriate for muons.
112 // when you use this remember to remove the cut on q^2!
113
114 //ep em invariant mass^2
115 double m2 = ( ep->getP4() + em->getP4() ).mass2();
116 EvtVector4R q = ep->getP4() + em->getP4();
117 //Just use the prob summed over spins...
118
119 EvtTensor4C w, v;
120
121 v = 2.0 * ( gamma->getP4() * q ) *
122 EvtGenFunctions::directProd( q, gamma->getP4() ) -
123 ( gamma->getP4() * q ) * ( gamma->getP4() * q ) * EvtTensor4C::g() -
124 m2 * EvtGenFunctions::directProd( gamma->getP4(), gamma->getP4() );
125
126 w = 4.0 * ( EvtGenFunctions::directProd( ep->getP4(), em->getP4() ) +
127 EvtGenFunctions::directProd( em->getP4(), ep->getP4() ) -
129 ( ep->getP4() * em->getP4() - ep->getP4().mass2() ) );
130
131 double prob = ( real( cont( v, w ) ) ) / ( m2 * m2 );
132 const double m2Diff = m_m0Sq - m2;
133 prob *= ( 1.0 / ( m2Diff * m2Diff + m_m0SqG0Sq ) );
134
135 // EvtGenReport(EVTGEN_INFO,"EvtGen") << "prob is "<<prob<<endl;
136 setProb( prob );
137
138 return;
139}
double real(const EvtComplex &c)
EvtComplex cont(const EvtTensor4C &t1, const EvtTensor4C &t2)
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
EvtDecayBase()=default
int getNDaug() const
void checkSpinParent(EvtSpinType::spintype sp)
void setProbMax(double prbmx)
EvtId getParentId() const
EvtId getDaug(int i) const
void checkNDaug(int d1, int d2=-1)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
const EvtId * getDaugs() const
void setProb(double prob)
void setWeight(double weight)
static double getMass(EvtId i)
Definition EvtPDL.cpp:311
double initializePhaseSpace(size_t numdaughter, const EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
const EvtVector4R & getP4() const
EvtParticle * getDaug(const int i)
double m_poleSize
const double m_m0Sq
const double m_m0SqG0Sq
std::string getName() const override
void initProbMax() override
EvtDecayBase * clone() const override
void init() override
void decay(EvtParticle *p) override
static const EvtTensor4C & g()
double mass2() const
EvtTensor3C directProd(const EvtVector3C &c1, const EvtVector3C &c2)